home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 82 / asm / source / ash / keytest.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  2.0 KB  |  62 lines

  1. ; *** Keytest ver 1.0 (C) 1997 by Dines Justesen ***
  2. ;
  3. ; This program will let you see all the scancodes
  4. ; returned by the keyboard handler. Press a key
  5. ; and the program will show you the scancode, except
  6. ; for ON which exits the program. Do note that the
  7. ; function does not return when 2nd or alpha is
  8. ; pressed (they are used to change cursor). The
  9. ; function also supports contrast change so 2nd and
  10. ; up/down changes the contrast but does not return.
  11. ;
  12. ;
  13.  
  14.  
  15. #INCLUDE "ti82.h"          ; Std. include file
  16. #DEFINE L_TEXT_START SET 1,(IY+$0D) \ ROM_CALL(CLEAR_DISP) \ RES 1,(IY+$0D) \ RES 2,(IY+$0D) \ LD HL,$0000 \ LD (CURSOR_POS),HL
  17.        ; Start up code
  18.  
  19.        L_TEXT_START
  20.        SET    3,(IY+05)    ; Display white on black
  21.        LD     HL,TitleStr  ; Display title
  22.        LD     DE,(PROGRAM_ADDR)
  23.        ADD    HL,DE
  24.        ROM_CALL(D_ZT_STR)  ;3914h
  25.        LD     HL,$0007     ; Goto 7,0
  26.        LD     (CURSOR_POS),HL
  27.        LD     HL,NameStr   ; Display name
  28.        LD     DE,(PROGRAM_ADDR)
  29.        ADD    HL,DE
  30.        ROM_CALL(D_ZT_STR)
  31.        LD     HL,$0003     ; Goto 3,0
  32.        LD     (CURSOR_POS),HL
  33.        RES    3,(IY+05)    ; Display black on white
  34.        LD     HL,KeyStr    ; Display char line
  35.        LD     DE,(PROGRAM_ADDR)
  36.        ADD    HL,DE
  37.        ROM_CALL(D_ZT_STR)
  38. Main:
  39.        LD     HL,$0000     ; Goto position (0,0)
  40.        LD     (CURSOR_POS),HL
  41.        ROM_CALL(KEY_HAND)  ; Get key
  42.        LD     HL,$0803     ; Goto position (3,8)
  43.        LD     (CURSOR_POS),HL
  44.        PUSH   AF           ; Save scan code for later
  45.        LD     H,0          ; Show number of key
  46.        LD     L,A
  47.        ROM_CALL(D_HL_DECI)
  48.        POP    AF           ; Restore scan code
  49.        OR     A            ; Was key on ?
  50.        JR     NZ,Main      ; No loop
  51.        RES    4,(IY+9)     ; Clear bit (enter has not been pressed)
  52.        TEXT_END
  53.        RET
  54.  
  55. TitleStr:
  56. .DB "Keytest  ver 1.0",0
  57. KeyStr:
  58. .DB "Key    :        ",0
  59. NameStr:
  60. .DB " Dines Justesen ",0
  61. .END
  62.