comments?
This commit is contained in:
8
cpu.c
8
cpu.c
@@ -127,8 +127,12 @@ void assemble(const char* filename)
|
||||
{
|
||||
char instruction[10];
|
||||
int reg1, reg2, addr;
|
||||
|
||||
if (sscanf(line, "%s %d %d", instruction, ®1, ®2) == 3)
|
||||
if (strncmp(line, ";", 1) == 0)
|
||||
{
|
||||
// comment, ignore
|
||||
continue;
|
||||
}
|
||||
else if (sscanf(line, "%s %d %d", instruction, ®1, ®2) == 3)
|
||||
{
|
||||
if (strncmp(instruction, "MOV", 3) == 0)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
|
||||
;this is a comment
|
||||
MOV 1 2
|
||||
HLT
|
||||
|
||||
Reference in New Issue
Block a user