home *** CD-ROM | disk | FTP | other *** search
- ;
- ; SYSLIB Module Name: SISALPHA
- ; Author: Richard Conn
- ; SYSLIB Version Number: 3.6
- ; Module Version Number: 1.1
-
- public isalpha
-
- EXT CAPS
-
- ;
- ; ISALPHA returns Zero Flag Set if char in A is alphabetic (A-Z,a-z).
- ; ISALPHA returns NZ if not.
- ;
- ; Char in A is unaffected.
- ;
- ISALPHA:
- PUSH BC ; SAVE BC
- LD C,A ; SAVE CHAR IN C
- AND 7FH ; MASK OUT MSB
- CALL CAPS ; CAPITALIZE
- CP 'A' ; LESS THAN A?
- JP C,NO
- CP 'Z'+1 ; LESS THAN OR EQUAL TO Z?
- JP NC,NO
- 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