Using only the assembly language instructions discussed so far, write a program to accept a number in hexadecimal form and display the decimal equivalent of the number. A typical interaction of your...


Using only the assembly language instructions discussed so far, write a program to


accept a number in hexadecimal form and display the decimal equivalent of the number.


A typical interaction of your program is (user input is shown in bold):


Please input a positive number in hex (4 digits max.): A10F


The decimal equivalent of A10FH is 41231


Do you want to terminate the program (Y/N): Y


You should refer to Appendix A for an algorithm to convert from base b to decimal.


Hints:


1. Required multiplication can be done by the shl instruction.


2. Once you have converted the hex number into the equivalent in binary using the


algorithm of Appendix A, you can use the PutInt routine to display the decimal


equivalent.



May 26, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here