[Solved]Cannot compile inw XX

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
leyley
Member
Member
Posts: 35
Joined: Thu Jun 28, 2012 1:54 am

[Solved]Cannot compile inw XX

Post by leyley »

I cannot compile something like this:

Code: Select all

outw %ax,$0x01F7

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.
Last edited by leyley on Wed Oct 31, 2012 1:17 am, edited 1 time in total.

Code: Select all

#rm -rf /
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Cannot compile inw XX

Post by Love4Boobies »

That immediate operand can only be 8-bit. Next time bother to at least check the manual.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
leyley
Member
Member
Posts: 35
Joined: Thu Jun 28, 2012 1:54 am

Re: Cannot compile inw XX

Post 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!

Code: Select all

#rm -rf /
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: Cannot compile inw XX

Post 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.
User avatar
leyley
Member
Member
Posts: 35
Joined: Thu Jun 28, 2012 1:54 am

Re: Cannot compile inw XX

Post 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.

Code: Select all

#rm -rf /
User avatar
Griwes
Member
Member
Posts: 374
Joined: Sat Jul 30, 2011 10:07 am
Libera.chat IRC: Griwes
Location: Wrocław/Racibórz, Poland
Contact:

Re: Cannot compile inw XX

Post 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.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
User avatar
leyley
Member
Member
Posts: 35
Joined: Thu Jun 28, 2012 1:54 am

Re: Cannot compile inw XX

Post 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!

Code: Select all

#rm -rf /
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: [Solved]Cannot compile inw XX

Post 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.
Post Reply