; PROGRAM: TESTERR ; AUTHOR: Jay P. Sage ; VERSION: 1.0 ; DATE: 07 JULY 85 ; PREVIOUS VERSIONS: FINDERR BY Ted H. Emigh vers equ 13 ; Version 1.3 modifications by Howard Goldstein, February 28, 1991 ; Modified to work with JetFind Version 1.22 rather than 1.20. 1.22 ; is the version that is currently being sold. ; Version 1.2 modifications by Bruce Morgen, February 21, 1991 ; Added support for the "hit count" of JetFind Version 1.20 ; (Plu*Perfect Systems). If there are no hits (strings found), ; the program error flag is set. Added safety header as ; program was already into the fourth record. ; Version 1.1 modifications by Bruce Morgen, September 20, 1988 ; Implemented Type 3 format, restored F80 support since a Type 3 ; version can be used with F80, tightened code since there is no ; need to use memory storage when there are unused CPU registers. ; Also restored support for BASCOM 5.30 and CB80 2.0 (addresses ; as per FNDERR13.MAC). ; ; Since TESTERR uses no external references, it can be assembled ; to a HEX or COM file directly, I just added the appropriate ORG ; directive and used MAC with MLOAD instead of M80/L80, e.g.: ; ; MAC TESTER11 $-SPZ;MLOAD TESTERR=TESTER11 ; ; SLRMAC (or even ASM with MLOAD) ought to work too, if using M80, ; comment out the ORG directive, specifying the load address at ; link time instead, e.g.: ; ; M80 =TESTER11.ASM;L80 /P:9800,TESTER11,TESTERR/N/E ; ; Jay's notes from version 1.0 follow: ; TESTERR is based on the program FINDERR. The latter caused the error ; counts returned by various programs to be stored in the ZCPR3 registers. ; TESTERR, instead, uses the program error flag in the ZCPR3 message buffer. ; ; This program is completely rewritten to eliminate the complex macros in ; FINDERR and provide a program that will convert to Zilog opcodes with ZCON ; and assemble with ZAS. Support for testing F80 has been dropped because ; the addresses to be checked will always be overwritten when the testing ; program is loaded - did anyone ever test FINDERR with F80?! ; ; The program is invoked as in the following example: ; ; TESTERR M80 ; ; Additional programs can be added by including appropriate branches and ; sections of testing code. The one constraint that must be observed is ; that TESTERR itself must be short enough not to overwrite the memory ; locations that contain the error counts. If that becomes a problem, the ; built-in help message could be shortened considerably. If it becomes ; essential to test addresses low in memory, then an RCP version of this ; program or of FINDERR should be made, or it should be written to run ; higher and memory and invoked with GET and JUMP commands. ; One word of caution. The original distribution of SYSFCP.ASM contained an ; error in the IF ERROR function -- the sensing is done in reverse! ; IF ERROR returns TRUE if the program error flag is reset and FALSE if it ; is set. You must correct that error in your FCP or use the IF testing in ; reverse. ;----------------------------------------------------------------------------- ; Configuration information ; General Equates false equ 0 true equ not false tstm80 equ true ; Testing M80 v3.44? tstf80 equ true ; Testing F80 v3.44? tstbas equ true ; Testing BASCOM v5.30? tstcb8 equ true ; Testing CB80 v2.0? tstjtf equ true ; Testing JetFind v1.22? if not (tstm80 or tstf80 or tstbas or tstcb8 or tstjtf) oops equ ASSEMBLY ERROR, MUST SPECIFY A PROGRAM TO TEST endif fcb equ 5ch bdos equ 5 cr equ 0dh lf equ 0ah tab equ 09h ;Equates for addresses where error counts are kept by the programs to be tested ; M80/F80, Version 3.44 m80f equ 03cedh ; Addr of word with fatal error count (M80) m80w equ 03cefh ; Addr of word with warning error count (M80) f80f equ 001c1h ; Addr of word with fatal error count (F80) f80w equ 002adh ; Addr of word with warning error count (F80) ; BASCOM, Version 5.30 bcf equ 017e0h ; Addr of byte with error count (BASCOM) ; CB80, Version 2.0 cbf equ 0148ch ; Addr of byte with error count (CB80) ;jtfhit equ 03f03h ; Addr of word with "hit count" (JetFind 1.20) jtfhit equ 03fc2h ; Addr of word with "hit count" (JetFind 1.22) ;----------------------------------------------------------------------------- ; ZCPR3 initialization org 9800h ; Mandate high ORG ; External Environment Definition ; ; TYP3HDR.MAC, Version 1.2 -- Extended Intel Mnemonics ; This code has been modified as suggested by Charles Irvine so that it will ; function correctly with interrupts enabled. Extended Intel mnemonics by ; Gene Pizzetta, April 30, 1989. Slightly modified as suggested by Howard ; Goldstein (from a suggestion by Joe Wright) by Bruce Morgen, February 9, ; 1991 ; ; This is header code that can be used at the beginning of a type-3-environment ; program so that it will abort with an error message when not loaded to the ; correct address (such as when a user tries to run it under CP/M or Z30). ; entry: db 18h,0bh ; jr start0 (Must use relative jump) db 0 ; Filler db 'Z3ENV',3 ; Type-3 environment z3env: dw 0 ; Filled in by Z33 dw entry ; Intended load address ; start0: lxi h,0 ; Point to warmboot entry mov a,m ; Save the byte there di ; Protect against interrupts mvi m,0c9h ; Replace warmboot with a return opcode rst 0 ; Call address 0, pushing RETADDR onto stack retaddr: mov m,a ; Restore byte at 0 dcx sp ; Get stack pointer to point dcx sp ; ..to the value of RETADDR pop h ; Get it into HL and restore stack ei ; We can allow interrupts again lxi d,retaddr ; This is where we should be xra a ; Clear carry flag db 0edh,52h ; dsbc de (Subtract - we should have 0 now) jz start ; If addresses matched, begin real code dad d ; Restore value of RETADDR ; lxi d,notz33msg-retaddr ; Offset to message dad d xchg ; Switch pointer to message into DE bdospr: mvi c,9 jmp bdos ; Return via BDOS print string function ; notz33msg: db 'Not Z33+$' ; Abort message if not Z33-compatible start: lhld z3env ; HL pts to environment ;----------------------------------------------------------------------------- ; Beginning of TESTERR ; Check command tail for program name or help request lda fcb+1 ; First letter of program name cpi '/' ; Check for explicit help request jz help cpi ' ' ; Check for no command tail jz help mov c,a ; Stash character in C ; Get pointer to ZCPR3 message buffer lxi d,34 ; Offset to addr of message address in ENV dad d ; Point to location of message address mov a,m ; Get the address into HL inx h mov h,m mov l,a ora h ; See if message buffers supported rz ; Messages not supported, abort mvi e,6 ; Offset in messages to program error flag dad d ; Compute address (D = 0, do DE is offset) xchg ; Stash result in DE ; Branch to the code for the program to be checked mov a,c ; Get back character if tstm80 cpi 'M' jz testm80 endif if tstf80 cpi 'F' jz testf80 endif if tstbas cpi 'B' jz testbas endif if tstcb8 cpi 'C' jz testcb80 endif if tstjtf cpi 'J' jz testjetf endif jmp help ; If program name not recognized, go to help ;----------------------------------------------------------------------------- ; TESTM80 ; This section of code tests the fatal and warning error counts of M80. If ; either count is non-zero, the error flag is set. The result is returned in ; the CPU zero flag. if tstm80 testm80: lxi h,m80f ; Point to M80 fatal errors mov a,m ; Get first byte of error count inx h ; Point to second byte ora m ; Add it into the test lxi h,m80w ; Now point to warning count ora m ; Add in its two bytes inx h ora m endif ;tstm80 if tstm80 and (tstf80 or tstbas or tstcb8) jmp setflag ; Now go set the program error flag endif ;tstm80 and (tstf80 or tstbas or tstcb8) ;----------------------------------------------------------------------------- ; TESTF80 ; This section of code tests the fatal and warning error counts of F80. If ; either count is non-zero, the error flag is set. The result is returned in ; the CPU zero flag. if tstf80 testf80: lxi h,f80f ; Point to F80 fatal errors mov a,m ; Get first byte of error count inx h ; Point to second byte ora m ; Add it into the test lxi h,f80w ; Now point to warning count ora m ; Add in its two bytes inx h ora m endif ;tstf80 if tstf80 and (tstbas or tstcb8) jmp setflag ; Now go set the program error flag endif ;tstf80 and (tstbas or tstcb8) ;----------------------------------------------------------------------------- ; TESTBAS ; This section of code tests the error count of BASCOM. If the count is ; non-zero, the error flag is set. The result is returned in the CPU ; zero flag. if tstbas testbas: lda bcf ora a endif ;tstbas if tstbas and tstcb8 jmp setflag endif ;tstbas and tstcb8 ;----------------------------------------------------------------------------- ; TESTCB80 ; This section of code tests the error count of CB80. If the count is ; non-zero, the error flag is set. The result is returned in the CPU ; zero flag. if tstcb8 testcb80: lda cbf ora a endif ;tstcb8 if tstcb8 and tstjtf jmp setflag endif ;----------------------------------------------------------------------------- ; This section of code tests the "hit count" of JetFind. If the count ; is zero the error flag is set. The result is returned in the CPU ; zero flag. If JetFind itself has already set the Program Error Flag ; (indicating a problem), the hit count is irrelevant and we do nothing ; at all, simply exiting TESTERR with the Program Error Flag unchanged. ; This allows IF.COM to distinguish between a JetFind-detected problem ; (Program Error Flag = 1) and a FINDERR-detected hit count of zero ; (Program Error Flag = 255). ;----------------------------------------------------------------------------- if tstjtf testjetf: ldax d ; Has JetFind itself set flag? ora a rnz ; Hit count doesn't matter, exit! lhld jtfhit mov a,l ora h jz jtferr mvi a,1 jtferr: dcr a endif ; Now go set the program error flag setflag: ; Set prog error flag based on psw zero flag from tests above xchg ; Point HL to the error flag mvi m,0 ; Show no error found rz ; If no errors, we are done dcr m ; Else, set program error flag ret ;----------------------------------------------------------------------------- ; Help Message ; help: lxi d,helpmsg jmp bdospr ; Use BDOS print helpmsg: db 'TESTERR, Version ' db (vers/10)+'0','.',(vers mod 10)+'0' db cr,lf db ' Syntax: TESTERR PN' db cr,lf db ' where PN is first letter of name ' db 'of the program to check.' db cr,lf db ' Programs supported:' if tstm80 db ' M80' endif if tstf80 db ' F80' endif if tstbas db ' BASCOM' endif if tstcb8 db ' CB80' endif if tstjtf db ' JETFIND' endif db cr,lf,lf db ' TESTERR reads the error count ' db 'reported by the preceeding' db cr,lf db ' program & sets the flag tested ' db 'by the "IF ER" command.' db '$' end