diff options
Diffstat (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S')
| -rw-r--r-- | Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S new file mode 100644 index 0000000..552f24d --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S @@ -0,0 +1,26 @@ + EXPORT __main
+ IMPORT main
+ IMPORT |sb$$interLUdata$$Base|
+
+SWI_GetEnv * &10
+SWI_Exit * &11
+
+ AREA |StartupCode|, CODE, READONLY, REENTRANT
+
+;
+; This is the initial entry point to the image.
+; (The compiler ensures it is linked in to the image by generating a reference
+; to __main from the object module generated from compiling a file containing
+; an extern main()).
+ ENTRY
+
+; We have to establish a stack for C, initialise the library, then call _main
+; (which will set up the arguments for main, then call it).
+|__main|
+ LDR r9, =|sb$$interLUdata$$Base|
+ SWI SWI_GetEnv ; to decide heap limit
+ MOV r13, r1 ; top of program workspace
+ BL |main|
+ SWI SWI_Exit
+
+ END
|
