subject
Computers and Technology, 13.08.2021 04:10 liv467

Using x86 assembly language, Write a program that converts an integer from -100 to 100 to text.
Below is a partial algorithm to convert an integer to text:
idiv user's number by 10 and store eax into variable Quotient and edx into Remainder
compare Quotient to 2 and jump to Twenty if equal; compare Quotient to 3 and jump to Thirty if equal; etc.
Twenty:
Output "twenty"
Jump to OnesDigit
Thirty:
Output "thirty"
Jump to OnesDigit
OnesDigit:
compare Remainder to 1 and jump to One if equal; compare Remainder to 2 and jump to Two if equal; etc.
One:
Output "one"
Jump to Ending
Two:
Output "two"
Jump to Ending
Example outputs
This x86 assembly program converts an integer to text.
Enter an integer from -100 to 100: 73
seventy-three
Enter an integer from -100 to 100: -100
negative one hundred
File Edit Search Run Options Help
format PE console
include win32ax. inc!
start:
ask user to enter a number
mov [Num), -25
print negative is less than 0
cmp [Num], o
jge positive
cinvoke printf,
negative neg [Num]
positive;
mov EAX, [Num]
cda
mov EBX, 10
idiv EBX
mov [Q], EAX
mov [R], EDX
twenty
cmp [Q), 2
jne thirty
cinvoke printf, "twenty"
invoke Sleep, -1

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:50
Which of the following had the greatest influence on opening the internet to the generly public
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
How are stop motion special effects in animated films created
Answers: 1
You know the right answer?
Using x86 assembly language, Write a program that converts an integer from -100 to 100 to text.
Questions
question
Mathematics, 09.07.2019 08:00
question
Mathematics, 09.07.2019 08:00
question
SAT, 09.07.2019 08:00
Questions on the website: 13722360