Newsgroups: comp.os.msdos.programmer
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!n8emr!bluemoon!andy
From: andy@bluemoon.uucp (Andy Vaught)
Subject: Re: byte vs word movs
Message-ID: <k88Z44w164w@bluemoon.uucp>
Sender: bbs@bluemoon.uucp (BBS Login)
Organization: Blue Moon BBS ((614) 868-998[0][2][4])
References: <1991Jun22.170522.3008@maytag.waterloo.edu>
Date: Sun, 23 Jun 91 13:10:07 EDT

dmurdoch@watstat.waterloo.edu (Duncan Murdoch) writes:

> In article <ysyw42w164w@bluemoon.uucp> andy@bluemoon.uucp (Andy Vaught) write
> >storm@cs.mcgill.ca (Marc WANDSCHNEIDER) writes:
> >> SECTOR    DB 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
> ...
> >> MOV  DX, SECTOR[BX]
> What does it do?  The instruction looks ambiguous to me, since DX is word
> sized and SECTOR[BX] is byte sized.  Does TASM move a word (i.e 0B0A if
> BX=0)?  That's probably not what was intended...
> 
> Duncan Murdoch
> dmurdoch@watstat.waterloo.edu

 
Since the author specified the DX register, the assembler should, IMHO, 
generate a word move without complaint. "SECTOR" is only an offset into a 
memory location. Although "bytes" were specified, this is an artifact of 
the assembler and its rigid (rabid?) typechecking. The whole thing is a 
matter of taste- I feel that assembler (like C) should let you do weird 
things without complaint.

------------------------------------------------------------------
 Andy Vaught (Fuzzy Andy)  ::  C Code. C Code Run. Run C code, Run...
 Grad Student on Vacation  ::  before I whip out my 12-Gauge
    andy@bluemoon.uucp     ::  Dynamic Debugging Tool!
