Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is maximum displacement and how to cross this limit?

1120


how to initialize a register to 0000?

1071


What is need of start 0? In steed of can we use anyother numerics? If we use what will happen?

1003


explain icm instruction?

1024


Explain the difference between various read and find statement and which one should be used when for better adabas performance?

947


How many maximum base registers we can have in a single program?

1027


Explain how to initialize a register to 0000?

957


Explain how to access vsam file?

1041


Explain the difference in data type "x" and "p"?

972


Explain about house keeping in assembler?

1001


How is data passed from a calling program to an assembler called program?

993


Explain about maximum displacement?

996


How do you round the addition or subtraction of two numbers in assembler?

974


Ap wkur,=p5 where wkur is a label?

1072


What is maximum displacement?

1095