[comp.sys.ibm.pc] Help needed with keyboard mapping

silvert@dalcs.UUCP (Bill Silvert) (01/31/89)

I would appreciate help with reading a single character from the
keyboard.  I can do this with N. American keyboards, but on the German
keyboard the Y and Z are interchanged and I get the wrong value.

Here is the subroutine I use (I don't actually use a PC, so this may be
a poorly coded routine -- be understanding!) -- this is for MASM:

.CODE
	PUBLIC Getkey
Getkey	PROC
	push	bp
	mov	bp,sp
	les	bx,[bp+6]	; load address of argument into BX and ES
	mov	ah,01h		; function 1
	int	21h		; the byte returned is in AL
	mov	es:[bx],al	; copy contents of AL to argument
	pop	bp
	ret	4		; 4-byte address on stack
Getkey	ENDP

	END

Obviously function 1 is not the one I want, but the documentation I've
seen isn't very clear about how to use the keyboard mapping.  Since I
don't have access to a German PC, I can't do any experimenting and would
like a tested solution (this is for use in an ecological simulation
package which is used worldwide, and I've gotten reports of this problem
from Germany -- it is a non-commercial package, we don't sell it, so
please no flames).

-- 
Bill Silvert, Habitat Ecology Division.
Bedford Institute of Oceanography, Dartmouth, NS, Canada B2Y 4A2
	UUCP: ...!{uunet,utai,watmath}!dalcs!biomel!bill
	CDN: biomel@cs.dal.CDN	BITNET: bs%dalcs@dalac.BITNET