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

Programming, for all ages and all languages.
Post Reply
Mehmetdev1
Posts: 23
Joined: Fri Apr 01, 2022 10:06 am
Location: Türkiye, Uşak/Merkez

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

Post 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));
Attachments
Hata.png
Hata.png (6.68 KiB) Viewed 2176 times
M. Alp
yasar11732
Member
Member
Posts: 28
Joined: Thu Sep 27, 2018 5:10 pm
Libera.chat IRC: yasar
Location: Turkey
Contact:

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

Post by yasar11732 »

inw works with 16 bit operands, you are giving it a 8 bit operand, hence the error.
Post Reply