Assembly Language Logical Shift

From TRCCompSci - AQA Computer Science
Revision as of 09:25, 14 January 2019 by Admin (talk | contribs) (Created page with "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 LSR R2,R2,#1...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
      LSR R2,R2,#1
      CMP R2,#1
      BGT LOOP
      BLT END
      ADD R3,R3,R0
END:  OUT R3,4
      HALT