I'm disassembling a 16-bit DOS executable, and looking at the following three instructions:
mov dx,0x3ce
mov ax,0xff08
out dx,ax
I know it writes the value 0xff08
to I/O port 0x3ce
. I also know that port 0x3ce
is the "Graphics 1 & 2 Address" register on an IBM EGA card. Problem is, according to the manual, this port should take a byte value, not a word.
What I'm guessing is happening is that the word 0xff08
is taken as two different bytes, where one byte ends up in the specified register and the other goes to an adjacent one. Or maybe the offending byte gets thrown out? Either way it's a guess, as I can't seem to find much info about this specific behavior.
I don't have a good intuitive sense about which direction the I/O address space flows, or how the little-endian storage of the word may come into play. After this snippet executes, which ports got which bytes?