Computers and Technology
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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, ed72018373
Which law requires employers to provide safe working environments for their employees? a. civil rights act b. fair labor standards act c. occupational safety and health act d. wagner act
Answers: 1
image
Computers and Technology, 22.06.2019 23:00, nicog94
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
image
Computers and Technology, 23.06.2019 06:20, kiarakagni
What is a point-in-time measurement of system performance?
Answers: 3
image
Computers and Technology, 24.06.2019 10:10, nakeytrag
Which view in a presentation program displays a split window showing the slide in the upper half and a blank space in the lower half?
Answers: 1
Do you know the correct answer?
Using x86 assembly language, Write a program that converts an integer from -100 to 100 to text.

Questions in other subjects:

Konu
World Languages, 04.08.2019 00:10