Difference between revisions of "Assembly Language Logical Shift"
(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...") |
|||
Line 6: | Line 6: | ||
MOV R3, R0 | MOV R3, R0 | ||
LOOP: LSL R3,R3,#1 | LOOP: LSL R3,R3,#1 | ||
− | + | SUB R2,R2,#2 | |
CMP R2,#1 | CMP R2,#1 | ||
BGT LOOP | BGT LOOP |
Revision as of 09:29, 14 January 2019
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