1999-04-16 01:35:26 +00:00
|
|
|
comment "subroutine prologue"
|
2001-11-10 17:55:48 +00:00
|
|
|
.macro gdbasm_enter
|
2001-12-04 19:45:57 +00:00
|
|
|
st r11,@-sp
|
1999-04-16 01:35:26 +00:00
|
|
|
st r13,@-sp
|
2001-12-04 19:45:57 +00:00
|
|
|
mv r11,sp
|
1999-04-16 01:35:26 +00:00
|
|
|
.endm
|
|
|
|
|
|
|
|
comment "subroutine epilogue"
|
2001-11-10 17:55:48 +00:00
|
|
|
.macro gdbasm_leave
|
2001-12-04 19:45:57 +00:00
|
|
|
add3 sp,r11,0
|
|
|
|
ld r13,@sp+
|
|
|
|
ld r11,@sp+
|
|
|
|
jmp r13
|
1999-04-16 01:35:26 +00:00
|
|
|
.endm
|
|
|
|
|
2001-11-10 17:55:48 +00:00
|
|
|
.macro gdbasm_call subr
|
1999-04-16 01:35:26 +00:00
|
|
|
bl \subr
|
|
|
|
.endm
|
|
|
|
|
2001-11-10 17:55:48 +00:00
|
|
|
.macro gdbasm_several_nops
|
1999-04-16 01:35:26 +00:00
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
.endm
|
|
|
|
|
|
|
|
comment "exit (0)"
|
2001-11-10 17:55:48 +00:00
|
|
|
.macro gdbasm_exit0
|
1999-04-16 01:35:26 +00:00
|
|
|
ldi r4, 1
|
|
|
|
ldi r0, 0
|
|
|
|
trap 15
|
|
|
|
.endm
|
2000-07-04 02:47:08 +00:00
|
|
|
|
|
|
|
comment "crt0 startup"
|
2001-11-10 17:55:48 +00:00
|
|
|
.macro gdbasm_startup
|
2001-12-04 19:45:57 +00:00
|
|
|
; R14 always contains memory base address (0)
|
|
|
|
|
|
|
|
ldi r14,0
|
|
|
|
|
|
|
|
; Set the USER and SYSTEM stack pointers.
|
|
|
|
|
|
|
|
ldi r0, 0 ; zero arguments
|
|
|
|
ldi r1, 0
|
|
|
|
mvtc r0, psw ; select SPI and set it
|
|
|
|
ldi sp, _stack
|
|
|
|
ldi r10, 0x8000 ; select SPU/FP and set it
|
|
|
|
mvtc r10, psw || ldi r11, 0; clear stack frame
|
|
|
|
ldi sp, _stack - 0x200
|
|
|
|
ldi r13, 0
|
|
|
|
|
|
|
|
st r11, @-sp
|
|
|
|
st r13, @-sp
|
|
|
|
; mv r11, sp
|
|
|
|
|
2000-07-04 02:47:08 +00:00
|
|
|
.endm
|