JWasm - Wasm

JWasm is a fork of WASM v1.7a. The most remarkable features which have been implemented are
  • local labels in procedures.
  • '::' operator to allow to define a global label inside a procedure.
  • PROTO directive.
  • INVOKE directive.
  • TYPEDEF directive.
  • UNION directive.
  • RECORD directive.
  • nested (+anonymous) STRUCTs and UNIONs.
  • LOCAL directive improved, now fully MASM compatible.
  • some of Masm's OPTIONs are accepted:
    • option PROC: private | public | export
    • option DOTNAME | NODOTNAME (nodotname is dummy)
    • option CASEMAP: none | notpublic | all (notpublic is dummy)
    • option PROLOGUE: none | prologuedef | <macro name>
    • option EPILOGUE: none | epiloguedef | <macro name>
    • option NOKEYWORD: <reserved name>
  • FLAT accepted as segment attribute.
  • symbol type conflicts are now detected and reported as errors.
  • EXTERNDEF accepts structured types and pointer to types.
  • /Cp cmdline option added to make JWasm preserve case of identifiers.
  • operators LOW, HIGH, LOWWORD, HIGHWORD, OPATTR, TYPE, .TYPE, WIDTH, MASK.
  • PROC improved: procedure parameters and locals are now true symbols with type information and all types supported by MASM are allowed.
  • /Fl cmdline switch extended, additionally displays macros, structures, records and typedefs.
  • /EP cmdline switch to display preprocessed lines on stdout.
  • CATSTR, SUBSTR, SIZESTR and INSTR, as well their macro function sisters @CatStr, @SubStr, @SizeStr and @InStr.
  • ECHO directive.
  • EQU/TEXTEQU are handled exactly the way MASM does it.
  • macro functions (EXITM).
  • Types REAL4, REAL8 and REAL10 .
  • HLL features (.IF, .ENDIF, .WHILE, .REPEAT, .BREAK, ...).
  • predefined equates @Cpu and @CurSeg added.
  • Conditional directives (ELSEIFB, ELSEIFIDN, ...) added.
  • evaluation operator % supported.
  • literal-character operator ! supported.
  • -D commandline option will always define a "text macro" and won't try to convert it to a number.
  • PURGE directive.
  • WHILE directive.
  • ASSUME <stdreg>: ptr <qualified type> supported.
  • @Environ macro function supported.
Lots of bugs have been fixed, for example:
  • text equates were handled pretty different compared to the way MASM does it,
  • fixup of start address now refers to the group of the start address's segment. WASM supplied in OW v1.7a still has problems if the start address is in a segment which isn't the first one in a group.
  • EXTERNDEFs which aren't referenced in the source caused a EXTDEF entry to be created in the object module.
  • SIZEOF (sometimes?) returned double the size of a variable.
  • structure field names were stored in the global symbol table. This caused various problems and often bad code was created.
  • some "reserved" words in WASM, which aren't reserved in MASM were removed from this list: "ERROR", "PRIVATE", "COMMON", "EXPORT", "CASEMAP",...
  • quotes and curly-bracket delimiting strings were removed during the tokenisation process. This isn't MASM compatible.
  • string equates were "evaluated" very early, making it impossible to define a string equate which contained another string equate.
  • a macro "local" directive caused a text equate with identical name to be generated or changed.
  • alignment argument for STRUCTs was silently ignored.
  • macro parameters in the macro definition were expanded. Thus it was impossible to give macro parameters a name which was already used in the namespace (for example the name of a previously defined macro).
  • a macro name given as parameter in a IFDEF/IFNDEF line was "evaluated", which is a bad idea.
  • if a source line ends with a comma, it was generally concatenated with the next line. This caused problems with invokation of macros with "empty" arguments. The automatic concatenation is now done only if a text item (enclosed in <> or {}) is still open at the end of the line and last character of the line is a comma.
  • If many errors occured, WASM exited and didn't delete the zero-sized object module.
  • defining arrays with zero items caused a protection fault.
  • it was impossible to redefine a macro.
  • ALIAS directive syntax differed from MASM's one.