From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../ARM202U/EXAMPLES/REENT/MAIN.S | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/REENT/MAIN.S') 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 -- cgit v1.2.3