-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.a
160 lines (119 loc) · 5.71 KB
/
variables.a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
;==============================================================================
; DEMON - copy(l)eft 2018 http://harald.ist.org/
; tabsize=8
;==============================================================================
;==============================================================================
!zone GLOBAL_VARIABLES
;==============================================================================
; Some of these variables are also used by other functions for completely
; different purposes, to reduce memory usage. Any recycling is mentioned in the
; comments.
;==============================================================================
; elfn_go.a
;==============================================================================
; Client context record
;------------------------------------------------------------------------------
client_ctxrec
client_pc !word $1234 ; Program counter (next instruction)
client_irqv !byte 0,0 ; IRQ vector at $0314
;client_nmiv !byte 0,0 ; NMI vector at $0316
client_bank !byte 0 ; ROM visibility configuration in $01
client_sptr !byte 0 ; Stack pointer
client_akku !byte 0 ; .A register
client_xreg !byte 0 ; .X register
client_yreg !byte 0 ; .Y register
client_sreg !byte 0 ; Status register
client_ctxrec_end
; Monitor context record
;------------------------------------------------------------------------------
monitor_ctxrec
monitor_pc !word $1234 ; Program counter (next instruction)
monitor_irqv !byte 0,0 ; IRQ vector at $0314
;monitor_nmiv !byte 0,0 ; NMI vector at $0316
monitor_bank !byte 0 ; ROM visibility configuration in $01
monitor_sptr !byte 0 ; Stack pointer
monitor_akku !byte 0 ; .A register
monitor_xreg !byte 0 ; .X register
monitor_yreg !byte 0 ; .Y register
monitor_sreg !byte 0 ; Status register
; Monitor control data
;------------------------------------------------------------------------------
orig_brk_vector !byte 0,0 ; Break vector in monitor context
orig_nmi_vector !byte 0,0 ; Original NMI service routine
step_mode !byte 0 ; Normal call, step or trace
step_opc_save_a0 !byte 0 ; BRKs are written over the instuctions
step_opc_save_a1 !byte 0
step_opc_save_b0 !byte 0 ; after the one about to be executed
step_opc_save_b1 !byte 0
step_brk_addr_a !byte 0,0 ; The addresses of those BRKs are kept,
step_brk_addr_b !byte 0,0 ; for restoring the original opcs later
nmi_brk_addr !byte 0,0
nmi_brk_save !byte 0
;==============================================================================
; eval_line.a
;==============================================================================
param_1 !byte 0,0 ; Temporary variables for int16 values
param_2 !byte 0,0 ; of read-in parameters
el_command !byte 0 ; Pass used command character to elfn_*
; functions
;==============================================================================
; elfn_assemble.a
;==============================================================================
clear_start
mnem_temp !byte 0,0,0 ; Holds 3 chars when comparing mnemonic
amode_pre_1 !byte 0 ; Holds '#' or '(' signs, if found
amode_pre_2 !byte 0 ; Holds '$' sign before operand
mnem_param !byte 0,0,0,0 ; Holds up to 4 chars (operand nibbles)
amode_post_1 !byte 0 ; Holds ',' or ')', if found
amode_post_2 !byte 0 ; Holds 'X', 'Y' or ',', if found
amode_post_3 !byte 0 ; Holds 'X' or 'Y', if found
clear_end
addr_lo !byte 0 ; Value of address at beginning of
addr_hi !byte 0 ; input string (for aREL)
asm_ilen !byte 0 ; Length of assembled instruction
asm_opcode !byte 0 ; Assembled instruction (return value)
asm_operand_lo !byte 0 ; Assembled instruction (return value)
asm_operand_hi !byte 0 ; Assembled instruction (return value)
;==============================================================================
; elfn_direct.a
;==============================================================================
direct_command !byte 0
;==============================================================================
; elfn_disassemble.a
;==============================================================================
dass_temp_lo !byte 0 ; Operand; Address, an aREL points to
dass_temp_hi !byte 0
;==============================================================================
; elfn_hexdump.a
;==============================================================================
hexd_address !byte 0,0 ; These bytes are also used by
hexd_offset !byte 0,0 ; elfn_symbol.a as temp string buffer
hexd_buffer !byte 0,0,0,0, 0,0,0,0 ; One byte used as .temp in
;elfn_disassemble.a:check_print_divider
hexd_colors !byte 0,0,0,0, 0,0,0,0
hexd_temp !byte 0
force_unknown_opc = hexd_temp ; Flag for disassemble to show the byte
; and not the full instruction (scroll)
scroll_opcode = hexd_temp-1 ; Temp storage for disassembled op
;==============================================================================
; elfn_illegals.a
;==============================================================================
illegal_opcs !byte 0
;==============================================================================
; elfn_transfer.a
;==============================================================================
workspace_start !word heap
workspace_end !word $9fff
;==============================================================================
; system_state.a
;==============================================================================
prev_rom_config !byte 0 ; Used as temp storage .opcode in
; opcode_matrix.a:get_instruction_len
roms_raddr !byte 0,0
roms_akku !byte 0
switch_raddrs !byte 0,0, 0,0
switch_sptr !byte 0
sr_zp_backup !byte 0,0, 0,0, 0,0, 0,0, 0 ; Also used as .asmbuf in
; elfn_help.a:help_opcode
;==============================================================================
!eof