Mercurial > hg > Members > kono > os9 > sbc09
changeset 5:35028b396a35
on going
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 04 Jul 2018 21:30:24 +0900 |
parents | 6159cc57d44e |
children | 9c2602e1d716 |
files | a09.c engine.c |
diffstat | 2 files changed, 25 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/a09.c Wed Jul 04 19:33:22 2018 +0900 +++ b/a09.c Wed Jul 04 21:30:24 2018 +0900 @@ -8,7 +8,7 @@ Generates binary image file from the lowest to the highest address with actually assembled data. - Machine dependencies: + Machin edependencies: char is 8 bits. short is 16 bits. integer arithmetic is twos complement. @@ -480,7 +480,7 @@ if(level==10)return scanfactor(); t=scanexpr(level+1); while(1) { - skipspace(); + // skipspace(); c=*srcptr++; switch(c) { case '*':oldcat=exprcat; @@ -550,11 +550,18 @@ exprcat|=oldcat|16; break; } - case '!':if(level>=6||*srcptr!='=')EXITEVAL - srcptr++; - oldcat=exprcat; - t=t!=scanexpr(6); - exprcat|=oldcat|16; + case '!':if(level>=6) { + if (*srcptr=='=') { + srcptr++; + oldcat=exprcat; + t=t!=scanexpr(6); + exprcat|=oldcat|16; + } else { + oldcat=exprcat; + t|=scanexpr(6); + exprcat|=oldcat|16; + } + } break; case '=':if(level>=6)EXITEVAL if(*srcptr=='=')srcptr++; @@ -727,6 +734,11 @@ case '#': if(mode==5)error|=2;else mode=0; srcptr++; + if (*srcptr=='"') { + operand = (srcptr[1]<<8) + srcptr[2] ; + srcptr += 3; + break; + } operand=scanexpr(0); break; case '<': @@ -844,6 +856,7 @@ } error>>=1; } + error = 0; errors++; } @@ -938,7 +951,8 @@ oneimm(int co) { scanoperands(); - if(mode>=3)error|=2; + if(mode>=3) + error|=2; putbyte(co); putbyte(operand); } @@ -1321,7 +1335,7 @@ char c; srcptr=srcline; oldlc=loccounter; - error=0; + // error=0; unknown=0;certain=1; lp=0; codeptr=0;
--- a/engine.c Wed Jul 04 19:33:22 2018 +0900 +++ b/engine.c Wed Jul 04 21:30:24 2018 +0900 @@ -40,8 +40,8 @@ extern int romstart; #ifdef USE_MMU -inline Byte * mem0(Word adr, Byte *immu) { return & iphymem[ ( immu[ (adr) >> 13 ] <<13 ) + ((adr) & 0x1fff )] } -#define mem(adr) mem0(adr,immu) +static inline Byte * mem0(Byte *iphymem, Word adr, Byte *immu) { return & iphymem[ ( immu[ (adr) >> 13 ] <<13 ) + ((adr) & 0x1fff )]; }; +#define mem(adr) (*mem0(iphymem, adr,immu)) #else #define mem(adr) mem[adr] #endif