Could one of you GitHub account members that are working on JWASM improve the JWASM manual?
There should be especially a MASM compatibility chapter that shows what does work and what should be substituted by JWASM specific ways of solving things.
I'm reading an old assembler book written for MASM and DOS. And i ran into a bunch of problems while trying to adapt the code to JWASM.
Especially the Conditional Assembly (IF, ELSE etc.) with MACROs was a problem.
MASM code:
; MASM way
IF (parameter1 EQ BL) ; BL = BL register
didn't work and had to be substituted with:
; JWASM way
IFIDNI <parameter1>, <BL>
for JWASM
The same applies to all other operators of MASM's if:
EQ = equal
NE = not equal
LT = less than
LE = less or equal
GT = greater
GE = greather or equal
Other incompatibility issues or things that had to be handled in a JWASM way were:
Linking:
; MASM way
; Creating object code + linking in one go
ML code1.asm code2.asm lib.bib
; JWASM + WLINK way
; Creating object code
jwasmr code1.asm code2.asm
; linking it with wlink (part of Open Watcom C Compiler)
; where
; prog = name of the executable
; name = cmd parameter of wlink
; file = cmd parameter of wlink
; code1 and code2 = oject files without extension
; lib.bib = library WITH extension
wlink name prog file code1, code2, lib.bib
When creating subroutines:
; MASM way
.MODEL SMALL
...
.CODE
TESTFUNC PROC FAR USES AX, BX ; Where TESTFUNC is our routine name
[code]
[code]
;JWASM way
.MODEL SMALL, C ; JWASM requests a language to use as calling convention here. C will do fine in most cases.
...
.CODE
TESTFUNC PROC FAR USES AX, BX
And when calling them in another file, for example main.asm
; MASM way
PUBLIC TESTFUNC
.MODEL SMALL
.CODE
....
CALL TESTFUNC
...
;JWASM way
PUBLIC _TESTFUNC ; JWASM expects a leading "_"
.MODEL SMALL C ; JWASM expects the corresponding calling convention
.CODE
....
CALL _TESTFUNC ; JWASM expects a leading "_" again
...
I don't have a github account, thus i can't add that myself to the issues page.
Github does require too much contract text to accept just to register an account.
But you can use all the stuff i mentioned here if you need so. I put this comment under public domain.