📄 lib_sdram_execute.s
字号:
;------------------------------------------------------------------------------;- ATMEL Microcontroller Software Support - ROUSSET -;------------------------------------------------------------------------------; The software is delivered "AS IS" without warranty or condition of any; kind, either express, implied or statutory. This includes without; limitation any warranty or condition with respect to merchantability or; fitness for any particular purpose, or against the infringements of; intellectual property rights of others.;-----------------------------------------------------------------------------;- File source : Execute.s;- Object : Execution code to allow consumption measurement;- Translator : ARM Software Development Toolkit V2.5;-;- Exported Resources : ExecuteTest;- Imported Resources : None;-;- 1.0 2002/06/25 ED : Creation;------------------------------------------------------------------------------ AREA TEST, CODE, READONLYNB_LOOP EQU 16;------------------------------------------------------------------------------;- Function : ExecuteTest;- Treatments :;- Input Parameters :;- r0 = address where to run the test function from;- r1 = 0 indicates to run the test in ARM, else in Thumb;- Output Parameters :;- r0 = copied assembler code length;- Registers lost : None;- Called Functions : None;- Called Macros : None;------------------------------------------------------------------------------ EXPORT ExecuteTestExecuteTest stmdb r13!, {r4,r5,r6,r14} mov r4, r0 movs r2, r1 ldreq r2, =ExecuteArmTest ldrne r2, =ExecuteThumbTest bic r2, r2, #3 ldr r3, =Execute_end sub r5, r3, r2CopyTest_loop ldr r12, [r2], #4 str r12, [r0], #4 cmp r2, r3 blo CopyTest_loop;- Test Arm or Thumb Call requested movs r2, r1 beq ArmCall;- Thumb Call add r4, r4, #1 mov lr, pc bx r4;- Exit b Exit;- Arm CallArmCall mov lr, pc mov pc, r4;- ExitExit mov r0, r5 ldmia r13!, {r4,r5,r6, r14} bx r14;------------------------------------------------------------------------------;- Function : ExecuteArmTest;- Treatments :;- Input Parameters : None;- Output Parameters : None;- Registers lost : None;- Called Functions : None;- Called Macros : None;------------------------------------------------------------------------------ EXPORT ExecuteArmTestExecuteArmTest mov r0, #0 mov r1, #NB_LOOPArmTest_first_loop add r0, r0, #1 cmp r1, r0 beq EndArmExecute mov r6, #0 mov r7, #NB_LOOPArmTest_second_loop add r6, r6, #1 cmp r7, r6 beq ArmTest_first_loop b ArmTest_second_loopEndArmExecute bx lr;------------------------------------------------------------------------------;- Function : ExecuteThumbTest;- Treatments : AT91 Thumb execution function;- Input Parameters : None;- Output Parameters : None;- Registers lost : None;- Called Functions : None;- Called Macros : None;------------------------------------------------------------------------------ CODE16 EXPORT ExecuteThumbTestExecuteThumbTest mov r0, #0 mov r1, #NB_LOOPThumbTest_first_loop add r0, r0, #1 cmp r1, r0 beq EndThumbExecute mov r6, #0 mov r7, #NB_LOOPThumbTest_second_loop add r6, r6, #1 cmp r7, r6 beq ThumbTest_first_loop b ThumbTest_second_loopEndThumbExecute bx lr CODE32 ALIGNNbLoop DCD NB_LOOP Execute_end END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -