LIB2 / FILE VIEW

keyboard.s

DOWNLOAD ORIGINAL ↓

; ======================================================================
; lib-set-01 / KEYBOARD r008 -- Keystone/CH08 dual-machine derivative.
; Alex Barragan and ChatGPT (Solcito), 2026-10-20.
;
; Public candidate API:
;   KBD_INIT   : start an isolated card-local keyboard session; mode=00.
;   KBD_EVENT  : wait for complete press/release (no auto-repeat).
;                $17=1 CHAR ($0 logical code), 2 MENU, 3 BRK,
;                4 CAPS transition; $13 current keyboard mode.
;   KBD_RESET  : reset KEYMD before returning to any host CRTKY user.
;   KBD_RELEASE: await release; no event delivered.
;
; Backend is byte-exact CH08 S003 keyv540.s/.inc, whose core derives
; from Keystone and BOOT 0.02a KEYSCAN. No host-language CRTKY/SYSCAL
; in this Keyboard service. This borrowed KEYMD session MUST NOT overlap
; host CRTKY/KEY_WAIT; caller does KBD_RESET before Menu resumes.
; Native PB-2000C and AI-1000 qualification remains OPEN for r008.
; RAM: borrowed C-ROM KEYMD (RAM1:09E4h). No Lab/UI dependency.
; ======================================================================
KBD_INIT:
        CAL     K540_INIT
        RTN
KBD_EVENT:
        CAL     K540_GET
        RTN
KBD_RESET:
        CAL     K540_RESET
        RTN
KBD_RELEASE:
        CAL     K540_WAIT_UP
        RTN