datasg segment para 'code' msg1 db 'enter a string:',"$" msg2 db 'inverse string is :',"$" strlist label byte max db 20 len db ? buffer db 20 dup('') dolar db '$' datasg ends codesg segment para 'code' main proc far assume ds:datasg, cs:codesg,ss : stksg mov ax,datasg mov ds,ax ;--------------------------------------------- mov ah,6h mov al,25 mov ch,0 mov cl,0 ;clear screen mov dh,24 mov dl,79 mov bh,7 int 10h ;--------------------------------------------- mov ah,2h mov dh,10 mov dl,30 ;move of cursor mov bh,0 int 10h ;--------------------------------------------- lea dx,msg1 mov ah,9h int 21h ;-------------------------------------------- mov ah,0ah lea dx,strlist ;Enter int 21h ;---------------------------------------------------------- mov ah,2h mov dh,12 mov dl,30 ;move of cursor mov bh,0 int 10h ;--------------------------------------------------------- mov dx,offset msg2 mov ah,9h int 21h ;---------------------------------------------------------- lea bx,buffer mov ch,0 mov cl,len sub cl,1 add bx,cx mov cl,0 P1: mov dl,[bx] mov ah,2h int 21h Inc cl dec bx cmp cl,len jnz p1 mov ax,4c00h int 21h main endp codesg ends end main