LOGO
General Discussion Undecided where to post - do it here.

Reply to Thread New Thread
Old 12-18-2006, 10:03 AM   #1
Fdmnrnba

Join Date
Oct 2005
Posts
478
Senior Member
Default Quick PC Assembly langue question
I ran the program in debug. The value I got was zero for both up and down keys. I have an ASCII table of values and it did not work when I use it in the program
Fdmnrnba is offline


Old 12-18-2006, 11:23 AM   #2
stastony

Join Date
Oct 2005
Posts
477
Senior Member
Default
I´ve done my fair share of PC Assembly, all you need is a screwdriver really...
stastony is offline


Old 12-18-2006, 06:14 PM   #3
LSg44PDu

Join Date
Oct 2005
Posts
440
Senior Member
Default
Right now since I cant figure this out, I am using the w key for up and the s key for down.
LSg44PDu is offline


Old 12-18-2006, 07:31 PM   #4
dwestemesse

Join Date
Oct 2005
Posts
478
Senior Member
Default
Here is a short sample of the code I am using:

Code:
Code
mov ah,01h  ;using 1h so that the program does not wait for key to be pressed, it is only checking to see if it is int 16h ;do the interrupt 	 jz mainloop ;Zero flag is set if no key is pressed  ;go on to check what key was pressed and process input

dwestemesse is offline


Old 12-19-2006, 10:21 AM   #5
kubekniekubek

Join Date
Oct 2005
Posts
701
Senior Member
Default
Originally posted by Dr. A. Cula
I found some (rather sketchy) doc that seems to confirm that int 0x16, function 0x01 returns 0 in AL for function keys (http://www.htl-steyr.ac.at/~morg/pci...s/inte1at0.htm).

But it also says that AH contains that key's scan code and I think you should use that if AL is 0. Here is a list of keyboard scan codes: http://www.cs.cmu.edu/afs/cs/user/ra...WWW/files.html (I found it in the part A archive, in the INTERRUP.A file). Also see the INTERRUP.D file for some more info on int 0x16. I will try that, thanks.
kubekniekubek is offline


Old 12-20-2006, 12:05 AM   #6
jenilopaz

Join Date
Oct 2005
Posts
399
Senior Member
Default
I'm quite sure you need to check a second value for function keys like the arrow keys. I don't know assembly at all, but I know that in BASIC and other languages that pick up ASCII for arrow keys, you get a 0 and then another value for keyboards (appears visually with a ^, like ^M for enter).
jenilopaz is offline


Old 12-20-2006, 12:58 AM   #7
gogona

Join Date
Oct 2005
Posts
420
Senior Member
Default
I just put it into my program and it works perfect.
gogona is offline



Reply to Thread New Thread

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

All times are GMT +1. The time now is 09:14 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 PL2
Design & Developed by Amodity.com
Copyright© Amodity