Ok, so I was working on some CPU code to make a simple keyboard out of buttons and have it type letters out on the console.
The way I have it working, it' really bulky code-wise, is that I have each letter under it's own call procedure. There's also a set of buttons with values 1-9 (a-i until I get it working, then a-z)
It works like a charm, except for the fact that every letter just replaces the previous...
SO... my question is, how do you get the letter to move over to the next space before putting it down.
Heres a sample out of my code, it basically just repeats for all the letters.
Code:
DATA;
messagea:**//macro a
db 'A ',0;
messageb:**//macro b
db 'B ',0;
WriteStringa:**//draw
**mov eax,65536;
**AWriteLoopa:
****cmp #esi,0;
****je AEnda;
****mov #eax,#esi;
****inc eax;
****mov #eax,edx;
****inc eax;
****inc esi;
**jmp AWriteLoopa;
**AEnda:
**ret
CODE;
**mainloop:
**mov ecx,port0;
**cmp ecx,1; // if port 0 = 1
**je drawa;**// then draw A (goto label)
**cmp ecx,2;
**je drawb;
**jmp mainloop;
drawa: // call the Draw A procedure
**mov esi,messagea;
**mov edx,000999;
**call WriteStringa;
**jmp mainloop;
drawb:
**mov esi,messageb;
**mov edx,000999;
**call WriteStringa;
**jmp mainloop;
Bookmarks