Question: Write a procedure named PackedToAsc that converts a 4 - byte packed decimal integer to a string of ASCII decimal digits. Pass the packed integer

Write a procedure named PackedToAsc that converts a 4-byte packed decimal integer to a string of ASCII decimal digits. Pass the packed integer and the address of a buffer holding the ASCII digits to the procedure. Write a short test program that passes at least 5 packed decimal integers to your procedure. Display the string of digits to the console. Take a screenshot. (50 points)
numbers DWORD 12345678h,23456781h,45678123h,78654321h,56781234h
buffer BYTE 9 DUP(0)
The first number is 12345678h
After converting, you will see the following in buffer 3132333435363738
writeString will output 12345678(this is what you see on the console which is the string "12345678" not the integer )
Unpacked Decimal:
In unpacked decimal representation, each decimal digit is stored in a separate nibble (4 bits). The high 4 bits of each nibble are reserved for the digit itself, and the low 4 bits are often unused or set to zero 03=low 4 bits0000 high 4 bits0011
ASCII Decimal:
In ASCII representation of decimal numbers, each decimal digit is encoded using 7 or 8 bits, typically within a byte. The binary representation of the ASCII digits starts with the binary value 0011, which corresponds to the hexadecimal value 3.'3'=33=low 4 bits0011 high4bits0011
Putting it together:
In an unpacked decimal integer, the high 4 bits of each nibble are always zeros because they are used solely to represent the decimal digit. For example, if you have the decimal digit 5, its unpacked representation would be 0101, where the high 4 bits are 0000(zeros).
In an ASCII decimal representation, the high 4 bits of the binary representation of each digit are set to 0011 because ASCII digits start with the value 3 in binary. For example, the ASCII representation of the digit 5 is 00110101 in binary.
In summary, when comparing the high 4 bits of unpacked decimal and ASCII decimal representations:
Unpacked Decimal: Always zeros (unused for the digit itself).
ASCII Decimal: Always 0011 because it corresponds to the starting value of ASCII digits. Please help me write Full Program in Assembly language using microsoft visual studio, Irvine library.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!