w1.2: working on assignment1.2
This commit is contained in:
18
assignment_assembly/assignment2/multiply.asm
Normal file
18
assignment_assembly/assignment2/multiply.asm
Normal file
@@ -0,0 +1,18 @@
|
||||
.cpu cortex-m4
|
||||
.thumb
|
||||
.syntax unified
|
||||
.globl multiply
|
||||
.text
|
||||
.thumb_func
|
||||
multiply:
|
||||
MOVS.N R2, #0
|
||||
ADDS.N R1, #0
|
||||
BEQ.N =exit
|
||||
loop:
|
||||
ADDS.N R2, R0, R2
|
||||
SUBS.N R1, #1
|
||||
BNE.N =exit
|
||||
B.N =loop
|
||||
exit:
|
||||
MOVS.N R0, R2
|
||||
BX.N LR
|
||||
Reference in New Issue
Block a user