News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

hello.asm error on newer MASM

Started by DragonautX, February 20, 2021, 05:44:23 AM

Previous topic - Next topic

DragonautX

Hi, I'm new to MASM. I tried out VS 2019's MASM (14.28.29334.0) on C:\masm32\tutorial\console\demo1\hello.asm. I got a "constant expected" error. But it worked fine on the MASM that's part of the MASM SDK (6.14.8444).
  -See masm-error-small.jpg

I looked at windows.inc. I found "include winextra.inc" on line 26889. In "winextra.inc", I found some STD_ALERT struct in lines 11050-11054. I commented that out. And both MASMs compile successfully.
  -See masm-fixed-small.jpg

I'm not sure why that's happening. Is that hello.asm just for the old MASM, or did I forget to add an ML.exe option?

jj2007

The Masm 14.x series is notoriously buggy, so it's not your fault. Try to get a different assembler version. See in particular https://masm32.com/board/index.php?topic=8852.msg96603#msg96603

hutch--

Not all versions of ML.EXE are the same. Slight changes over time and additions to instruction sets produce problems of this type. The supplied version was 6.14 worked correctly but when you choose to use a later version, you will need to check the odd bits and pieces.

There is no simple way to provide a set of include files for every ML version or Windows version. A few tweaks here and there will make it possible to use the latest ML version so you can use the latest instruction sets.

DragonautX

Thanks hutch--, that's good reasoning. MASM 6 should be good for me. But I'll make a note of this for future versions.

TouEnMasm

Lmalert.sdk
Quote
STD_ALERT   STRUCT DEFALIGNMASM
   alrt_timestamp DWORD ?
   alrt_eventname WORD EVLEN+1 dup (?)
   alrt_servicename WORD SNLEN+1 dup (?)
STD_ALERT      ENDS

delet the () beetween WORD EVLEN
constant EVLEN and SNLEN need include lm.h (.sdk)

Fa is a musical note to play with CL

daydreamer

Quote from: DragonautX on February 20, 2021, 10:05:06 AM
Thanks hutch--, that's good reasoning. MASM 6 should be good for me. But I'll make a note of this for future versions.
what masm version you need depend on if you gonna need use latest avx2,RDRAND etc or masm 6.14 is good enough for :
;important beginning of source file to maximize assembler caps
;otherwise you can get unnecesary error messages

.686p ;686 instructions+p=assemble protected mnemonics
          ;fpu instructions
.MMX ;Pentium MMX instructions
.XMM ;SSE only version 1 if v6.14 ,using macros you can extend to newer opcodes/mnemonics or v6.15 or little higher version

Hutch I am unsure about support for AMD specific opcodes 3dnow and such on ml 6.14?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--

Probably not but I don't have an old AMD to test it with.

DragonautX

To TouEnMasm:

Ya, MASM 14 works now. Just to double check, this is what you meant, right?

-Looks like winextra.inc already defines SNLEN and EVLEN on lines 8808 and 8816. The comment above says it's from lmcons.h.
-My STD_ALERT uses WCHAR, not WORD. But I still removed the brackets, and everything works now:

STD_ALERT struct
    alrt_timestamp dd ?
    alrt_eventname WCHAR  EVLEN + 1 dup(?)
    alrt_servicename WCHAR SNLEN + 1 dup(?)
STD_ALERT ends

====================
To daydreamer:

This is more for learning. I want to study more about the JIT from the Dolphin Emulator. It's for a personal project. It uses some x64Emitter, which is here:

https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Common/x64Emitter.cpp

As long as I can practice assembly and SIMD on the x86 MASM, I'll think I'll be alright studying the emitter.


~~~~By the way, what do you mean by "assembler caps"? Looks like you just wrote directives. Did you mean "directives"?

daydreamer

English isn't my native language, some old examples only use. 486 directives,so i thought it was important to show max any ml version out
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--

Magnus,

Use 686p, MMX and XMM and you can write anything.

DragonautX

Oh ok. That makes sense. I thought "assembler caps" meant something else, like "maximum size of your code", in terms of bytes. Instead of "what types of instructions are allowed".