From: Andrew Crabtree Message-Id: <199707222205.AA051199111@typhoon.rose.hp.com> Subject: Re: How to outw ? To: tcho AT polbox DOT com Date: Tue, 22 Jul 1997 15:05:11 PDT Cc: djgpp AT delorie DOT com In-Reply-To: <33D519FB.499A@polbox.com>; from "Tomasz Chojnacki" at Jul 22, 97 10:37 pm Precedence: bulk > 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 ___________ __/ _____________________________________________________