Skip to content

Commit

Permalink
l3 -- more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yih-Chun Hu committed Sep 3, 2024
1 parent d8dd49b commit c4e6830
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stack.asm
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ TOPINLOOP
LDR R0, R6, #0 ; peek at the top of the stack
NOT R0, R0
ADD R0, R0, #1
LDR R3, R2, #0
LDR R3, R2, #0 ; next outstream character
BRz NOMOREINPUT ; (no more output)
ADD R0, R0, R3 ; compares the peek with the next output element
BRnp EXITINLOOP
BRnp EXITINLOOP ; top of stack doesn't match the next output, leave loop
JSR POP ; same so we pop
; the other way to handle running off the end of the stack,
; rather than the R6 <= BOT_OF_STACK_MEMORY check, is to check
Expand Down

0 comments on commit c4e6830

Please sign in to comment.