add MOD instruction

This commit is contained in:
KikooDX 2021-08-20 13:51:14 +02:00
parent b4539c6f6d
commit 20ff035b85
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@ ADD
SUB
MUL
DIV
MOD
NEG
LBL
JMP

View File

@ -78,6 +78,11 @@ parse(char *path)
op1 = get_value(1);
printf("Ans/%s\n", op1);
}
else if (strcmp(token, "MOD") == 0)
{
op1 = get_value(1);
printf("MOD(Ans,%s\n", op1);
}
else if (strcmp(token, "NEG") == 0)
{
printf("-Ans\n");