Question: Ise 8 0 8 6 Instruction set for assembly language and write using the code segment in the picture. Convert binary to unsigned int Problem:
Ise Instruction set for assembly language and write using the code segment in the picture.
Convert binary to unsigned int
Problem: Convert a binary string to decimal. Accept buffered user input in the form of a bit binary string. Convert to unsigned integer and print to the screen. If the user enters less than bits, you may pad the binary number with zeros on the left.
Hint: To print the numbers, you have to modify the print int tat example file the file is on Nexus That version uses division for bits, but you need division using bits for this assignment.
Sample Execution:
Enter a bit binary number:
The decimal unsigned integer equivalent is
Enter a bit binary number:
The decimal unsigned integer equivalent is
Convert binary to signed int
Problem: Convert a binary string to decimal. Accept buffered user imput in the form of a bit binary string. Convert to signed integer and print to the screen. If the user enters less than bits, or inputs illegal character, return an error message and prompt for input again.
Sample Execution:
Enter a iboblt binary number:
The decimal signed integer equivalent is
Enter a bit binaty number:
Error: Please enter exactly hits:
Error: Illegal characters detactod. Please enter a bit binary number:
Evaluation
marks will be awarded for correctly converting to unsigned int and stgned int ie marks each marks are for implementing error mensuge in Problem The remaining to matk are style points based on subjective evaluation of the quality of your solutions and zaif comments amother tor maks each
data
; data segment. Keyword db means define byte. You can also define word du
; Define input number
; stack seqment
data iNum
stack segment stack
db dup P
: This the stack of bytes
stackl ences
code
begreart
hsnume es:code, ds:data, ss:stackl
start:
; Perform initialization
: Put the starting address of the stack into the ax register murt of thiat firar
: Put the starting address of the stack segment into the ss regiater where if belargs
nov ah Wiset up code to specity return to dos
Int I Interpt number Return control to dou promet
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
