home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / MKEY02.ASM < prev    next >
Assembly Source File  |  1994-10-15  |  967b  |  40 lines

  1.     page    66,132
  2. ;******************************** MKEY02.ASM *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11. .list
  12. comment 
  13. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -(MOUSE/KEY)
  14. IS_DIGIT - check if key returned by KEY_READ is the ASCII from 0-9
  15. ;
  16. ; inputs:    AX = keycode returned by KEY_READ or AH=0, AL=ascii
  17. ; output:    if CF = 0, keycode is a character from 0-9
  18. ;            if CF = 1, keycode is not a character from 0-9
  19. ;* * * * * * * * * * * * * *
  20. 
  21.     PUBLIC    IS_DIGIT
  22. IS_DIGIT        PROC    FAR
  23.     OR      AH,AH
  24.     JNZ     ID_NOT
  25.     CMP     AL,'0'
  26.     JB      ID_NOT
  27.     CMP     AL,'9'
  28.     JA      ID_NOT
  29.     CLC
  30.     JMP     ID_EXIT
  31. ID_NOT:
  32.     STC
  33. ID_EXIT:            
  34.     RETF
  35. IS_DIGIT ENDP
  36.  
  37. LIBSEG    ENDS
  38.     end
  39.