La funzione 0Ah dell'INT 21h mi divrebbe permettere di inserire una stringa finchè non premo INVIO...io invece premo INVIO e il programma, magicamente, arriva alla sua conclusione come nn lo so.
Questo è il listato:
codice:
dosseg
.model small
.stack 64
.data
STR1 DB 10 DUP (?)
STR2 DB 10 DUP (?)
INS_STR1 DB 'Inserisci la prima stringa di 8 caratteri ','$'
INS_STR2 DB 10,13,'Inserisci la seconda stringa di 8 caratteri ','$'
MESSAGE1 DB 10,13,'le stringhe sono uguali','$'
MESSAGE2 DB 10,13,'le stinghe non sono uguali','$'
.code
main proc far
mov ax,@data
mov ds,ax
mov es,ax
;***INSERIMENTO STRINGHE***
mov ah,09h
mov dx,offset INS_STR1
int 21h
mov dx,offset STR1
mov ah,0Ah
int 21h
mov ah,09h
mov dx,offset INS_STR2
int 21h
mov dx,offset STR2
mov ah,0ah
int 21h
cld
mov si,offset STR1+2
mov di,offset STR2+2
mov cx,08h
repe cmpsb
je passe
mov dx,offset message2
jmp affichage
passe: mov dx,offset message1
affichage: mov ah,09h
int 21h
mov ax,4c00h
int 21h
main endp
end main
In rosso dove dovrebbe essere fatta la correzione...però ho notato che se tolgo l'istruzione mov dx,offset STR1 il programma mi permette di inserire la stringa, ma poi me la mette nella posizione sbagliata...