Debian Codegraph @

examples/prism-armasm.html

raw symbols SCIP
1 <h2>Full example</h2>
2 <pre><code>; Source: https://developer.arm.com/documentation/dui0473/c/writing-arm-assembly-language/subroutines-calls
3 AREA subrout, CODE, READONLY ; Name this block of code
4 ENTRY ; Mark first instruction to execute
5 start MOV r0, #10 ; Set up parameters
6 MOV r1, #3
7 BL doadd ; Call subroutine
8 stop MOV r0, #0x18 ; angel_SWIreason_ReportException
9 LDR r1, =0x20026 ; ADP_Stopped_ApplicationExit
10 SVC #0x123456 ; ARM semihosting (formerly SWI)
11 doadd ADD r0, r0, r1 ; Subroutine code
12 BX lr ; Return from subroutine
13 END ; Mark end of file</code></pre>