sujonshekh

Compare (negative,positive,Zero) 17/2/17

Feb 17th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; You may customize this and other start-up templates;
  2. ; The location of this template is c:\emu8086\inc\0_com_template.txt
  3.  
  4. org 100h
  5.  
  6. .data  
  7. MSGpos db "the number is positive $"
  8. MSGzero db "the number is zero $"    
  9. MSGneg db "the number is negetive $"  
  10. .code
  11. mov ax,@data
  12. mov ds,ax
  13.  
  14. mov bl,-8 ; here change any number then the msg will display to compare yhis number it's not a user define number
  15. cmp bl,0
  16.  
  17. jg levelG
  18. jl levelL
  19. je level
  20.        
  21. levelL:
  22. lea dx,MSGneg
  23. mov ah,9
  24. int 21h
  25.  
  26. jmp finish  
  27.  
  28. levelG:
  29. lea dx,MSGpos
  30. mov ah,9
  31. int 21h
  32.  
  33. jmp finish  
  34.  
  35. level:
  36. lea dx,MSGzero
  37. mov ah,9
  38. int 21h
  39.  
  40. jmp finish
  41.  
  42.  
  43.  
  44.  finish:
  45.                                    
  46.                                      
  47.                                      
  48.  
  49. ret
Add Comment
Please, Sign In to add comment