#163 ✓invalid
Peter Johnson

dd words memory expressions, overriding each other with 64 bit registers

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

Originally posted on Trac by bjohnst8@gmail.com
Original Trac Ticket

  Description

I believe there is a problem with the use of dd when using 64 bit registers, namely rax... essentially one memory expression runs into the other, which means that when one expression is altered so to is the other.
the compiler fails to warn about this behaviour.
I use
standard
yasm -f elf -g dwarf2 -m amd64 FILENAME.asm
ld -o FILENAME FILENAME.o

the simplest fix to the problem is to use dq expressions instead of dd
or to place a dummy dd expression between them, however
I believe the compiler should warn about this eventuallity

I have included the simple program I have built to show this problem

Trac Attachments

http://www.tortall.net/projects/yasm/attachment/ticket/174/error.asm
http://www.tortall.net/projects/yasm/raw-attachment/ticket/174/erro...
http://www.tortall.net/projects/yasm/timeline?from=2009-06-09T21%3A...

Trac Comments

Changed 2 years ago by bjohnst8@gmail.com



simple example of the override problem

                  Changed 2 years ago by bjohnst8@gmail.com

      attachment
        error.asm​
          added

simple example of the override problem

      attachment
        error.asm​
          added

Comments and changes to this ticket

  • Peter Johnson

    Peter Johnson June 25th, 2011 @ 08:26 PM

    • Tag changed from core, p1 to core, p1, wontfix
    • State changed from “new” to “invalid”

    Fundamentally this is a shortcoming of NASM syntax. It allows maximum flexibility and minimal syntax (no "DWORD PTR" like in MASM) but also lets you shoot yourself in the foot. No plan to fix this unless we add MASM syntax support.

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

Tags

Pages