News:

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

3 short notation questions

Started by mike2, August 02, 2011, 11:32:25 AM

Previous topic - Next topic

mike2

Question 1:
=====
Since I could read it the best, I always used ASM code in the form of "Mov DWord Ptr [EAX+10h], 1234h". Now I tried to assemble my files with POASM (tested with 5.0 and 6.50), but it always fails with an error telling me "invalid usage of DWord". I found out that POASM only accepts "dword" and "DWORD" as valid and will fail on any other notation. I already tried to put "DWord equ <DWORD>" at the beginning of my files: They will assemble fine with POASM, but now MASM gives me the error "syntax error: equ". POASM doesn't care if I use "Ptr" or "pTr" or something, it only fails on DWORD, WORD, BYTE, ...

Is there any way to bypass this problem without doing a search&replace in all my files?

Question 2:
=====

Sometimes I have code looking like this:
someproc proc

arg_0 = dword ptr 4

    mov    [esp+arg_0], 12h
    ret    04h

someproc endp

MASM will assemble the code without errors to "mov dword ptr [esp+04h], 00000012h", but POASM will fail with "Invalid combination of opcode and operands (or wrong CPU setting)". It really wants me to write "mov dword ptr [esp+arg_0], 12h", which is somehow double, since "arg_0" already contains the "dword ptr" part.

Is there some way to make POASM accept this kind of code?

Question 3:
===
Do POASM and POLINK use environment variables other than "INCLUDE" and "LIB"? Do they support a config file or an environment variable to set parameters I don't always want to put on their command line?

dedndave


FORTRANS

Hi,

   You could try assembler dependent code separated by IF,
ELSE, and ENDIF directives.  Then an EQUate could select the
assembler.  A bit ugy perhaps, but should work.

Regards,

Steve N.

dedndave

if you want to make it work.....

QuoteI already tried to put "DWord equ <DWORD>" at the beginning of my files:
They will assemble fine with POASM, but now MASM gives me the error "syntax error: equ"

you're almost there
the reason this fails in MASM is "DWord" is a reserved word
i.e., you cannot use it as a name for an EQUate
also, it is actually a TEXTEQUate - that won't matter, and i don't know if PoAsm supports TEXTEQU

at any rate.....
;MASMasm EQU 1        ;remove the semicolon if assembling with MASM

IFNDEF MASMasm
DWord equ <DWORD>
ENDIF

Vortex

Hi mike2,

I didn't test it but did you try this one?

arg_0 equ <dword ptr 4>

mike2

I already tried "arg_0 equ <dword ptr 4>". It will simpy replace "arg_0" by "dword ptr 4", which will of course fail. The "=" is the correct sign for this situation, but POASM will not interpret it like MASM does.

I could execute POASM with something like "/DPOASM=1" on the command line, but that would be also circuitous. I there really no config file or environment variable which could be used to set some default settings for POASM or POLINK?

drizz

IFDEF __JWASM__
ELSEIFDEF __POASM__
ELSE; __MASM__
ENDIF
The truth cannot be learned ... it can only be recognized.

mike2

That helped me. Thank you very much.