MOV #160000, R0
      MOV #064550, (R0)+  ; MOVB #150 and #151
      MOV #959., R1  ; number of words left, base ten
LOOP: MOV #020040, (R0)+  ; two 040 bytes
      DEC R1
      BGT LOOP
      HALT

It's not only an excessive optimization hangup which made me collapse the byte moves into word-size moves. In fact it is invalid to say "MOVB #123, 456" because immediate mode is really (R7)+, and incrementing R7 by just one is bad; [R7] must always be even.

You were not expected to be aware of or concerned with this issue.


[exam] [CSC 258 additional problems] [main course page]