Steve, you also need "LMG R2,R5,datetimen", not R4.  Otherwise you don't load 
the low-order 8 bytes of datetimes into R5.  LMG (like LM) takes individual 
register numbers, not the numbers of paired registers.

HTH

Peter

> -----Original Message-----
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-
> [email protected]] On Behalf Of Steve Comstock
> Sent: Monday, January 09, 2012 4:41 PM
> To: [email protected]
> Subject: 128-bit arithmetic
>
> Well, I want to calculate an interval between two STCKE time values.
>
> It seems like this is a great opportunity to use SLBGR, but I
> don't have a lot of confidence in the right way to do this.
>
> Suppose me ending timestamp is in datetimen and my starting
> timestamp is in datetimes, defined this way:
>
> datetimen ds cl16
> datetimes ds cl16
>
> 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)
>          SLBGR  R3,R5
>          SLBGR  R2,R4
>
> after this, I think the difference is in R2/R3 as a
> 128-bit integer
>
> Is this right?
>
> If so, then I can store R2/R3 into a 16-byte area and use
> CONVTOD to calculate the difference. Somehow that seems a
> little off.
>
> Would appreciate any insights / suggestions for this.
--


This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

Reply via email to