Home Dashboard Directory Help
Search

MASM64 SERIOUS BUG by Roman313


Status: 

Closed
 as By Design Help for as By Design


1
0
Sign in
to vote
Type: Bug
ID: 620186
Opened: 11/9/2010 7:12:19 AM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

Hi !
MASM64 (ML64) has serious bug:

can't compile asm-file like this:

mov [rax], offset any_function
ML64 show error:
A2070: "invalid instruction operands"

When I try like this:
mov qword ptr [rax], offset any_function
ML64 show error:
A2084: "constant value too large"

When I using Flat Assembler (FASM),
this construction:
mov qword ptr [rax], offset any_function
compiled and work OK.

What does at mean ?
What can I do with MASM ?
Any MASM patch exists ?

Please, answer to: avtukhoff@hotmail.com
Details
Sign in to post a comment.
Posted by Roman313 on 3/10/2011 at 1:31 PM
Not sure.
FASM work OK, its parsed this write.
Posted by Microsoft on 1/14/2011 at 2:38 PM
Thank you for contacting Microsoft and for using the Microsoft Macro Assembler.

In 64-bit mode the MOV instruction can have a 64-bit immediate for some encodings such as:

MOV RAX, OFFSET FXN

But the instruction form that writes 64 bits to memory, such as:

MOV QWORD PTR [RAX], 0

is limited to a 32-bit immediate. When the assembler sees:

MOV QWORD PTR [RAX], OFFSET FXN

the immediate evaluates to a 64-bit value, which is too large to accept as an immediate.

I would suggest you use an intermediate step to store the offset in a register and then store that register to the memory location. This would look something like:

MOV RBX, OFFSET FXN
MOV [RAX], RBX

Hope this helps
Microsoft Visual Studio Team
Posted by Microsoft on 11/9/2010 at 7:24 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.