On 1/9/2012 3:23 PM, Mike Shaw wrote:
On Mon, Jan 9, 2012 at 4:54 PM, Edward Jaffe<[email protected]>wrote:
On 1/9/2012 1:40 PM, Steve Comstock wrote:
Here's what I'm thinking:
LMG R2,R4,datetimen - put datetime into R2/R3
(use 64 bits in each reg)
and put datetimes into R4/R5
(use 64 bits in each reg)
should be
LMG R2,R5,datetimen
SLBGR R3,R5
SLBGR R2,R4
You're not supposed to use a logical subtract 'with borrow' on the
low-order
part. You use it only on the high-order part--AFTER doing a logical
subtract
'without borrow' on the low-order part.
Ed is again correct.
I have no doubt. :-)
So, I guess the sequence is:
slgr R3,R5
slbgr R2,R4
and, again, I can store the value into one of the
16 byte areas I have allocated, for example:
stmg R2,R3,datetimen
then call CONVTOD, something like:
convtod convval=datetimen,etodval=twork, x
timetype=dec,datetype=yyyymmdd
but does this really return an interval?
This technique can be used to write routines that
perform fixed-point arithmetic with arbitrarily long numbers, since you can
perform the subtraction four bytes (or eight bytes) at a time, propagating
a borrow should one occur.
--
Mike Shaw
MVS/QuickRef Support Group
Chicago-Soft, Ltd.
--
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-355-2752
http://www.trainersfriend.com
* To get a good Return on your Investment, first make an investment!
+ Training your people is an excellent investment
* Try our tool for calculating your Return On Investment
for training dollars at
http://www.trainersfriend.com/ROI/roi.html