//	.globl undef
	.globl asm_test

// Function written in assembly language, calling an invalid instruction
.func undef
undef2:
//    DCI  0xF123                         // DCI is not an ARM assmebly instruction
//    DCI  0x4567
    BX   LR
.endfunc


.func asm_test
asm_test:
@	ADR R0, do_print
@	BX R0
	push {r0,r1,r2,r3,lr}
	ADR R0, thumbcode
	MOV LR, PC
	BX R0
.endfunc

exit:
	MOV R0, #1
	SVC 0
	pop {r0,r1,r2,r3,pc}
	bx lr

	NOP @ Gotta be a better way of aligning thumbcode!!

	@All thumb code to be placed ater this point.
	@.thumb
thumbcode:
	MOV R3, #0

loop:
	ADD R3, #1
	SUB R0, R1
	BGE loop
	SUB R3, #1
	ADD R2, R0, R1
	BX LR

do_print:
	MOV R7, #4 @ syscall 4 is print
	MOV R0, #1 @ Stdout is monitor
	MOV R2, #19 @ string is 19 characters long
	LDR R1,=string @string located at string:
	SVC 0

	.data
string:
	.ascii "Hello World String\n"
