Port.h assembler messages




Port.h assembler messages

Postby Hondacar1212 » 25. Aug 2017, 13:43

I have a problem with port.h i get two errors.
They aren't compiler errors, errors when trying to make the port.o from the makefile.

Port.h:70: error '%al' not allowed with 'outw'

The error is this line
__asm__ volatile ("outw %0, %1" : : "a" (_data), "Nd" (_port));

The second error is more or less the same

Port.h:94: error '%al' not allowed with 'outl'

__asm__ volatile ("outl %0, %1" : : "a" (_data), "Nd" (_port));


Then it fails to make the port.o file.

Any ideas?
Hondacar1212
 
Posts: 1
Joined: 10. Aug 2017, 00:31

by Advertising » 25. Aug 2017, 13:43

Advertising
 

Re: Port.h assembler messages

Postby akaydinb » 3. Mar 2018, 08:24

Hello,
Actually, I am not a AT&T syntax guy, so I am not pretty sure but outw command stands for out word. Since al is not a word-length register you cannot use with outw, you have to use it either with outb or you have to declare data variable as an uint16_t .

And then, since outl means out long, you have to use either outb if your data is a uint8_t variable or have to declare data as an uint32_t.

Regards,
akaydinb
 
Posts: 1
Joined: 3. Mar 2018, 07:57


Return to Compiling & Linking

Who is online

No registered users

cron