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/BASICASM/LOADCON4.S | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/LOADCON4.S (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/LOADCON4.S') diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/LOADCON4.S b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/LOADCON4.S new file mode 100644 index 0000000..5f046c9 --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/LOADCON4.S @@ -0,0 +1,29 @@ + AREA Loadcon4, CODE + ENTRY ; Mark first instruction +Start + BL func1 ; Branch to first subroutine + BL func2 ; Branch to second subroutine + SWI 0x11 ; Terminate + +func1 + LDR r0, =Start ; => LDR R0,[PC, #offset to + ; Litpool 1] + LDR r1, =Darea +12 ; => LDR R1,[PC, #offset to + ; Litpool 1] + LDR r2, =Darea + 6000 ; => LDR R2, [PC, #offset to + ; Litpool 1] + MOV pc,lr ; Return + + LTORG ; Literal Pool 1 contains 3 literals + +func2 + LDR r3, =Darea +6000 ; => LDR r3, [PC, #offset to + ; Litpool 1] + ; (sharing with previous literal) + ; LDR r4, =Darea +6004 ; If uncommented will produce an + ; error as Litpool 2 is out of range + MOV pc, lr ; Return + +Darea % 8000 + END ; Literal Pool 2 is out of range of + ; the LDR instructions above -- cgit v1.2.3