Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- mov bx, offset arr
- mov ch,0
- mov cl,0
- Input:
- mov ah,1
- int 21h
- cmp al, 0Dh
- je OffsetFixing
- mov [bx], al
- inc bx
- inc cl
- jmp Input
- OffsetFixing:
- ;cl or cx holds the length
- ;since bx is 16 bit cx is subtracted
- sub bx,cx ;making bx point the first element
- mov dh,cl ;dh = length
- ;if loop is used cx would become 0
- Print:
- mov dl, [bx]
- sub dl,1
- mov ah,2
- int 21h
- inc bx
- dec cx
- jz Done
- jmp Print
- Done:
- ret
- arr dB 100 dup (?)
Add Comment
Please, Sign In to add comment