[comp.binaries.ibm.pc.d] Keyboard "fix" TSRs

AHS%psuvm.bitnet@rutgers.edu (06/19/88)

Tom Almy, toma@tekgvs.TEK.COM, writes of his set of KBD*.com programs:

        All of these [AT only] programs were written by me, using the CFORTH
        Forth Compiler, and are placed in public domain for the benefit of
        other PC users who are frustrated with these keyboard designs.

        I am not supplying sources, the programs are small enough that DEBUG
        can be used to reverse-engineer them.

        Tom Almy
        toma@tekgvs.TEK.COM
-----------------------------------


I attempted a dissassembly of:

         KBDL     COM      332   6-15-88   7:03a

I include the dissassembly below.  The dissassembled code is logically
consistent in its jumps, calls, reads, and writes, but is very strange.  The
resulting flow is very simple, yet this dissassembled code is so strange that I
wonder.....  Further, the file KBDL.COM contains several CD 21 op-codes but
contains *no* CD 27 or CD 31 op-codes which are *necessary* to terminate and
stay resident.  Is it Forth, is it Almy, is it me.....  I don't know, I don't
have an AT to try it (if I would still dare try it).



TITLE   KBDL

RET_NEAR MACRO
DB	0C3H
ENDM

.RADIX	16


S0000	SEGMENT
	ASSUME DS:S0000, SS:S0000 ,CS:S0000 ,ES:S0000
        ORG     0100H


L0100:  JMP     L010B

;The following DB are bytes unused by the program
        DB      4C,2

L0105   DW      0000

L0107   DW      0000,000A

L010B:  MOV     SP, FF9A
        MOV     WORD PTR L0105, FF98
        MOV     BP, FFFE
        MOV     L0107,BP
        CLD
        CALL    L017F
        MOV     AX, 4C00   ;Terminate *normally* with exit code of 00
        INT     21

;The following DB's are bytes unused by the program
        DW      L0000
        DW      L0000
        DB      80,0FC,4F,75,2DH
        DB      3C,3A,75,1A,6
        DB      2E,8E,6,7E,0
        DB      26,0F6,6,17,4
        DB      2,75,2,0B0,1DH
        DB      0A2,7DH,0,7,0F9
        DB      2E,0FF,2E,80,0
        DB      3C,0BA,75,0BH,0A0
        DB      7DH,0,4,80,0F9
        DB      2E,0FF,2E,80,0
        DB      0F9,2E,0FF,2E,80
        DB      0,5E,58,5A,5BH
        DB      1E,8E,0DBH,0B4,25
        DB      0CDH,21,1F,0FF,0E6
        DB      0B4,35,0CDH,21,89
        DB      0D8,8C,2 DUP(0C3),0BA
        DB      0C,0,0B8,0,31
        DB      0CDH,21

L017F:  CALL    L01FE

;The following DB's are bytes unused by the program
        DB      33,43,41,50,53
        DB      4C,4F,43,4BH,20
        DB      2DH,3E,20,43,54
        DB      52,4C,2C,2 DUP(20),4C
        DB      45,46,54,53,48
        DB      49,46,54,20,2BH
        DB      20,43,41,50,53
        DB      4C,4F,43,4BH,20
        DB      2DH,3E,20,43,41
        DB      50
        DB      53,4C,4F,43,4BH
        DB      0E8,57,0,0E8,42
        DB      0
        DB      0BH,42,79,20,54
        DB      6F,6DH,20,41,6C
        DB      6DH,79,0E8,45,0
        DB      0C7,6,7E,0
        DW      L0000
        DB      0B8,15,0,0E8,97
        DB      0FF,0A3,24,1,89
        DB      1E,26,1,0BA,24
        DB      1,52,0BA,80,0
        DB      52,0BA,3C,0,52
        DB      0E8,51,0,8C,0C8
        DB      50,0BA,84,0,52
        DB      0BA,15,0,52,0E8
        DB      65,0FF,0E9,79,0FF

L01FE:  POP     BX
        MOV     AL,[BX]
        XOR     AH,AH
        INC     BX
        PUSH    BX
        PUSH    AX
        ADD     BX,AX
        POP     AX
        POP     DX
        PUSH    BX
        MOV     BX,DX
        JMP     L0231

;The following DB's are bytes unused by the program
        DB      0B8,0DH,0,0E8,9
        DB      0,0B8,0A,0,0E9
        DB      3,0


L021C   DB      1,2 DUP(0)

;The following DB's are bytes unused by the program
        DB      0A2
        DB      1E,2,0B4,40,0B9
        DB      1,0,0BA,1E,2
        DB      8BH,1E,1C,2,0CDH
        DB      21,0C3

L0231:  MOV     CX,AX
        MOV     DX,BX
        MOV     BX,L021C
        MOV     AH,40      ;Write to device having the handle 0100
        INT     21
        RET_NEAR

;The following DB's are bytes unused by the program
        DB      5BH,59,5F,5E,0E3
        DB      6,8C,0D8,8E,0C0
        DB      0F3,0A4,0FF,0E3

	S0000	ENDS
;
END	L0100

--end