?? armcode2.s
字號:
#*********************************************************************************************
# NAME: ARMcode2.s *
# Author: Embest *
# Desc: ARM instruction examples *
# Example for Condition Code *
# History: shw.He 2005.02.22 *
#*********************************************************************************************
/*------------------------------------------------------------------------------------------*/
/* constant define */
/*------------------------------------------------------------------------------------------*/
.global _start
/*------------------------------------------------------------------------------------------*/
/* code */
/*------------------------------------------------------------------------------------------*/
.text
.equ num, 2 /* Number of entries in jump table */
_start:
mov r0, #0 /* set up the three parameters */
mov r1, #3
mov r2, #2
bl arithfunc /* call the function */
stop:
b stop
# ********************************************************************************************
# * According R0 valude to execute the code *
# ********************************************************************************************
arithfunc: /* label the function */
cmp r0, #num /* Treat function code as unsigned integer */
bhs DoAdd /* If code is >=2 then do operation 0. */
adr r3, JumpTable /* Load address of jump table */
ldr pc, [r3,r0,LSL#2] /* Jump to the appropriate routine */
JumpTable:
.long DoAdd
.long DoSub
DoAdd:
add r0, r1, r2 /* Operation 0, >1 */
mov pc, lr /* Return */
DoSub:
sub r0, r1, r2 /* Operation 1 */
mov pc,lr /* Return */
.end /* mark the end of this file */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -