源程序a; NAME: asm1_a.s; Author: TYW /WUHAN R&D Center,Embest; Desc: ARM instruction examples; History: 2007.5.1x EQU 45 ; x=45y EQU 64 ; y=64/stack_top EQU 0x30200000 ; define the top address for stacksexport Reset_HandlerAREA text,CODE,READONL YexportReset_Handler ; code start */ldr sp, =stack_topmov r0, #x ; put x value into R0str r0, [sp] ; save the value of R0 into stacksmov r0, #y ; put y value into R0ldr r1, [sp] ; read the data from stack,and put it into R1add r0, r0, r1 ;R0=R0+R1str r0, [sp]stopb stop ; end the code ,cyclingend调试脚本//*** <<< Use Configuration !disalbe! Wizard in Context Menu >>> ***//Name: DebugINRam.iniFUNC void Setup (void){// <o> Program Entry Point, .AXF File download AddressPC = 0x030000000;}//map 0x00000000,0x0200200 READ WRITE execmap 0x30000000,0x30200000 read WRITE execSetup(); // Setup for Running//g,main源程序b;# NAME: ARMcode.s *;# Author: EWUHAN R & D Center, st * ;# Desc: ARMcode examples * ;# copy words from src to dst;# History: shw.He 2005.02.22GLOBAL Reset_Handlerarea start,code,readwriteentrycode32num EQU 20 ;/* Set number of words to be copied */ Reset_Handlerldr r0, =src ;/* r0 = pointer to source block */ldr r1, =dst ;/* r1 = pointer to destination block mov r2, #num ;/* r2 = number of words to copy */ldr sp, =0x30200000 ;/* set up stack pointer (r13) blockcopymovs r3,r2, LSR #3 ;/* number of eight word multiples */beq copywords ;/* less than eight words to move ?/stmfd sp!, {r4-r11} ;/* save some working registers/ octcopyldmia r0!, {r4-r11} ;/* load 8 words from the source stmia r1!, {r4-r11} ;/* and put them at the destination */subs r3, r3, #1 ;/* decrement the counter */bne octcopy ;/* ... copy more */ldmfd sp!, {r4-r11} ;/* don't need these now - restore originals */copywordsands r2, r2, #7 ;/* number of odd words to copy */beq stop ;/* No words left to copy ? */ wordcopyldr r3, [r0], #4 ;/* a word from the source */str r3, [r1], #4 ;/* store a word to the destination */subs r2, r2, #1 ;/* decrement the counter */bne wordcopy ;/* ... copy more */stopb stopsrcdcd 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4dstdcd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0end调试脚本bFUNC void Setup (void){// <o> Program Entry PointPC = 0x30000000;}//LOAD debug_in_RAM\Project.axf INCREMENTAL // Download//map 0x00000000,0x02000000 READ WRITE execmap 0x30000000,0x30200000 read WRITE execSetup(); // Setup for Running//g, main实验二源程序1/* NAME : C_CALL.C *//* AUTHOR : TYW *//* DESC : C EXAMPLE */ /* HISTORY : 1.8.2006 *//* MODIFY : 11.5.2007void delay(int nTime);/* NAME : START *//* FUNC : ENTRY POINT */ /* PARA : NONE *//* RET : NONE *//* MODIFY : *//* COMMENT : */ main(){int i = 5;for( ; ; ){delay(i);}}/* NAME : DELAY *//* FUNC : DELAY SOME TIME */ /* PARA : nTime -- INPUT *//* RET : NONE *//* MODIFY : *//* COMMENT : */ void delay(int nTime){int i, j = 0;for(i = 0; i < nTime; i++){for(j = 0; j < 10; j++){}}}调试脚本FUNC void Setup (void){// <o> Program Entry PointPC =main;;}//LOAD debug_in_RAM\Project.axf INCREMENTAL // Download//map 0x000,0x200000 READ WRITE EXECmap 0x30000000,0x30200000 READ WRITE execSetup(); // Setup for Running//g, main源程序2;# File:startup.s;# Author: Wuhan R&D Center, embest;# Desc: C start up codes.Configure memory, Initialize ISR ,stacks,initialize C-variables ;# Fill zeros into zero-initialized C-variables;# History:area RESET,code,readonlyentry;# Set interrupt / exception vectorsb Reset_HandlerUndefined_Handlerb Undefined_HandlerSWI_Handlerb SWI_HandlerPrefetch_Handlerb Prefetch_HandlerAbort_Handlerb Abort_Handlernop IRQ_Handlerb IRQ_HandlerFIQ_Handlerb FIQ_HandlerReset_Handler; ldr sp, =0x0C002000;# Branch on C code Main function (with interworking);# Branch must be performed by an interworking call as;# either an ARM or Thumb.main C function must be;# supported. This makes the code not position-independant.;# A Branch with link would generate errorsIMPORT __mainLDR R0, =__mainBX R0; # jump to __main();# * Loop for ever;# * End of application. Normally, never occur.;# * Could jump on Software Reset ( B 0x0 ).Endb Endend调试脚本FUNC void Setup (void){// <o> Program Entry PointPC = 0x30000000;}//LOAD debug_in_RAM\Project.axf INCREMENTAL // Download //map 0x000,0x200000 READ WRITE EXECmap 0x30000000,0x30200000 READ WRITE execSetup(); // Setup for Running//g, main。