home *** CD-ROM | disk | FTP | other *** search
/ Antic Magazine 1982 April / Antic_Vol_1_No_1_April_1982.atr / keymask.asm < prev    next >
Assembly Source File  |  2021-02-09  |  2KB  |  1 lines

  1. 10        .TITLE"KEY MASK 1.0"¢20 ;********************************¢30 ;***        KEY MASK 1.0      ***¢40 ;***(c) 1982 by, Matt Loveless***¢50 ;***  written especially for  ***¢60 ;***      ANTIC magazine      ***¢70 ;********************************¢80 ;¢90 ;*** EQUATES ***¢0100 ;¢0110 KBCODE =    $D209     ; Key board code¢0120 VKEYBD =    $0208     ; Keyboard IRQ ve¢0130 TABLE  =    $CB       ; Free zero Page locations¢0140 ;¢0150 ;=========================================================¢0160 ;  INIT ROUTINE:  Puts my keyboard handler online¢0170 ;=========================================================¢0180        *=   $0600     ; Page 6¢0190 BEGIN  SEI            ; Disable IRQ's¢0200        LDA  VKEYBD    ; Point the keyboard vector to my¢0210        STA  JMPLOC+1  ; routine, and set my routine's JMP¢0220        LDA  VKEYBD+1  ; instruction to point to the OS's¢0230        STA  JMPLOC+2  ; routine¢0240        LDA  #MYRTN&255 ; Lo byte of my routine¢0250        STA  VKEYBD¢0260        LDA  #MYRTN/256 ; Hi byte of my routine¢0270        STA  VKEYBD+l¢0280        PLA            ; Remove USR amount byte¢0290        PLA            ; Get hi byte of the mask string¢0300        STA  TABLE+1¢0310        PLA            ; Get lo byte¢0320        STA  TABLE¢0330        CLI            ; Re-Enable IRO's !¢0340        RTS            ; Return to BASIC¢0350 ;=========================================================¢0360 ;THE NEW KEYBOARD INTERRUPT ROUTINE¢0370 ;=========================================================¢0380 MYRTN  TYA            ; Keyboard IRQ vector points here¢0390        PHA            ; Save Y-register¢0400        LDY  KBCODE    ; Get the key code¢0410        LDA  (TABLE),Y ; and use it to index into the string¢0420        BNE  GONORM    ; Is it masked out?¢0430        PLA            ; YES - then ignore key and¢0440        TAY            ; restore registers¢0450        PLA¢0460        RTI            ; Exit the keyboard interrupt¢0470 ;¢0480 GONORM PLA            ; Restore Y-register¢0490        TAY¢0500 JMPLOC JMP  $0000     ; Go to normal system keyboard routine¢0510         .END¢