Guest User

Untitled

a guest
Jul 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. org 100h
  2.  
  3. mov bx, offset arr
  4. mov ch,0
  5. mov cl,0
  6.  
  7. Input:
  8. mov ah,1
  9. int 21h
  10. cmp al, 0Dh
  11. je OffsetFixing
  12. mov [bx], al
  13. inc bx
  14. inc cl
  15. jmp Input
  16.  
  17.  
  18. OffsetFixing:
  19. ;cl or cx holds the length
  20. ;since bx is 16 bit cx is subtracted
  21. sub bx,cx ;making bx point the first element
  22. mov dh,cl ;dh = length
  23. ;if loop is used cx would become 0
  24.  
  25. Print:
  26. mov dl, [bx]
  27. sub dl,1
  28. mov ah,2
  29. int 21h
  30. inc bx
  31. dec cx
  32. jz Done
  33. jmp Print
  34.  
  35. Done:
  36.  
  37.  
  38. ret
  39. arr dB 100 dup (?)
Add Comment
Please, Sign In to add comment