Question: 4. (25 points) Design and write an MSP430 assembly language subroutine i2a (char*a, int myl) that converts a 16-bit BCD encoded integer, myl, into a
4. (25 points) Design and write an MSP430 assembly language subroutine i2a (char*a, int myl) that converts a 16-bit BCD encoded integer, myl, into a character array with elements corresponding to the decimal representation of the integer. For example, an integer my9.746 (03246 in memory) is converted into an array with 4 elements as follows: [0]6',a[1-4, a 2j-17.3]/9. The main program that calls the subroutine is shown below. Asci('A')-041, asci(0)-0130 W Stop OT: NO STACKINO, SP OTMOLDOTTL step watchdog ti in code here push. 14 allocate space for a ll chars 14 points to the allocated area push the starting address the stack Integer is passed through RA call subroutine free space on the stack add. 2, SP lend: Stack Pointer definitie 12a_s: 4. (25 points) Design and write an MSP430 assembly language subroutine i2a (char*a, int myl) that converts a 16-bit BCD encoded integer, myl, into a character array with elements corresponding to the decimal representation of the integer. For example, an integer my9.746 (03246 in memory) is converted into an array with 4 elements as follows: [0]6',a[1-4, a 2j-17.3]/9. The main program that calls the subroutine is shown below. Asci('A')-041, asci(0)-0130 W Stop OT: NO STACKINO, SP OTMOLDOTTL step watchdog ti in code here push. 14 allocate space for a ll chars 14 points to the allocated area push the starting address the stack Integer is passed through RA call subroutine free space on the stack add. 2, SP lend: Stack Pointer definitie 12a_s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
