Bisccit
Bisccit

Reputation: 31

How to rewrite [es:di] to att syntax

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.

Upvotes: 0

Views: 306

Answers (1)

Ernie Sanderson
Ernie Sanderson

Reputation: 434

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]

Upvotes: 2

Related Questions