summaryrefslogtreecommitdiffstats
path: root/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/LOADCON4.S
blob: 5f046c97b7026e1d9661c69846ce90b7b8808438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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