Question: Using the code in Section 7.7.1, write a procedure named AddPacked that adds two packed dec imal integers of arbitrary size (both must be the
Using the code in Section 7.7.1, write a procedure named AddPacked that adds two packed dec imal integers of arbitrary size (both must be the same). Write a test program that passes AddPacked several pairs of integers: 4-byte, 8-byte, and 16-byte. Display the sums in hexadeci mal. Use the following registers to pass information: ESI - pointer to the first number EDI - pointer to the second number EDX - pointer to the sum ECX - number of bytes to add (A VideoNote for this exercise is posted on the Web site.)
7.7.1 DAA Instruction The DAA (decimal adjust after addition) instruction converts a binary sum produced by ADD or ADC in AL to packed decimal format. For example, the following instructions add packed deci- mals 35 and 48. The binary sum (7Dh) is adjusted to 83h, the packed decimal sum of 35 and 48.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
