I wonder why the following direct coding of "PUSH OFFSET label" doesn't generate correct opcode (lenght of "NOP" is 1 byte, "PUSH OFFSET label" is 5 bytes):


Start: ; say that run-time offset of Start is 401000

push $ ; this is correctly assembled to 68 401003

BYTE 68h
DWORD $ - 1 ; this is not correctly assembled to 68 400FFF (should be 401008)
END Start

It seems that "$" in "DWORD $ - 1" is evaluated as offset of label Start instead of (Start+9) and that is weird.

BTW, when I use the following code instead, it is assembled correctly:

BYTE 68h
DWORD loc ; this is correctly assembled to 68 401008
Posted on 2004-12-28 10:32:59 by MazeGen
seems odd to me too, which assembler are you using?
Posted on 2004-12-28 12:47:27 by lifewire
It is ML 6.14.8444 (you can copy&paste&compile it directly).
It seems really like a bug. I use location counter often and it always works, except this case...
Posted on 2004-12-28 13:01:30 by MazeGen
Same thing with ML 8.00.40904

This also works :

current equ $
BYTE 68h
DWORD current

You can report the problem to Microsoft to have their opinion :

Posted on 2004-12-28 13:26:49 by Dr. Manhattan
Thanks for checking it, Doctor :)

You can report the problem to Microsoft to have their opinion :


I'm too lazy for registering and reporting. It is also well known M$ is not interested in fixing any bugs in ML. The workaround is known, so I'll use it.
Posted on 2004-12-28 15:25:14 by MazeGen
Finally I've reported it:
Posted on 2004-12-29 03:22:34 by MazeGen
I validated it :) I'm sure they will at least have a look at it. I reported the COMMENT bug in ml 8.0 and it was fixed.
Posted on 2004-12-29 04:40:27 by Dr. Manhattan
I validated it :)

Thanks :)
I reported the COMMENT bug in ml 8.0 and it was fixed.

Could you provide the link? I would like to know about all MASM bugs, since it's pretty annoying to fight with unknown bugs :evil:
Posted on 2004-12-29 06:29:11 by MazeGen
See :


There are only three search results for 'ml'


Ignore the first report. I thought there was a bug in the linker :oops: But you can see there is a feedback.
Posted on 2004-12-29 06:55:06 by Dr. Manhattan
I've heard that VS 2005 beta is for free, isn't it? I've tried to download it, but I fail. I followed these steps:

I made .net passport successfully.
I started here:

I clicked: Get the Beta

I clicked: Visual Studio 2005 Professional Edition
I clicked: download to MSDN Subscribers
It redirected me to:

I clicked: Add Passport

Now it needs "Subsription or Partner ID". I searched it and I found that I'd have to pay for this ID (for the msdn subscription), but the beta should be for free...

So how can I get it? Could you help me?

Posted on 2004-12-30 08:58:35 by MazeGen
I used this link


The price was 5 ?

I used this link to download the Beta Refresh tools :

Posted on 2004-12-30 10:42:12 by Dr. Manhattan
Thanks for the info, Manhattan :)
Posted on 2005-01-03 06:27:13 by MazeGen