News:

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

Reserved keywords

Started by donkey, March 30, 2009, 04:53:33 PM

Previous topic - Next topic

donkey

Hi Jeremy,

I have been using PTR to define a pointer in the header project and it works fine. However when I use it as a declaration in the data section I get the error:

QuoteError!
Line 49 of assembler source file (TestStuff.asm):-
Use B, W or D instead of BYTE, WORD and DWORD PTR

This is obviously a hold over from the bad old days when the majority of GoAsm work was translated MASM files with a few original works thrown in. I don't think that it is necessary now that GoAsm has a much more experienced user base and is widely differentiated from MASM. This is especially true for applications that need to be built for both 32 and 64 bit where you would use application defined types to ensure the proper data size in both versions. In the case of PTR I checked the manual first to make sure it was not otherwise reserved and used it throughout the header project, unfortunately I did not think to check it when declaring data as that was beyond the scope of the project originally. Other defined types in the header project are unfortunately BYTE, WORD and DWORD, which are there to make transitioning code simpler, though those ones are not used in the actual header files.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

Edgar

Yes this is a hang over from the past.
I have now removed PTR as a word which triggers an error message.
GoAsm Version 0.56.5f as attached.



[attachment deleted by admin]
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

donkey

Hi Jeremy,

PTR works great, thanks. I installed the new version (I was running version c) and my debug macros no longer work. For example

PrintTest(ARG)    MACRO
    #IF DEBUG_OFF
    #ELSE
        mov eax,ARG
    #ENDIF
    ENDM

Start:
PrintTest(1)
cmp eax,1
jne >
invoke MessageBox,NULL,"hello",0,0
:


EDIT: Appears that if I use #IFDEF everything works, not a problem at all, should have used it originally anyway.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

This was because of my attempt in GoAsm 0.56.5e (wrongly numbered GoAsm 0.56.5d) to improve the error message if a defined word was not found in a conditional statement and a relative operator followed.
Due to an error, my amendment to the code did not maintain the "FALSE" return if the defined word was not found in a conditional statement and a relative operator did not follow the defined word which was not found.
GoAsm 0.56.5g corrects this error.


[attachment deleted by admin]
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

donkey

Thanks Jeremy,

I had already changed the only file it affected but its good to know its fixed. Almost finished with testing the new type defs for the header project, I'm replacing all global and local declarations in Help2 Viewer with type defs to see if everything is working properly, so far so good. I have eliminated BYTE, WORD and DWORD, they can easily be replaced by CHAR, SHORT and DWORD32/LONG if someone is so inclined.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable