.model small
disp macro msg
mov ah,09h
lea dx,msg
int 21h
endm
.data
src db 05 dup(0)
dest db 05 dup(0)
cnt db 00
msg1 db 10,13,"The non overlapping array:$"
msg2 db 10,13,"Enter the string:$"
.code
main:
mov ax,@data
mov ds,ax
disp msg2
lea si,src
lea di,dest
up1:
mov ah,01h
int 21h
mov [si],al
inc cnt
inc si
cmp cnt,05
jne up1
lea si,src
lea di,dest
up2:
mov bl,[si]
mov [di],bl
inc si
inc di
dec cnt
jnz up2
lea si,src
disp msg1
up3:
mov dl,[si]
mov ah,02h
int 21h
inc si
inc cnt
cmp cnt,0Ah
jne up3
mov ah,4ch
int 21h
end main
end
disp macro msg
mov ah,09h
lea dx,msg
int 21h
endm
.data
src db 05 dup(0)
dest db 05 dup(0)
cnt db 00
msg1 db 10,13,"The non overlapping array:$"
msg2 db 10,13,"Enter the string:$"
.code
main:
mov ax,@data
mov ds,ax
disp msg2
lea si,src
lea di,dest
up1:
mov ah,01h
int 21h
mov [si],al
inc cnt
inc si
cmp cnt,05
jne up1
lea si,src
lea di,dest
up2:
mov bl,[si]
mov [di],bl
inc si
inc di
dec cnt
jnz up2
lea si,src
disp msg1
up3:
mov dl,[si]
mov ah,02h
int 21h
inc si
inc cnt
cmp cnt,0Ah
jne up3
mov ah,4ch
int 21h
end main
end
------------------------------------------------OUTPUT-----------------------------------------------
D:\tasm\BIN>edit nov1.asm
D:\tasm\BIN>tasm nov1.asm
Turbo Assembler Version 4.1 Copyright (c) 1988, 1996 Borland International
Assembling file: nov1.asm
Error messages: None
Warning messages: None
Passes: 1
Remaining memory: 451k
D:\tasm\BIN>tlink nov1.obj
Turbo Link Version 7.1.30.1. Copyright (c) 1987, 1996 Borland International
Warning: No stack
D:\tasm\BIN>nov1
Enter the string:Hello
The non overlapping array:HelloHello
D:\tasm\BIN>