Question
Assembly programming Write an assembly language program for the WASP processor using the Sting assembler. Your assembly program should allow the user to convert a
Assembly programming
Write an assembly language program for the WASP processor using the Sting assembler. Your assembly program should allow the user to convert a four-digit binary number to decimal. The program works as follows:
The user will enter four digits into the WASP console, using only the digits 1 and 0. The digits will be displayed on the screen when they are entered.
The program will convert the digits to a decimal number and display it on the next line.
The program will then end.
If the user enters a symbol other than 1 or 0, then the program will display E to indicate an error.
Example output:
0010 2
1111 15
1010 10
1b11 E
Hints:
For input and output, the system uses the ASCII values of the characters. The digit 1 will be stored as the ASCII value 49. The digit 0 will be stored as the ASCII value 48. If you want to display the symbol 2, you need to output the ASCII value 50.
Sometimes the program needs to display TWO characters. For example, the number 15 is displayed as the symbol 1 and the symbol 5. This is not automatic you will need to display both symbols. Fortunately, there are only two possibilities: The program will only display a single symbol, or will display a 1 followed by another symbol. So you can handle this with a simple branch.
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