Professional Documents
Culture Documents
Model Stack
Model Stack
Model Stack
.MODEL SMALL
.STACK 100H
.DATA
.CODE
start:
mov ax, @data
mov ds, ax
mov dx, offset msg
mov ah, 09h
int 21h
MOV CX, 5 ; Assume that the user will enter 5 numbers
INPUT:
; Display message to enter a number
MOV AH, 09H
LEA DX, prompt
INT 21H
; Even
MOV DX, OFFSET MSG2
JMP DISPLAY
ODD:
; Odd
MOV DX, OFFSET MSG1
DISPLAY:
; Display the result
MOV AH, 09H
INT 21H
LOOP INPUT
INPUT_ERROR:
; Display an error message
MOV DX, OFFSET error_msg
MOV AH, 09H
INT 21H