-2

I'm using the GAS assembler.
I'm trying to write to the I/O port 0x20, I do it like this:

outb $0x20, $0x20

But I get this error:

Error: operand type mismatch for out

What am I doing wrong?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • There is no encoding for `out imm, imm` in the x86 instruction set manual. The only encodings are for `out imm8, [e]a[x/l]`, and `out dx, [e]a[x/l]`, each writing the value from the `[e]a[x/l]` register. – EOF Jul 09 '20 at 19:46

1 Answers1

2

See https://c9x.me/x86/html/file_module_x86_id_222.html.

You can't have two immediates for operands for out. This has nothing to do with the operand size or suffix of out.

General Grievance
  • 4,555
  • 31
  • 31
  • 45