🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2067

Re: TASM bug? (no, not at all)

#2067
From: James Birdsall
Date: Tue, 04 Sep 1990 20:15
25 lines
1762 bytes
 In article <38580@shemp.CS.UCLA.EDU> wales@CS.UCLA.EDU (Rich Wales) writes:
 >In article <4691@bdt.UUCP> doug@bdt.UUCP (Doug Asherman) reports a prob-
 >lem when he moves a value from the DL register into a byte in memory[...]
 >
 [lots of good explanation deleted]
 >
 >Alternatives to CBW (in case "__key__" could be in the range 128-255 and
 >needed to be treated as unsigned) would be to do XOR AH,AH either before
 >or after loading AL -- or else to do XOR AX,AX before loading AL.  This
 >would take one more byte of code, and one more processing cycle, than a
 >CBW; the difference probably isn't important unless the code in question
 >is in the middle of a tight loop.

   There's also MOVZX, an obscure instruction that is available on all 80x86.
It will extend a byte to a word, zeroing the high byte. I don't know how the
execution time compares to an XOR/MOV pair, but I suspect it is faster.
   Unfortunately, the complementary instruction (MOVSX, move with sign
extend) is only available on the 386.

-- 
---
James W. Birdsall        jwbirdsa@amc.com         71261.1731@compuserve.com
          Compu$erve: 71261,1731            GEnie: J.BIRDSALL2
For it is the doom of men that they forget. -- Merlin
Technical Details
Message-ID: <2953@amc-gw.amc.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!uw-beaver!sumax!amc-gw!jwbirdsa
References: <4691@bdt.UUCP> <38580@shemp.CS.UCLA.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zephyr.ens.tek.com!uw-beaver!sumax!amc-gw!jwbirdsa
From: jwbirdsa@amc-gw.amc.com (James Birdsall)
Newsgroups: comp.os.msdos.programmer,comp.sys.ibm.pc.misc
Subject: Re: TASM bug? (no, not at all)
Message-ID: <2953@amc-gw.amc.com>
Date: 4 Sep 90 20:15:18 GMT
References: <4691@bdt.UUCP> <38580@shemp.CS.UCLA.EDU>
Reply-To: jwbirdsa@europa.amc.com (James Birdsall)
Distribution: na
Organization: Applied Microsystems, Redmond, WA
Lines: 25