Write a program loop using a pointer and a counter toclear the contents of hex locations 500 to 5FF with 0.

March 9, 2024 · By Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp

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

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion