Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Do While
Do While
Carrera de Informática
Programa 1: do while
.model small
.stack 64
.data
.code
inicio proc
mov ax,@data
mov ds,ax
mov bl,90
Programa 3: do while
do:
mov ah,2
mov dl,bl
int 21h
mov dl,"_"
int 21h
dec bl
while:
cmp bl,65
jne do
findowhile:
mov ah,4ch
int 21h
inicio endp
end
Programa 2:Contar palabras
.MODEL SMALL
.CODE
ORG 100H
main:
JMP inicio
FRASE db "EL respeto al derecho ajeno es la paz $"
nlindb 10,13,"Nro. de palabras: $"
npdb 0
Programa 2:Contar palabras
Inicio:
LEA BX,FRASE
MOV DI,0
MOV DX,BX
MOV AH,9
INT 21H
bucle:
MOV dl,[bx+di]
CMP dl,32 ; ascci de espacio 32
JE cpal
CMP dl,’$’
JE fin
INC di
JMP bucle
Programa 2:Contar palabras
cpal:
INC di
INC np
JMP bucle
fin:
MOV ah,9
LEA dx,nlin
INT 21h
MOV dl,np
ADD dl,30h
MOV ah,2
INT 21h
MOV ah,4ch
INT 21h
End main
Práctica