-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathNP2.X86
73 lines (61 loc) · 1.16 KB
/
NP2.X86
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
np2str db 3, 'NP2'
db 3, 'ver'
np2str_cpu db 3, 'cpu'
np2str_clock db 5, 'clock'
np2str_hwreset db 13, 'hardwarereset'
sendnp2port: mov dx, 07efh
xor cx, cx
db FIXCS
lodsb
mov cl, al
if 1
@@: db FIXCS
lodsb
out dx, al
loop short @b
else
db FIXCS
rep outsb
endif
ret
checknp2port: mov cl, cs:[si]
cnp2p_lp: in al, dx
inc si
cmp al, cs:[si]
loope short cnp2p_lp
ret
getnp2verb: push cx
push dx
push si
mov si, offset np2str
call sendnp2port
sub si, 4
call checknp2port
jne short nonhitnp2verb
inc si
call sendnp2port
in al, dx
cmp al, 'B'
jb short nonhitnp2verb
pop si
call sendnp2port
mov si, I2ABUFFER
push si
rnp2p_lp: in al, dx
mov [si], al
inc si
test al, al
jne short rnp2p_lp
nonhitnp2verb: pop si
pop dx
pop cx
ret
PUT_CPU: mov si, offset np2str_cpu
call getnp2verb
np2verbout: jne short unknownout
jmp TEXTOUT_DS
PUT_CLOCK: mov si, offset np2str_clock
call getnp2verb
je short np2verbout
unknownout: mov si, offset res_unknown
jmp TEXTOUT_CS