Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include 'emu8086.inc'
- ORG 100h
- CALL scan_num ; get number in CX.
- MOV BX, CX ; copy the number to BX.
- CMP BX,200
- JNAE green
- JNBE range
- green:
- LEA SI, msg1 ; ask for the number
- CALL print_string ;
- jmp bye
- range:
- CMP BX,500
- JNAE yellow
- JNBE Red
- yellow:
- LEA SI, msg2 ; ask for the number
- CALL print_string ;
- jmp bye
- red:
- LEA SI, msg3 ; ask for the number
- CALL print_string ;
- jmp bye
- msg1 db 'green' ,0
- msg2 db 'yellow' ,0
- msg3 db 'red' ,0
- DEFINE_SCAN_NUM
- DEFINE_PRINT_STRING
- bye:
- EN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement