diff options
-rw-r--r-- | problem1.asm | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/problem1.asm b/problem1.asm index 882eec2..f27fd90 100644 --- a/problem1.asm +++ b/problem1.asm @@ -5,14 +5,21 @@ mov R2, [R5] inc R5 mov R3, [R5] + cmp R3, R4 + je zero sub R1, R2 - mov R2, 0x1 mov R4, R1 + mov R1, 0x0 + mov R5, 0x1 + cmp R3, R5 + je done loop: add R1, R4 - inc R2 - cmp R2, R3 + inc R4 + cmp R4, R3 jne loop +zero: + mov R1, 0x0 +done: mov R2, 0x1E mov [R2], R1 - halt |