ref: 3128b86e38f6375c886cae173dc9deff3e4c0d3f
parent: e4fbcddc49d1884e2bf8d804e73194f48e974d02
author: mkf <mkf@cloud9p.org>
date: Sun Jul 7 05:17:07 EDT 2024
a: fix build, add support for comments
--- a/5552a.c
+++ b/5552a.c
@@ -94,7 +94,7 @@
for(int i = 0 ; i < lc ; i++)
{
if(!strcmp(labels[i].name, name))
- sysfatal("duplicate label %s\t
+ sysfatal("duplicate label %s\t"
"prev pc: %x\t"
"curr pc: %x", name, labels[i].pc, pc);
}
@@ -134,6 +134,8 @@
addlabel(line);
return;
}
+ else if(line[i] == ';')
+ break;
}
for(int i = 0 ; i < scount ; i++)
@@ -144,7 +146,7 @@
program[pc].arg1 = atoi(line+spaces[0]);
else if(scount == 2)
program[pc].arg2 = atoi(line+spaces[1]);
- pc++
+ pc++;
}
void