Reference no: EM132209637
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, 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.