Logo Studenta

ejercicio2 1_3

Esta es una vista previa del archivo. Inicie sesión para ver el archivo original

PILA SEGMENT PARA STACK 'STACK' 
 DB 200 DUP('?') 
PILA ENDS 
;-------------------------------------------
DATOS SEGMENT WORD PUBLIC 'DATA'
Ingresar DB 10,13, 'Ingrese una palabra:$'
Fin DB 10,13, 'Fin del programa.$'
Buffer DB 11,?,10 DUP ('$')
msg1 DB ' El numero de vocales es: $'
DATOS ENDS
;-------------------------------------------
CODIGO SEGMENT WORD PUBLIC 'CODE'
 ASSUME cs:CODIGO, ds:DATOS, ss:PILA
INICIO:
 mov AX, DATOS
 mov DS, AX
 
 mov ah,0Ah
 mov dx,offset buffer
 int 21h
 
 mov cx,10
 mov si,offset buffer+2
 mov bl,0
 
COUNT_VOWELS: ;Conteo de las vocales 
 mov al, [si]
 cmp al, 'a'
 jl not_vowel
 cmp al, 'z'
 jg not_vowel
 cmp al, 'a'
 je is_vowel
 cmp al, 'e'
 je is_vowel
 cmp al, 'i'
 je is_vowel
 cmp al, 'o'
 je is_vowel
 cmp al, 'u'
 je is_vowel
NOT_VOWEL: ;No vocales 
 inc si
 loop count_vowels
 jmp end_count
IS_VOWEL: ;Son vocales 
 inc bl
 inc si
 loop count_vowels
END_COUNT: ;fin de recuento
 mov ah, 09h
 lea dx, msg1
 int 21h
 mov dl, bl
 add dl, '0'
 mov ah, 02h
 int 21h
 mov ah, 4Ch
 int 21h
 
 mov AH,4Ch
 int 21h
 
CODIGO ENDS
end INICIO

Continuar navegando

Materiales relacionados

20 pag.
3063

I E De Santander

User badge image

Cultura Digital 34879

31 pag.
PORTAFOLIO U2-1-31

Progreso

User badge image

Anónimo Xd

6 pag.
5 pag.
ADA 1 3 Presentación electrónica

SIN SIGLA

User badge image

seeeeeeeeeeeeeeeeeeeeef