[comp.sys.zenith.z100] PDLIB, MASM problems

GUBBINS@RADC-TOPS20.ARPA (Gern) (12/01/88)

It has just come to my attention that a lot of the ASM code in
the HZPDLIB has problems with different versions of MASM and the
PUP includes.  CRTSAVER.ASM is the example I am working on now.

It seems that MS-DOS Version 2 and Version 3 PUPs each contain less
of some of the EQU definitions in the include files.   You can't
MASM MDISK.ASM from the Version 2 PUP with Version 3 DEFxxx.asm files
(one EQU is missing).  CRTSAVER has several EQU missing when using
the version 2 or 3 DEFxxx.asm, but is fine with ZDOS DEFxxx.asm.
Also, after Including the needed definitions, CRTSAVER will not assemble
under MASM version 4.x (phase errors - and I don't know how to correct
them), BUT will assemble and run perfectly under MASM version 1.3 (from
ZDOS disks).

So, if the *.ASM file from the HZPDLIB bombs out, try MASM and DEFxxx
files from ZDOS disks.  I also recommend not Including the DEF files,
but inserting the code as necessary.

Does anyone know how to correct for bogus Phase errors???

Gern
-------

GRIEB@LOCKE.HS.WASHINGTON.EDU (CINDY GRIEB) (12/01/88)

I have had similar problems many times... since I only have MASM for ZDOS v.1.
Anytime I try to compile a source which uses DEF files specific to v.2 or v.3
I'm out of luck.  In fact, I was wondering if it is possible to post the DEF
files... or are they "proprietary"?
                                                Cindy Grieb
                                                GRIEB@locke.hs.washington.edu

nelson@SUN.SOE.CLARKSON.EDU (Russ Nelson) (12/02/88)

The .DEF files are probably considered to be part of the BIOS source.  Are
you really still using MASM 1.0?  Go buy a copy of Turbo Assembler.

But Gern had asked about fixing "bogus" phase errors.  Phase errors
are never bogus -- the assembler really is confused about where a
label should be placed.  The problem is that the assembler knows more
on the second pass than the first, and it will resize or change an
instruction based upon that information.  For example, if MASM decides
that a segment override is needed, it will insert one.  However, if
the symbol is undefined on the first pass, the segment override won't be
inserted.  Automatic phase error!

Rule one of MASM programming: always define your data first.  Rarely does
data need to be at the end of the program, and if it does, you probably
are going to refer to it as the base of an array rather than an actual
value.  But even if it does need to be at the end, you can slide things
around with careful use of segments and groups.

--russ (nelson@clutx [.bitnet | .clarkson.edu])
To surrender is to remain in the hands of barbarians for the rest of my life.
To fight is to leave my bones exposed in the desert waste.

GUBBINS@RADC-TOPS20.ARPA (Gern) (12/04/88)

Russ,

What I >really< meant about 'bogus Phase errors" is why MASM 1.0 had the
'intelligence' to assemble the old program code properly and MASM 4.x
seemingly does not.  Granted, the program code in question was written
sloppy (CRTSAVER, and others), but this was not a problem until later
MASM versions.  I have since corrected the code (as pointed out, it
seems to usually stem from the TEST instruction, which it did (Thanx
to the sender of that note!).

Also, your point on the DEFincludes as being only for the purpose of
BIOS recompile is well taken, but ZDS doesn't seem to follow that
as several ancient MASM sample codes Include them in application examples,
as does MDISK.ASM, etc.

While I'm ragging on ZDS sloppy code, I once tried to reassemble MS-DOS
Version 3 Z-100 BIOS from PUP as per information provided, and it didn't
work, it crashed.  Anyone know why???


Cheers,
Gern
-------