YKEY20.DOC 12-04-87 R.Gaspari Yet another function key handler. Source code enclosed. This is a different kind of function key processor. It is designed as an overlay onto a specific application program. Once overlaid, it is read into memory along with the application program at run time. After program execution, it will remove itself during program termination. It will accept either of two types of function keys. "Type 1" is defined as a single byte in the range 80h to FEh. "Type 2" is defined as a two byte sequence of the form ESCAPE-X where X is any ascii character. After trapping the function key, YKEY will replaces that key with a specified fixed length replacement string. The program is designed to look at contiguous bytes. If your first function key is 80h (or ESC-^@), the replacement bytes for that key and for each successive key after that should be placed at KNMTBL. If your first function key is greater, for example 0DBh (or ESC-[), the replacement bytes for that key and for each successive key after that should be placed at KFNTBL. Either or both may be used. I use both. It must be tailored to each program onto which it is appended. Installation steps are discussed below. To demonstrate the procedure a small library of examples is included for: VDE26 IMP245 MBASIC Because it's part of the way I use this overlay, the code used for the resident pop-up clock display is added as part of the overlay. It is designed to trap a "hot-key" and provide a continuous display of the SMT no-slot clock time in the upper right hand corner of the crt screen. ******************************************** INSTALLATION First, use DDT to examine the application program to be overlaid. Look at the size of the program and look at its first three bytes. Using VDE26 as an example, a DDT examination looks as follows: A>DDT VDE.COM Next PC 3100 0100 ; 3100h is the end of the program -d 0100 C3 80 04 .. .. ; the first three bytes are JMP 0480h Second, edit the YKEY overlay. Specify the end of the program. Specify the return to the original program (after YKEY is sent up into high memory). Specify the hardware equates (TYPE1 & CLOCK). Specify your base address KBA. I use either the bdos base or ccp; your bdos base address is the address at 0006h less 6 and can be determined using DDT and (d)isplaying the contents starting at addr 0000h. Lastly, specify your choice of function key replacements. Third, assemble the overlay file using Z80MR.COM (available in the public domain). Fourth and last, use DDT to overlay the resulting HEX file onto the application program. A sample session would be as follows: A>DDT VDE.COM DDT VERS 2.2 NEXT PC 3100 0100 (note again 3100 is the end of VDE.COM) -Iykvde.hex ("Insert" the HEX file into name buffer) -R (overlay the HEX file onto the COM file) NEXT PC 3480 0000 (note that the size has grown to 3480) -^C (return to CP/M) A>SAVE 52 VDE.COM (now have a modified .COM file) Send bug reports and comments to Russell Gaspari, 6656 W. 87th Place, Los Angeles 90045.