;Copyright (C) 1996 Donald Bindner ; ;This program is free software; you can redistribute it and/or ;modify it under the terms of the GNU General Public License ;as published by the Free Software Foundation; either version 2 ;of the License, or (at your option) any later version. ; %define offset ; ORG in PSP to pick up the envseg equ 2Ch ; Environment Segment. org 100h ; ORG for all COM programs. jmp main dvorak_disabled db 0 ; flag to disable this program ;************************ data for keyboard translation orig_table db 12*2, 13*2 db 16*2,17*2,18*2,19*2,20*2,21*2,22*2,23*2,24*2,25*2,26*2,27*2 db 30*2,31*2,32*2,33*2,34*2,35*2,36*2,37*2,38*2,39*2,40*2 db 44*2,45*2,46*2,47*2,48*2,49*2,50*2,51*2,52*2,53*2 table_size equ $ - offset orig_table new_table db 26*2,27*2 db 40*2,51*2,52*2,25*2,21*2,33*2,34*2,46*2,19*2,38*2,53*2,13*2 db 30*2,24*2,18*2,22*2,23*2,32*2,35*2,20*2,49*2,31*2,12*2 db 39*2,16*2,36*2,37*2,45*2,48*2,50*2,17*2,47*2,44*2 ; This is the layout given by the table above. ; [ ] ; ' , . p y f g c r l / = ; a o e u i d h t n s - ; ; q j k x b m w v z reset_15h: ; required for protocol header retf int15h4Fh: ; ; Exit: al changed to simulate keys in Dvorak layout ; carry set ; ;**************************************** Interrupt sharing protocol header jmp short .H0 ; jump to actual start of handler .old_Int15h dd 0 ; address of next handler in chain dw 424Bh ; signature db 00h ; EOI flag jmp short reset_15h ; hardware reset routine times 7 db 0 ; reserved ;**************************************** End of header .H0: pushf cmp ah,4Fh ; is it our function? jne .Q0 ; if not do old function test byte [cs:dvorak_disabled], 0FFh ; if not disabled do our function jz .L1 .Q0: ; exit to old routine popf jmp far [cs:.old_Int15h] ; otherwise just continue .L1: ; search the key-table for a command ; AL = key ; push cx ; save anything we change push di push es shl ax, 1 ; save break bit in carry flag ; note, there is room in ax for this mov cx, cs mov es, cx ; set es to segment of key table mov di, offset orig_table ; and di to offset mov cx, table_size cld ; search forward repne scasb ; do the search jne .L99 ; if not found just exit add di, byte table_size-1 ; loc of replacement key scancode mov al, [es:di] ; and do the replacement .L99: shr ax, 1 ; get back break bit pop es pop di pop cx jmp short .Q0 ; do old routine