Skip to content

Commit 25dc106

Browse files
authored
Merge pull request #27 from cormacj/template-work
add some comparisons
2 parents cb2d6d5 + eb94ad5 commit 25dc106

File tree

1 file changed

+159
-0
lines changed

1 file changed

+159
-0
lines changed
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
I took AMSDOS.COM from a CPM disc and tested the output of various disassemblers:
2+
3+
z88dis:
4+
5+
```
6+
$ z88dk.z88dk-dis -mz80 -o 0x100 -e 0x140 AMSDOS.COM
7+
ld c,$0c ;[0100] 0e 0c
8+
call $0005 ;[0102] cd 05 00
9+
ld a,l ;[0105] 7d
10+
di ;[0106] f3
11+
ld bc,$7f8e ;[0107] 01 8e 7f
12+
exx ;[010a] d9
13+
ex af,af' ;[010b] 08
14+
xor a ;[010c] af
15+
ex af,af' ;[010d] 08
16+
ld de,$0000 ;[010e] 11 00 00
17+
cp $30 ;[0111] fe 30
18+
jr c,$0124 ;[0113] 38 0f
19+
ld de,$4000 ;[0115] 11 00 40
20+
ld bc,$7fc4 ;[0118] 01 c4 7f
21+
ld hl,$49ed ;[011b] 21 ed 49
22+
ld ($4122),hl ;[011e] 22 22 41
23+
jp $4122 ;[0121] c3 22 41
24+
ld sp,$c000 ;[0124] 31 00 c0
25+
ld a,$c9 ;[0127] 3e c9
26+
ld ($0038),a ;[0129] 32 38 00
27+
push de ;[012c] d5
28+
call $bcc8 ;[012d] cd c8 bc
29+
pop de ;[0130] d1
30+
ld hl,$0139 ;[0131] 21 39 01
31+
add hl,de ;[0134] 19
32+
call $bcd4 ;[0135] cd d4 bc
33+
rst $00 ;[0138] c7
34+
ld b,d ;[0139] 42
35+
ld b,c ;[013a] 41
36+
ld d,e ;[013b] 53
37+
ld c,c ;[013c] 49
38+
jp $001a ;[013d] c3 1a 00
39+
```
40+
41+
42+
z80dasm:
43+
44+
```
45+
$ z80dasm -a -l AMSDOS.COM
46+
; z80dasm 1.1.6
47+
; command line: z80dasm -a -l AMSDOS.COM
48+
49+
org 00100h
50+
51+
ld c,00ch ;0100
52+
call 00005h ;0102
53+
ld a,l ;0105
54+
di ;0106
55+
ld bc,07f8eh ;0107
56+
exx ;010a
57+
ex af,af' ;010b
58+
xor a ;010c
59+
ex af,af' ;010d
60+
ld de,00000h ;010e
61+
cp 030h ;0111
62+
jr c,l0124h ;0113
63+
ld de,04000h ;0115
64+
ld bc,07fc4h ;0118
65+
ld hl,049edh ;011b
66+
ld (04122h),hl ;011e
67+
jp 04122h ;0121
68+
l0124h:
69+
ld sp,0c000h ;0124
70+
ld a,0c9h ;0127
71+
ld (00038h),a ;0129
72+
push de ;012c
73+
call 0bcc8h ;012d
74+
pop de ;0130
75+
ld hl,l0139h ;0131
76+
add hl,de ;0134
77+
call 0bcd4h ;0135
78+
rst 0 ;0138
79+
l0139h:
80+
ld b,d ;0139
81+
ld b,c ;013a
82+
ld d,e ;013b
83+
ld c,c ;013c
84+
jp 0001ah ;013d
85+
```
86+
87+
z80-smart-disassember:
88+
```
89+
$ ./z80-disassembler.py -l 0x100 AMSDOS.COM -e 0x140
90+
91+
z80-disassembler.py - v0.80 - A Smart Z80 reverse assembler
92+
Visit https://github.com/cormacj/z80-smart-disassembler for updates and to report issues
93+
94+
Disassembling AMSDOS.COM: 64 bytes
95+
96+
97+
98+
Pass 1: Identify addressable areas
99+
100+
Pass 2: Search for strings
101+
102+
Pass 3: Build code structure
103+
104+
Pass 4: Validate labels
105+
106+
Pass 5: Produce final listing
107+
;-----------------------------------
108+
; Produced using: z80-disassembler.py v0.80 - A Smart Z80 reverse assembler
109+
; Visit https://github.com/cormacj/z80-smart-disassembler for updates and to report issues
110+
;
111+
; Command line used: z80-disassembler.py -l 0x100 AMSDOS.COM -e 0x140
112+
;-----------------------------------
113+
114+
; Define labels for external calls
115+
116+
117+
118+
org 0x100
119+
120+
LD C,12 ;0x100: 0e 0c ".."
121+
CALL 0x5 ;0x102: cd 05 00 "..."
122+
LD A,L ;0x105: 7d "}"
123+
DI ;0x106: f3 "."
124+
LD BC,0x7f8e ;0x107: 01 8e 7f "..."
125+
EXX ;0x10a: d9 "."
126+
EX AF,AF' ;0x10b: 08 "."
127+
XOR A ;0x10c: af "."
128+
EX AF,AF' ;0x10d: 08 "."
129+
LD DE,0 ;0x10e: 11 00 00 "..."
130+
CP 0x30 ;0x111: fe 30 ".0"
131+
JR c, C_0124 ;0x113: 38 0f "8."
132+
LD DE,0x4000 ;0x115: 11 00 40 "..@"
133+
LD BC,0x7fc4 ;0x118: 01 c4 7f "..."
134+
LD HL,0x49ed ;0x11b: 21 ed 49 "!.I"
135+
LD (0x4122),HL ;0x11e: 22 22 41 """A"
136+
JP 0x4122 ;0x121: c3 22 41 "."A"
137+
;--------------------------------------
138+
C_0124: ; XREF: 0x113
139+
LD SP,0xc000 ;0x124: 31 00 c0 "1.."
140+
LD A,0xc9 ;0x127: 3e c9 ">."
141+
LD (0x38),A ;0x129: 32 38 00 "28."
142+
PUSH DE ;0x12c: d5 "."
143+
CALL 0xbcc8 ;0x12d: cd c8 bc "..."
144+
POP DE ;0x130: d1 "."
145+
LD HL,S_0139 ;0x131: 21 39 01 "!9." - References: "BASI"
146+
ADD HL,DE ;0x134: 19 "."
147+
CALL 0xbcd4 ;0x135: cd d4 bc "..."
148+
RST 0 ;0x138: c7 "."
149+
;--------------------------------------
150+
S_0139: ; XREF: 0x131
151+
DEFB "BASI", 'C' + 0x80 ;0x139: 0x139 to 0x140
152+
DEFB 0x1a ;0x13e: 0x1a
153+
DEFB 0x0 ;0x13f:
154+
155+
156+
Lines of code: 42
157+
Code Labels: 1
158+
Data Labels: 1
159+
```

0 commit comments

Comments
 (0)