📄 smckxl.asm
字号:
;
; PS2WatchExt - Check if External PS/2 Devices still attached.
; WatchPortX - Check if device is still attached to PS/2 Port.
; WatchExtKbd - Check if Keyboard is still attached.
; WatchExtAux - Check if Aux in Legacy mode is still attached.
;
; Section 32.3
;
; PortXPlugDetect - External Device was Detected being plugged in.
; ExtKbdPlugIn - External Keyboard was detected being plugged in.
; ExtAuxPlugIn - External Mouse was detected being plugged in.
; ExtAuxRemoved - External Mouse was detected being removed.
;
; Section 32.4
;
; RestoreKbd - Restore Keyboard state from Internal Keyboard.
; ResetAllAux - Reset Aux devices.
; RestoreAllAux - Restore Aux devices state from RAM variables.
; FlushAllAux - Flush Aux Devices.
; Section 33.0
;
; Command1PortX - Send Command OR Data byte to PS/2 device.
; Command2PortX - Send Command AND Data byte to PS/2 device.
;
; Section 33.1
;
; Send2PortX - Serial transmission to PS/2 device.
; Wait4PortX - Wait for PS/2 device response, then receive byte.
; FlushPortX - Wait for data frm PS/2 device, then receive byte.
; ReceivePortX - Serial transmission from PS/2 device.
; PS2TimeOut - PS/2 Interface time-out service.
; SetXmtTmoPX - Setaup Timeout flags for transmission to device.
; SetRcvTmoPX - Setaup Timeout flags for receiving from device.
;
; Section 33.2
;
; Send2Port0 - Serial transmission to PS/2 Port0.
; Send2Port1 - Serial transmission to PS/2 Port1.
; Send2Port2 - Serial transmission to PS/2 Port2.
;
; Section 33.3
;
; Wait4Port0 - Wait PS/2 Port0 device response,then receive byte.
; Wait4Port1 - Wait PS/2 Port1 device response,then receive byte.
; Wait4Port2 - Wait PS/2 Port2 device response,then receive byte.
; Port0Start - Start transmission from PS/2 Port0
; Port1Start - Start transmission from PS/2 Port1
; Port2Start - Start transmission from PS/2 Port2
;
; Section 33.4
;
; DevicesActive - Make Kbd/Aux interfaces active.
; DevicesInactive - Make Kbd/Aux interfaces inactive.
; Section 34.0
;
; ChkAuxMux - Check AUX Muxed Mode (de)/activation squences.
; SwtAux2Mux - Switch to Aux Multiplexed Mode.
; SwtAux2RvLgc - Switch to Reverted Legacy Mode.
; Cmd90_2Aux0 - Aux 0 Device command (not supported).
; Cmd91_2Aux1 - Aux 1 Device command (PS/2 Port 0).
; Cmd92_2Aux2 - Aux 2 Device command (PS/2 Port 1).
; Cmd93_2Aux3 - Aux 3 Device command (PS/2 Port 2).
; Process_MuxCmds - Process Aux command in Multiplexing mode.
; CmdA7_A8Mux - Proces Multiplexing Aux enable/disable commands.
; WatchAuxMux - Check if Aux Mux Device is still attached.
; Section 50.0
;
; Code_End: - end of the code space
;
;-------------------- END TABLE OF CONTENTS ---------------------------------
;--------------- BEGIN VARIABLES MAP ----------------------------------------
;
; INDEX bit7=0:
; Physical RAM Notes
; Address
;
; I 000h-07Fh Most Common MK Variables
;
; INDEX bit7=1:
;
; KSTATE9.4-3: RAM Physical RAM Notes
; KSTATE5.6-4 Bank# Address
; 00000 0 I 080h-0FFh Scan Matrix in this bank
; 00001 1 SFR 080h-0FFh most IO control
; 00010 2 X 0100h-017Fh FnTable in this bank.
; 00011 3 X 0180h-01FFh *try to avoid using this bank
; 00100 4 X 0200h-027Fh -
; 00101 5 X 0280h-02FFh -
; 00110 6 X 0300h-037Fh -
; 00111 7 X 0380h-03FFh -
; 01000 8 X 0400h-047Fh free
; 01001 9 X 0480h-04FFh free
; 01010 10 X 0500h-057Fh free
; 01011 11 X 0580h-05FFh free
; 01100 12 X 0600h-067Fh free
; 01101 13 X 0680h-06FFh free
; 01110 14 X 0700h-077Fh reserved for dynamic code
; 01111 15 X 0780h-07FFh reserved for dynamic code
; 10000 16 AR 000h-07Fh advanced registers
; 10001 17 AR 080h-0FFh advanced registers
; 10010 18 X 0000h-007Fh *try to avoid using this bank
; 10011 19 X 0080h-00FFh *try to avoid using this bank
; 10100 20 reserved
; 10101 21 reserved
; 10110 22 reserved
; 10111 23 reserved
; 11000 24 reserved
; 11001 25 reserved
; 11010 26 reserved
; 11011 27 reserved
; 11100 28 reserved
; 11101 29 reserved
; 11110 30 reserved
; 11111 31 I 000h-07Fh duplicate of IntRAM 000h-07Fh
;
; *try to avoid using this bank:
;
; RAM bank 3:
; 0180h-01FFh may be reserved for Scan Matrix if it is dynamic downloadable.
; In this case,
; RAM bank 0= external RAM 0180h-01FFh,
; RAM bank 3= internal RAM 080h- 0FFh.
; all the other banks are same as above definition.
;
; RAM bank 18,19:
; Since the RAM read/write MACROs,-- lda, sta, use 000h-0FFh for accessing
; internal RAM, so it is better to allocate external RAM 0000h-00FFh for
; special purpose usage. (It can not be access by using lda/sta)
;
; RAM bank 31:
; For MK/ITE51XL internal usage only. System should use INDEX bit7=0 to
; access internal RAM bank 000h-07Fh.
;
;----------------------------------------------------------------------------
;
; Internal RAMs (000h-07Fh):
;
; 0 1 2 3 4 5 6 7
; +--------+--------+--------+--------+--------+--------+--------+--------+
;00| Temp | Temp | Temp | Temp | Temp | Temp | Temp | Temp |07
; +--------+--------+--------+--------+--------+--------+--------+--------+
;08| | | | | | | | |0F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;10| | | |FUNCTSK |WAKETSK |DLYTSK1 |Function|PwArea0 |17
; +--------+--------+--------+--------+--------+--------+--------+--------+
;18|PwArea1 |PwArea2 |PwArea3 |PwArea4 |PwArea5 |PwArea6 |PwArea7 |PwArea8 |1F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;20| KCCB |KCState | KCMisc |KState1 |KState2 |KState3 |KState4 |TimeOut |27
; +--------+--------+--------+--------+--------+--------+--------+--------+
;28|KState5 |KStateA |KState6 |KState7 |KState8 |KState9 |HotKeys |PS2WkMsk|2F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;30|PENDING |BRKBUF0 |BRKBUF1 | Delay0 | INDEX | BREAK | TskDly | LEDcnt |37
; +--------+--------+--------+--------+--------+--------+--------+--------+
;38|KEYRPT | OutPtr | TopPtr | BotPtr |TmRate1 |TmRate2 |TmRate3 |TmRate4 |3F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;40|PwNull1 |PwNull2 |PwScan1 |PwScan2 |PwIndex |BlkMtrxT|Debounce|TmRate5 |47
; +--------+--------+--------+--------+--------+--------+--------+--------+
;48|InpDEBNC|InpRpTmL|InpRpTmH|BATTDLY |BATTTSK |SMBFL2 |SMBFLG |InRpLtch|4F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;50|BATTMSK |BAT2MSK |BAT3MSK | SMBFL3 |FnSTICKY|GHOSTFLG|TMPULSE |SMBSTAT |57
; +--------+--------+--------+--------+--------+--------+--------+--------+
;58|MAKEBUF |MAKEBUF |MAKEBUF |MAKEBUF |MAKEBUF |MAKEBUF |MAKEBUF |MAKEBUF |5F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;60|KeyBuf0 |KeyBuf1 |KeyBuf2 |KeyBuf3 |KeyBuf4 |KeyBuf5 |KeyBuf6 |KeyBuf7 |67
; +--------+--------+--------+--------+--------+--------+--------+--------+
;68| AUXMUX |AuxPref |LstAuxCm|AUXPRIME|MSTATE1 |MSTATE2 |MSTATE3 |MSTATE4 |6F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;70|AuxPdSts| PS2IDX |PS2STATE| PS2PMF |PS2WKTSK| PS2TSK |MISCPMF |MISCTMP |77
; +--------+--------+--------+--------+--------+--------+--------+--------+
;78|MISCTM2 |MISCTM3 |SWTopPtr|SWBotPtr|SCANDLY | TEMPR9 | X | Y |7F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;80|KeyBuf0 |KeyBuf1 |KeyBuf2 |KeyBuf3 |KeyBuf4 |KeyBuf5 |KeyBuf6 |KeyBuf7 |87
; +--------+--------+--------+--------+--------+--------+--------+--------+
;88|KeyBuf8 |KeyBuf9 |KeyBufA |KeyBufB |KeyBufC |KeyBufD |KeyBufE |KeyBufF |8F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;90|OutBuf0 |OutBuf1 |OutBuf2 |OutBuf3 |OutBuf4 |OutBuf5 |OutBuf6 |OutBuf7 |97
; +--------+--------+--------+--------+--------+--------+--------+--------+
;98|OutBuf8 |OutBuf9 |OutBufA |OutBufB |OutBufC |OutBufD |OutBufE |OutBufF |9F
; +--------+--------+--------+--------+--------+--------+--------+--------+
;A0|PS55Buf0|PS55Buf1|PS55Buf2|PS55Buf3|PS55Buf4|PS55Buf5|PS55Buf6|PS55Buf7|A7
; +--------+--------+--------+--------+--------+--------+--------+--------+
;A8| | | | | | | | |AF
; +--------+--------+--------+--------+--------+--------+--------+--------+
;B0|PS20CFG |PS21CFG |PS22CFG | PS20ID | PS21ID | PS22ID |PS20BUT |PS21BUT |B7
; +--------+--------+--------+--------+--------+--------+--------+--------+
;B8|PS22BUT |PS20InaT|PS21InaT|PS22Inac| AuxDataBuf (4BYTES) |BF
; +--------+--------+--------+--------+--------+--------+--------+--------+
;C0|HotKey1 |HotKey2 |HotKey3 |HotKey4 |HotKey5 |HotKey6 |KeyTsk1 |KeyTsk2 |C7
; +--------+--------+--------+--------+--------+--------+--------+--------+
;C7|KeyTsk3 |KeyTsk4 |KeyTsk5 |AuxBATTm| | |PBOverTL|PBOverTH|CF
; +--------+--------+--------+--------+--------+--------+--------+--------+
;D0|KBCRETVEC(2BYTES)| KBCCNTX (5 BYTES |TMPRAM |D7
; +--------+--------+--------+--------+--------+--------+--------+--------+
;D7| |DF
; + STACK +
;F7| |FF
; +--------+--------+--------+--------+--------+--------+--------+--------+
;
;RAM Bank2 Physical Address 000h-07Fh (Index 80h-FFh w/KSTATE5.6,5,4 = 000):
; 0 1 2 3 4 5 6 7
; +--------+--------+--------+--------+--------+--------+--------+--------+
;80| |87
; | |
; | Internal Keyboard Matrix RAM (128 bytes) |
; | |
;F8| |FF
; +--------+--------+--------+--------+--------+--------+--------+--------+
; 8 9 A B C D E F
;
;RAM Bank3 Physical Address 07Fh-0FFh (Index 80h-FFh w/KSTATE5.6,5,4 = 010):
; 0 1 2 3 4 5 6 7
; +--------+--------+--------+--------+--------+--------+--------+--------+
;80| |87
; | |
; | Not Used (128 bytes) |
; | |
;F8| |FF
; +--------+--------+--------+--------+--------+--------+--------+--------+
; 8 9 A B C D E F
;RAM Bank4 Physical Address 100h-17Fh (Index 80h-FFh w/KSTATE5.6,5,4 = 011):
; 0 1 2 3 4 5 6 7
; +--------+--------+--------+--------+--------+--------+--------+--------+
;80| |87
; | |
; | |
; | Not Used (64 bytes) |
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -