summaryrefslogtreecommitdiffstats
path: root/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/BASICASM/EXAMPLE.S
blob: c93e2444d4b465cad75b3c7309aa3159c0c13087 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
	AREA 	Example, CODE, READONLY	; name this block of code
	ENTRY							; mark first instruction
									; to execute
start
	MOV		r0, #15					; Set up parameters
	MOV		r1, #20
	BL		firstfunc				; Call subroutine
	SWI		0x11					; terminate

firstfunc							; Subroutine firstfunc
	ADD		r0, r0, r1				; r0 = r0 + r1
	MOV		pc, lr					; Return from subroutine
									; with result in r0
	END								; mark end of file