;PROGRAM TO DELETE REPEATED CHARACTERS AND REPLACE THEM WITH SINGLE CHARCATER
data segment
strip db 'aarrbccddeeffffz ','$'
count equ $-strip
strop db count+1 dup(?)
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov ch,count
lea si,strip
lea di,strop
inc di
loopin:
mov cl,ch
mov bp,si
mov al,[bp]
chek:
dec cl
jz copy
inc bp
cmp al,[bp]
jne chek
jmp loopout
copy:
inc di
mov [di],al
loopout:
inc si
dec ch
jnz loopin
mov ah,09h
lea dx,strip
int 21h
lea dx,strop
int 21h
int 3
code ends
end start
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment