Advertisement
sharifuddin

if else label

Apr 6th, 2017
310
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. ; add your code here
  7.  
  8. .data  
  9. smallmsg db "AX is smallest $"
  10. bigmsg db "BX is greater then $"
  11. axgreatermsg db "Ax is greater then BX and CX $"
  12.  
  13. .code
  14. mov ax,@data        
  15. mov ds,ax
  16.  
  17.  
  18. mov ax,5
  19. mov bx,15
  20. mov cx,7
  21. cmp ax,bx
  22. jl bxcx  
  23. jg axbx
  24.  
  25. bxcx:
  26. cmp bx,cx
  27. jl smallDisplay
  28. jg greatDisplay
  29.  
  30. smallDisplay:
  31. lea dx,smallmsg
  32. mov ah,9
  33. int 21h
  34. jmp finished
  35.  
  36. greatDisplay:  
  37. lea dx,bigmsg
  38. mov ah,9
  39. int 21h
  40. jmp finished
  41.  
  42. axbx:
  43.    lea dx,axgreatermsg
  44. mov ah,9
  45. int 21h    
  46. jmp finished
  47.  
  48.     finished:
  49. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement