Advertisement
sujonshekh

assmble cmp to 3 level if else system

Mar 10th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ; You may customize this and other start-up templates;
  3. ; The location of this template is c:\emu8086\inc\0_com_template.txt
  4.  
  5. org 100h
  6.  
  7. ; add your code here
  8.  
  9. .data  
  10. smallmsg db "AX is smallest $"
  11. bigmsg db "BX is greater then $"
  12. axgreatermsg db "Ax is greater then BX and CX $"
  13.  
  14. .code
  15. mov ax,@data        
  16. mov ds,ax
  17.  
  18.  
  19. mov ax,5
  20. mov bx,15
  21. mov cx,7
  22. cmp ax,bx
  23. jl bxcx  
  24. jg axbx
  25.  
  26. bxcx:
  27. cmp bx,cx
  28. jl smallDisplay
  29. jg greatDisplay
  30.  
  31. smallDisplay:
  32. lea dx,smallmsg
  33. mov ah,9
  34. int 21h
  35. jmp finished
  36.  
  37. greatDisplay:  
  38. lea dx,bigmsg
  39. mov ah,9
  40. int 21h
  41. jmp finished
  42.  
  43. axbx:
  44.    lea dx,axgreatermsg
  45. mov ah,9
  46. int 21h    
  47. jmp finished
  48.  
  49.     finished:
  50. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement