You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -50,16 +51,19 @@ Recommended arguments, but optional:
50
51
51
52
Formatting options:
52
53
-t TEMPLATEFILE Use a template file. This helps decode strings and allows for fine tuning disassembly. See README.md for more details
53
-
-s STRINGTERMINATOR string terminator value - defaults are [0, 13, 141] and printable characters+0x80. You can supply a number, or a single character. You can repeat this as many times as needed.
54
-
-a {pyradev,z80asm,maxam,z88}, --assembler {pyradev,z80asm,maxam,z88}
54
+
--labels LABELSFILE Use a label file. This file provides user-defined labels that may be external to the program. See README.md for more details
55
+
-s STRINGTERMINATOR string terminator value - defaults are [0, 13, 141] and printable characters+0x80. You can supply a number, or a single character. You can repeat this as many times
56
+
as needed.
57
+
-a {maxam,z88,z80asm,pyradev}, --assembler {maxam,z88,z80asm,pyradev}
55
58
Format the code for particular assemblers. The default is z88.
56
59
--style {lst,asm} asm produces a file that can be assembled. lst is a dump style output. The default is asm style.
57
60
--xref {off,on} Enable or disable cross references for labels
58
61
--stayincode Don't try to decode data after a RET/JP
59
-
--labeltype {2,1} 1: Uses short name eg D_A123 or C_A345 2: Uses full names, eg data_A123 or code_A123
60
-
-c {2,1,0}, --comments {2,1,0}
62
+
--labeltype {1,2} 1: Uses short label names eg D_A123 or C_A345 2: Uses descriptive label names, eg data_A123 or code_A123
63
+
-c {0,1,2}, --comments {0,1,2}
61
64
0: No comments 1: Address 2: (Default) Address+hex and ascii dump
62
-
--explain {2,1,0} 0: (Default) No code explanations 1: Data references only 2: Everything
65
+
--explain {0,1,2} 0: (Default) No code explanations 1: Data references only 2: Everything
66
+
63
67
```
64
68
65
69
# Decoding options
@@ -109,7 +113,7 @@ Maxam uses hex addresses in the format `&12cd`
109
113
110
114
z88 and z80asm use number style `0x12cd`
111
115
112
-
z80asm implies that labeltype is 2 which uses longer labelnames (eg `code_12CD`)
116
+
z80asm implies that labeltype is 2 which uses longer labelnames (eg `code_12CD`). This is because z80asm has issues with shorter variable names.
CALL 0xbb5a ;0x121: cd 5a bb ".Z." The current PC value plus three is pushed onto the stack, then PC is loaded with 0xbb5a.
194
198
```
199
+
# Label file
200
+
201
+
This is used by adding `--labels LABELSFILE` to the command line.
202
+
203
+
A label file allows external calls, such as BIOS entry points, to be defined and used in disassembled code. I've included `amstrad-labels.txt` in this repository as an example and for convenience.
204
+
205
+
The disassembler tracks what labels have been used during disassembly and will only add the labels that were used to the final disassembly.
206
+
207
+
208
+
This is defined as follows:
209
+
210
+
```
211
+
;A list of Amstrad CPC BIOS calls.
212
+
;Recorded here for use with the disassembler
213
+
214
+
KL_ROM_SELECT equ 0xb90f
215
+
KL_CURR_SELECTION equ 0xb912
216
+
KL_PROBE_ROM equ 0xb915
217
+
KL_ROM_DESELECT equ 0xb918
218
+
```
219
+
220
+
Comments start with ';'
221
+
222
+
Blank lines are ignored.
223
+
224
+
Labels should be structed as `Labelname equ 0x0000`
225
+
195
226
196
227
# Templates
197
228
@@ -254,12 +285,17 @@ The disassembler will try to automatically identify strings in the code, but it
254
285
255
286
# Example usage
256
287
288
+
This command disassembles the RODOS219.ROM file and stores the output in rodos.asm
0 commit comments