Question
HCS12 Assembly The program converts a four-ASCII-digit number to an 8-bit unsigned binary. The first digit is either + (=$2B) or - (=$2D). The absolute
HCS12 Assembly
The program converts a four-ASCII-digit number to an 8-bit unsigned binary. The first digit is either + (=$2B) or - (=$2D). The absolute value of the number is smaller than 128ten. For example, a 4- digit number as +, 0 (=$30), 1 (=$31), and 8 (=$38) should be converted into 0001 0010 in binary. A 4-digit number as +, 1, 2, and 7 should be converted into 0111 1111 in binary. You may assume the first digit is always + at this point. Note: instead of $30, you should use 0 (including the single quotes) directly in the assembly code. In addition, you should use + or - (instead of $2B or $2D) in your code.
Modify the previous program so that the conversion would still work when the first digit is -. The 8-bit binary should be in twos complement format. For example, a 4-digit number as -, 0, 1, and 8 should be converted into 1110 1110 in binary, while -, 1, 2, and 7 should be converted into 1000 0001.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started