GNU AS using .intel_syntax inline?
Posted: Sat Apr 11, 2009 2:54 pm
Hello everyone.
I've been trying to use AS with the .intel_syntax... and it's able to create the proper source and build it, but I can't get variables into the asm(...); no matter what I've tried.
I'm not even sure that the variables getting in there are the issue... but it's my best guess as it says undefined reference on the two variables I'm trying to use.
(rather simple)Code below:
The commented asm command is the exact same thing in AT&T syntax.
Any help on the matter would be much appreciated.
-Jim
[EDIT] It seems I'm now only getting "too many memory references"
I've been trying to use AS with the .intel_syntax... and it's able to create the proper source and build it, but I can't get variables into the asm(...); no matter what I've tried.
I'm not even sure that the variables getting in there are the issue... but it's my best guess as it says undefined reference on the two variables I'm trying to use.
(rather simple)Code below:
Code: Select all
void outb(u16 port,u8 value)
{
//asm volatile("outb %1, %0" : : "dN" (port), "a" (value));
asm volatile("mov dx,_port");
asm volatile("mov al,_value");
asm volatile("out dx,al");
}
Any help on the matter would be much appreciated.
-Jim
[EDIT] It seems I'm now only getting "too many memory references"
Code: Select all
./src/kernel.c: Assembler messages:
./src/kernel.c:7: Error: too many memory references for `mov'
./src/kernel.c:8: Error: too many memory references for `mov'
./src/kernel.c:9: Error: too many memory references for `out'