File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change 1717
1818#include "dis.h"
1919
20+ static int position = 0 ;
21+
22+ static void
23+ rewind_dta_word (FILE * f )
24+ {
25+ position = 0 ;
26+ rewind (f );
27+ }
28+
2029static inline int
2130get_byte (FILE * f )
2231{
@@ -36,19 +45,18 @@ get_half (FILE *f)
3645static word_t
3746get_dta_word (FILE * f )
3847{
39- word_t word , h1 , h2 ;
48+ word_t word ;
4049
4150 if (feof (f ))
4251 return -1 ;
4352
44- h1 = get_half (f );
45- h2 = get_half (f );
46-
47- //fprintf (stderr, "%06llo %06llo\n", h1, h2);
48- word = (h1 << 18 );
49- word += h2 ;
50- //word = (get_half (f) << 18);
51- //word += get_half (f);
53+ word = (get_half (f ) << 18 );
54+ word += get_half (f );
55+
56+ if ((position % 128 ) == 0 )
57+ word |= START_RECORD ;
58+
59+ position ++ ;
5260 return word ;
5361}
5462
@@ -71,7 +79,7 @@ write_dta_word (FILE *f, word_t word)
7179struct word_format dta_word_format = {
7280 "dta" ,
7381 get_dta_word ,
74- NULL ,
82+ rewind_dta_word ,
7583 write_dta_word ,
7684 NULL
7785};
You can’t perform that action at this time.
0 commit comments