ùPRTSET COM*àlPRTSET DOC<&JsPRTSET Z80b>»8Z3OFFSETLIB(”ùÿ ÿ ÿ ; Z3 Environment offsets Z3Jmp EQU 0000h ; dummy jump Z3Id EQU 0003h ; 'Z3ENV' Z3Class EQU 0008h ; 1 byte Z3ExpPathVec EQU 0009h ; address of external path Z3ExpPathCnt EQU 000Bh ; count of 2 byte path blocks Z3RcpVec EQU 000Ch ; address of RCP Z3RcpCnt EQU 000Eh ; count of 128 byte RCP blocks Z3IopVec EQU 000Fh ; address of IOP Z3IopCnt EQU 0011h ; count of 128 byte IOP blocks Z3FcpVec EQU 0012h ; address of FCP Z3FcpCnt EQU 0014h ; count of 128 byte FCP blocks Z3NdirVec EQU 0015h ; address of NDIR Z3NdirCnt EQU 0017h ; count of 18 byte NDIR blocks Z3ClVec EQU 0018h ; address of CL Z3ClCnt EQU 001Ah ; count of 1 byte CL blocks Z3EnvVec EQU 001Bh ; address of ENV Z3EnvCnt EQU 001Dh ; count of 128 byte ENV blocks Z3ShStkVec EQU 001Eh ; address of SHSTK Z3ShStkCnt EQU 0020h ; count of shell stack entries Z3ShStkSize EQU 0021h ; size of shell stack entry Z3MsgBufVec EQU 0022h ; address of MSGBUF Z3ExtFcbVec EQU 0024h ; address of EXTFCB Z3ExtStkVec EQU 0026h ; address of EXTSTK Z3Quiet EQU 0028h ; quiet flag (0=not quiet - 1=quiet) Z3WhlVec EQU 0029h ; address of wheel byte Z3Speed EQU 002Bh ; processor speed in Mhz Z3MaxDisk EQU 002Ch ; maximum number of disk drives Z3MaxUser EQU 002Dh ; maximum user number Z3DuForm EQU 002Eh ; 0=don't accept DU - 1=accept DU Z3CrtSel EQU 002Fh ; which crt is selected Z3PrtSel EQU 0030h ; which printer is selected Z3Crt0Col EQU 0031h ; maximum columns on crt 0 Z3Crt0Row EQU 0032h ; maximum rows on crt 0 Z3Crt0Text EQU 0033h ; maximum rows of text on crt 0 Z3Crt1Col EQU 0034h ; maximum columns on crt 1 Z3Crt1Row EQU 0035h ; maximum rows on crt 1 Z3Crt1Text EQU 0036h ; maximum rows of text on crt 1 Z3Prt0Col EQU 0037h ; maximum columns on printer 0 Z3Prt0Page EQU 0038h ; maximum lines per page on printer 0 Z3Prt0Text EQU 0039h ; maximum lines of text on printer 0 Z3Prt0FF EQU 003Ah ; 0=can't form feed - 1=can formfeed Z3Prt1Col EQU 003Bh ; maximum columns on printer 0 Z3Prt1Page EQU 003Ch ; maximum lines per page on printer 0 Z3Prt1Text EQU 003Dh ; maximum lines of text on printer 0 Z3Prt1FF EQU 003Eh ; 0=can't form feed - 1=can formfeed Z3Prt2Col EQU 003Fh ; maximum columns on printer 0 Z3Prt2Page EQU 0040h ; maximum lines per page on printer 0 Z3Prt2Text EQU 0041h ; maximum lines of text on printer 0 Z3Prt2FF EQU 0042h ; 0=can't form feed - 1=can formfeed Z3Prt3Col EQU 0043h ; maximum columns on printer 0 Z3Prt3Page EQU 0044h ; maximum lines per page on printer 0 Z3Prt3Text EQU 0045h ; maximum lines of text on printer 0 Z3Prt3FF EQU 0046h ; 0=can't form feed - 1=can formfeed Z3ShFileName EQU 0047h ; shell variable file name Z3ShFileType EQU 004Fh ; shell variable file type Z3FileName1 EQU 0052h ; file name 1 Z3FileType1 EQU 005Ah ; file type 1 Z3FileName2 EQU 005Dh ; file name 2 Z3FileType2 EQU 0065h ; file type 2 Z3FileName3 EQU 0068h ; file name 3 Z3FileType3 EQU 0070h ; file type 3 Z3FileName4 EQU 0073h ; file name 4 Z3FileType4 EQU 007Bh ; file type 4 Z3Filler EQU 007Eh ; 2 unused bytes ; Tcap Offset from Environment Z3TermName EQU 0080h ; 16 byte name of terminal Z3CursorUp EQU 0090h ; cursor up code Z3CursorDown EQU 0091h ; cursor down code Z3CursorRight EQU 0092h ; cursor right code Z3CursorLeft EQU 0093h ; cursor left code Z3DelayCls EQU 0094h ; delay after clear screen Z3DelayPos EQU 0095h ; delay after cursor positioning Z3DelayEol EQU 0096h ; delay after clear to end of line  0080h ; 16 byte name of terminal Z3CursorUp EQU 0à Z3ENVÍ5ØÍOØÝ* !ÍvÍ„ØͨØÍÆØÍäØÍØÍkɯ* ¼ÂX½ÂXGÍ’½Í’7ɯ!€N±(>/#í±y·ÊX>/¾ ôGÍ’öÍ’7ÉÝ~(·ÂXGÍ’ÉÍ%Øz· {þ0 2BÆ02« ÃXëmÍ’Í[7ÉÍ%Øz· {·(2CÃXë“Í’Í[7ÉÍ%Øz· {·(2DÃXëÊÍ’Í[7ÉÍ%Øz· {·( 2E:D»ÒXëüÍ’Í[7ÉÍ>8Í7þN ¯>2FÃXb Í’7É:i<2iÍ>ØͨÒX%Í’7ÉÍuÍU~·(Í• ñÃXöÍ’7É7?É’ Í’Íôž Í’ÉÝå!BNË!Ë!Ý #~Ýw7Ý#÷ÝáÝ~(·À¡ Í’ÉõÅÕåÝåýå ÍýáÝááÑÁñÉÅå¯27~Í7Ö0ÚÌþ ÚÃÖþÒÌ>27#î~Í7O+~Í7Gá:7ÊEyþHÊ þXÊ þOÊ"þQÊ"xþBÊ8ÍI~Í7þDÂE#ÃEÍp~Í7#þHÊEþXÊE{7ÁÉÍ¥~Í7#þOÊEþQÊEÃÍÐ~Í7#þBÂ{·ÁÉÅ~Ö0Úmþ Òmõåbk)))ëáñƒ_zÎW#ÃM{ÁÉÅ~Í7Ö0Ú¢þ Ú‰ÖþÒ¢õå!ÂT]áñƒ_zÎ#Ãt{ÁÉÅ~Ö0ÚÍþÒÍõå!»T]áñƒ_zÎ#é{ÁÉÅ~Ö0ÚñþÒñå!T]áƒ_zÎ#ÃÔ{ÁÉõÅÕå'ÍèÍdÍ Í}Æ0ÍAáÑÁñÉ}“o|šgÚ, Ã}ƒo|Šgy·Â9°ÀyÆ0ÃAõÅÕåO*. PÕéáÑÁñÉõ~#·ÊbÍÈÊV+ñÉõ~#·ÊbÍÈÂfÃbõ~#·Ê‚ÍÊv+ñÉõ~#·Ê‚͆ÂÅOÍþʣͭ§¯yÁÉ>ÿ·yÁÉÅOæÍ7þAÚÂþ[Ò¯yÁÉ>ÿ·yÁÉÅOæþ!Úøþ0Úôþ:ÚøþAÚôþ[ÚøþaÚôþ{ÚøþÊø¯yÁÉ>ÿ·yÁÉÅOæþ0Úþ:Ò¯yÁÉ>ÿ·yÁÉåÅOæ !.¾Ê*# yÁáÉ  æþaØþ{Ðæ_É PRTSET - Version 1.00 - October 23, 1985 Copyright 1985 by James L. Tuksal All Rights Reserved $ This program must be installed via the Z3INS utility $ Syntax: PRTSET Ptr,Cpl,Lpp,Tpp,Ff where: Ptr is the printer to modify (0-3) Cpl is the characters per line (1-255) Lpp is the lines per page (1-255) Tpp is the text per page (1-255) Ff is the form feed flag (y or n) example: PRTSET 2,132,66,60,Y Modifies printer 2 for a maximum of 132 characters per line, with 66 lines per page, of which 60 can contain text (i.e. leaving a margin of 6 lines) for a printer that is able to accept form feeds. $ Non-numeric entry OR invalid format for numeric base in parameter 0 $ Invalid printer number: must be 0-3$ Invalid number of characters per line: must be 1-255$ Invalid number of lines per page: must be 1-255$ Invalid number of text per page: must be 1-255 must be < or = Lpp$ Form feed flag missing - must be "y" or "n" $.....found $ $ Printer 0 modified. $(##óÉ#¯~É:• ·7Àý~þ;(þ ( ý#þ,(þ!8ëÉ2• 7É*  Íô8Ãfw#" ÉDM* PRTSET (Version 1.0) Copyright 1985 by James L. Tuksal All Rights Reserved Thió softwarå ió releaseä intï thå publiã domain® Alì righô arå reserveä bù thå author® Iô maù bå freelù distributed¬ however¬ iô ió noô tï bå solä foò profiô withouô thå author'ó expresó permission. Syntax: PRTSET Ptr,Cpl,Lpp,Tpp,Ff Function:           PRTSEÔ (PRinTeò parameteò SET© ió á ZCPR³ utilitù           thaô permitó thå useò tï seô thå printeò parameteró           foò printeò 0¬ 1¬ 2¬ oò 3® Thió dynamicallù changeó           thå characteristicó oæ thå printeò controì parameteró           iî thå environmenô whicè arå useä bù otheò ZCPR³           utilitieó sucè aó PRINT® CPSEÌ maù bå useä tï selecô           whicè seô oæ printeò parameteró arå active. Options: None. Comments:           Ptr is the printer to modify. Valid values range from 0 to 3.   Cpl is the number of characters per line. Valid values range from 1 to 255.   Lpp is the number of lines per page. Valid values range from 1 to 255.   Tpp is the number of lines of text per page. Valid values range from 1 to 255. Tpp must be less than or equal to Lpp (Tpp<=Lpp).   Ff is the form feed flag. Valid values are "y" or "n" (case not significant).   Valiä formató foò all inpuô numbers arå:   Binary number bbbbbbbbbbbbbbbbB            where b=0 or b=1   Octal number oooooooO or oooooooQ            where 0 <= o <= 7   Decimal number ttttt or tttttD            where 0 <= t <= 9 Š   Hexadecimal number hhhhH or hhhhX            where 0 <= h <= F           Alì numberó returneä iî erroò messageó arå iî decimal. Example:   PRTSET 2,132,66,60,Y           Iî thió example¬ thå commanä setó printeò ² tï á           maximuí oæ 13² characteró peò line¬ witè 6¶ lineó peò           page¬ oæ whicè 6° caî contaiî texô (i.e® leavinç á           margiî oæ ¶ lines© foò á printeò thaô ió ablå tï           accepô forí feeds. Error Messages: This program must be installed via the Z3INS utility    Yoõ haven'ô installeä thå prograí witè thå Z3INÓ           utilitù yet® Afteò yoõ havå donå so¬ thió messagå           will go away. Non-numeric entry OR invalid format for numeric base in parameter n   Eitheò thå parameteò yoõ entereä ió noô numeric¬ oò           noô iî á formaô showî abovå (i.e® binary¬ octal¬           decimal¬ hexadecimal) Invalid printer number: must be 0-3.....found n           Thå printeò numbeò yoõ entereä ió ouô oæ range® Yoõ           must enter a value between 0 and 3. Invalid number of characters per line: must be 1-255.....found n           Thå numbeò oæ characteró peò linå yoõ entereä ió ouô           of range. You must enter a value between 1 and 255. Invalid number of lines per page: must be 1-255.....found n           Thå numbeò oæ lineó peò pagå yoõ entereä ió ouô oæ           range. You must enter a value between 1 and 255. Invalid number of text per page: must be 1-255 must be < or = Lpp.....found n           Thå numbeò oæ lineó oæ texô peò pagå ió ouô oæ rangå           oò largeò thaî thå numbeò oæ lineó peò page® Yoõ musô           enteò á valuå betweeî ± anä 25µ thaô ió lesó thaî oò           equal to the number of lines per page. Form feed flag missing - must be "y" or "n" Š           Yoõ diä noô enteò á valuå foò thå forí feeä flag® Yoõ           musô enteò á "y¢ iæ youò printeò caî accepô forí           feeds, or an "n" if your printer cannot. Printer n modified           Thió ió noô aî error¬ buô jusô information® Iô jusô           telló yoõ thaô thå printeò parameteró werå modifieä           accordinç tï youò specifications. Technical Notes:           PRTSET requires a Z80 processor to run. PRTSET uses an external Z3 environment descriptor.           PRTSET requires ZAS to assemble.           Wheî assemblinç PRTSEÔ requireó Z3OFFSET.LI (whicè           describeó thå offsetó withiî thå Z³ environmenô           descriptor© aó aî includå file.           PRTSEÔ requireó ZLINË foò linkinç tï SYSLIB.REÌ duå           to the use of these routines: CAPS EVAL ISALNUM SKPUN SKSP PHLFDC Note of appreciation:           É wisè tï expresó mù thankó tï Richarä Conî foò           providinç thå SYSLI routineó anä concept¬ therebù           easinç thå programminç burden. ; Program Name: PRTSET ; Author: James L. Tuksal ; Version: 1.0 ; Date: 10/23/85 ; Note of appreciation: ; I wish to express my thanks to Richard Conn for providing the ; SYSLIB routines and concept, thereby easing the programming ; burden. ; Imported Declarations / References EXTRN CAPS EXTRN EVAL EXTRN ISALNUM EXTRN SKPUN EXTRN SKSP EXTRN PHLFDC ; Equates Debug EQU 0 ; debugging code: 1=include 0=exclude ; ASCII control codes Cr EQU 0Dh ; carriage return Lf EQU 0Ah ; line feed Eom EQU '$' .IN Z3OFFSET ; DOS BdosVec EQU 0005h ; vector to BDOS CmdLengthVec EQU 0080h ; Length of command tail CmdTailVec EQU 0081h ; command tail ; Macros ShowStr MACRO StrVec LD DE,StrVec CALL DisplayStr ENDM ; Insert values into the appropriate printer description within ; the environment desciptor. CSEG ; start of code PrtSet: JP Start DB 'Z3ENV' DB 01h Z3Vector: DW 0000h Start: CALL InstallCheck ; test installation RET C CALL HelpCheck ; test for help request RET C LD IX,(Z3Vector) ; get pointer to Z3 Environment LD HL,CmdTailVec ; get pointer to command tail CALL ShowBanner ; display banner (if quiet not set) CALL GetPrt ; get printer number RET C CALL GetCpl ; get characters per line RET C CALL GetLpp ; get lines per page RET C CALL GetTpp ; get text per page RET C CALL GetFf ; get form feed flag RET C CALL ModifyEnv ; modify the environment descriptor RET ; return to CP/M - ZRDOS InstallCheck: XOR A LD HL,(Z3Vector) ; get vector to Z3 Environment CP H ; test for prior installation JP NZ,Ok CP L JP NZ,Ok ShowStr Banner ShowStr NotInstalled SCF ; indicate error RET HelpCheck: XOR A LD HL,CmdLengthVec ; => length of command tail LD B,00H LD C,(HL) ; get command tail length OR C JR Z,Syntax ; go if no parameters LD A,'/' ; show help flag INC HL ; => command tail CheckAgain: CPIR ; scan for / LD A,C OR A JP Z,Ok ; go if characters exhausted LD A,'/' ; --===otherwise===-- CP (HL) ; test for 2nd / of // pair JR NZ,CheckAgain ; scan for next / Syntax: ShowStr Banner ShowStr Help ; otherwise show syntax SCF RET ShowBanner: LD A,(IX+Z3Quiet) OR A JP NZ,Ok ; go if quiet ShowStr Banner ; otherwise - shout it to the world RET GetPrt: CALL GetNumber RET C LD A,D ; get msd of 16 bit number OR A JR NZ,PrtError ; msd not 0 - number is way too large LD A,E ; get lsd of 16 bit number CP 04h JR NC,PrtError ; lsd must be less than 4 LD (PtrNumber),A ; save printer number for later ADD A,30h ; make it displayable LD (ModifiedPrt),A JP Ok PrtError: EX DE,HL ShowStr InvalidPrt CALL RangeError SCF RET GetCpl: CALL GetNumber RET C LD A,D ; get msd of 16 bit number OR A JR NZ,CplError ; msd not 0 - number is way too large LD A,E ; get lsd of 16 bit number OR A JR Z,CplError ; lsd must be greater than 0 LD (CplAmount),A ; save Cpl number for later JP Ok CplError: EX DE,HL ShowStr InvalidCpl CALL RangeError SCF RET GetLpp: CALL GetNumber RET C LD A,D ; get msd of 16 bit number OR A JR NZ,LppError ; msd not 0 - number is way too large LD A,E ; get lsd of 16 bit number OR A JR Z,LppError ; lsd must be greater than 0 LD (LppAmount),A ; save Cpl number for later JP Ok LppError: EX DE,HL ShowStr InvalidLpp CALL RangeError SCF RET GetTpp: CALL GetNumber RET C LD A,D ; get msd of 16 bit number OR A JR NZ,TppError ; msd not 0 - number is way too large LD A,E ; get lsd of 16 bit number OR A JR Z,TppError ; lsd must be greater than 0 LD (TppAmount),A ; save Cpl number for later LD A,(LppAmount) CP E JP NC,Ok TppError: EX DE,HL ShowStr InvalidTpp CALL RangeError SCF RET GetFf: CALL Parse JR C,FfError ; no parameter CALL CAPS CP 'N' JR NZ,FfOk ; go if printer form feeds XOR A JR SaveFf FfOk: LD A,01h SaveFf: LD (FfFlag),A ; save form feed flag JP Ok FfError: ShowStr InvalidFf SCF RET GetNumber: LD A,(ParameterNumber) ; bump parameter number in message INC A LD (ParameterNumber),A CALL Parse ; find parameter RET C ; oops...parameter missing CALL EVAL ; convert text to number IF Debug JR C,NumericError ; oops...Houston we've got a problem... PUSH DE EX DE,HL CALL PHLFDC ; display it to be sure EX DE,HL ShowStr NewLine POP DE JP Ok ELSE JP NC,Ok ENDIF NumericError: ShowStr NonNumeric SCF RET Parse: CALL SKSP ; skip spaces CALL SKPUN ; skip punctuation LD A,(HL) ; get character that stopped parse OR A ; check for end of string JR Z,ParseError ; thats all folks.... CALL ISALNUM ; test for alphanumeric JR NZ,Parse ; oh well, try again.... JP Ok ParseError: ShowStr Help ; no parameter - so show syntax SCF RET Ok: SCF ; clear carry CCF ; done this way to leave A intact RET RangeError: ShowStr InvalidRange CALL PHLFDC ; display number in error ShowStr NewLine RET ModifyEnv: PUSH IX LD HL,PtrNumber ; create offset to correct printer LD C,(HL) SLA C ; multiply by 4 (i.e. number of fields) SLA C LD B,00h ADD IX,BC LD B,04h ; number of fields to fill ModifyLoop: INC HL LD A,(HL) LD (IX+Z3Prt0Col),A INC IX DJNZ ModifyLoop POP IX LD A,(IX+Z3Quiet) OR A RET NZ ; go if quiet ShowStr Modified RET DisplayStr: PUSH AF PUSH BC PUSH DE PUSH HL PUSH IX PUSH IY LD C,09h CALL BdosVec POP IY POP IX POP HL POP DE POP BC POP AF RET DSEG ; start of data PtrNumber: DB 0 ; printer to modify CplAmount: DB 0 ; characters per line amount LppAmount: DB 0 ; maximum lines per page amount TppAmount: DB 0 ; text lines per page amount FfFlag: DB 0 ; form feed flag Banner: DB Cr,Lf DB 'PRTSET - Version 1.00 - October 23, 1985',Cr,Lf DB 'Copyright 1985 by James L. Tuksal',Cr,Lf DB ' All Rights Reserved' DB Cr,Lf,Eom NotInstalled: DB Cr,Lf DB 'This program must be installed via the Z3INS utility' DB Cr,Lf,Eom Help: DB Cr,Lf DB 'Syntax:',Cr,Lf DB ' PRTSET Ptr,Cpl,Lpp,Tpp,Ff',Cr,Lf DB ' where:',Cr,Lf DB ' Ptr is the printer to modify (0-3)',Cr,Lf DB ' Cpl is the characters per line (1-255)',Cr,Lf DB ' Lpp is the lines per page (1-255)',Cr,Lf DB ' Tpp is the text per page (1-255)',Cr,Lf DB ' Ff is the form feed flag (y or n)',Cr,Lf DB ' example:',Cr,Lf DB ' PRTSET 2,132,66,60,Y',Cr,Lf DB ' Modifies printer 2 for a maximum of 132 characters',Cr,Lf DB ' per line, with 66 lines per page, of which 60 can',Cr,Lf DB ' contain text (i.e. leaving a margin of 6 lines)',Cr,Lf DB ' for a printer that is able to accept form feeds.' DB Cr,Lf,Eom NonNumeric: DB Cr,Lf DB 'Non-numeric entry OR invalid format for numeric base ' DB 'in parameter ' ParameterNumber: DB '0' DB Cr,Lf,Eom InvalidPrt: DB Cr,Lf DB 'Invalid printer number: must be 0-3' DB Eom InvalidCpl: DB Cr,Lf DB 'Invalid number of characters per line: must be 1-255' DB Eom InvalidLpp: DB Cr,Lf DB 'Invalid number of lines per page: must be 1-255' DB Eom InvalidTpp: DB Cr,Lf DB 'Invalid number of text per page: must be 1-255',Cr,Lf DB ' must be < or = Lpp' DB Eom InvalidFf: DB Cr,Lf DB 'Form feed flag missing - must be "y" or "n"' DB Cr,Lf,Eom InvalidRange: DB '.....found ' DB Eom NewLine: DB Cr,Lf,Eom Modified: DB Cr,Lf DB 'Printer ' ModifiedPrt: DB '0 modified.' DB Cr,Lf,Eom END PrtSet