1	comment "subroutine prologue"
2	.macro gdbasm_enter
3        ldx     _.frame
4	pshx
5	sts     _.frame
6	.endm
7
8	comment "subroutine epilogue"
9	.macro gdbasm_leave
10        pulx
11        stx     _.frame
12	rts
13	.endm
14
15	.macro gdbasm_call subr
16	jsr	\subr
17	.endm
18
19	.macro gdbasm_several_nops
20	nop
21	nop
22	nop
23	nop
24	.endm
25
26	comment "exit (0)"
27	.macro gdbasm_exit0
28        clra
29        clrb
30        wai
31	.endm
32
33	comment "crt0 startup"
34	.macro gdbasm_startup
35        .sect .data
36        .globl _.frame
37_.frame: .word 0
38        .previous
39        lds     #0x2000
40        clr     _.frame
41        clr     _.frame+1
42	.endm
43
44	comment "Declare a data variable"
45	.macro gdbasm_datavar name value
46	.data
47\name:
48	.long	\value
49	.endm
50