Created
August 18, 2015 08:19
-
-
Save owlfox/8b91b7d014cba089d673 to your computer and use it in GitHub Desktop.
Summer2015 Day3 Quiz1.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@prologue... | |
@move x to r0 | |
@r2=n=1 | |
cmp r0, #0 | |
beq .L6 | |
LSR r1, r0, LSR #16 | |
cmp r1 #0 | |
beq .L1; | |
LSR r1, r0, LSR #24 | |
cmp r1 #0 | |
beq .L2; | |
LSR r1, r0, LSR #28 | |
cmp r1, #0 | |
beq .L3; | |
LSR r1, r0, LSR #30 | |
cmp r1 #0 | |
beq .L4; | |
.L1: | |
add r2, r2, #16 | |
LSL r0, r0, #16 | |
bl .L5 | |
.L2: | |
add r2, r2, #8 | |
LSL r0, r0, #8 | |
bl .L5 | |
.L3: | |
add r2, r2, #4 | |
LSL r0, r0, #4 | |
bl .L5 | |
.L4: | |
add r2, r2, #2 | |
LSL r0, r0, #2 | |
bl .L5 | |
.L5: | |
LSR r1, r0, #31 | |
SUB r2, r2, r1 | |
mov r0, r2 | |
.L6 | |
mov r0, 32 | |
@epilogue... | |
再來算branch數量 約8個 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment