-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHEX.INC
48 lines (35 loc) · 968 Bytes
/
HEX.INC
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
; HEX Unit for file lister <C> 1992 Created by Dàrk Shàde
.CODE
; Procedure to show the content of a file in HEX format
ShowHex PROC
jcxz HexSetup
mov ah, 07h
HexRead: mov ax, 0720h
stosw
mov al, fs:[si]
inc si
push ax
shr al, 4
add al, '0'
cmp al, '9'
jbe HexDig_1
add al, 'A' - '0' - 10
HexDig_1: mov ah, 07h
stosw
pop ax
and al, 1111b
add al, '0'
cmp al, '9'
jbe HexDig_2
add al, 'A' - '0' - 10
HexDig_2: mov ah, 07h
stosw
mov ax, 0720h
stosw
dec cx
jz HexDone
jmp HexRead
HexDone: ret
HexSetup: mov cl, 3
ret
ShowHex ENDP