News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

YASM programming for 64-bit Windows and AMD64

Started by richh, May 03, 2005, 05:44:47 PM

Previous topic - Next topic

richh

Does any body know where I can documentation for using YASM in the 64-bit mode?
I am able to create a 64-bit assembly file and Link it to A Windows 64 console mode app.
I pass information back and forth but, I cannot access a local data variable declared with
.data section. I have tried all the standard methods, but with no success.

THanks

hutch--

rich,

I think the YASM 64 bit version is still in development so I would be tempted to climb all over their site to see if they have any documentation available for it in terms of syntax. There is supposed to be a 64 bit version of NASM floating around as well.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

rea

I do a litle search, specially I find this http://cvs.tortall.net/pipermail/yasm-announce/2004-October/000002.html is the anouncement, there say in the "know isues" something about changin the machine...

Quote
Known issues:

  - Changing the machine to "amd64" does not automatically default to bits
64 mode; specify BITS 64 in the assembly source as a workaround.

I supose than the flag at command line -m amd64 dosent work...

But you can still add bits 64 at the start of the file....

Perhaps this can help:


bits 64
section .data
label1 dq 0x123456789abcdef0
section .code
mov rax, 123
mov rax, [label1]
mov ax, 123
mov ax, [label1]
bits 32
;mov rax, 123
;mov rax, [label1]
mov ax, 123
mov ax, [label1]


assemble it with yasm  -f elf -l l64.txt 64.asm

You can watch the list file l64.txt, you will see how bits 64 and bits 32 affect the output...


Browse more the site of yasm, also you can join the mailing list and for example request the author for sources... or something like that... :).


By the way, something that I was missing is that rax and all the others hae no meaning in 32 or 16 bits, then you will see a warning if you uncomment those two comments in that file.