; TITLE "SSKPUN - Syslib 4.0" NAME ('SKPUN') ;================================================================= ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;----------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from SSKPUN.Z80 Ver 1.1 by Richard Conn ; Date : 28 Jul 89 ; Version : 1.3 ; Module : SSKPUN ; Abstract: This module contains the routines SKPUN and SKNPUN ; which scan a character string until a non-punctuation char ; (SKPUN) or a punctuation character (or ending Null) is ; encountered (SKNPUN). A pointer to the delimiting char ; is returned. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC SKPUN, SKNPUN ; From SYSLIB Get.. EXT ISPUN .Z80 CSEG ;=============================================================== ; NAME - SKPUN ; Entry: HL - Points to a character string ; Exit : HL - Points to the first non-punc char or 0 encountered ; Uses : HL ; Special Requirements: None ;=============================================================== SKPUN: PUSH AF ; Save A Reg and Flags SKP1: LD A,(HL) ; Get next char INC HL ; Pt to next OR A ; Done? JR Z,SKP2 CALL ISPUN ; Is a punctuation char? JR Z,SKP1 ; Continue skip if so SKP2: DEC HL ; Pt to offending char POP AF ; Get A reg and Flags RET ;=============================================================== ; NAME - SKNPUN ; Entry: HL - Points to a character string ; Exit : HL - Points to the first punc char or 0 encountered ; Uses : HL ; Special Requirements: None ;=============================================================== SKNPUN: PUSH AF ; Save A Reg and Flags SKNP1: LD A,(HL) ; Get next char INC HL ; Pt to next OR A ; Done? JR Z,SKP2 CALL ISPUN ; Is a punctuation char? JR NZ,SKNP1 JR SKP2 END