Ciao a tutti, ho un problema su un esercizio, uso come programma l'emu 8086
La traccia mi chiede di acquisire il mio nome da tastiera e memorizzarlo nel vettore NOME.
Ho provato in questo modo:
; multi-segment executable file template.
data segment
DIM EQU 10
NOME db 0
; add your data here!
pkey db "press any key...$"
ends
stack segment
dw 128 dup(0)
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
mov ax, 0
mov cx, 10
mov si, 0
ciclo: mov ah, 1
int 21h
mov NOME[si], al
inc si
loop ciclo
; add your code here
lea dx, pkey
mov ah, 9
int 21h ; output string at ds:dx
; wait for any key....
mov ah, 1
int 21h
mov ax, 4c00h ; exit to operating system.
int 21h
ends
end start ; set entry point and stop the assembler.
In questo modo dopo aver eseguito , riesco ad acquisire il nome, però mi escono dopo il nome alcune lettere ripetute, che sostituiscono in parte la scritta "press any key" , in questo modo: http://i46.tinypic.com/hvze68.jpg
come posso risolvere?

Rispondi quotando