Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 3 - PRINTDEC - 4 5 Points - Print a 1 6 - bit number as decimal. 1 . Use DIV and MOD from
Part PRINTDEC Points Print a bit number as decimal.
Use DIV and MOD from previous steps in this assignment.
NOTE that the DIV and MOD algorithms listed above will not work with negative values.
When testing only use R and R values which are less than x hexadecimal or less than in
decimal. For this assignment, you can assume R will never contain a value greater than xFFF when
calling PRINTDEC.
A bit number will be stored in R You will have to figure out each digit one at a time and print
each.
DO NOT PRINT leading zeros. Loop until a nonzero digit is found and then print the rest of the digits.
YOU CAN NOT ignore all zeros. Only ignore leading zeros.
DO NOT PRINT a newline at the end.
Your program should print a single if R is
Main should look like this when submitting part
orig x
JSR PRINTDEC
JSR PRINTDEC
HALT
Assume you have a number like in R
Divide by to get add and print it
Divide by to get Mod by to get add and print it
Divide by to get Mod by to get add and print it
Divide by to get Mod by to get add and print it
Divide by to get Mod by to get add and print it
Assume you have a number like in R
Divide by to get Ignore it
Divide by to get Ignore it
Divide by to get Mod by to get add and print it
Divide by to get Mod by to get add and print it
Divide by to get Mod by to get add and print it
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