Craddock, Chris wrote:
Don't forget that the 8 byte TOD is unsigned, so bit zero is part of the
value, not the sign. You will need to use the subtract logical form to
get the right answer without playing bit-shifting games, even in a 64
bit register.

Ummm. Remember, the only difference between logical and arithmetic binary add/subtract operations is the way the condition code is set (and lack of overflow interrupt for logical instructions -- which I almost never use) The bits in the register(s) -- including any so-called "sign" bit -- are treated *identically* in either case. (That's the beauty of representing negative numbers using two's complement form.)

After the following code fragment runs, the contents of R0 & R1 will be identical:
    STCK  TOD
    L     R0,TOD
    L     R1,TOD
    S     R0,=X'7FFFFFFF'
    SL    R1,=X'7FFFFFFF'

--
Edward E Jaffe
Phoenix Software International, Inc
5200 W Century Blvd, Suite 800
Los Angeles, CA 90045
310-338-0400 x318
[EMAIL PROTECTED]
http://www.phoenixsoftware.com/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to