From 188403fabdd71505238a4c2404c62be06caad67e Mon Sep 17 00:00:00 2001 From: mrbobbyguy <84521318+somerandomviolinkid@users.noreply.github.com> Date: Mon, 7 Sep 2026 17:56:42 -0500 Subject: [PATCH] many --- main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 2591004..84f6aa7 100644 --- a/main.c +++ b/main.c @@ -304,7 +304,7 @@ void execute() { break; case JSR: cpu.regFile[7] = cpu.pc; - if (!(cpu.ir & 0x400)) { + if (!(cpu.ir & 0x800)) { cpu.pc += sext(cpu.ir & 0x7FF, 11); } else { cpu.pc = cpu.regFile[(cpu.ir >> 8) & 0x7]; @@ -821,12 +821,12 @@ int assemble() { } int r0 = parseReg(tokens[1]); - if (r0 == -1) { + if (r0 < 0) { printf("Wrong tokens on line %d!\n", lineCount); return -3; } - instruction += ((r0 & 0x7) << 6); + instruction += ((r0 & 0x7) << 9); } else if (strcmp(tokens[0], "jsr") == 0) { instruction += (12 << 12); @@ -857,7 +857,7 @@ int assemble() { } int r0 = parseReg(tokens[2]); - if (r0 == -1) { + if (r0 < 0) { printf("Wrong tokens on line %d!\n", lineCount); return -3; } @@ -873,7 +873,7 @@ int assemble() { } int r0 = parseReg(tokens[1]); - if (r0 == -1) { + if (r0 < 0) { printf("Wrong tokens on line %d!\n", lineCount); return -3; }