#143 ✓resolved
Peter Johnson

Relative addressing should be the default in 64 bit mode

Reported by Peter Johnson | June 25th, 2011 @ 07:50 PM

Originally posted on Trac by www.agner.org
Original Trac Ticket

  Description

I will suggest that the default addressing mode for x64 should be relative, not absolute.

Absolute addressing is safe to use only in Linux and BSD. It is unsafe in Windows DLLs because the load address may be > 231. It will not work in Mac because the image base is > 232 by default.

mov register, [rel label]
is one byte smaller than
mov register, [abs label]

mov rax,label should default to mov rax,qword label, not mov rax,dword label.

Trac Attachments

h3. Trac Comments
comment:1

              Changed 3 years ago by peter@tortall.net


See the default directive (section 4.2 in the manual).

DEFAULT REL

at the top of your code will switch the assembler to using relative mode in effective addresses by default (use abs to override).

The startup default is always abs for consistency across assembler modes.  This is also compatible with NASM.

      comment:1

                  Changed 3 years ago by peter@tortall.net

      Status
        changed from new to closed
    
      Resolution
        set to wontfix

See the default directive (section 4.2 in the manual).

DEFAULT REL

at the top of your code will switch the assembler to using relative mode in effective addresses by default (use abs to override).

The startup default is always abs for consistency across assembler modes.  This is also compatible with NASM.

      Status
        changed from new to closed
    
      Resolution
        set to wontfix

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket

Pages