"McKown, John" <[EMAIL PROTECTED]> wrote:

> I'm going from memory, here. And I was actually 
> doing addition, not subtraction.

> *    A64=3DA64-B64
>          LM     R14,R15,A64
>          LM     R0,R1,B64
>          SLR    R15,R1              SUBTRACT LOW ORDER 32-BITS
>          BC     11,DONEXT     BRANCH IF NO BORROW
>          BCTR   R14,0       DECREMENT HIGH ORDER BY 1 DUE TO BORROW
> DONEXT   DS     0H
>          SLR    R14,R0              SUBTRACT HIGH ORDER 32-BITS
>          BC     4,OVERFLOW

The question was how to detect overflow.  I think you 
also have to detect overflow when you do the BCTR.

Say you subtract 1 from 2**-63.  The overflow occurs when
the 1 is subtracted from the high half, not in the SLR.

Well, for signed subtract the last one should be SR.
The case above would be for unsigned, so consider subtracting
one from zero.

-- glen

Reply via email to