Hi,
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):


.686
.MODEL FLAT, STDCALL
OPTION CASEMAP:NONE

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

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:


loc:
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 :

http://lab.msdn.microsoft.com/productfeedback/default.aspx
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 :

http://lab.msdn.microsoft.com/productfeedback/default.aspx

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:
http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?FeedbackId=b3255762-6c34-4bb4-8ffb-e10bcb97d5b7
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 :

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=4265440e-19de-43fd-aaeb-cd657798b3e0

There are only three search results for 'ml'

http://lab.msdn.microsoft.com/productfeedback/SearchResults.aspx?text=ml&stype=1&fields=2&type=0&category=0&os=0&oslang=0&status=0&msstatus=0&resolution=0&chgdays=&validation=0&votes=&voterating=0&workarounds=False&attachments=False&product=0&version=0&creator=&createdWithin=

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
Hi,
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:
http://lab.msdn.microsoft.com/vs2005/

I clicked: Get the Beta
http://lab.msdn.microsoft.com/vs2005/get/default.aspx

I clicked: Visual Studio 2005 Professional Edition
I clicked: download to MSDN Subscribers
It redirected me to:
http://msdn.microsoft.com/subscriptions/

I clicked: Add Passport
https://msdn.one.microsoft.com/Registration/1033/Registered.asp?Option=2

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

http://lab.msdn.microsoft.com/vs2005/get/emeaorder/default.aspx

The price was 5 ?

I used this link to download the Beta Refresh tools :

http://www.microsoft.com/downloads/details.aspx?FamilyID=afd04ff1-9d16-439a-9a5e-e13eb0341923&displaylang=en
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