* ASCF 0 Do not print out ASCII assemblies * * * Wiz-Stat -- A Utility for use with Wiz-Print * version 1.3 and the North Star MDS * * * DRVRAD EQU 0E00H Print driver routine address * DATA EQU 38H A NOP instruction used to flag data areas * DOS EQU 100H CIN EQU 10H CONTC EQU 16H PRNTR EQU 0DH DRET EQU 28H * TRUE EQU 0 FALSE EQU -1 * CHCR EQU 0DH CHLF EQU 0AH CHBEL EQU 7 CHRUB EQU 5FH CHDEL EQU 7FH * ORG DRVRAD * START LXI SP,STACK LXI H,SGNON CALL OUTCHR * LHLD DOS+PRNTR+1 MOV A,M CPI 0C3H JNZ NONE LXI D,3 DAD D MOV A,M CPI DATA JZ LIST * NONE LXI H,NOMES CALL OUTCHR JMP LEAVE * LIST LXI H,STTMES CALL OUTCHR * LXI H,ACTDVC MVI A,16 LST1 MVI M,0FFH INX H DCR A JNZ LST1 * LXI H,DOS+PRNTR+1 XRA A STA COUNT * LOOP MOV E,M INX H MOV D,M XCHG . * MOV A,M CPI 0C3H JNZ DONE INX H INX H INX H MOV A,M CPI DATA JNZ DONE * LXI D,-12 DAD D PUSH H CALL OUTADD LXI H,SPC1 CALL OUTCHR POP H * SHLD LSTWIZ LDA COUNT INR A STA COUNT * LXI D,25 DAD D PUSH H MOV A,M STA DEVICE CALL OUTH2 * LXI H,SPC2 CALL OUTCHR POP H LXI D,-10 DAD D PUSH H * MOV A,M CPI TRUE LXI H,TRMES JZ $+3 LXI H,FLSMES CALL OUTCHR LXI H,SPC3 CALL OUTCHR * POP H INX H PUSH H MOV A,M CPI TRUE LXI H,TRMES JZ $+3 LXI H,FLSMES CALL OUTCHR * POP H PUSH H MOV A,M DCX H ANA M CPI FALSE LXI H,INMES JZ LST7 * LDA DEVICE MOV B,A LXI H,ACTDVC * LST5 MOV A,M CPI 0FFH JZ LST6 * CMP B INX H JNZ LST5 * LXI H,INMES JMP LST7 * LST6 MOV M,B LXI H,ACTMES * LST7 CALL OUTCHR * POP H LXI D,11 DAD D JMP LOOP * DONE LXI H,CHGMES CALL OUTCHR CALL YESNO JNZ LEAVE No changes to make * LDA COUNT CPI 1 LHLD LSTWIZ JZ DN15 * LXI H,LDMES CALL OUTCHR DN1 CALL GETADD JZ DN1 DN15 SHLD ADDBUF Store the address * LXI H,DOS+PRNTR+1 * DN2 MOV E,M INX H MOV D,M LDAX D CPI 0C3H JNZ DNELVE XCHG INX H INX H INX H MOV A,M CPI DATA JNZ DNELVE * LXI D,-12 DAD D XCHG LHLD ADDBUF MOV A,H SUB D JNZ DN3 MOV A,L SUB E JZ DN4 * DN3 LXI H,26 DAD D JMP DN2 * DN4 LXI H,DVCMES CALL OUTCHR * LXI H,15 DAD D CALL TRUFLS MVI M,TRUE JNZ $+2 MVI M,FALSE INX H * PUSH H LXI H,PRTMES CALL OUTCHR POP H CALL TRUFLS MVI M,TRUE JNZ $+2 MVI M,FALSE PUSH H * LXI H,INTMES Ask about clearing the print buffer CALL OUTCHR CALL YESNO POP H INX H MVI M,TRUE JZ $+2 MVI M,FALSE * DN5 CALL CRLF CALL CRLF CALL CRLF JMP LIST * DNELVE LXI H,DNMES CALL OUTCHR JMP DN5 * LEAVE CALL CRLF CALL CRLF JMP DOS+DRET * ******************** * * Ask for a True/False answer. Z-flag set if "False" * TRUFLS PUSH H CALL INCHAR ANI 5FH CPI 'F' PUSH PSW LXI H,FLSMES JZ $+3 LXI H,TRMES CALL OUTCHR POP PSW POP H RET . * ******************** * * Ask for a Yes/No answer. Z-flag set if "Yes" * YESNO CALL INCHAR * ANI 5FH Convert possible lower case to uppercase * CPI 'Y' Is it a "Yes"? PUSH PSW Save the flags LXI H,MESYES Point to the "Yes" message JZ $+3 Go print it if "Yes" * LXI H,MESNO Else print "No" * CALL OUTCHR Do it POP PSW Restore the flags * RET . * ******************** * * Send out a carriage return/line feed * CRLF MVI B,CHCR Send out a carriage return XRA A To device 0 CALL DOS+PRNTR Send it out * MVI B,CHLF Do the same for the line feed XRA A CALL DOS+PRNTR * RET . * ******************** * * Get one character of input from device 0 * INCHAR XRA A From device 0 CALL DOS+CIN Go ask for the character * CPI 03H Has he typed a CTRL-C ? RNZ . Return if not * JMP LEAVE * ******************** * * Print out the four digit ASCII representation of HL * OUTADD MOV A,H Get H CALL OUTHEX Send it out MOV A,L Get L and fall through to send it out * * Output the two digit ASCII representation of A * OUTHEX PUSH PSW Save it RLC Bring the high nybble to the low RLC RLC RLC CALL OUTH1 Send it out * POP PSW Restore A for printing low nybble * OUTH1 ANI 0FH Strip off unwanted bits CPI 0AH Is it an alphabetic hex digit? JC OUTH2 If not, go print it * ADI 7 Otherwise, add offset * OUTH2 ADI 30H Convert it to ASCII MOV B,A Put character in B XRA A Send it to device 0 * JMP DOS+PRNTR Go do it * ********************* * * Get a four digit hexadecimal number from the user. * Editing features are available. * GETADD MVI C,4 Maximum number digits allowed MVI L,'F' Highest hex value allowed * INR C Adjust for later INR L * MOV H,C Used in DELT routine * LXI D,ADDBUF Point to the address buffer * * All done initializing, get address * ADDLP CALL INCHAR Go get one character from user * CPI CHRUB Is it a rubout? JZ DELT CPI CHDEL Or a delete? JZ DELT Back up a character if so * CPI CHCR How about a carriage return? JZ ENTR Go convert ASCII digits to binary if so * CPI 'A' Is lower to uppercase conversion necessary? JC $+2 Carry says no ANI 5FH Do the conversion * CMP L Compare with highest hex value allowed JNC ADDLP If value not in range, ignore it CPI '0' Test lower bounds also JC ADDLP * DCR C Do we already have enough digits? INX B Increment BC (really C) without changing flags JZ ADDLP Loop back up and wait for RUBOUT or C/R if so * STAX D Store the character in memory INX D Bump the buffer pointer * DCR C Decrement the digit count CALL OUTH2+2 Send out the character * JMP ADDLP All done * * Rubout routine * DELT MOV A,C Do we have nothing to delete? CMP H JZ ADDLP Ingore if that's the case * INR C Add to the digit count DCX D Decrement the buffer pointer * MVI B,CHRUB Send a rubout to device 0 CALL OUTH2+3 * JMP ADDLP And get some more input * * Convert ASCII to binary * ENTR STAX D Use carriage return as end-of-address mark * LXI D,ADDBUF Point to address buffer LXI H,0 Initialize binary value MVI B,0 * CNVRT LDAX D Get the digit INX D Bump the pointer * CPI CHCR Are we all done? JZ ANYINPT Check for no input case if so * DAD H We've got a legal digit, DAD H multiply current value by 16 DAD H DAD H * CPI 'A' Convert this digit to a 4-bit binary value JC $+2 SUI 7 Convert alphabetic hex if necessary ANI 0FH Strip off unwanted bits * MOV C,A Make value a full 16 bits DAD B Add it to the current value * JMP CNVRT Keep converting * * If no input was given, return with the Z-flag set * ANYINPT EQU $ LDA ADDBUF Is the first character the end-of-number mark? CPI CHCR Make the test RET . Return with result in hand * ADDBUF DS 5 Storage for 4 digits + end of number mark * ******************** * * Print the text message pointed to by HL * OUTCHR MOV B,M Pick up the character XRA A Send it to the console CALL DOS+PRNTR Go do it * PUSH H PUSH B * CALL DOS+CONTC * LXI B,400 * OUTWT DCX B Wait a bit MOV A,B ORA C JNZ OUTWT * POP B POP H * INX H Pick up the next character MOV A,M ORA A JNZ OUTCHR RET . All done, return * ******************** * * System output messages * SGNON DB CHCR,CHLF ASC 'Wiz-Stat V1.3 by Stephen Maguire Copyright' ASC ' (C) 1981' DB CHCR,CHLF,CHCR,CHLF,0 * NOMES ASC 'No Wiz-Prints currently executing...' DB CHCR,CHLF,0 * STTMES ASC 'Wiz-Print Device Device Status Print' ASC ' Status Status' DB CHCR,CHLF,CHCR,CHLF,' ',' ',0 * SPC1 ASC 'H #' DB 0 * SPC2 ASC ' ' DB 0 * SPC3 ASC ' ' DB 0 * MESYES ASC 'Yes' DB 0 MESNO ASC 'No ' DB 0 * TRMES ASC 'True ' DB 0 * FLSMES ASC 'False' DB 0 ACTMES ASC ' Active ' DB CHCR,CHLF,' ',' ',0 INMES ASC ' Inactive' DB CHCR,CHLF,' ',' ',0 * CHGMES DB CHCR,CHLF ASC 'Change status? (C/R = abort to DOS) ' DB 0 * DNMES DB CHCR,CHLF ASC 'There is no such Wiz-Print executing...' DB CHCR,CHLF,0 * LDMES DB CHCR,CHLF ASC 'Load address of Wiz-Print to change: ' DB 0 * DVCMES DB CHCR,CHLF ASC 'Device status: (T/F) ' DB 0 * PRTMES ASC ' Print status: (T/F) ' DB 0 * INTMES DB CHCR,CHLF ASC 'Clear the print buffer? (C/R = No) ' DB 0 * COUNT DS 1 LSTWIZ DS 2 DEVICE DS 1 ACTDVC DS 16 * DS 20H STACK EQU $