summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();