Question: Write a program that clears the screen, locates the cursor near the middle of the screen, prompts the user for two integers, adds the integers,

Write a program that clears the screen, locates the cursor near the middle of the screen, prompts the user for two integers, adds the integers, and displays their sum. You will need to use the ClrScr, Gotoxy, WriteString, Crlf, and ReadInt procedures from the Irvine32 library.

Using the ArrayScan program below as a model, implement the search using the LOOPZ instruction.

TITLE Scanning an Array ;Scan an array for the first nonzero value. INCLUDE Irvine32.inc .data intArray SWORD 0,0,0,0,1,20,35,-12,66,4,0 ;intArray SWORD 1,0,0,0 ;alternate test data ;intArray SWORD 0,0,0,0 ;alternate test data ;intArray SWORD 0,0,0,1 ;alternate test data noneMsg BYTE "A non-zero value was not found",0 .code main PROC mov ebx,OFFSET intArray ;point to the array mov ecx,LENGTHOF intArray ;loop counter L1: cmp WORD PTR [ebx],0 ;compare a value to zero jnz found ;found a value add ebx,2 ;point to next loop L1 ;contine the loop jmp notFound ;none found found: ;display the value movsx eax,WORD PTR[ebx] call WriteInt jmp quit notFound: ;display "not found" message mov edx,OFFSET noneMsg call WriteString quit: call crlf exit main ENDP END main 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!