Page 1 of 1

some low level routines

Posted: Fri Jan 24, 2003 1:38 am
by kerim
Does anyone have assembler low level routines for reading a character from keyboard, displaying a character on the screen clearing the keyboard buffer, moving a cursor, etc. 8)

Re:some low level routines

Posted: Fri Jan 24, 2003 2:16 am
by Pype.Clicker
for what environment ? plain hardware ? BIOS ? MS-DOS ?

Re:some low level routines

Posted: Fri Jan 24, 2003 3:52 pm
by distantvoices
mov ax,0xb8000
mov gs,ax
mov [gs:2],'q'

simplest code to put a character on the screen.

Re:some low level routines

Posted: Fri Jan 24, 2003 4:02 pm
by kerim
I said 'low level' which, of course, means hardware level :)

Re:some low level routines

Posted: Sun Jan 26, 2003 3:22 am
by Pype.Clicker
that's because at the lowest level, there's no keyboard buffer...
reading a character from the keyboard is done with

Code: Select all

in al,0x60
cmp al,128
jae .keyup
;; key with scancode <al> pressed
.keyup:
;; key with scancode <al&127> released.
For the cursor (text) placement, check the VGA registers, and mainly the Cathod Ray Tube Controller (CRT controller) registers...
I've seen a reference to it in a 2-weeks old thread called something like "print function" ...

Re:some low level routines

Posted: Mon Jan 27, 2003 2:24 am
by kerim
Are there any texts on the Web dealing with VGA registers and low level VGA programming ?

Re:some low level routines

Posted: Mon Jan 27, 2003 3:08 am
by Pype.Clicker
yep. try google, or search within the forum's archive ...