Advertisement
Guest User

even-odd

a guest
Feb 24th, 2017
81
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. x_ db "ODD$"
  8. y_ db "EveEn$"
  9. z_ db "This is a out of range compare ! $"
  10.  
  11.  
  12. .code
  13. mov ax,@data
  14. mov ds,ax
  15. mov al,5
  16.  
  17. 1,3: cmp al,1
  18.     je odd_
  19.     cmp al,3
  20.     je odd_
  21.    
  22.    
  23. 2,4: cmp al,2
  24.     je even_
  25.     cmp al,4
  26.     je even_
  27.     jne bb
  28.  
  29.     odd_:
  30.     lea dx,x_
  31.     mov ah,9
  32.     int 21h  
  33.      jmp finish
  34.    
  35.     even_:lea dx,y_
  36.     mov ah,9
  37.     int 21h  
  38.     jmp finish
  39.      
  40.    bb:
  41.    lea dx,z_
  42.    mov ah,9
  43.    int 21h
  44.    jmp finish
  45.          
  46.    finish:
  47.  
  48. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement