1 Replies - 612 Views - Last Post: 14 October 2018 - 05:21 AM

#1 urMark   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-October 18

Translation Intel to AT&T

Posted 12 October 2018 - 01:42 PM

I'm translating code from Intel to AT&T syntax, but I can't find out how to translate
mov [es:di + 20], 1
can you help me with this? Thanks in advance
Is This A Good Question/Topic? 0
  • +

Replies To: Translation Intel to AT&T

#2 turboscrew   User is offline

  • D.I.C Lover
  • member icon

Reputation: 171
  • View blog
  • Posts: 1,109
  • Joined: 03-April 12

Re: Translation Intel to AT&T

Posted 14 October 2018 - 05:21 AM

I wonder if that instruction is valid. It doesn't seem to specify the data size.
I also wonder if the "es:" has a real meaning. Maybe this instruction is the same as:
mov 20[di], 1

or maybe:
mov es:20[di], 1

with something like "word ptr" to state the size?
I don't think x86 does double indirections...
The Masm 6.1 manual says:

Quote

he assembler allows a variety of syntaxes for indirect memory operands. However, all registers must
be inside brackets. You can enclose each register in its own pair of brackets, or you can place the
registers in the same pair of brackets separated by a plus operator (+). All the following variations are
legal and assemble the same way:
mov ax, table[bx][di]
mov ax, table[di][bx]
mov ax, table[bx+di]
mov ax, [table+bx+di]
mov ax, [bx][di]+table
All of these statements move the value in
table indexed by BX+DI into AX.


that _could_ translate to AT&T as (assuming 32-bit) data:
movl 1, es:20(di)


I wonder which assembler is used... even the Intel syntax is a bit different from assembler to another.

Generally, I suck with x86 assembly, and Intel syntax especially, so don't take my word for it.

This post has been edited by turboscrew: 14 October 2018 - 05:37 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1