V
V
Volodymyr Palamar2020-02-10 22:41:45
assembler
Volodymyr Palamar, 2020-02-10 22:41:45

How to write a command in Intel syntax?

How to write x86 command:
With AT&T
movb $4,%ah
on Intel syntax The
trick is that with AT&T the command takes only 2 bytes
A20000000000
And with Intel
B00400000000

Disassembly gave this result:
mov ds:0x0,al
Can someone explain to me what this meansds:0x0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2020-02-10
@GORNOSTAY25

.text
        .att_syntax
foo:
        movb    $4, %al

        .intel_syntax

        mov     %al, 4

$ gcc -c att-intel.S 
$ objdump -d att-intel.o

att-intel.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo>:
   0:   b0 04                   mov    $0x4,%al
   2:   b0 04                   mov    $0x4,%al

Disassembly gave the following result:
mov ds:0x0,al
Can someone explain to me what it means ds: 0x0

Means that disassembled something not that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question