我有问题。我必须在 8086 汇编中编写一个程序来用字符串填充数组,然后只打印出字符“a、A、e、E、i、I、o、O、u、U”。
我已经成功打印出数组中的每个字符,但是当我开始添加条件和跳转时,我的程序就进入了一个无限循环:(
这是整个代码:
org 100h
jmp main
;messsages to be shown:
msg1 db 'this is an example program.', 10, 13, 'made to show only the vocal letters of a string', 10, 13, 'write some words', 10, 10, 13, '$'
msg2 db 10, 10, 13, 'your phrase:', 10, 10, 13, '$'
;variables
aux db 0
vct dw 0
;program start
main:
lea dx, msg1
mov ah, 09h
int 21h
mov cx, 20
ingresarNumero:
mov ah, 08h
int 21h
cmp al, 08h
je borrar
cmp al, 0Dh
je enter
cmp al, 20h
je enter
mov ah, 0Eh
int 10h
mov ah, 0
mov vct[si], ax
inc si
loop ingresarNumero
ultimaPosicion:
mov ah, 08h
int 21h
cmp al, 08h
je borrar
cmp al, 0Dh
je finIngreso
jmp ultimaPosicion
borrar:
cmp cx, 20
je ingresarNumero
mov ah, 0Eh
int 10h
mov al, 0
int 10h
mov al, 8
int 10h
pop ax
inc cx
dec si
jmp ingresarNumero
enter:
cmp cx, 20
je ingresarNumero
jmp finIngreso
finIngreso:
lea dx, msg2
mov ah, 09h
int 21h
push cx
mov cx, si
mov si, 0
superloop:
mov ax, vct[si]
mov ah, 0Eh
int 10h
inc si
loop superloop
ret