Mail Archives: djgpp/1997/07/22/18:08:27
> I have the following problem:
> Why can't I compile the below code:
Like the error message says, its not a valid opcode.
> outw %ax, $0x2100
> E:/DJGPP/TMP\cca00041:13: Error: operands given don't match any known
From Intels Pentium Processor Users Manual Volume 3
Out - Output to Port
OUT imm8,AL
OUT imm8,AX
OUT imm8,EAX
OUT DX,AL
OUT DX,AX
OUT DX,EAX
The problem is the immediate field is only 8 bits. You need to move the
value for the port into DX and then use it instead. Remember to
switch opcode order for AT&T syntax.
> outw %ax, $0x21
Here 0x21 will fit in an 8 bit value no problem, 0x2100 above is too big.
--
_______ ___________________________________________________________
/ Andrew Crabtree
/ Workgroup Networks Division
____ ___ / Hewlett-Packard
/ / / / Roseville, CA
__/ __/ _____/ 916/785-1675
/ andrewc AT rosemail DOT rose DOT hp DOT com
___________ __/ _____________________________________________________
- Raw text -