Page 2 of 2

Re: Perform calculation with great number

PostPosted: Wed May 04, 2011 12:11 am
by steve-myers
You are treating the value from IGGCSI00 as a signed value. It is not signed. After your shift you have a 64-bit signed value in register 6 and 7, so the result of your division is signed, and wrong. This will work.
         SR    6,6
         L     7,=X'D1394000'
         D     6,=A(12*5096)

Re: Perform calculation with great number

PostPosted: Wed May 04, 2011 9:41 am
by steve-myers
I do not think your proposal to use Divide Logical would do you much good.

You might achieve some success by replacing the SRDA in your code with SRDL This would make your code the rough equivalent of my code in my last post.

Re: Perform calculation with great number

PostPosted: Mon May 09, 2011 1:16 pm
by sensuixel
You're right, the DIVIDE LOGICAL didn't got me out of trouble, but the SRDL made if work.

Here's the code i used
         SR       R6,R6           
         L        R6,=X'D1394000'
         SRDL     R6,32           
         D        R6,=A(12*4096) 
         LTR      R6,R6           
         BZ       *+L'*+4         
         A        R7,=F'1'       


I get X'000116F7' which is correct

Thank you really much for the SRDL tips and also for test of remainder, i find it very elegant

Re: Perform calculation with great number

PostPosted: Mon May 09, 2011 8:20 pm
by steve-myers
sensuixel wrote:...Thank you really much for the SRDL tips and also for test of remainder, i find it very elegant
Thar's true, but do you really understand that the value you got from IGGCSI00 is a negative number in System/360 2's complement arithmetic? That's what got you in trouble in the first place, and I have to admit I missed it at first, until other people pointed it out to us.