
	.model tiny
	.code

; to create the file:
;  TASM <filename>
;  TLINK /TDC <filename>
;  REN <filename>.COM KEYBOARD.CFG
;
; Structure is:
;  Keycode	  (1 byte)
;   Condition	  (1 byte)
;    Return value (1 word)
;   Condition	  (1 byte)
;    Return value (1 word)
;   Condition	  (1 byte)
;    Return value (1 word)
;    .
;    .
;    .
;   0FFh <-- end of condition/return value list
;
; Keycode is the value in the keypress table in IT on Ctrl-F1 (remember the
; values on the keypress table are in HEX..)
;
; Condition is one of the following
;  0 = requires NO Shift/Ctrl/Alt/...,
;  1 = if Shift and key while caps lock OFF *OR* CAPS lock ON, no ctrl/alt
;  2 = if Shift and key while caps lock ON *OR* CAPS lock OFF, no ctrl/alt
;  3 = if Shift
;  4 = if Ctrl
;  5 = if left/right Alt
;  6 = if Left Alt
;  7 = if Right Alt
;  8 = if Numlock on, no ctrl/alt
;  9 = if Numlock off, no ctrl/alt
;  0FFh = end of list.
;
; Return value is the character, or a DOS character value

ORG 100h

FileStart:

FileLength  DW	    Offset EndKeyboardTable - Offset StartKeyboardTable

StartKeyboardTable:

	DB	2	; 1
	 DB	 0
	 DW	 '1'
	 DB	 3	 ; !
	 DW	 '!'
	 DB	 5	 ; |
	 DW	 '|'
	 DB	 0FFh

	DB	3	; 2
	 DB	 0
	 DW	 '2'
	 DB	 3	 ; "
	 DW	 '"'
	 DB	 5	 ; @
	 DW	 '@'
	 DB	 0FFh

	DB	4	; 3
	 DB	 0
	 DW	 '3'
	 DB	 3	 ; ú
	 DW	 'ú'
	 DB	 5	 ; #
	 DW	 '#'
	 DB	 0FFh

	DB	5	; 4
	 DB	 0
	 DW	 '4'
	 DB	 3	 ; $
	 DW	 '$'
	 DB	 5	 ; ~
	 DW	 '~'
	 DB	 0FFh

	DB	6	; 5
	 DB	 0
	 DW	 '5'
	 DB	 3	 ; %
	 DW	 '%'
	 DB	 0FFh

	DB	7	; 6
	 DB	 0
	 DW	 '6'
	 DB	 3	 ; &
	 DW	 '&'
	 DB	 5	 ; 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; .
	 DB	 0
	 DW	 '.'
	 DB	 3	; :
	 DW	 ':'
	 DB	 0FFh

	DB	53	; -
	 DB	 0
	 DW	 '-'
	 DB	 3	; _
	 DW	 '_'
	 DB	 0FFh

	DB	55	; XT/AT printscreen, Enhanced keyboard *
	 DB	 0
	 DW	 '*'
	 DB	 0FFh

	DB	57	; Spacebar
	 DB	 0
	 DW	 ' '
	 DB	 3
	 DW	 ' '
	 DB	0FFh

	DB	71	; Keypad 7
	 DB	 8
	 DW	 '7'
	 DB	 10
	 DW	 7
	 DB	 0FFh

	DB	72	; Keypad 8
	 DB	 8
	 DW	 '8'
	 DB	 10
	 DW	 8
	 DB	 0FFh

	DB	73	; Keypad 9
	 DB	 8
	 DW	 '9'
	 DB	 10
	 DW	 9
	 DB	 0FFh

	DB	74	; Grey -
	 DB	 0
	 DW	 '-'
	 DB	 0FFh

	DB	75	; Keypad 4
	 DB	 8
	 DW	 '4'
	 DB	 10
	 DW	 4
	 DB	 0FFh

	DB	76	; Keypad 5
	 DB	 8
	 DW	 '5'
	 DB	 10
	 DW	 5
	 DB	 0FFh

	DB	77	; Keypad 6
	 DB	 8
	 DW	 '6'
	 DB	 10
	 DW	 6
	 DB	 0FFh

	DB	78	; Grey +
	 DB	 0
	 DW	 '+'
	 DB	 0FFh

	DB	79	; Keypad 1
	 DB	 8
	 DW	 '1'
	 DB	 10
	 DW	 1
	 DB	 0FFh

	DB	80	; Keypad 2
	 DB	 8
	 DW	 '2'
	 DB	 10
	 DW	 2
	 DB	 0FFh

	DB	81	; Keypad 3
	 DB	 8
	 DW	 '3'
	 DB	 10
	 DW	 3
	 DB	 0FFh

	DB	82	; Keypad 0
	 DB	 8
	 DW	 '0'
	 DB	 10
	 DW	 0
	 DB	 0FFh

	DB     86	; <
	 DB	 0
	 DW	 '<'
	 DB	 3	; >
	 DW	 '>'
	 DB	 0FFh

	DB	128+35h ; Grey /
	 DB	 0
	 DW	 '/'
	 DB	 0FFh

	DB	0FFh

EndKeyboardTable:

End	FileStart
