diff options
Diffstat (limited to 'ARM_assembly/MultProject/Mult32x32.s')
-rw-r--r-- | ARM_assembly/MultProject/Mult32x32.s | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ARM_assembly/MultProject/Mult32x32.s b/ARM_assembly/MultProject/Mult32x32.s new file mode 100644 index 0000000..03a06ca --- /dev/null +++ b/ARM_assembly/MultProject/Mult32x32.s @@ -0,0 +1,23 @@ + ;INITIALISATION + + MOV R0, #12 + MOV R1, #4 + MOV R2, R0 + MOV R3, #0 + MOV R5, #0 + MOV R6, #32 + + ;CODE + +MULT AND R4, R2, #1 ;movs LSB + + CMP R4, R5 ;Compares current and prev bit + ADDLO R3, R3, R1 ;adds if 0 1 + SUBHI R3, R3, R1 ;sub if 1 0 + MOV R5, R4 + + MOVS R3, R3, ASR #1 + MOV R2, R2, RRX + + SUBS R6, R6, #1 + BNE MULT |