Page 1 of 1
[Solved]Cannot compile inw XX
Posted: Tue Oct 30, 2012 10:31 pm
by leyley
I cannot compile something like this:
Code: Select all
Error: suffix or operands invalid for 'out'
X86 protected mode, paging enabled. I use gcc -m32 cause the host is a x86_64 red hat
Anyone can help me?
Thanks!
[Solved]Must use DX for port and AX for data.
Re: Cannot compile inw XX
Posted: Tue Oct 30, 2012 10:56 pm
by Love4Boobies
That immediate operand can only be 8-bit. Next time bother to at least check the manual.
Re: Cannot compile inw XX
Posted: Tue Oct 30, 2012 11:04 pm
by leyley
Love4Boobies wrote:That immediate operand can only be 8-bit. Next time bother to at least check the manual.
I don't have such GAS manual... Please give a link to download one. Thanks!
Re: Cannot compile inw XX
Posted: Tue Oct 30, 2012 11:45 pm
by Kazinsal
He means the Intel processor manuals, which detail everything officially documented about the x86 processors.
If you're going to immediately ask for a link to those as well instead of googling for them (which I guarantee will return multiple proper results), maybe OS dev isn't the hobby for you.
Re: Cannot compile inw XX
Posted: Wed Oct 31, 2012 12:15 am
by leyley
Blacklight wrote:He means the Intel processor manuals, which detail everything officially documented about the x86 processors.
If you're going to immediately ask for a link to those as well instead of googling for them (which I guarantee will return multiple proper results), maybe OS dev isn't the hobby for you.
The 'link' I need is just a PDF version of GAS manual... If there are some places which can download one, please share it to me. Thanks.
I never ask something that told me the answer precisely. Just give me some directions. OK, I'll find Intel processor manuals.
Re: Cannot compile inw XX
Posted: Wed Oct 31, 2012 12:47 am
by Griwes
No, you don't need GAS manual in PDF. You need intel or amd manuals, as it was stated above - they are the place describing valid instructions with valid operands, not GAS manual.
Re: Cannot compile inw XX
Posted: Wed Oct 31, 2012 12:57 am
by leyley
Griwes wrote:No, you don't need GAS manual in PDF. You need intel or amd manuals, as it was stated above - they are the place describing valid instructions with valid operands, not GAS manual.
Downloading... but very slow.
Thanks for your replies!
Re: [Solved]Cannot compile inw XX
Posted: Wed Oct 31, 2012 3:57 pm
by Kazinsal
Another good source, if you can wrap your head around it, is
http://ref.x86asm.net/coder32.html -- a list of all x86 (not x86-64 though, you want coder.html for that) opcodes, and thus, what operands each instruction can take.
But the Intel/AMD manuals are the definitive source for documented instructions and operation of the x86 processors.