LDA NBR / Initialize counter
CMA / 2’s complement of NBR INC
STA CTR / save -NBR to counter
LDA ADR / Save start address
STA PTR / Initialize pointer PTR
LOP, CLA / Clear AC
STA PTR I / Reset memory word
ISZ PTR / Increment pointer
ISZ CTR / increment counter
BUN LOP / Branch to LOP (CTR < 0)
HLT / Halt when CTR = 0
NBR, HEX FF / NBR of cleared words
CTR, – / Counter
ADR, HEX 500 / Start address
PTR, – / Pointer
EasyExamNotes.com
Write a program loop using a pointer and a counter toclear the contents of hex locations 500 to 5FF with 0.
Source: https://easyexamnotes.com/write-a-program-loop-using-a-pointer-and-a-counter-toclear-the-contents-of-hex-locations-500-to-5ff-with-0/
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion