; ID: Joseph Wyatt / CIS 253 / Fall, 2002 ; PURPOSE: Demonstrate use of Irvine library functions ; DESIGN: Clear screen ; Move cursor & Prompt user ; Get number ; Move Cursor and put out message ; Experiment with access outside data area ;======================================================== TITLE Chapter 5 Exercise Example INCLUDE Irvine32.inc .data begin = $ number SDWORD ? prompt1 BYTE "Hello! - What number? ",0 answer BYTE " is great number!", 0 ending = $ .code main PROC ; Clear the screen call ClrScr ; Move the cursor mov dh,5 ; row mov dl,20 ; column call Gotoxy ; put cursor there ; Prompt user for a number mov edx,OFFSET prompt1 call WriteString ; display prompt (up to trailing zero) ; Get the number from the user call ReadInt mov number, eax ; number entered stored in eax ; Move the cursor mov dh,14 mov dl,20 call Gotoxy ; Write final message mov eax, number ; put number to display in eax call WriteInt ; write number mov edx,OFFSET answer ; write text call WriteString call Crlf call Crlf ; Experiment - can we access beyond data area? call Readint mov eax,[begin-4] ; ?? call DumpRegs mov eax,[ending+4] ; ?? call DumpRegs exit 1 main ENDP END main