.model small
disp macro a
mov ah,09h
lea dx,a
int 21h
endm
.data
msg1 db 10,13,10,13,"The Overlapping array is:$"
msg2 db 10,13,10,13,"Enter 5 characters:$"
src db 05h dup(0)
dest db 05h dup(0)
cnt db 00h
.code
main:
mov ax,@data
mov ds,ax
lea SI,src
lea DI,dest
disp msg2
up:
mov ah,01h
int 21h
mov [SI],al
inc SI
inc cnt
cmp cnt,05
jne up
lea SI,src
add SI,0004
lea DI,dest
add DI,0001
disp msg1
up1:
mov bl,[SI]
mov [DI],bl
dec SI
dec DI
dec cnt
jnz up1
lea SI,src
mov cnt,00h
l1:
mov dl,[SI]
mov ah,02h
int 21h
inc SI
inc cnt
cmp cnt,0AH
jne l1
mov ah,4ch
int 21h
end main
end
disp macro a
mov ah,09h
lea dx,a
int 21h
endm
.data
msg1 db 10,13,10,13,"The Overlapping array is:$"
msg2 db 10,13,10,13,"Enter 5 characters:$"
src db 05h dup(0)
dest db 05h dup(0)
cnt db 00h
.code
main:
mov ax,@data
mov ds,ax
lea SI,src
lea DI,dest
disp msg2
up:
mov ah,01h
int 21h
mov [SI],al
inc SI
inc cnt
cmp cnt,05
jne up
lea SI,src
add SI,0004
lea DI,dest
add DI,0001
disp msg1
up1:
mov bl,[SI]
mov [DI],bl
dec SI
dec DI
dec cnt
jnz up1
lea SI,src
mov cnt,00h
l1:
mov dl,[SI]
mov ah,02h
int 21h
inc SI
inc cnt
cmp cnt,0AH
jne l1
mov ah,4ch
int 21h
end main
end
-----------------------------------------------OUTPUT-----------------------------------------------
D:\tasm\BIN>edit ov1.asm
D:\tasm\BIN>tasm ov1.asm
Turbo Assembler Version 4.1 Copyright (c) 1988, 1996 Borland International
Assembling file: ov1.asm
Error messages: None
Warning messages: None
Passes: 1
Remaining memory: 451k
D:\tasm\BIN>tlink ov1.obj
Turbo Link Version 7.1.30.1. Copyright (c) 1987, 1996 Borland International
Warning: No stack
D:\tasm\BIN>ov1
Enter 5 characters:Hello
The Overlapping array is:HeHello
D:\tasm\BIN>