Files

31 lines
2.4 KiB
Plaintext

1 .module wc_txtpr
2 .area _CODE
00006006 3 WC_ENTRY = 0x6006
4 .globl _wc_txtpr
00000000 5 _wc_txtpr::
00000000 DD E5 [15] 6 push ix ; (1) save caller IX
00000002 E5 [11] 7 push hl ; (2) save win ptr (HL = 1st arg)
00000003 D5 [11] 8 push de ; (3) save str ptr (DE = 2nd arg)
00000004 DD 21 00 00 [14] 9 ld ix, #0
00000008 DD 39 [15] 10 add ix, sp
0000000A DD 56 09 [19] 11 ld d, 9(ix) ; D = y
0000000D DD 5E 08 [19] 12 ld e, 8(ix) ; E = x
00000010 DD 6E 00 [19] 13 ld l, 0(ix)
00000013 DD 66 01 [19] 14 ld h, 1(ix) ; HL = str ptr
00000016 D9 [ 4] 15 exx ; shadow: HL'=str, D'=y, E'=x
00000017 DD 6E 02 [19] 16 ld l, 2(ix)
0000001A DD 66 03 [19] 17 ld h, 3(ix) ; HL = win ptr
0000001D E5 [11] 18 push hl
0000001E DD E1 [14] 19 pop ix ; IX = win ptr
00000020 D9 [ 4] 20 exx ; restore HL=str, D=y, E=x
00000021 3E 0B [ 7] 21 ld a, #0x0B
00000023 CD 06 60 [17] 22 call WC_ENTRY
00000026 7A [ 4] 23 ld a, d ; A = return: next Y
00000027 D1 [10] 24 pop de ; (3) restore DE
00000028 E1 [10] 25 pop hl ; (2) restore HL
00000029 DD E1 [14] 26 pop ix ; (1) restore IX
0000002B E1 [10] 27 pop hl ; HL = return address
0000002C 33 [ 6] 28 inc sp ; } discard caller's push bc (2 bytes: y, x)
0000002D 33 [ 6] 29 inc sp ; }
0000002E E9 [ 4] 30 jp (hl) ; return (callee cleans stack args)