From adeee84c774b0c3021d27f10c735150542326554 Mon Sep 17 00:00:00 2001 From: mrbobbyguy <84521318+somerandomviolinkid@users.noreply.github.com> Date: Sun, 6 Sep 2026 16:47:56 -0500 Subject: [PATCH] fix br assembler bug --- main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 92812fb..dca8d02 100644 --- a/main.c +++ b/main.c @@ -770,7 +770,7 @@ int assemble() { return -4; } - size_t l = strlen(tokens[2]); + size_t l = strlen(tokens[1]); if (l > 3 || l == 0) { printf("Wrong tokens on line %d!\n", lineCount); return -3; @@ -778,11 +778,11 @@ int assemble() { int conditionCodes = 0; for (int i = 0; i < l; i++) { - if (tokens[2][i] == 'n') { + if (tokens[1][i] == 'n') { conditionCodes |= 0b100; - } else if (tokens[2][i] == 'z') { + } else if (tokens[1][i] == 'z') { conditionCodes |= 0b010; - } else if (tokens[2][i] == 'p') { + } else if (tokens[1][i] == 'p') { conditionCodes |= 0b001; } } @@ -932,4 +932,4 @@ int main(int argc, char** argv) { } return 0; -} \ No newline at end of file +}