home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ZSYS
/
SIMTEL20
/
SYSLIB
/
SLIB2.LBR
/
SISALNUM.Z80
< prev
next >
Wrap
Text File
|
2000-06-30
|
640b
|
37 lines
;
; SYSLIB Module Name: SISALNUM
; Author: Richard Conn
; SYSLIB Version Number: 3.6
; Module Version Number: 1.1
public isalnum
EXT ISDIGIT,ISALPHA
;
; ISALNUM returns Zero Flag Set if char in A is alphanumeric
; (0-9,A-Z,a-z). ISALNUM returns NZ if not.
;
; Char in A is unaffected.
;
ISALNUM:
PUSH BC ; SAVE BC
LD C,A ; SAVE CHAR IN C
CALL ISDIGIT ; IS IT A DIGIT?
JP Z,YES
CALL ISALPHA ; IS IT ALPHABETIC?
JP NZ,NO
YES:
XOR A ; SET FLAG
LD A,C ; GET CHAR
POP BC ; RESTORE BC
RET
NO:
LD A,0FFH ; SET FLAG
OR A
LD A,C ; GET CHAR
POP BC ; RESTORE BC
RET
END