1
I have the variable:
simbolo db "0 $"
and I also have the following function::
read_keyboard:
mov ah, 1
int 21h
ret
Which is a simple interruption that reads from the telado, and saves what was read in AH.
My problem is: how do I load the content of AH (keyboard read) in my variable symbol?
have tried:
mov simbolo, [AH]
and also
lea simbolo, AH
And I didn’t succeed.
Thank you very much @Gomiero, everything worked out. But I read in some places saying that the interruption should be done the way I did, using in the first line the
mov ah, 1
. Could you explain to me why I should use this line? Since what is read is stored inAL
.– D_Alves
@You’re welcome! The value in the register
AH
, setate before of the interrupt call, corresponds to the function that will be called. After the interruption, the result is obtained in the registerAL
. Each DOS function has a number (always placed inAH
) and can: receive parameters and/or return results in other registers. Here is a link (in English) with the list of calls, parameters and returns: http://stanislavs.org/helppc/int_21.html– Gomiero