PARMLIB Version 1.0 Parse CP/M Command Line Parameters Copyright 22 Jul 89 by Carson Wilson In answer to a call for more Z80 library functions by Jay Sage, PARMLIB performs several of elemental functions to aid in the frequent task of parsing the CP/M command line. I have tried to balance generality and efficiency with ease of use. For this reason, many of the routines automatically address CP/M's default command line buffer which starts at address 80 hex. None of the routines uses any registers other than those required to return results. For examples of use, see my file ZLT12.LBR. PARMLIB.LBR includes PARMLIBS.REL and PARMLIBM.REL, which are relocatable library files in SLR and MicroSoft formats, respectively. Several of the PARMLIB routines themselves call SYSLIB routines. For this reason, be sure to instruct your linker to search SYSLIB for routines after linking one or more PARMLIB routines to your program. Several generalized routines are also included. PARCHR will search a string pointed to by HL (null terminated) for the value in A (except a null). PREGDUMP was used in debugging PARMLIB, and simply prints the contents of all main registers to the screen. If you have any problems or suggestions, please contact me via modem at Antelope Freeway RAS, 312-764-5162, Chicago. I am sysop there, so you can leave me a message with the APPLY command. I would be happy to release PARMLIB for inclusion in other free libraries of Z80 routines, but you should try to contact me before doing so in case there have been any updates. ------------------------------------------------------------------ Module: PPARCNT Prog Size 0019 Data Size 0000 Public Symbols Defined: PARCNT External Symbols Referenced: SKNSP SKSP PARCNT - Counts CP/M command line parameters. Entry: - none. Exit: - contains number of parameters. - Z if no parameters present, else NZ. Uses: - . Notes: Number of parameters cannot exceed 255 since there are only 127 bytes available in CP/M's command line buffer. ------------------------------------------------------------------ Module: PPARGET Prog Size 001B Data Size 0000 Public Symbols Defined: PARGET External Symbols Referenced: PARCNT SKNSP SKSP PARGET - Gets pointer to CP/M command line parameter #A. Entry: - holds number of desired parameter. Exit: - NZ if parameter found, Z if not found. - holds first character of parameter, or 00 if not found. - points to parameter #A, if found. Uses: - , . Notes: see PARCNT, above. ------------------------------------------------------------------ Module: PPARCHR Prog Size 000E Data Size 0000 Public Symbols Defined: PARCHR External Symbols Referenced: PARCHR - Scans string for character in A. Entry: - holds character to search for. - points to null-terminated string. Exit: - (NZ) if character found, (Z) if not found. - holds character if found, 00 if none found. - points to found character or null terminator. Uses: - , . Notes: Does not scan for ^@. Stops at first match, starting with (HL). Scans strings of any length, even over 0FFFFh! ------------------------------------------------------------------ Module: PREGDUMP Prog Size 0069 Data Size 0000 Public Symbols Defined: REGDUMP External Symbols Referenced: CRLF PA2HC PHL4HC PRINT REGDUMP - Displays contents of registers to screen. Entry: - All registers defined. Exit: Registers A, HL, BC, DE, IX, IY displayed. Uses: - none. Notes: Display uses one console line.