我的任务是创建一个宏来计算内存地址中的个数。我已经做到了。但是,每当我调用我的宏时,它只会调用第一种情况。情况2和3无法调用。我不确定如何进行。
;Your First Macro.
MACRO
$Lab08Code Count1s_Lab08 $a, $b, $c
$Lab08Code
MOV $b, #0
$Lab08Code.loop
CMP $c, #0
BEQ $Lab08Code.stop
CLZ $a, $c
ADD $a, #1
ADD $b, #1
LSL $c, $a
BNE $Lab08Code.loop
$Lab08Code.stop B $Lab08Code.stop
MEND
; Your Second macro.
AREA Lab_11_Kevin_Nguyen, CODE, READONLY
EXPORT __main
__main
LDR R1, =0xFFFFFFFF
LDR R2, =0x2345ABCD
Case_1_Lab_08 Count1s_Lab08 R4, R3, R1
;Case_1_Lab_09 Count1s_Lab09 R5, R2
LDR R1, =0x0
LDR R2, =0x0
Case_2_Lab_08 Count1s_Lab08 R6, R3, R1
;Case_2_Lab_09 Count1s_Lab09 R7, R2
LDR R1, =0xFFFFFFFF
LDR R2, =0xFFFFFFFF
Case_3_Lab_08 Count1s_Lab08 R8, R3, R1
;Case_3_Lab_09 Count1s_Lab09 R9, R2
stop B stop
END