Page 1 of 1

Assembly '%al' not allowed with 'inw' Error

Posted: Sat Apr 30, 2022 4:01 am
by Mehmetdev1
Assembly '%al' not allowed with 'inw' How to Solve the Error I'm Sharing the Screenshot And The Code That Caused The Error.

Error Caused Code:

Code: Select all

__asm__ volatile("inw %1, %0" : "=a" (result) : "Nd" (portnumber));

Re: Assembly '%al' not allowed with 'inw' Error

Posted: Sat Apr 30, 2022 4:53 am
by yasar11732
inw works with 16 bit operands, you are giving it a 8 bit operand, hence the error.