Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site batcomputer.TN.CORNELL.EDU Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!tektronix!uw-beaver!bullwinkle!batcomputer!braner From: braner@batcomputer.TN.CORNELL.EDU (braner) Newsgroups: net.micro.atari16 Subject: Re: keypad probem ,need vt100 for ST Message-ID: <396@batcomputer.TN.CORNELL.EDU> Date: Fri, 6-Jun-86 13:43:13 EDT Article-I.D.: batcompu.396 Posted: Fri Jun 6 13:43:13 1986 Date-Received: Sun, 8-Jun-86 05:54:59 EDT References: <8605162146.AA21671@ucbvax.Berkeley.EDU> <343@batcomputer.TN.CORNELL.EDU> Reply-To: braner@batcomputer.UUCP (braner) Organization: Theory Center, Cornell University, Ithaca NY Lines: 114 [] * This is the assembly source for the program that installs * keyboard conversion tables. * The table is read from a binary file 384 bytes long. .xdef _main _main: bra SK * Space for keyboard tables even US ds.b 128 SH ds.b 128 CL ds.b 128 TT dc.b 27,"E" dc.b 13,10,"+--------------------------+" dc.b 13,10,"| SET-KEYBOARD PROGRAM |" dc.b 13,10,"| |" dc.b 13,10,"| by Moshe Braner, 8605 |" dc.b 13,10,"+--------------------------+" dc.b 13,10 dc.b 13,10,"Name of .ktb file: (RETURN for sys) _" dc.b 8, 0 even * get file name from user SK move.l A0,-(SP) * save registers move.l D0,-(SP) pea TT(PC) * push addr of title move.w #9,-(SP) * code of PRINT LINE trap #1 * call GEMDOS addq.l #6,SP lea FL(PC),A0 move.b #40,(A0) * max no. of chars to input... pea FL(PC) * into filename buffer... move.w #10,-(SP) * using READLINE() function... trap #1 * of GEMDOS addq.l #6,SP tst.b D0 * any input? bne S1 * - then do it, * exit program S0 move.w #24,-(SP) * else... trap #14 * restore system kbd table... addq.l #2,SP move.l (SP)+,D0 * restore registers... move.l (SP)+,A0 clr.w -(SP) * and return to GEMDOS trap #1 * read data file S1 lea FN(PC),A0 * use input length to put a clr.b #0(A0,D0) * 0 at end of filename clr.w -(SP) * open file for read only pea FN(PC) * using given filename move.w #$3D,-(SP) trap #1 * OPEN() addq.l #8,SP tst.w D0 bmi S0 * exit upon error lea FH(PC),A0 move.w D0,(A0) * save file handle pea US(PC) * read into table area move.l #$180,-(SP) * a complete keyboard table move.w D0,-(SP) * from this file move.w #$3F,-(SP) trap #1 * READ() adda.l #12,SP lea FE(PC),A0 move.w D0,(A0) * save error code lea FH(PC),A0 move.w (A0),-(SP) * push file handle move.w #$3E,-(SP) trap #1 * CLOSE() addq.l #4,SP tst.w D0 * exit upon error in... bmi S0 * closing or... move.w FE(PC),D0 * reading tst.w D0 bmi S0 * install new table pointers pea CL(PC) * new keyboard tables pea SH(PC) pea US(PC) move.w #16,-(SP) * code of keytbl() trap #14 adda.l #14,SP * exit but leave table resident move.l (SP)+,D0 * restore registers... move.l (SP)+,A0 move.w #0,-(SP) * no-error code move.l #$400,-(SP) * save this much stuff move.w #$31,-(SP) * code for KEEP PROCESS trap #1 * return to GEMDOS * File handle, error_code, name_len & name buffers even FH ds.w 1 FE ds.w 1 FL ds.b 2 FN ds.b 40 * - Moshe Braner, Cornell, 607-255-3498