cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

joy.s (544B)


      1	.include	"global.s"
      2
      3	.globl	.int
      4
      5	.area	_HEADER_JOY (ABS)
      6
      7	.org	0x60		; JOY
      8.int_JOY:
      9	PUSH	AF
     10	PUSH	HL
     11	LD	HL,#.int_0x60
     12	JP	.int
     13
     14	.area	_HOME
     15
     16_add_JOY::
     17	PUSH	BC
     18	LDA	HL,4(SP)	; Skip return address and registers
     19	LD	C,(HL)
     20	INC	HL
     21	LD	B,(HL)
     22	CALL	.add_JOY
     23	POP	BC
     24	RET
     25
     26.add_JOY::
     27	LD	HL,#.int_0x60
     28	JP	.add_int
     29
     30_remove_JOY::
     31	PUSH	BC
     32	LDA	HL,4(SP)	; Skip return address and registers
     33	LD	C,(HL)
     34	INC	HL
     35	LD	B,(HL)
     36	CALL	.remove_JOY
     37	POP	BC
     38	RET
     39
     40.remove_JOY::
     41	LD	HL,#.int_0x60
     42	JP	.remove_int
     43
     44	.area	_DATA
     45
     46.int_0x60::
     47	.blkw	0x08