You're using 80x86 assembly language, and I'm assuming you're using a PC as a target platform.
Under DOS the ports are accessible, under Win32, pretty much not, unless Win98 or earlier.
Web Search PC bios, DOS interrupts, etc.
I wouldn't just be throwing values and random ports. I know one very early computer (though I think it was an 8080) that used I/O ports to control the high voltage circuit on the built in monitor, and the wrong value would blow the circuitry! But I digress.
You have the basic idea of value to port.
forms:
; OUT #8, AL/AX,EAX,RAX
out 045h,al
; OUT DX,AL/AX/EAX/RAX
out dx,al
; String based
; these are only efficient for repeat counts of 64 or more.
; OUTSX
outsb ; Output 8 bits
outsw ; Output 16 bits
outsd ; Output 32 bits
mov ecx,5
rep outsb
; these are similar to a LODS (String Load) instruction
outs dx,byte ptr ds:[esi]
outs dx,word ptr ds:[esi]
outs dx,dword ptr ds:[esi] wildgoose
Practically a Posting Shark
896 posts since Jun 2009
Reputation Points: 546
Solved Threads: 99