Files
CS-Classes/CS219/rotate
2025-06-17 14:42:22 -07:00

13 lines
346 B
Plaintext

;loads data to registers
MOV r1, #2
MOV r2, #3
MOV r3, #8
LSL r1,r1, #1 ;multiplies by 2
LSL r4,r2, #2 ;multiplies by 4
ADD r2,r2,r4 ;then adds from r4 and its original integer
LSR r3,r3, #1 ;divides by 2
ADD r1,r1,r2 ;adds r1 and r2
SUB r6,r1,r3 ;then outputs result after subtracting the results of r1 and r3