Advertisement
apl-mhd

loop break if press q

Jul 22nd, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mov bh, 'a'
  2.  
  3.  
  4.  
  5. input:
  6. cmp bh,'q'      ;infinity loop condition
  7. JNE cont
  8. hlt
  9.  
  10.  
  11. cont:  
  12. mov ah, 1    ; charcter input
  13. int 21h
  14.  
  15.  
  16. mov bh, al
  17.  
  18.  
  19. mov ah,2        ; display charcter
  20. mov dl, al
  21. int 21h
  22.  
  23. mov ah, 2
  24. mov dl, 0AH
  25. int 21h      ;display new line
  26.  
  27.  
  28. mov ah,2
  29. mov dl, 0DH
  30. int 21h
  31.  
  32.  
  33. jmp input ; bakc to input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement