View previous topic :: View next topic
|
Author |
Message |
sjothiprakash
New User
Joined: 21 Jul 2007 Posts: 12 Location: Chennai
|
|
|
|
Hi friends,
Anybody know how to find the root(√) value using assembler instructions, and also finding log values using assembler instructions.
If you know how to code for it please give me. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
sjothiprakash wrote: |
root(√) |
As in square root, the math function? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Here is some pseudo-code for square-root calculation
Code: |
read in number
if number > 0 then
left = 0
right = number + 1
loop while (right - left) > 0.001
mid = (left + right)/2
if ( mid*mid < number ) then
left = mid
else
right = mid
ifend
loopend
write out 'Square root of ' Number ' is ' mid
else
write out 'Illegal value: '
ifend
|
|
|
Back to top |
|
|
sjothiprakash
New User
Joined: 21 Jul 2007 Posts: 12 Location: Chennai
|
|
|
|
Hi Scherrer,
I hope the pseudo will give the square root value of a number but how to check the loop condition with the floating point value(0.001).
And also as a fresher to assembler i dont know divisions with rounding(DP & CP) will give the excat value which will need to used in the loop condition.
Can you give me one more example related to assembler instructions.
William,
Yes, your question is correct, i am asking for maths root calculation.
Please Give me a clear picture. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
how to check the loop condition with the floating point value(0.001). |
I don't believe the 0.001 is really a floating point value - it is merely a decimal number with scaling (or a fraction) - unless that is also floating point - long ago having a floating decimal was not a floating point number (which was used for scientific notion).
As far as division and remainders, you might want to use binary numbers (rather than packed-decimal) for calculating. I seem to recall that if use something like the following you will have your remainder in a register"
Code: |
L R8,HEX0 EVEN/ODD PAIR, RESULT = REMAINDER
L R9,HEX5 EVEN/ODD PAIR, RESULT = QUOTIENT
L R3,HEX2 DIVISOR
DR R8,R3 * DIVIDE, REGISTER & REGISTER
|
|
|
Back to top |
|
|
sjothiprakash
New User
Joined: 21 Jul 2007 Posts: 12 Location: Chennai
|
|
|
|
William,
Can you please tell me which Library should be called for "Language Environment Programming services" |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
The LE libs should already be available...... |
|
Back to top |
|
|
sjothiprakash
New User
Joined: 21 Jul 2007 Posts: 12 Location: Chennai
|
|
|
|
But there is Reason code=12 for link editing.... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
sjothiprakash wrote: |
But there is Reason code=12 for link editing.... |
OK..... |
|
Back to top |
|
|
sjothiprakash
New User
Joined: 21 Jul 2007 Posts: 12 Location: Chennai
|
|
|
|
This is the error what i got on link editing
ABEND 013-64 OCCURRED WHILE PROCESSING PARTITIONED DATA SET WITH DDNAME SYSLIB.
UNABLE TO PROCESS LIBRARY SYSLIB DURING AUTOCALL PROCESSING.
SYMBOL CEESSSQT UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL LIBRARY.
MODULE ENTRY NOT PROVIDED. ENTRY DEFAULTS TO SECTION SAMPLE2. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You need to research your abend code before posting. This is from the manual linked to from the forums.
Quote: |
64
An OPEN macro instruction was issued for a null data set using an access method other than QSAM or BSAM. Correct the DD statement to specify a real data set, or access the data set using BSAM or QSAM. |
If there are inconsistencies in your library concatenation/specification, you need to talk with your system support people to find out where your problem is. |
|
Back to top |
|
|
sjothiprakash
New User
Joined: 21 Jul 2007 Posts: 12 Location: Chennai
|
|
|
|
Hi dick,
Now I changed my JCL appropriatly, but still its shown RC=12 for CEESSSQT as :
" SYMBOL CEESSSQT UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL LIBRARY " |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Jothi,
I'd suggest talking with your system support people and make sure that your assemble/link includes all of the LE libraries.
Have you tried to call this using a COBOL program? If you do so, and it works, you may see that the libraries used for COBOL are not the exact same as the ones in your assembly.
If you are going to use these callable routines, i'd suggest you work with the system support people so there will be a standard method (if one does not alerady exist). If each developer creates their own compile/assemble/link jcl, it may cause all sorts of problems later. |
|
Back to top |
|
|
|