0% found this document useful (0 votes)
16 views

Code Eee

Uploaded by

thaitoan020205
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Code Eee

Uploaded by

thaitoan020205
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

; You may customize this and other start-up templates;

; The location of this template is c:\emu8086\inc\0_com_template.txt

org 100h

; Full Name:Luong Duc Quang Trung


; ID STUDENT: 075205015034
; Last right - most digit in my own Student ID is 4

; You may customize this and other start-up templates;


; The location of this template is c:\emu8086\inc\0_com_template.txt
include 'emu8086.inc'
game:
;Input a character whose value from 0 to 9
mov dx, offset msg1
mov ah, 9
int 21h

; read character in al:


mov ah, 1
int 21h

cmp al, '0'


jb stop

cmp al, '9'


ja stop

cmp al, '4'

;Compare the number with 4 if the number is not below 4 , LENH will be jump
to label 'above_or_equal'
jnb above_or_equal; Use ONLY JNB instruction

mov dx , offset below_4 ;Print on the screen the declaration about the
comparison
;jmp print

above_or_equal:
;If the number is above or equal four
mov dx , offset aboveEqual_4 ;Print on the screen the declaration about the
comparison

;print: mov ah, 9


;int 21h
;jmp game ; loop.

stop: ret ; stop

msg1 db "enter a number<0 to 9>or any other character to exit: $"


below_4 db " is below four!" , 0Dh,0Ah, "$"
aboveEqual_4 db " is above or equal four!" , 0Dh,0Ah, "$"

You might also like