Title Catch Keyboard Input (14_Sept_84) ; ; Copyright 1984 ; Morrow Designs, Inc. ; San Leandro Ca. ; .z80 ; cseg aseg org 0100h ;---------------------------------------------------------------------- ; Equates (20_Aug_84) ;-------------------- ; No equ 0 ;Remove/Non_Banked is False Yes equ 0FFh ;Remove/Non_Banked is True Bios_Entry equ 0 ;Bios Entry Point ConIn_Offset equ 9 ;Offset to ConIn Bios Entry Control__ equ 1Fh ;Control Underscore Call_Code equ 0CDh ;Call Code Bdos_PString equ 9 ;Bdos Print String Code Cr equ 0Dh ;Carriage Return Lf equ 0Ah ;Line Feed ;---------------------------------------------------------------------- ; Rsx Prefix Section (20_Aug_84) ;------------------------------- ; Serial: db 1,2,3,4,5,6 ;Space for the Serial Number Start: db 0C3h ;Jump to Start of Code dw Start_Rsx ;Vector to Start of Code Next: db 0C3h ;Jump to Start of Next Rsx dw 0 ;Vector to Next Rsx Prev: dw 0 ;Address of Previous Rsx or Location 5 Remove: db No ;No to keep Rsx active after Warm Boot NonBank: db No ;No for using both banked & non-banked systems Name: db '12345678' ;Name of this Rsx Loader: db 0 ;Loader Flag dw 0 ;Reserved ;---------------------------------------------------------------------- ; Rsx Code (20_Aug_84) ;--------------------- ; Start_Rsx: push hl push de ld hl,(Next+1) ld (Start+1),hl ;Redirect Start to Next Rsx ld hl,(Bios_Entry+1) ld l,9 ;HL:= Address of ConIn Jump inc hl ld e,(hl) inc hl ld d,(hl) ;DE:= Vector to ConIn Code ld (Vector),de ;Save Vector ld de,Intercept ld (hl),d dec hl ld (hl),e ;Reset Vector to Intercept Vector pop hl pop de jp Next ;Continue with Next Bdos Call Intercept: db Call_Code ;Call the ConIn Routine Vector: dw 0 ;(Vector to ConIn Routine) cp Control__ ;If (this is'nt a Control UnderScore) ret nz ; Return ld (Save_Sp),sp ld sp,Local_Stack push af push bc ;Save Registers push de push hl ld c,Bdos_PString ;C:= Print String Function ld de,Announcement ;DE:= Print String Pointer call Next ;Print the Announcement; pop hl pop de pop bc ;Restore Registers pop af ld sp,(Save_Sp) ret ;Return Save_Sp: dw 0 Announcement: db Cr,Lf,'Underscore has been typed',Cr,Lf,'$' ds 32,0 Local_Stack: dw 0 end