blob: 993e21070bbe53ca51a2f53217706be77895ce7f (
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
|
INCLUDE "constants.asm"
if DEBUG
SECTION "Print Hexadecimal functions", ROM0[$3597]
else
SECTION "Print Hexadecimal functions", ROM0[$355B]
endc
PrintHexBytes: ; 3597 (0:3597)
.loop
push bc
call PrintHexByte
pop bc
dec c
jr nz, .loop
ret
PrintHexByte:: ; 35a0 (0:35a0)
ld a, [de]
swap a
and $0f
call PrintHexDigit
ld [hli], a
ld a, [de]
and $0f
call PrintHexDigit
ld [hli], a
inc de
ret
PrintHexDigit: ; 35b2 (0:35b2)
ld bc, .hexDigitTable
add c
ld c, a
ld a, $00
adc b
ld b, a
ld a, [bc]
ret
.hexDigitTable:
db "0123456789ABCDEF"
|