I am having trouble writing a sentinel controlled loop in LC-3 assembly language. I know that you must store the sentinel somewhere in memory and that when the sentinel is detected, then the loop is done. However, how do you actually write this in LC-3 code.
Lets say I have the following example where I want to get user input of integers until the user enters a '#' character. How would I write the sent controlled loop for this. I have the following:
LD R1, PTR
LD R6, SENT
LEA R0, PROMPT
BR TEST ;; how do you write the TEST loop. I know what i have is wrong
SENT .FILL #35 ;;dec representation of '#'
PROMPT .STRINGZ "ENTER NUMBERS, # WHEN YOU WANT TO STOP"
PTR .FILL x4000
PLEASE HELP ME. THANKS