Opcode Instruction Description
6E - OUTS DX, m8 Output byte from memory location specified in DS:(E)SI to I/O port specified in DX.
6F - OUTS DX, m16 Output word from memory location specified in DS:(E)SI to I/O port specified in DX.
6F - OUTS DX, m32 Output doubleword from memory location specified in DS:(E)SI to I/O port specified in DX.
6E - OUTSB Output byte from memory location specified in DS:(E)SI to I/O port specified in DX.
6F - OUTSW Output word from memory location specified in DS:(E)SI to I/O port specified in DX.
6F - OUTSD Output doubleword from memory location specified in DS:(E)SI to I/O port specified in DX.


1. It says that the instuctions output a byte/word/dword from DS:(E)SI, but ollydbg shows that they output from ES:(E)DI. Which one is correct?
2. The INS instruction loads from the ES:(E)DI, or the DS:(E)SI? Both the ollydbg and the manual say that it's ES:(E)DI, but I'm confused because of this OUTS :|
Posted on 2005-12-04 11:50:00 by ti_mo_n
hi ti_mo_n,

Hope this helps
1. The outs(b/w/d) transfers data from ds:(e)si unless the src operand is given
2. The ins(b/w/d) gets the data from a port and stores it in es:(e)di, even if a destination operand is specified..

later..  8)
Posted on 2005-12-04 13:00:23 by lone_samurai5
w00t? :| According to the Intel's manual, the source operand is only for compilers to set the approptiate port size (that's why they have the same opcodes). And how is that possible that the string instruction (INS) inputs from DS:(E)DI ? All string instructions work on either ES:(E)DI or DS:(E)SI pair. :| Now I'm even more confused ^^"
Posted on 2005-12-04 13:19:52 by ti_mo_n
sorry for confusing ya, its really late and i'm feelin kinda sleepy, just typed it wrong.. it IS es:(e)di  :oops:
Posted on 2005-12-04 13:25:34 by lone_samurai5

w00t? :| According to the Intel's manual, the source operand is only for compilers to set the approptiate port size (that's why they have the same opcodes).


The src operand is not used to set the port size ... it is just the memory location from which data is copied to the port..
Posted on 2005-12-04 13:49:06 by lone_samurai5
Port size is specified by the opcode (+optional memory size prefix):

The size of the I/O port being accessed (that is, the size of the source and
destination operands) is determined by the opcode for an 8-bit I/O port or by the operand-size
attribute of the instruction for a 16- or 32-bit I/O port.


...I still don't know wheter the manual or the ollydbg is correct ^^"
Posted on 2005-12-04 14:07:27 by ti_mo_n
I'm pretty sure the stuff in the intel manual is correct, btw what did ollydbg say??
Posted on 2005-12-04 14:22:23 by lone_samurai5
Ollydbg doesn't show any source operand, because it's just a compiler 'hint'. opcodes 6E and 6F don't have any operands. As for the port size: I can't test it because ollydbg opens applications in protected mode, ring 3.
Posted on 2005-12-04 14:30:48 by ti_mo_n

Ollydbg doesn't show any source operand, because it's just a compiler 'hint'. opcodes 6E and 6F don't have any operands. As for the port size: I can't test it because ollydbg opens applications in protected mode, ring 3.


Sure you can - search the board for SetInformationProcess :)
Posted on 2005-12-04 14:48:47 by f0dder