Skip to content

Commit

Permalink
fix jnzb not using an offset in assembler
Browse files Browse the repository at this point in the history
  • Loading branch information
MESYETI committed Nov 16, 2023
1 parent bcfaec2 commit a6fae89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions demos/lines.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ loop:
set d 0
cmp b d
; draws black if its even
jnz draw_black
jnzb draw_black
; and white if its odd
set b 15
jmp next
jmpb next

draw_black:
set b 0
Expand All @@ -32,8 +32,8 @@ next:
set b 0
; checks if rendered every pixel
cmp c b
jnz end
jmp loop
jnzb end ; crashes here?
jmpb loop

end:
jmp end
jmpb end
2 changes: 1 addition & 1 deletion source/assembler/assembler.d
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class Assembler {
addr = labels[paramNode.name];

string[] bsInstructions = [
"jmpb", "jmpzb", "jzb", "rdbb", "rdwb", "rdab",
"jmpb", "jnzb", "jzb", "rdbb", "rdwb", "rdab",
"wrbb", "wrwb", "wrab"
];

Expand Down

0 comments on commit a6fae89

Please sign in to comment.