blob: a6a14f3ea888c5c6009013f5b1a79d21730501ef (
plain)
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
|
.org util_data
hex_char:
.byte "0123456789ABCDEF"
.org utils
print_hi:
and
sta idx3
lda
jsr charcpy
lda.q idx0
ldx
jsr print_hex
lda.q hex_str
sta.q strbuf+1
lda.q hex_str+8
sta.q strbuf+9
ldx
stx idx3
lda
jsr charcpy
lda
jsr charcpy
rts
print_lo:
lda
sta idx3
pntlo_lp:
ldx
pha
jsr print_hex
lda.w (ptr3)
jsr charcpy
lsr
jsr charcpy
pla
inc
cmp
bcs pntlo_end
pntlo_lp1:
pha
lda
jsr charcpy
pla
jmp pntlo_lp
pntlo_end:
inx
lda
sta strbuf, x
tax
lda.d
jsr print_str
rts
print_chunk:
ldx
phy
txy
pntchnk_lp:
and
ldx
lda (idx0), y
jsr print_hex
lda.w (ptr3)
jsr charcpy
lsr
jsr charcpy
iny
cpy
beq pntchnk_end
lda
jsr charcpy
jmp pntchnk_lp
pntchnk_end:
ply
inx
and
sta strbuf, x
tax
sta idx3
rts
print_hex:
pha
and
ldb
lda.w
jsr set_ptr
inb
lda.d
clc
adc
jsr set_ptr
ldb
pla
pnthex_lp:
pha
and
phy
tay
lda (ptr2), y
dec ptr3
sta (ptr3)
ply
pla
pnthex_lp1:
cpx
bcc pnthex_lp2
dex
beq pnthex_end
jmp pnthex_lp3
pnthex_lp2:
ldb
pnthex_lp3:
lsr
beq pnthex_lp4
jmp pnthex_lp
pnthex_lp4:
cpb
beq pnthex_end
jmp pnthex_lp
pnthex_end:
rts
charcpy:
ldx idx3
sta strbuf, x
inc idx3
rts
|