|
|||||||||||
|
Technical Support On-Line Manuals Assembler User Guide |
Assembler User GuideAn example ARM assembly language module
Example 7 illustrates some of the core constituents of an assembly language module. The example is written in ARM assembly language. The constituent parts of this example are:
Example 7 defines
a single section called Example 7. Constituents of an assembly language module
AREA ARMex, CODE, READONLY
; Name this block of code ARMex
ENTRY ; Mark first instruction to execute
start
MOV r0, #10 ; Set up parameters
MOV r1, #3
ADD r0, r0, r1 ; r0 = r0 + r1
stop
MOV r0, #0x18 ; angel_SWIreason_ReportException
LDR r1, =0x20026 ; ADP_Stopped_ApplicationExit
SVC #0x123456 ; ARM semihosting (formerly SWI)
END ; Mark end of file
The The application code in Example 7 begins executing at the label After executing the main code, the application terminates
by returning control to the debugger. This is done using the ARM
semihosting SVC (
The
| ||||||||||
|
|||||||||||