summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-12-14 09:42:07 +0100
committertomsmeding <tom.smeding@gmail.com>2017-12-14 09:42:07 +0100
commit29c3d2141831a8eb1bda9e22c3e38771176cf3ef (patch)
tree0d04203e819a46d10e17feb4d307fceadb27f2dc
parent85f9e4b25b6bf8b3e4514e6fd6f8a21b4414ae44 (diff)
Fix bugHEADmaster
-rw-r--r--bfcomp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bfcomp.c b/bfcomp.c
index 4039856..10aa0e9 100644
--- a/bfcomp.c
+++ b/bfcomp.c
@@ -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();