How do you round the addition or subtraction of two numbers
in assembler?
what does the following code do?
AP WKUR,=P'5' where WKUR is a label
Answers were Sorted based on User's Feedback
Answer / dave grund
This is a vague two-part question.
1) You can round by adding .5
2) Adds 5 to WKUR, but it had better be a valid packed field, and not just a label.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / steve holton
Vague, indeed....as you would round differently depending
upon the data type of the numbers involved. You can add
intergerss, floats (and doubles) and packed decimal numbers
in assembler - to which does this question refer?
As the second half of the Q addresses packed decimal, I will
assume that part one does as well...
There are various ways to round data - truncation is one
valid way, another is to move to the closest "whole value"
in the least significant digit desired in the result, or you
can mov4e to the closest number towards +infinity, or to the
closest towards -infinity, or the closest towards 0, etc.,
So first off, you need a better definition of "round". What
I think this question was attempting to get at was to see it
you know about the SRP (shift-and-round-packed) instruction,
which allows you to apply a rounding factor and shift the
packed decimal result to the desired number of significant
digits.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / karta
After we do an add or , to Round it , we can do a SRP
SRP is shift and round packed.
Here SRP Value ,64-4,5 . usually we do right shifting after a DP and do add 5 to round it. eirther 0 or 5 will be issued. if zero, no rounding takes place.
Is This Answer Correct ? | 0 Yes | 0 No |
How are data passed from jcl parm to assembler program?
How to initialize 20,000 bytes in the Assembler..
What is house keeping in assembler? And explain the following code HELLOTSO START 0 * PRINT NOGEN BEGIN SAVE (14,12) LR 12,15 USING TYPE,12 ST 13,SAVE+4 LA 11,SAVE ST 11,8(13) LR 13,11
how do you round the addition or subtraction of two numbers in assembler? what does the following code do? change process tool(code changes from dev to prd) the changes made to your code should be effected in live. How the process takes place. That is how can you move the code changes from development to production?
How many maximum base registers we can have in a program?
What is the use of trt instruction?
What will happen if we drop the base register in the program which contains only one basereg?
how to find the dump
What is the use of TRT instruction and how it is working?
Why can only 256 bytes be moved from one address to another in a MVC?
Is it possible to access some memory location (Ex: VAR1 DS P) without using Base Displacement?
Explain how to access vsam file?