; TITLE "SISHEX - Syslib 4.0" NAME ('ISHEX') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from SISHEX.Z80 Ver 1.1 by Richard Conn ; Date : 28 Jul 89 ; Version : 1.3 ; Module : SISHEX ; Abstract: This module contains only the routine ISHEX which ; evaluates the character in Register A and returns with ; the Zero Flag Set (Z) if the character is in the range ; of "0".."9", "A".."F", or "a".."f". If the character is ; not a valid Hexidecimal digit, the Zero Flag is Reset (NZ). ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points: PUBLIC ISHEX ; From SYSLIB Get.. EXT ISDIGIT, CAPS .Z80 CSEG ;========================================================================= ; NAME - ISHEX ; Entry: A = Digit to evaluate ; Exit : A = Digit, Zero Flag Set (Z) if valid Hex Digit, Else Zero Clear (NZ) ; Uses : F ; Special Requirements: None ;========================================================================= ISHEX: CALL ISDIGIT ; Is it a digit? RET Z ; ..return if so with the Z flag set PUSH BC ; Save BC LD C,A ; Save char in C CALL CAPS ; Capitalize CP 'A' ; Less than A? JR C,NO CP 'F'+1 ; Less than or equal to F? JR C,YES NO: DEFB 0F6H ; Set NO response with "OR 0AFH" YES: XOR A ; Set YES Flag LD A,C ; Get char POP BC ; Restore BC RET END