I got the error
Error: operand type mismatch for `in'
The line generating this is:
inb %%eax, %%edx
I tried these: inb %%eax, $0x00000064 and inb %%eax, $0x64.
But neither of them did change the output. I also tried with in instead of inb, but I'm taking shots in the dark at this point.
Any ideas?
"inb" means that you execute a mnemonic command "in" on the operands of size byte (8-bit). inw is for words (16-bit), inl is for long words (32-bit) and inq is for quad (on 64 bit machines). The %eax register is 32-bit, which consists of %ax (16-bit). The %ax register, in its turn, consists of high 8 bits (%ah) and low 8 bits (%al). Thus, if you are to use "inb", you should use %al or %ah, e.g.,
To use "in" with %eax, you need to append "l" to the command (or to omit the letter as some compilers can infer the type). That is,
should do fine.