|
|
| version 1.1, 2003/12/10 12:48:09 | version 1.2, 2004/01/23 08:44:30 |
|---|---|
| Line 1 | Line 1 |
| np2str db 'NP2', 0 | np2str db 3, 'NP2' |
| np2str_ver db 'ver', 0 | db 3, 'ver' |
| np2str_cpu db 'cpu', 0 | np2str_cpu db 3, 'cpu' |
| np2str_clock db 'clock', 0 | np2str_clock db 5, 'clock' |
| np2str_hwreset db 13, 'hardwarereset' | |
| sendnp2port: mov dx, 07efh | |
| np2commsend: db FIXCS | xor cx, cx |
| db FIXCS | |
| lodsb | lodsb |
| test al, al | mov cl, al |
| je short np2commsnd_end | db FIXCS |
| out dx, al | rep outsb |
| jmps np2commsend | ret |
| np2commsnd_end: ret | |
| checknp2port: mov cl, cs:[si] | |
| cnp2p_lp: in al, dx | |
| inc si | |
| cmp al, cs:[si] | |
| loope short cnp2p_lp | |
| ret | |
| getnp2verb: push dx | getnp2verb: push cx |
| mov dx, 07efh | push dx |
| push si | push si |
| mov si, offset np2str | mov si, offset np2str |
| call np2commsend | call sendnp2port |
| mov bx, 4 | sub si, 4 |
| sub si, bx | call checknp2port |
| cnp2vb_lp2: in al, dx | |
| cmp cs:[si], al | |
| jne short nonhitnp2verb | jne short nonhitnp2verb |
| inc si | inc si |
| dec bl | call sendnp2port |
| jne cnp2vb_lp2 | |
| mov si, offset np2str_ver | |
| call np2commsend | |
| in al, dx | in al, dx |
| cmp al, 'B' | cmp al, 'B' |
| jae hitnp2verb | jb short nonhitnp2verb |
| nonhitnp2verb: pop si | pop si |
| or si, si | call sendnp2port |
| pop dx | |
| ret | |
| hitnp2verb: pop si | |
| call np2commsend | |
| mov si, I2ABUFFER | mov si, I2ABUFFER |
| mov bx, si | push si |
| hnp2verb_lp: in al, dx | rnp2p_lp: in al, dx |
| mov [bx], al | mov [si], al |
| inc bx | inc si |
| test al, al | test al, al |
| jne hnp2verb_lp | jne short rnp2p_lp |
| nonhitnp2verb: pop si | |
| pop dx | pop dx |
| pop cx | |
| ret | ret |
| PUT_CPU: mov si, offset np2str_cpu | PUT_CPU: mov si, offset np2str_cpu |
| call getnp2verb | call getnp2verb |
| np2verbout: jne short unknownout | np2verbout: jne short unknownout |
| Line 60 PUT_CLOCK: mov si, offset np2str_clock | Line 63 PUT_CLOCK: mov si, offset np2str_clock |
| je short np2verbout | je short np2verbout |
| unknownout: mov si, offset res_unknown | unknownout: mov si, offset res_unknown |
| jmp TEXTOUT_CS | jmp TEXTOUT_CS |