este programa duplica la palbra al dar enter

duplicar palabra

este programa duplica la palbra al dar enter

Búsqueda de ejemplos en Ensamblador
;Autor ricardo hernandez torre
;URL richarhernandez.blogspot.com

gotoab macro fil,col
   mov ah,02h         ; peticion para colocar el cursor
   mov bh,00          ; numero de pagina de video 0
   mov dh,fil         ; renglon
   mov dl,col         ; columna
   int 10h            ; llamada a la interrupcion de video BIOS
endm

.model small
.stack
.data

cad db 20 dup(' '),'$'
nom db 40 dup(' '),'$'
dom db 30 dup(' '),'$'
ciudad db 15 dup(' '),'$'
tel db 10 dup(' '),'$'

.code
.startup
lee_cad proto c, cadena:ptr byte,cuantos:ptr byte
imprime proto c, direc: ptr byte
gotoxy proto c, fil: byte,col: byte
cambia proto c, fi:byte,ci:byte,ff:byte,cf:byte

call limpiar
invoke gotoxy, 10,10
invoke lee_cad, addr nom, 40
invoke gotoxy, 11,10
invoke lee_cad, addr dom, 30
invoke gotoxy, 12,10
invoke lee_cad, addr ciudad, 15
invoke gotoxy, 13,10
invoke lee_cad, addr tel, 10

invoke gotoxy, 14,10
invoke imprime, addr nom
invoke gotoxy, 15,10
invoke imprime, addr dom
invoke gotoxy, 16,10
invoke imprime, addr ciudad
invoke gotoxy, 17,10
invoke imprime, addr tel

;invoke cambia, 1,1,24,79

.exit

gotoxy proc c, fil:byte,col: byte
  ; mov ah,02h         ; peticion para colocar el cursor
  ; mov bh,00          ; numero de pagina de video 0
  ; mov dh,fil         ; renglon
  ; mov dl,col         ; columna
  ; int 10h            ; llamada a la interrupcion de video BIOS
  gotoab fil,col
   ret
gotoxy endp


;lee la cadena, el parametro cuantos indica cuantos lee.
lee_cad proc c, cadena:ptr byte, cuantos:ptr byte
mov SI,cadena
mov cX,0
.repeat
 mov ah,01h
 int 21h
 .If al != 13
  mov [SI],al
  inc SI
  inc cX
 .EndIf
.until (cX==cuantos) || (al==13)
ret
lee_cad endp

imprime proc c, direc:ptr byte
        mov ah,09h
        mov DX,direc          
        int 21h
        RET
imprime endp





limpiar proc
mov ah,00h
mov al,03h
int 10h
ret
limpiar endp

cambia proc c, fi:byte,ci:byte,ff:byte,cf:byte
mov ah,06h
mov al,00
mov bh,54h
mov ch,fi
mov cl,ci
mov dh,ff
mov dl,cf
int 10h
ret
cambia endp

end