00001c72 8B166036 mov dx,[0x3660] 00001c76 B8E000 mov ax,0xe0 00001c79 EE out dx,al 00001c7a EB00 jmp short 0x1c7c ; delay 00001c7c EB00 jmp short 0x1c7e ; delay 00001c7e 8B165C36 mov dx,[0x365c] 00001c82 A0423B mov al,[0x3b42] 00001c85 EE out dx,al 00001c86 EB00 jmp short 0x1c88 ; delay 00001c88 EB00 jmp short 0x1c8a ; delay 00001c8a 8B166036 mov dx,[0x3660] 00001c8e B8E100 mov ax,0xe1 00001c91 EE out dx,al 00001c92 EB00 jmp short 0x1c94 ; delay 00001c94 EB00 jmp short 0x1c96 ; delay 00001c96 8B165C36 mov dx,[0x365c] 00001c9a A0433B mov al,[0x3b43] 00001c9d EE out dx,alTwo locations hold the port addresses:
0x3660 holds the "ID" address -- i.e. 0x2e0 0x365c holds the "Data" address -- i.e. 0x2e2And here is a read from the Data port. I include the four jumps for delay prior to the sequence of interest as a point of interest.
000027a0 EB00 jmp short 0x27a2 ; delay 000027a2 EB00 jmp short 0x27a4 ; delay 000027a4 EB00 jmp short 0x27a6 ; delay 000027a6 EB00 jmp short 0x27a8 ; delay 000027a8 B8E200 mov ax,0xe2 000027ab 8B166036 mov dx,[0x3660] 000027af EE out dx,al 000027b0 EB00 jmp short 0x27b2 ; delay 000027b2 EB00 jmp short 0x27b4 ; delay 000027b4 8B165C36 mov dx,[0x365c] 000027b8 EC in al,dx 000027b9 A23E1A mov [0x1a3e],al ; save resultOne has to wonder if these delays will be sufficient on a faster processor. This code was originally used when a 33 Mhz processor was considered fast. However I have run this code on a 600 Mhz Pentium III without trouble.
Tom's Electronics pages / tom@mmto.org