I have a variable called char that is supposed to change his value to a keyboard key when I press that key. I visited How to change the value of a variable in assembly and it said for I to use mov char, key_value
. The problem is that I got terminal.asm:126: error: invalid combination of opcode and operands
. Searching for the solution online I saw that is necessary to put brackets [ ]. I tried that and the same error occurred.
Here it is a part of my file:
printChar:
mov edx, char;
loop5_terminal:
mov al, [edx];
mov byte [edi], al;
inc edi;
inc edi;
inc edx;
inc ebx
call cursor_terminal
cmp byte[edx],0;
jne loop5_terminal;
jne l2_terminal
l2_terminal:
cmp al , 0x03 ; Checks for key 2 input
mov char, [two]
je printChar
Thanks.