Question: 1. The 32-bit word at data address PACK contains an 8-digit packed BCD (Binary-Coded Decimal) number. As described in Lecture 5 of Module 1 ,

1. The 32-bit word at data address PACK contains an 8-digit packed BCD (Binary-Coded Decimal) number. As described in Lecture 5 of Module 1 , "Packed BCD " format uses four bits to represent each decimal digit, with two BCD digits packed into each byte (less-significant digit in the low half of the byte). Write a program to convert the packed BCD number stored in PACK to a string of eight ASCII character codes, representing the eight decimal digits of that number. (This string could be sent to a printer to print the number.) These ASCII codes are to be stored in an array of eight bytes of memory beginning at address STRG in RAM. For example, if the packed BCD number is 013587609, the eight characters should be stored in memory as follows: Your program is to convert this 32-bit packed BCD number to the corresponding ASCll character string. Note that this 32-bit BCD number corresponds to the size of a register. You will likely need shift and logical operations in this program. 2. Demonstrate your program in the debugger by initializing each byte of array STRG to 000 and the 32-bit value of PACK to 013587609. 3. Submit: - The source program - The debugger Memory view after executing the program, circling the bytes of STRG (use rendering format ASCII). Also show the BCD number in the Expressions view
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
