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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:40, math31343
Gabe wants to move text from one document to another document. he should copy the text, paste the text, and open the new document highlight the text, select the cut command, move to the new document, make sure the cursor is in the correct location, and select the paste command select the save as command, navigate to the new document, and click save highlight the text, open the new document, and press ctrl and v
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, jessisjawsome
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
image
Computers and Technology, 23.06.2019 22:20, kandi2565
What is a programming method that provides for interactive modules to a website?
Answers: 1
image
Computers and Technology, 24.06.2019 16:30, officialrogerfp3gf2s
Pressing the backspace key deletes the text to the of the insertion point. the left or the right?
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 in other subjects:

Konu
Mathematics, 26.09.2020 01:01
Konu
Mathematics, 26.09.2020 01:01