Assembly Language Logical Shift

From TRCCompSci - AQA Computer Science
Revision as of 09:29, 14 January 2019 by Admin (talk | contribs)
Jump to: navigation, search

This example uses a Logical Shift to perform multiplication.

      INP R0,2
      INP R1,2
      MOV R2, R1
      MOV R3, R0
LOOP: LSL R3,R3,#1
      SUB R2,R2,#2
      CMP R2,#1
      BGT LOOP
      BLT END
      ADD R3,R3,R0
END:  OUT R3,4
      HALT