Advertisement
MHSS

mp Exp5b

Oct 7th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. data segment
  2. string db 0ah,0dh,'Enter 0-9 Q or q for quit',0ah,0dh,'$'
  3. msge db 0ah,0dh,'Even no',0ah,0dh,'$'
  4. msgo db 0ah,0dh,'odd no',0ah,0dh,'$'
  5. data ends
  6.  
  7. code segment
  8. assume cs:code,ds:data
  9. start:
  10. mov ax,data
  11. mov ds,ax
  12. display1: lea dx,string
  13. mov ah,09h
  14. int 21h
  15. mov ah,01h
  16. int 21h
  17. cmp al,'q'
  18. jz exit
  19. cmp al,'Q'
  20. jz exit
  21. cmp al,30h
  22. jb display1
  23. cmp al,39h
  24. ja display1
  25. sub al,30h
  26. rcr al,01h
  27. jc odd
  28. lea dx,msge
  29. jmp skip
  30.  
  31. odd:lea dx,msgo
  32. skip: mov ah,09h
  33. int 21h
  34. jmp display1
  35.  
  36.  
  37. exit : mov ah,4ch
  38. int 21h
  39. code ends
  40. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement