flat assembler
Message board for the users of flat assembler.
Index
> DOS > I want to flush keys from keyboard buffer |
Author |
|
ASHLEY4 13 Jul 2004, 02:27
Hi ,If i get what you mean, you do not want to use int 21h because you want to boot your game from a floppy (eg: dos is not on the floppy)?.
If so here is the code to "set int vector" & "get int vector" with out useing Dos int's. Code: ;----------------------------------------------------------------------------; set interrupt vector_func25: ; cmp al, 19h ; do not allow to change int 19h (for rebooting) ; je near int21_error cli xor ah, ah shl ax, 2 push si push bx push es mov si, ax xor bx, bx mov es, bx mov word [es:si], dx ; offset mov bx, ds mov word [es:si+2], bx ; segment pop es pop bx pop si sti jmp int21_exit;----------------------------------------------------------------------------; get interrupt vector_func35: push ds push si xor ah, ah shl ax, 2 mov si, ax xor bx, bx mov ds, bx ; DS = 0 mov bx, word [ds:si+2] ; segment push bx mov bx, word [ds:si] ; offset pop es ; get segment pop si pop ds jmp int21_exit;-------------------------------------------------------------------------- int21_exit: ret;---------------------------------------------------------------------------- If you want a good keyboard handler, take a look at my game here: http://www.falconrybells.co.uk/ get the zip file called "pong.zip" you can do multiple key press, with the keyboard handler. ASHLEY4. |
|||
13 Jul 2004, 02:27 |
|
vid 13 Jul 2004, 19:17
i think you want to flush bios buffer. There is a functions which reads key from buffer without removing it, and if there is none it doesn't (!) wait. Use that one to find if there is some key in BIOS buffer and while there is any, use normal BIOS read key to remove it.
I don't recall numbers of these services, but you can easily find them in any list. |
|||
13 Jul 2004, 19:17 |
|
Matrix 09 Sep 2004, 17:26
i will help you
Code: clearkey: ;Clears keystroke buffer directly ( $0040:$001A := $0040:$001C ) push ds push es mov ax,$40 mov es,ax mov ds,ax mov di,$1a mov si,$1c movsw pop es pop ds ret here are some more codes : http://board.flatassembler.net/topic.php?t=2186 MATRIX |
|||
09 Sep 2004, 17:26 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.