summaryrefslogtreecommitdiffstats
path: root/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S
downloadStudium-master.tar.gz
Studium-master.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S')
-rw-r--r--Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S26
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