comments?

This commit is contained in:
xamidev
2024-10-18 21:23:10 +02:00
parent 4c6c501955
commit 730bc7858d
2 changed files with 7 additions and 3 deletions

8
cpu.c
View File

@@ -127,8 +127,12 @@ void assemble(const char* filename)
{
char instruction[10];
int reg1, reg2, addr;
if (sscanf(line, "%s %d %d", instruction, &reg1, &reg2) == 3)
if (strncmp(line, ";", 1) == 0)
{
// comment, ignore
continue;
}
else if (sscanf(line, "%s %d %d", instruction, &reg1, &reg2) == 3)
{
if (strncmp(instruction, "MOV", 3) == 0)
{