Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. include 'emu8086.inc'
  2.  
  3.  
  4. ORG 100h
  5.  
  6.  
  7. CALL scan_num ; get number in CX.
  8.  
  9. MOV BX, CX ; copy the number to BX.
  10.  
  11.  
  12.  
  13. CMP BX,200
  14. JNAE green
  15. JNBE range
  16.  
  17.  
  18. green:
  19. LEA SI, msg1 ; ask for the number
  20. CALL print_string ;
  21. jmp bye
  22.  
  23. range:
  24.  
  25. CMP BX,500
  26. JNAE yellow
  27. JNBE Red
  28.  
  29.  
  30. yellow:
  31. LEA SI, msg2 ; ask for the number
  32. CALL print_string ;
  33. jmp bye
  34.  
  35. red:
  36.  
  37. LEA SI, msg3 ; ask for the number
  38. CALL print_string ;
  39. jmp bye
  40.  
  41. msg1 db 'green' ,0
  42. msg2 db 'yellow' ,0
  43. msg3 db 'red' ,0
  44.  
  45.  
  46.  
  47. DEFINE_SCAN_NUM
  48. DEFINE_PRINT_STRING
  49.  
  50. bye:
  51.  
  52. EN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement