I'm going from memory, here. And I was actually doing addition, not
subtraction.
* A64=A64-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
--
John McKown
Senior Systems Programmer
UICI Insurance Center
Information Technology
This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and its'
content is protected by law. If you are not the intended recipient, you
should delete this message and are hereby notified that any disclosure,
copying, or distribution of this transmission, or taking any action
based on it, is strictly prohibited.
-----Original Message-----
From: VM/ESA and z/VM Discussions [mailto:[EMAIL PROTECTED] On
Behalf Of Neale Ferguson
Sent: Wednesday, November 30, 2005 10:19 AM
To: [email protected]
Subject: [OT] 64-bit subtract
I'm trying to implement a 64-bit subtract with overflow detection using
32-bit instructions and I can't seem to crack it. Without overflow
detection it's trivial but I can't get a reliable mechanism for
detecting overflow. Does anyone have a simple s/390 algorithm they'd
like to share?
Neale