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
Answer Posted / 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 |
Post New Answer View All Answers
Explain how to produce soc7 abend?
Explain about house keeping in assembler?
explain icm instruction?
How are data passed from jcl parm to assembler program?
How to pass the parameters from jcl to assembler program?
Explain how to pass instream data in sysin with assembler?
What is maximum displacement and how to cross this limit?
What will happen if we drop the base register in the program which contains only one basereg?
Why do we use "drop"?
How many maximum base registers we can have in a single program?
how to pass the parameters from jcl to assembler pgm?
Explain the difference between various read and find statement?
What is maximum displacement?
How is data passed from a calling program to an assembler called program?
Explain about base register?