diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-12-14 09:42:07 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-12-14 09:42:07 +0100 |
commit | 29c3d2141831a8eb1bda9e22c3e38771176cf3ef (patch) | |
tree | 0d04203e819a46d10e17feb4d307fceadb27f2dc | |
parent | 85f9e4b25b6bf8b3e4514e6fd6f8a21b4414ae44 (diff) |
-rw-r--r-- | bfcomp.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -238,14 +238,13 @@ void writeprogram(char *source,FILE *asmf,Sourcemap *sm){ do { char c=source[i]; if(addc&&c!='+'&&c!='-'){ - addc=(addc%256)+256%256; + addc=((addc%256)+256)%256; if(addc==1)fprintf(asmf,"\tinc byte [rbx] ; 1 +\n"); else if(addc==-1)fprintf(asmf,"\tdec byte [rbx] ; 1 -\n"); else fprintf(asmf,"\tadd byte [rbx], %d ; %d %c\n",addc,addc<0?-addc:addc,addc<0?'-':'+'); addc=0; } if(shiftc&&c!='>'&&c!='<'){ - shiftc=(shiftc%256)+256%256; if(params.lastcell){ if(lastshiftc>0&&shiftc<0){ int id=uniqid(); |