75 lines
2.9 KiB
HTML
75 lines
2.9 KiB
HTML
<html><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
|
<html>
|
|
|
|
<head>
|
|
<title>80386 Programmer's Reference Manual -- Opcode OUT</title>
|
|
</head>
|
|
|
|
<body>
|
|
<b>up:</b> <a href="C17.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/C17.HTM">Chapter 17 -- 80386 Instruction Set</a><br>
|
|
<b>prev:</b><a href="OR.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/OR.HTM"> OR Logical Inclusive OR</a><br>
|
|
<b>next:</b><a href="OUTS.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/OUTS.HTM"> OUTS/OUTSB/OUTSW/OUTSD Output String to Port</a>
|
|
<p>
|
|
<hr>
|
|
<p>
|
|
<h1>OUT -- Output to Port</h1>
|
|
<pre>
|
|
|
|
|
|
|
|
Opcode Instruction Clocks Description
|
|
|
|
E6 ib OUT imm8,AL 10,pm=4*/24** Output byte AL to immediate port
|
|
number
|
|
E7 ib OUT imm8,AX 10,pm=4*/24** Output word AL to immediate port
|
|
number
|
|
E7 ib OUT imm8,EAX 10,pm=4*/24** Output dword AL to immediate
|
|
port number
|
|
EE OUT DX,AL 11,pm=5*/25** Output byte AL to port number in
|
|
DX
|
|
EF OUT DX,AX 11,pm=5*/25** Output word AL to port number in
|
|
DX
|
|
EF OUT DX,EAX 11,pm=5*/25** Output dword AL to port number
|
|
in DX
|
|
</pre>
|
|
<em>
|
|
<h3>Notes</h3>
|
|
<pre>
|
|
|
|
|
|
|
|
*If CPL <= IOPL
|
|
**If CPL > IOPL or if in virtual 8086 mode
|
|
</pre>
|
|
</em>
|
|
<h2>Operation</h2>
|
|
<pre>
|
|
|
|
|
|
|
|
IF (PE = 1) AND ((VM = 1) OR (CPL > IOPL))
|
|
THEN (* Virtual 8086 mode, or protected mode with CPL > IOPL *)
|
|
IF NOT I-O-Permission (DEST, width(DEST))
|
|
THEN #GP(0);
|
|
FI;
|
|
FI;
|
|
[DEST] := SRC; (* I/O address space used *)
|
|
</pre>
|
|
<h2>Description</h2>
|
|
OUT transfers a data byte or data word from the register (AL, AX, or EAX) given as the second operand to the output port numbered by the first operand. Output to any port from 0 to 65535 is performed by placing the port number in the DX register and then using an OUT instruction with DX as the first operand. If the instruction contains an eight-bit port ID, that value is zero-extended to 16 bits.
|
|
<h2>Flags Affected</h2>
|
|
None
|
|
<h2>Protected Mode Exceptions</h2>
|
|
#GP(0) if the current privilege level is higher (has less privilege) than IOPL and any of the corresponding I/O permission bits in TSS equals 1
|
|
<h2>Real Address Mode Exceptions</h2>
|
|
None
|
|
<h2>Virtual 8086 Mode Exceptions</h2>
|
|
#GP(0) fault if any of the corresponding I/O permission bits in TSS equals 1
|
|
<p>
|
|
<hr>
|
|
<p><b>up:</b> <a href="C17.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/C17.HTM">Chapter 17 -- 80386 Instruction Set</a><br>
|
|
<b>prev:</b><a href="OR.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/OR.HTM"> OR Logical Inclusive OR</a><br>
|
|
<b>next:</b><a href="OUTS.HTM" tppabs="http://webster.cs.ucr.edu/Page_TechDocs/Doc386/OUTS.HTM"> OUTS/OUTSB/OUTSW/OUTSD Output String to Port</a>
|
|
</body>
|
|
|