📄 entry.s
字号:
#********************************************************************************************
# NAME: entry.s *
# Author: Embest *
# Desc: debugging with arm and thumb instruction *
# History: *
# *
#********************************************************************************************
/*------------------------------------------------------------------------------------------*/
/* constant define */
/*------------------------------------------------------------------------------------------*/
.equ count, 20
/*------------------------------------------------------------------------------------------*/
/* extern function */
/*------------------------------------------------------------------------------------------*/
.extern thumb_function
/*------------------------------------------------------------------------------------------*/
/* global symbol define */
/*------------------------------------------------------------------------------------------*/
.global _start
/*------------------------------------------------------------------------------------------*/
/* code */
/*------------------------------------------------------------------------------------------*/
.text
_start:
# Setup interrupt / exception vectors
b Reset_Handler
Undefined_Handler:
b Undefined_Handler
SWI_Handler:
b SWI_Handler
Prefetch_handler:
b Prefetch_handler
Abort_Handler:
b Abort_Handler
nop /* Reserved vector */
IRQ_Handler:
b IRQ_Handler
FIQ_Handler:
b FIQ_Handler
Reset_Handler:
ldr sp, =0x0C002000 /* set up user_mode stack pointer (r13) */
mov r0, #count /* the number of loop*/
mov r1, #0
mov r2, #0
mov r3, #0
mov r4, #0
mov r5, #0
mov r6, #0
loop0:
add r1, r1, #1
add r2, r2, #1
add r3, r3, #1
add r4, r4, #1
add r5, r5, #1
add r6, r6, #1
subs r0, r0, #1
bne loop0
adr r0, Thumb_Entry+1 /*jump to thumb program */
bx r0
# ****************************************************
# * thumb program entry *
# ****************************************************
.thumb
Thumb_Entry:
mov r0, #count
mov r1, #0
mov r2, #0
mov r3, #0
mov r4, #0
mov r5, #0
mov r6, #0
mov r7, #0
loop1:
add r1, #1
add r2, #1
add r3, #1
add r4, #1
add r5, #1
add r6, #1
add r7, #1
sub r0, #1
bne loop1
bl thumb_function
b Thumb_Entry
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -