parse-wormedit: better support for missing multiplayer levels
[wormy.git] / ti86abs.inc
1 ;
2 ;
3 ;       TI-86 'Paged Ram' Support routines
4 ;
5 ;
6
7 ;
8 ;       some ram equates
9 ;
10 _ABS_SRC_ADDR      equ         0C392h   ; 3 byte ABS address pointer
11 _ABS_DEST_ADDR     equ         0C395h   ; 3 byte ABS address pointer
12 _MM_NUM_BYTES      equ         0C398h   ; 3 byte block move counter
13 ;
14
15 ;
16 ;
17 ;       'Block' Move Support Routines
18 ;
19 ;
20
21 ;
22 ; ahl -> (_abs_src_addr)
23 ;
24 _SET_ABS_SRC_ADDR                equ            4647h
25
26 ;
27 ; ahl -> (_abs_dest_addr)
28 ;
29 _SET_ABS_DEST_ADDR               equ            5285h
30
31 ;
32 ; ahl -> (_mm_num_bytes)
33 ;
34 _SET_MM_NUM_BYTES                equ            464Fh
35
36
37 ;
38 ;       This routine mimmicks the Z80's LDIR instruction.
39 ;
40 ;
41 ; INPUTS       - abs_src_addr, abs_dest_addr, mm_num_bytes
42 ;                Source Address, Destination Address, and # of bytes,
43 ;                all in 24-bit form.
44 ; OUTPUTS      - abs_src_addr, abs_dest_addr, mm_num_bytes
45 ;                Modified exactly as HL, DE, and BC are after LDIR
46 ;
47 ;  moves (_mm_num_bytes) bytes starting @ (_abs_src_addr) to (_abs_dest_addr)
48 ;  incrementing the src/dest pointer after each byte moved
49 ;
50 _mm_ldir           equ         52EDh
51
52 ;
53 ;
54 ;       This routine mimmicks the Z80's LDIR instruction.
55 ;
56 ;
57 ; INPUTS       - abs_src_addr, abs_dest_addr, mm_num_bytes
58 ;                Source Address, Destination Address, and # of bytes,
59 ;                all in 24-bit form.
60 ; OUTPUTS      - abs_src_addr, abs_dest_addr, mm_num_bytes
61 ;                Modified exactly as HL, DE, and BC are after LDIR
62 ;
63 ;  moves (_mm_num_bytes) bytes starting @ (_abs_src_addr) to (_abs_dest_addr)
64 ;  decrementing the src/dest pointer after each byte moved
65 ;
66 _mm_lddr           equ         52F1h
67 ;
68
69 ;
70 ;  ahl -> (_abs_src_addr). move 10 bytes @ (_abs_src_addr) -> OP1
71 ;
72 _ABS_MOV10TOOP1    equ         5235h
73
74 ;
75 ;  move 10 bytes @ (_abs_src_addr) -> OP1
76 ;
77 _ABS_MOV10TOOP1_noset   equ    5239h
78
79 ;
80 ; ahl -> (_abs_dest_addr).move 10 bytes from (_abs_src_addr)->(_abs_dest_addr)
81 ;
82 _ABS_MOV10B_SET_D  equ         523Dh
83
84 ;
85 ; move 10 bytes from (_abs_src_addr) -> (_abs_dest_addr)
86 ;
87 _ABS_MOV10B        equ         5249h
88
89 ;
90 ; ahl -> (_abs_dest_addr). move 10 bytes from OP1 -> (_abs_dest_addr)
91 ;
92 _ABS_MOVFROP1_SET_D    equ     5241h
93
94 ;
95 ; move 10 bytes from OP1 -> (_abs_dest_addr)
96 ;
97 _ABS_MOVFROP1      equ         5245h
98
99 ;
100 ;
101 ;       Misc support
102 ;
103 ;
104 _inc_ptr_ahl    equ    4637h    ; ahl = ahl + 1
105 _dec_ptr_ahl    equ    463Bh    ; ahl = ahl - 1
106 _inc_ptr_bde    equ    463Fh    ; bde = bde + 1 , ahl & status intact
107 _dec_ptr_dbe    equ    4643h    ; bde = bde - 1 , ahl & status intact
108 _dec_ptr_ade    equ    46BFh    ; ade = ade - 1
109
110
111 ;
112 ; decode ABS ahl and load the RAM page and set hl = offset, (hl) = (ABS ahl)
113 ;
114 _load_ram_ahl   equ    462Fh
115
116 _GETB_AHL       equ    46C3h ; acc = (ABS ahl), hl = asic address now
117
118
119 _RAM_PAGE_1     equ    47E3h ; load RAM page 1, FPS page
120 _RAM_PAGE_7     equ    47F3h ; load RAM page 7, symbol table page
121
122 ;
123 ;  write c -> (ABS ahl), ahl = ahl + 1, still ABS address
124 ;
125 _writeb_inc_ahl    equ     5567h
126
127 \1a