IN c++ pretty please  ; apply_Irvine_libs.asm - A simple test program calling various Irvine library procedures,  ; code base modified from demo program AddTwo.asm ; include the Irvine's library INCLUDE Irvine32.inc .386 .model flat,stdcall .stack 4096 ExitProcess proto,dwExitCode:dword .data ; strings(texts) for prompts prompt_1st_int BYTE "Please enter the first integer: ",0 prompt_2nd_int BYTE "Please enter the second integer: ",0 prompt_text_color BYTE "Please pick the text color (1=blue, 2=green, 4=red, or any number from 0-15): ",0 prompt_proverb BYTE "Please teach me a proverb: ",0 response_str BYTE "The proverb I just learned: ", 0 ; strings(texts) for output labels/descriptions dec_sum_str BYTE "The sum in DEC is: ",0 hex_sum_str BYTE "The sum in HEX is: ",0 memory_dump_str BYTE "Memory Dump with operand_1, _2, and sum: ",0 ; variables definitions operand_1   SDWORD ? operand_2   SDWORD ? sum         SDWORD ? color_code  DWORD ? aString BYTE 80 DUP(0), 0 .code main proc    ;prompt the 1st number input    mov  edx, OFFSET prompt_1st_int    call WriteString        ; set input text color, "yellow" is a pre-define constant, in the Irvine library    mov eax, yellow    call SetTextColor    ; read input    call ReadInt    mov  operand_1, eax    ; reset text color, "white" is a pre-define constant, in the Irvine library    mov eax, white    call SetTextColor    ;prompt the 2nd number input    mov  ___, _____________________    call WriteString    ; set input text color to yellow    mov ___, ______    call SetTextColor    ; read input    call ReadInt    mov  operand_2, eax    call Crlf    ; reset text color to white    mov eax, white    call SetTextColor    ; prompt "output text color" selection    mov  ___, _____________________    call WriteString    ; set input text color    mov eax, yellow    call SetTextColor    ; read the color choice    call ReadInt    mov color_code, eax    call Crlf    ; reset text color to white    _________________    call SetTextColor    ; add the inputs, then save it to sum    mov   eax, operand_1    add   ___, _________    ; save sum    mov  ___, ___    ; display sum in DEC    mov  edx, OFFSET dec_sum_str    call WriteString        ; set text color    mov eax, color_code    call SetTextColor    ; display sum    mov eax, sum    call WriteInt    call Crlf    ; reset text color to white    mov eax, white    call SetTextColor    ; display sum in HEX    _______________________________    call WriteString    ; set text color    mov eax, color_code    call SetTextColor    mov eax, sum    call WriteHex    call Crlf    ; reset text color to white    mov eax, white    call SetTextColor    ; display memory dump    mov  edx, OFFSET memory_dump_str    call WriteString    ; set text color    mov eax, color_code    call SetTextColor    ;dump the memories of operand_1, 2 and sum    mov esi, OFFSET operand_1    mov ecx, LENGTHOF operand_1 + LENGTHOF operand_2 + LENGTHOF sum    mov ebx, TYPE operand_1    call DumpMem    call Crlf    call Crlf    ; reset text color to white    mov eax, white    call SetTextColor    ; prompt proverb    mov  edx, OFFSET prompt_proverb    call WriteString    ; set input text color    ______________    _________________    ; read string    mov  ecx, SIZEOF aString - 1    mov  edx, OFFSET aString    call ReadString    call Crlf    ; reset text color to white    mov eax, white    call SetTextColor    ; display learned string    mov edx, OFFSET response_str    ________________        ; set text color    mov eax, color_code    call SetTextColor    mov  edx, OFFSET aString    call WriteString    call Crlf    call Crlf    ; reset text color to white    mov eax, white    call SetTextColor    invoke ExitProcess,0 main endp end main

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

IN c++ pretty please 

; apply_Irvine_libs.asm - A simple test program calling various Irvine library procedures, 
; code base modified from demo program AddTwo.asm

; include the Irvine's library
INCLUDE Irvine32.inc

.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword

.data
; strings(texts) for prompts
prompt_1st_int BYTE "Please enter the first integer: ",0
prompt_2nd_int BYTE "Please enter the second integer: ",0
prompt_text_color BYTE "Please pick the text color (1=blue, 2=green, 4=red, or any number from 0-15): ",0
prompt_proverb BYTE "Please teach me a proverb: ",0
response_str BYTE "The proverb I just learned: ", 0

; strings(texts) for output labels/descriptions
dec_sum_str BYTE "The sum in DEC is: ",0
hex_sum_str BYTE "The sum in HEX is: ",0
memory_dump_str BYTE "Memory Dump with operand_1, _2, and sum: ",0

; variables definitions
operand_1   SDWORD ?
operand_2   SDWORD ?
sum         SDWORD ?
color_code  DWORD ?
aString BYTE 80 DUP(0), 0

.code
main proc

   ;prompt the 1st number input
   mov  edx, OFFSET prompt_1st_int
   call WriteString
   
   ; set input text color, "yellow" is a pre-define constant, in the Irvine library
   mov eax, yellow
   call SetTextColor

   ; read input
   call ReadInt
   mov  operand_1, eax

   ; reset text color, "white" is a pre-define constant, in the Irvine library
   mov eax, white
   call SetTextColor

   ;prompt the 2nd number input
   mov  ___, _____________________
   call WriteString

   ; set input text color to yellow
   mov ___, ______
   call SetTextColor

   ; read input
   call ReadInt
   mov  operand_2, eax
   call Crlf
   ; reset text color to white
   mov eax, white
   call SetTextColor

   ; prompt "output text color" selection
   mov  ___, _____________________
   call WriteString

   ; set input text color
   mov eax, yellow
   call SetTextColor

   ; read the color choice
   call ReadInt
   mov color_code, eax
   call Crlf
   ; reset text color to white
   _________________
   call SetTextColor

   ; add the inputs, then save it to sum
   mov   eax, operand_1
   add   ___, _________

   ; save sum
   mov  ___, ___

   ; display sum in DEC
   mov  edx, OFFSET dec_sum_str
   call WriteString
   
   ; set text color
   mov eax, color_code
   call SetTextColor

   ; display sum
   mov eax, sum
   call WriteInt
   call Crlf

   ; reset text color to white
   mov eax, white
   call SetTextColor

   ; display sum in HEX
   _______________________________
   call WriteString

   ; set text color
   mov eax, color_code
   call SetTextColor

   mov eax, sum
   call WriteHex
   call Crlf

   ; reset text color to white
   mov eax, white
   call SetTextColor

   ; display memory dump
   mov  edx, OFFSET memory_dump_str
   call WriteString

   ; set text color
   mov eax, color_code
   call SetTextColor

   ;dump the memories of operand_1, 2 and sum
   mov esi, OFFSET operand_1
   mov ecx, LENGTHOF operand_1 + LENGTHOF operand_2 + LENGTHOF sum
   mov ebx, TYPE operand_1
   call DumpMem
   call Crlf
   call Crlf

   ; reset text color to white
   mov eax, white
   call SetTextColor

   ; prompt proverb
   mov  edx, OFFSET prompt_proverb
   call WriteString

   ; set input text color
   ______________
   _________________

   ; read string
   mov  ecx, SIZEOF aString - 1
   mov  edx, OFFSET aString
   call ReadString
   call Crlf
   ; reset text color to white
   mov eax, white
   call SetTextColor

   ; display learned string
   mov edx, OFFSET response_str
   ________________
   
   ; set text color
   mov eax, color_code
   call SetTextColor

   mov  edx, OFFSET aString
   call WriteString
   call Crlf
   call Crlf
   ; reset text color to white
   mov eax, white
   call SetTextColor

   invoke ExitProcess,0
main endp
end main

Please enter the first integer: 36
Please enter the second integer: -898
Please pick the text color (1-blue, 2-green, 4-red, or any number from 0-15): 5
The sum in DEC is: -862
The sum in HEX is: FFFFFCA2
Memory Dump with operand_1, 2, and sum:
Dump of offset 004D611D
00000024 FFFFFC7E FFFFFCA2
Please teach me a proverb: A soft answer turns away wrath, but a harsh word stirs up anger.
The proverb I just learned: A soft answer turns away wrath, but a harsh word stirs up anger.
C:\CIS_21JA\Debug\Assignment 2.exe (process 24560) exited with code 0.
Press any key to close this window.
Transcribed Image Text:Please enter the first integer: 36 Please enter the second integer: -898 Please pick the text color (1-blue, 2-green, 4-red, or any number from 0-15): 5 The sum in DEC is: -862 The sum in HEX is: FFFFFCA2 Memory Dump with operand_1, 2, and sum: Dump of offset 004D611D 00000024 FFFFFC7E FFFFFCA2 Please teach me a proverb: A soft answer turns away wrath, but a harsh word stirs up anger. The proverb I just learned: A soft answer turns away wrath, but a harsh word stirs up anger. C:\CIS_21JA\Debug\Assignment 2.exe (process 24560) exited with code 0. Press any key to close this window.
1. Download and Read this program and understand what it does: apply Irvine libs tmpl.asm; it is the template(base code) for your programming
exercise and it has some blank lines, marked by "underlines
"; you can read Ch 5.4 of the text or, download this Help Manual to read more about
the specifications and the argument format/requirements for Procedures invocation : IrvineLibHelp.chm
2. Fill in the blank lines, one instruction each, in the template file above to get it running correctly. Here is an execution and output sample:
Please enter the first integer: 36
Please enter the second integer: -898
Please pick the text color (1-blue, 2-green, 4-red, or any number from 0-15): 5
The sum in DEC is: -862
The sum in HEX is: FFFFFCA2
Memory Dump with operand_1, 2, and sum:
Dump of offset 004D611D
80000024 FFFFFC7E FFFFFCA2
Please teach me a proverb: A soft answer turns away wrath, but a harsh word stirs up anger.
The proverb I just learned: A soft answer turns away wrath, but a harsh word stirs up anger.
C:\ CIS 21JA\Debug\Assignment 2.exe (process 24560) exited with code 0.
Press any key to close this window . . .
3. When you test your program, use you own data, including the proverb; Don't copy the input data from Above!
4. Submit your.asm file, with the modifications.
5. And, submit the screen capture similar to the Above, saved in pdf format.
Transcribed Image Text:1. Download and Read this program and understand what it does: apply Irvine libs tmpl.asm; it is the template(base code) for your programming exercise and it has some blank lines, marked by "underlines "; you can read Ch 5.4 of the text or, download this Help Manual to read more about the specifications and the argument format/requirements for Procedures invocation : IrvineLibHelp.chm 2. Fill in the blank lines, one instruction each, in the template file above to get it running correctly. Here is an execution and output sample: Please enter the first integer: 36 Please enter the second integer: -898 Please pick the text color (1-blue, 2-green, 4-red, or any number from 0-15): 5 The sum in DEC is: -862 The sum in HEX is: FFFFFCA2 Memory Dump with operand_1, 2, and sum: Dump of offset 004D611D 80000024 FFFFFC7E FFFFFCA2 Please teach me a proverb: A soft answer turns away wrath, but a harsh word stirs up anger. The proverb I just learned: A soft answer turns away wrath, but a harsh word stirs up anger. C:\ CIS 21JA\Debug\Assignment 2.exe (process 24560) exited with code 0. Press any key to close this window . . . 3. When you test your program, use you own data, including the proverb; Don't copy the input data from Above! 4. Submit your.asm file, with the modifications. 5. And, submit the screen capture similar to the Above, saved in pdf format.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT