🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.asm
Article #152

Re: Setting of flags by "Shr" on different processors.

#152
From: Chris Jones
Date: Thu, 07 Jan 1993 20:56
38 lines
2065 bytes
In article <1993Jan7.154426.3421@odin.diku.dk>, terra@diku.dk (Morten Welinder) writes:
|> 
|> The Intel 486 programmer's reference manual very clearly states that
|> the shift operations -- except for "Shrd" and "Shld" -- always set 
|> the basic flags. The code:
|> 
|> 	Mov	Ax,0
|> 	Mov	Cl,0
|> 	Cmp	Ax,-1		; Clear zero flag
|> 	Shr	Ax,Cl		; Result is zero.
|> 
|> should leave you with the zero flag set. However, tests on my i486 
|> shows that this is not true. The shift is executed as a "Nop".
|> 
|> I would like to know how other processors respond to this piece of
|> code. Please try it and email the result to "terra@diku.dk" stating
|> the processor type, of course. Also if you have a manual for another
|> processor, please look up the description of the shifts. I would like
|> to know if there are any differences.


From the Intel 486(TM) Microprocessor Family Programmer's Reference
Manual:

        SAL/SAR/SHL/SHR - Shift Instructions

        Flags Affected

            If count = 0, the flags are not affected.

        (page 26-253 in the 1992 edition)

--Chris
+-------------------------------+---------------------------------+
| Chris S Jones, Intel Corp.    :    chrisj@ichips.intel.com      |
| 2111 N.E. 25th, JF1-19        :    (503) 696-4022               |
| Hillsboro, OR 97124           :    #include <std.disclaimer>    |
+-------------------------------+---------------------------------+
Technical Details
Message-ID: <1993Jan7.205607.26110@ichips.intel.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!usc!sol.ctr.columbia.edu!eff!ssd.intel.com!ichips!pdx041!chrisj
References: <1993Jan7.154426.3421@odin.diku.dk>

Show Full Headers
Complete Article Headers
Newsgroups: alt.lang.asm,comp.sys.intel
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!usc!sol.ctr.columbia.edu!eff!ssd.intel.com!ichips!pdx041!chrisj
From: chrisj@pdx041.NoSubdomain.NoDomain (Chris Jones)
Subject: Re: Setting of flags by "Shr" on different processors.
Message-ID: <1993Jan7.205607.26110@ichips.intel.com>
Keywords: shr, intel, flags
Sender: news@ichips.intel.com (News Account)
Reply-To: chrisj@ichips.intel.com
Organization: INTEL X86 Focus Group
References:  <1993Jan7.154426.3421@odin.diku.dk>
Date: Thu, 7 Jan 1993 20:56:07 GMT
Lines: 38