home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
microcrn
/
issue_43.arc
/
KAYPRO43.ARC
/
KAYPRO.5
< prev
next >
Wrap
Text File
|
1988-07-21
|
5KB
|
164 lines
; Micro Cornucopia issue #43
; Kaypro Column - Figure 5 MAPU.ASM
;***********************************************
;* *
;*THIS SMALL PROGRAM GENERATES A CHARACTER *
;*TRANSLATION TABLE FOR THE KAYPRO CURSOR *
;*KEYS AND THE NUMERIC KEYPAD. IT INSTALLS THE*
;*TABLE INTO THE CP/M BIOS. THE TRANSLATION *
;*WILL REMAIN IN FORCE UNTIL THE NEXT COLD *
;*(NOT WARM) BOOT, OR UNTIL THE COMPLEMENTARY *
;*PROGRAM 'UNMAPU' IS RUN. *
;* *
;*THIS IS A SPECIAL VERSION FOR CP/M 2.2U *
;* *
;***********************************************
SIZE EQU 61 ;CPM SIZE IN K
CBASE EQU SIZE*1024-1C00H;BEGINNING OF CCP
FBASE EQU CBASE + 800H ;BEGINNING OF BDOS
BIOS EQU CBASE + 1600H;BEGINNING OF BIOS
KTAB EQU BIOS+244H;BEGIN OF KEYPAD TABLE
VTAB EQU BIOS+343H;BEGIN OF CURSOR TABLE
ORG 100H
MAPKEY: LXI H, MAP;ADDRESS TRANSLATION TABLE
LXI D, VTAB;ADDRESS CP/M CURSOR TABLE
MVI B, 4 ;SET BYTE COUNT
LOOP1: MOV A, M ;COPY TABLE INTO BIOS
STAX D
INX H
INX D
DCR B
JNZ LOOP1
LXI D, KTAB ;ADDRESS CP/M BIOS TABLE
MVI B, COUNT;SET BYTE COUNT
LOOP2: MOV A, M ;COPY TABLE INTO BIOS
STAX D
INX H
INX D
DCR B
JNZ LOOP2
RET ;RETURN TO CCP
;
; TRANSLATION TABLE FOR CURSOR KEYS
;
MAP: DB 'E'-'@' ;UP ARROW( ^E )
DB 'X'-'@' ;DOWN ARROW( ^X )
DB 'S'-'@' ;LEFT ARROW( ^S )
DB 'D'-'@' ;RIGHT ARROW( ^D )
; TABLE OF COUNTS AND OFFSETS
; THIS TABLE BEGINS THE DATA LOADED INTO THE BIOS.
; DON'T CHANGE THIS TABLE EXPLICITLY. ITS VALUES
; WILL BE ADJUSTED TO MATCH THE CHARACTER TABLE.
KMAP: DB CNT1
DB OFF1
DB CNT2
DB OFF2
DB CNT3
DB OFF3
DB CNT4
DB OFF4
DB CNT5
DB OFF5
DB CNT6
DB OFF6
DB CNT7
DB OFF7
DB CNT8
DB OFF8
DB CNT9
DB OFF9
DB CNT10
DB OFF10
DB CNT11
DB OFF11
DB CNT12
DB OFF12
DB CNT13
DB OFF13
DB CNT14
DB OFF14
;************************************************
;* *
;* FOLLOWING DATA MAY BE CHANGED FOR THE KEYPAD *
;* TRANSLATIONS DESIRED. *
;* *
;************************************************
; BYTE DATA FOR THE MAPS
; CHANGE THIS DATA AS DESIRED FOR THE APPLICATION
; DATA MAY BE ONE OR MORE BYTES PER KEY, AS LONG
; AS TOTAL NUMBER OF BYTES DOES NOT EXCEED 223.
K1: DB 'Q'-'@' ;NUM KEY '0'( ^Q )
K2: DB 'Z'-'@' ;NUM KEY '1'( ^Z )
K3: DB 'C'-'@' ;NUM KEY '2'( ^C )
K4: DB 'B'-'@' ;NUM KEY '3'( ^B )
K5: DB 'A'-'@' ;NUM KEY '4'( ^A )
K6: DB 'L'-'@' ;NUM KEY '5'( ^L )
K7: DB 'F'-'@' ;NUM KEY '6'( ^F )
K8: DB 'W'-'@' ;NUM KEY '7'( ^W )
K9: DB 'R'-'@' ;NUM KEY '8'( ^R )
K10: DB 'T'-'@' ;NUM KEY '9'( ^T )
K11: DB 'Y'-'@' ;NUM KEY '-'( ^Y )
K12: DB 'G'-'@' ;NUM KEY ','( ^G )
K13: DB 'K'-'@' ;NUM KEY 'ENTER'( ^K )
K14: DB 'V'-'@' ;NUM KEY '.'( ^V )
FIN: DS 0 ;DUMMY FOR ADDR CALCS
COUNT EQU FIN - KMAP ;#BYTES TO COPY
;
; BYTE COUNTS FOR TRANSLATIONS
;
CNT1 EQU K2 - K1
CNT2 EQU K3 - K2
CNT3 EQU K4 - K3
CNT4 EQU K5 - K4
CNT5 EQU K6 - K5
CNT6 EQU K7 - K6
CNT7 EQU K8 - K7
CNT8 EQU K9 - K8
CNT9 EQU K10 - K9
CNT10 EQU K11 - K10
CNT11 EQU K12 - K11
CNT12 EQU K13 - K12
CNT13 EQU K14 - K13
CNT14 EQU FIN - K14
;
; OFFSETS FROM BEGINNING OF TABLE
;
OFF1 EQU 01CH
OFF2 EQU OFF1 + CNT1
OFF3 EQU OFF2 + CNT2
OFF4 EQU OFF3 + CNT3
OFF5 EQU OFF4 + CNT4
OFF6 EQU OFF5 + CNT5
OFF7 EQU OFF6 + CNT6
OFF8 EQU OFF7 + CNT7
OFF9 EQU OFF8 + CNT8
OFF10 EQU OFF9 + CNT9
OFF11 EQU OFF10 + CNT10
OFF12 EQU OFF11 + CNT11
OFF13 EQU OFF12 + CNT12
OFF14 EQU OFF13 + CNT13
END