0

This is a short question but I did not manage to find the answer online.

How do you rewrite mov [es:di], dl into AT&T syntax?

I use it to write a pixel to the screen in real mode.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Bisccit
  • 11
  • 2

1 Answers1

2

mov %dl, %es:(%di):

In the AT&T Syntax, memory is referenced in the following way:

segment-override:signed-offset(base,index,scale)

parts of which can be omitted depending on the address you want.

%es:100(%eax,%ebx,2)

A corresponding Intel syntax indirect memory reference:

segment-override:[base + index*scale + signed-offset]

es:[eax + ebx*2 + 100]

Ernie Sanderson
  • 382
  • 2
  • 10
  • 1
    For NASM the segment override goes either inside the brackets (`[es:di]` like in the question) or before the instruction (`es lodsb`). – ecm Feb 23 '22 at 14:23