Documentos de Académico
Documentos de Profesional
Documentos de Cultura
mov ah,02h
mov dl,30h
print: int 21h
inc dl
cmp dl,39h
jbe print
mov ah,4Ch
int 21h
*Imprimir los n�meros del A al Z (codigo ascci)
mov ah,02h
mov dl,41h
print: int 21h
inc dl
cmp dl,5Ah
jbe print
mov ah,4Ch
int 21h
mov ax,0Ah
mov dl,02h
div dl
CL -> i
CH -> c
bl -> n
*Muestra 1 si es primo 0 si no es en,el resultado en [0000h]
n = ingresado
c = 0
for (i=1;i<=n;i++){
if(n%i==0){
c++;
}
}
if(c<=){
es primo
}else{
no es primo
}
mov bl,02h
mov ch,00h
mov cl,01h
bucle: cmp cl,bl
ja finbucle
mov al,bl
mov dl,cl
div dl
inc cl
cmp ah,0
jne bucle
inc ch
jmp bucle
finbucle: cmp ch,02h
ja no
mov [00],1h
jmp fin
no: mov [00],0h
fin: mov ah,4Ch
int 21h
MOV AH,0Ah
MOV DX,0Ah
MOV SI,DX
MOV [SI],29h
INT 21h
INC SI
MOV BH,0
MOV BL,[SI]
ADD SI,BX
INC SI
MOV [SI],24h
MOV AH,09h
INT 21h
MOV AH,4Ch
INT 21h