Mercurial > hg > Members > kono > os9 > sbc09
comparison a09.c @ 39:1d3057b6b786
rmb counter on pass 2
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 17 Jul 2018 07:07:59 +0900 |
parents | 52f7ad4c2ebb |
children | b8fa36c04ff7 |
comparison
equal
deleted
inserted
replaced
38:52f7ad4c2ebb | 39:1d3057b6b786 |
---|---|
1169 } | 1169 } |
1170 | 1170 |
1171 void os9begin() | 1171 void os9begin() |
1172 { | 1172 { |
1173 generate(); | 1173 generate(); |
1174 os9=1; // contiguous code generation ( i.e. ignore org nor rmb ) | 1174 os9=1; // contiguous code generation ( seprate rmb and code ) |
1175 oldlc = loccounter = rmbcounter = rmbmode = 0; | 1175 oldlc = loccounter = rmbcounter = rmbmode = 0; |
1176 reset_crc(); | 1176 reset_crc(); |
1177 putword(0x87cd); | 1177 putword(0x87cd); |
1178 putword(scanexpr(0)-loccounter); // module size | 1178 putword(scanexpr(0)-loccounter); // module size |
1179 skipComma(); | 1179 skipComma(); |
1191 putword(scanexpr(0)); | 1191 putword(scanexpr(0)); |
1192 skipspace(); | 1192 skipspace(); |
1193 } | 1193 } |
1194 prevloc = codeptr; | 1194 prevloc = codeptr; |
1195 rmbmode = 1; // next org works on rmb | 1195 rmbmode = 1; // next org works on rmb |
1196 rmbcounter=0; | |
1196 loccounter = 0x10000-codeptr; // should start at 0 | 1197 loccounter = 0x10000-codeptr; // should start at 0 |
1197 } | 1198 } |
1198 | 1199 |
1199 void os9end() | 1200 void os9end() |
1200 { | 1201 { |
1201 crc = crc ^ 0xffffff; | 1202 crc = crc ^ 0xffffff; |
1202 | 1203 |
1203 putbyte((crc>>16)&0xff); | 1204 putbyte((crc>>16)&0xff); |
1204 putbyte((crc>>8)&0xff); | 1205 putbyte((crc>>8)&0xff); |
1205 putbyte(crc&0xff); | 1206 putbyte(crc&0xff); |
1207 os9 = 0; | |
1206 } | 1208 } |
1207 | 1209 |
1208 | 1210 |
1209 void | 1211 void |
1210 pseudoop(int co,struct symrecord * lp) | 1212 pseudoop(int co,struct symrecord * lp) |
1645 } | 1647 } |
1646 do { | 1648 do { |
1647 pass=2; | 1649 pass=2; |
1648 prevloc = 0; | 1650 prevloc = 0; |
1649 loccounter=0; | 1651 loccounter=0; |
1652 rmbcounter=0; | |
1650 errors=0; | 1653 errors=0; |
1651 generating=0; | 1654 generating=0; |
1652 terminate=0; | 1655 terminate=0; |
1653 glineno=0; | 1656 glineno=0; |
1654 if(listing&&((listfile=fopen(listname,"w"))==0)) { | 1657 if(listing&&((listfile=fopen(listname,"w"))==0)) { |