🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #569

Re: assembler problem

#569
From: Larry A. Shurr
Date: Wed, 26 Sep 1990 16:23
36 lines
2335 bytes
In article <5622@munnari.oz.au>, cornish@ecr.mu.oz.au (Simon Cornish.) writes:
> (I'm new to 8088 assembly, so if I'm doing something silly, just tell me)

>  004E  A2 0381 R	 	         MOV   W_FLAG,AL
>  0051  FF 26 0382 R	 	         JMP   [WAITING]

>  	 	 	 	MNLOOP:
>  E r r o r   ---	6:Phase error between passes    
>  004F  AC	 	 	        LODSB         
>  0050  3C 1F	 	 	         CMP   AL,CTRL

> I can see that the indirect jump should be a four byte instr,
>  but the LODSB Is placed at 4F.   WHY DOES IT DO THIS?????

Hmmm.... Is [WAITING] a forward reference (i.e., not defined until later in
the program)?  Is it defined in your data segment (or in your DGROUP if you
aren an intermediate-level or higher experienced 8086 programmer)?  Is your
ASSUME DS:etc.. statement correct?

If WAITING is a forward reference symbol which is not defined in your DGROUP,
MASM will not know it needs a segment override until the second pass and will
not have allocated the extra byte for it.  This a phase error - in general,
phase error between passes means that MASM learned something between the 1st
and 2nd passes which causes the address allocations for each instruction to
change.  Frequently, but not exclusively, this means it learned of the need 
for a segment override prefix in an instruction with a forward reference.
If the problem is not with WAITING, what about W_FLAG?  If not W_FLAG, the
problem may have occurred earlier in the program - MASM has an annoying habit
of postponing the "Phase error" message until it encounters a line with a 
symbol definition.

Good luck, Larry
-- 
Larry A. Shurr (cbnmva!las@att.ATT.COM or att!cbnmva!las)
The end of the world has been delayed due to a shortage of trumpet players.
(The above reflects my opinions, not those of AGS or AT&T, but you knew that.)
Technical Details
Message-ID: <1990Sep26.162302.26775@cbnews.att.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnews!shurr
References: <5622@munnari.oz.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnews!shurr
From: shurr@cbnews.att.com (Larry A. Shurr)
Newsgroups: alt.msdos.programmer,comp.os.msdos.programmer
Subject: Re: assembler problem
Summary: Phase error... one of my favorites
Keywords: MASM v3.00
Message-ID: <1990Sep26.162302.26775@cbnews.att.com>
Date: 26 Sep 90 16:23:02 GMT
References: <5622@munnari.oz.au>
Organization: AT&T Bell Laboratories, Columbus, OH (actually an AGS consultant)
Lines: 36