سؤال

NOTE: I'm using a BSD based system so if I remember correctly this means args for called subroutines/functions are pushed onto the stack not placed in registers

I've been trying out assembly and I wanted to try my simple kernel-exit program:

.globl _start

_start:
    movl $0x20, %eax
    pushl %eax
    movl $0x1, %eax
    subl $0x4, %esp
    int $0x80

in 64 bit assembly.

I remember reading that a large difference is the registers are now renamed r prefixed instead of the 32 bit standard of an e prefix.

But what is the new postfix for 64 bit opcodes, if l already means long for 32 bits?

Out of curiosity why is it an r prefix for the new registers?

Also if there are any good resources where further information could be found. Or tutorials, tutorials are always fun.

هل كانت مفيدة؟

المحلول

The postfix is q for qword, and r supposedly stands for register. Here's an introduction in AT&T syntax.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top