.PO0 Talkin t Pris Printe wit WordSta an th Osborn 1 b Bria Dugle Fighte Pilo an sometim student... (Majo Dugl i a Ai Forc F-1 pilo presentl attendin schoo wit th Arm a F Leavenworth KS) Thi articl shoul b o interes t man othe neophyt hacker ou ther wh ar workin a learnin WordSta an gettin i t tal t variou do matri printers Severa article hav appeare i th FOGHOR abou interfacin WordSta an th th Epso MX-80/100 bu foun th informatio somewha fragmented--n doub du t m lac o experienc wit wha wa bein described I thi articl wil attemp t describ m experience i enoug detai s tha som o yo ne guys/gal ou ther ca lear fro them fo wha the are Specifically a goin t tal abou SETUP INSTALLin WordStar th capabilitie hav foun i m Pris 13 fro Integra Dat Systems an ho go i runnin wit m blu cas Osborn 1. fe week afte go th compute m mai orde printe showe up s decide t jum righ i an hoo i up ordere a RS-23 cabl wit th printer th cabl cam wit ta readin "Alto t Pape Tiger" picke th seria cabl becaus i wa available th ID printer us D 2 connecto fo eithe seria o paralle communications bu th edg connecto fo th Osborn wa no availabl ove th phon t hoo u t th paralle port. surve o th User' Referenc Guid fro th Osborn an th Owner' Manua fro th Pris Printe indicate tha neede t us SETUP progra o th Osborn CP/ Syste disk t configur th compute t tal t th printer di thi b puttin tha dis i driv A an th W dis i driv B: an typin SETU Th prompt i SETU ar self-explanatory th selection mad include Diabl (XON/XOFF seria protoco an 120 baud SETU als allow yo t assig value t th "specia functio keys" ^ thr ^9 I yo hav no don i already sugges yo loa commonl use string suc a "LB: an som other wil identif later. Afte completin th setu o m WordSta disk hooke u th cabl t th printe ( als se it jumper an di switche fo seria dat a 120 baud an turne i on--i worked di fin i wa necessar t cycl th OF LINE/O LIN switc sometimes thi turne ou t b cause b th protoco wa using. Th Pris Printe i ver "smart" i know whe i ha pape i it fo instance an wil no "go withou it A lon a yo leav i of lin (i ma b turne o an hooke up an pu i o lin onl whe yo wan t sen i tex o contro codes i wil wor fine. soo foun tha th programmabl functions describe i Tabl 6- o th Owner' Manual require sendin "escap sequences t th printer WordSta doe no see t lik non- printin character lik escape s wen bac t th books Th Use Guid include sectio o "Modifyin WordSta o th Osborn 1 b Tho Hoga startin o pag A-1 Thi sectio describe progra name INSTAL whic i o th CP/ Utilit disk INSTAL allow yo t chang th terminal printer communication protocol and/o th prin drive i th WS.CO progra an als allow yo t mak byt b byt patches I INSTAL yo wil fin brie explanation ar give o eac option Selectin on doe no commi yo t changin th W progra file--i allow yo t "bac out o an selectio befor makin i permanent Thi let yo chec ou an rea abou al th option befor yo chang anything Tr it. di no chang th termina selectio (selectio "U i "n change") a usin th Teletype-lik printe optio righ now selectio "A" bu selectio "C (backspacin teletype work also Sinc th protoco i handle outsid o WS th "n protocol optio an us o th CP/ Lis Drive see t b th correc choice t INSTALL thir an fourt questions O th othe hand ra i fo whil wit XON/XOF se i bot W an i CP/ an i stil worked s wh knows? A thi poin yo wil hav indicate choice o "n change (selectio "U" t INSTALL question abou th terminal printer communication protocol an prin driver Th nitty- gritt par come nex i th "specia modifications section INSTAL allow yo t ad specia characte sequence t hav you printe respon correctl t WordSta commands Thes includ hal lin advance backspace alternat characte set an s on whic ma var fro on printe t th next Eac sequenc i addresse b labe store i INSTAL o b fou digi he memor address ( kno o n complet inde t thes label an addresse bu rea WordSta Referenc Manual o th Customizatio Note probabl explai them Som ar liste i th Use Guid (mentione below an other hav bee identifie i othe FOGHOR articles.) Th Pris Printe respond t th standar ASCI code fo suc command a backspace linefeed an carriag return I als wil accep mor complicate command beginnin wit a escap characte whic establis th valu o som functions e.g. th siz o linefee o th positio o margin o ta stops. Tabl 6-4 mentione above list 1 programmabl functio parameter tha ma b se b sendin variou escap sequence t th printer A exampl i th Left/Righ Margi command Th tw argumen value ar th position o th lef an righ margin i 120th o a inc measure fro th left-mos printabl characte positio o th printer Escap i ASCI characte 2 (decimal) o 1 (hex) Th comman character J an th argumen value mus b separate b comm o spac characters Th terminato mus b non-numeri characte othe tha comm o space th dolla sig i suggeste sinc i i printin character bu perio o othe characte wil work. A exampl o th margi settin comman sequenc describe abov woul b CHR$(27) J 0 780 $ Thi sequenc woul se th lef margi a th left-mos positio an th righ margi a 1/ inche t th right Thi sequenc coul b loade int WordSta usin th specia modification par o th INSTAL program bu require a leas byte o space. loo a th "specia modifications label an th spac allotte t eac o page A-1 an A-1 o th Use Guid show tha findin plac fo thi comman coul b difficult Th onl are lon enoug i th initializatio sequenc whic allow u t 1 characters Puttin thi margi comman ther woul requir startin a th labe PSINIT an insertin th character 09h 1Bh 4Ah 2Ch 30h 2Ch 37h 38h 30h an 24h Thes enterie ar facilitate b hittin RETUR fo label afte th firs one INSTAL increment th labe addres b on whe yo hi RETUR instea o givin i ne labe o a address Onl th tw he value fo eac characte ar type in th lowe cas "h jus identifie eac a representin byt i hex. Inspectin th exampl abov ma giv ris t som questions Th firs byte 09h i cu t th W progra tellin i th numbe o character i thi comman string 1B i th ASCI escap characte an 4A i th ASCI cod fo "J i hex 2C i th comm use a separator 30h 37h an 38h ar th ASCI code fo th number "0" "7" an "8" an 24 i "$" Althoug thi sequenc wil fi here i i no reall ver flexible Yo ma wan t se som o th code tha wil fi suc a PALT: PSTD: ROLUP: ROLDOW: an USR1 thr USR4: Tabl 6- o th printe Owner' Manua list th contro code fo prin mode characte size typ spacin an s on PSTD an PALT coul b use t switc betwee 1 cp an 1 cp densitie (characte sizes) fo example Thi woul requir th following: PSTD 0 Numbe o characters PSTD + 1 1 cp densit cod fo th Pris Printer PALT 01 PALT + 1 1 cp densit code Usin thes code i WordSta document woul requir ^P fo standar an ^P fo alternat densit selection ROLUP an ROLDOW coul b loade wit 01h 19h an 01h 14 respectivel t allo printin subscript an superscripts Th USRx function migh b use t tur variou combination o proportiona an justifie prin mode o an off fo example: USR1 02 USR1 + 0 Printe justif ON USR1 + 1 Select proportiona spacin mode USR2 02 USR2 + 0 Printe justif OFF USR2 + 0 Select fixe spacin mode Thes mode woul b selecte i th documen b ^P an ^P respectively Thes coul b spli u int individua control fo eac paramete i n othe "user function wer needed. Mos o th location ar no lon enoug t le W pas escap sequence effectivel t th printer However thi sectio o INSTAL ca als chang an byt i th WS.CO program Som thing tha ar hand t chang her ar byte tha determin ho W configure itsel o startup Th followin addres label wer consolidate fro severa FOGHOR article reprinte i th Portabl Companion. ITITOG 0 Start W wit INSER OFF INITWF:+ 0 Start W wit Justificatio OFF ITPOPN F Default t OMI pag numbers WID 7 Set termina displa scree widt t 12 character (ma valu withou th warnin message) Minimu valu i 4 he o 6 decimal. 038 0 Default t rule lin OFF INITWF:+ 0 Default t Hyphe Hel OFF ITHELP 0 Default Hel leve t (0 i normal) DEL3 1 Set dela tim i hex delay th displa o "hel screens longe o shorte a desired DEL4 i normall 40h. Afte yo hav mad an change yo wan t try mak th las label/addres "0 (zero) INSTAL wil giv yo on las chanc t chang you mind I al i a yo desir it INSTAL wil sav you modifie WS.CO fil o th driv yo designate a th beginning O m machin thi take while jus wai til th drive qui turning Yo ca the tr you creatio b puttin th W dis i th defaul drive giv i ^C an the W . Thi bring m t th incredibl lon progra listin tha follow th tex o thi article MBasi allow sendin an ASCI character t th printe wit a LPRIN CHR$(xx statement s starte writin littl progra t mak fe smal computations chec them an sen the t th printe befor startin printin session gues go carrie away... starte ou b LPRINTin th code wante t sen t th printe directly Thi wa littl cumbersome s adde som routine t tak a inpu pag siz an som margi size an figur th value fo eac programmabl comman argumen fro thes inputs wante t chec wha ha befor sen i t th printer s pu i PRIN (t th screen sectio first Thi eventuall gre t th progra liste here Yo wil not tha decima ASCI code ar easie t us i BASIC s 1B (escape i no CHR$(27) PRINTER.BA i men drive progra tha ask yo fo al th informatio neede t configur you printer Margin an pag size ar pu i i inches muc easie tha thinkin i 48th an 120ths an th progra figure ou th cod neede b th printe t giv yo wha yo want No al th Pris Printe option ar covere (sinc don' hav colo i particular) bu mos are I i mor oriente t th shee feeder sinc tha i wha use bu i wil wor wit pin-fee pape also I i mostl self-explanatory bu som comment ma hel yo follo wha di an why. Th strin variable startin a lin 10 jus mak i easie t identif th progra o listin whil usin th sam line fo sign-o message Mos o th variable use ar liste an explaine i th nex section Th firs 1 ar give "default value i th process thes ma b change t whateve yo lik i mos cases Th string beginnin wit "D ar use t kee fro havin t typ th sam thin ove agai man time late i th program. DE F i use t implemen curso positionin o th screen CHR$(13 (C withou LF i i jus reset MBasic character pe lin counte s tha extraneou CR ar no inserte o th display. Althoug th progra gre wit man revision an modifications trie t kee th cod "to down a muc a possible Ther ar fe conditiona GOTO tha ski ove part tha ar sometime no neede bu onl on majo reroutin o th flo (155 GOT 950 i used Th res o i i handle wit GOSUB whic shoul allo eas understandin o wha i goin on. firs wrot th sectio i line 95 t 131 t prin th code o th scree a the wer t b sen t th printer bu tha mad i har t se wha yo had Yo coul substitut th subroutin fro lin 480 modifie t PRIN instea o LPRIN an t displa " instea o CHR$(27 (whic i non-printin o th display a thi locatio i yo prefe t se exactl wha yo ar sendin t th printer (Not tha som boundar check ar mad t kee fro sendin margin tha ar of th pape o negativ values thes shoul b retaine i som form.) Al o th "gotchas foun i usin WordSta wit m Pris 13 ar explaine i th scree comment include i th program Th bigges one com fro attemptin t us smar tex formattin progra wit a equall smar printer WordSta know th lengt o eac pag becaus yo tel i (defaul P i 6 lines) s i "knows i mus sen tha man linefeed t ge t th botto o page I yo leav th printer boundar ski switc ON fo example,i wil caus tex o subsequen page t craw dow abou a inc fo eac page Similarly i yo chang th siz o th linefee t somethin othe tha 8/48th ( lpi) followin pag format wil b wron unles yo redefin th pag lengt t WS. hav th Sprin Optio whic flie alon a 20 cp i draf font Correspondenc fon i printe a abou 11 cp i FIXE spacin mod o u t 15 cp i PROPORTIONA spacing On thin include wit th Sprin mod i draf fon characte spacin o 13. cpi--th onl wa t ge thi spacin i no t sen AN characte setting includin size font o typ spacin command t th printer Then i th di switche wer se t th 13. siz an draf fon a printe turn-on yo ca us tha siz characters Thi cause som o th otherwis extraneou conditiona statement i th LPRIN sectio (lin 4800). I yo us pi fe continuou pape yo wil us th printer FOR SE switc t se th to o for a th perforations FOR SE i no require whe printin wit WordSta an shee fe paper T LLIS MBasi programs FOR SE shoul b use t positio th firs printe line Usin FOR SE t pu th firs lin som distanc dow th pag subtract tha amoun fro th printabl are wit shee fe pape ( 1 botto margi remain a 1 i othe words) Left/righ margin ca b controlle wit WIDT LPRIN statemen t lis program withou settin margin a th printer A lon a yo d no wan th printe t justif you printing WordSta margi control wil wor fin fo printin documents I margin ar se i th printe an WordSta send lin tha i to long th printe wil ad a extr carriag retur an prin dangler. Microjustificatio i no supporte betwee WordSta an th Pris Printer T ge proportiona printin fro th printe require th printe justificatio O an require settin margins hav foun th mos reliabl metho fo usin thi capabilit i t compos th tex i WordSta "N (non-document mode Thi mod doe no ad CR o LF a th en o eac line Th printe woul rathe d it ow wor wrappin i thi mod anyway Th proble i tha th numbe o character pe inc change i th proportiona prin mod (the ar muc close together) an ther i n eas wa t figur ou wher line wil end Th printe wil justif line ende wit CR bu the mus b mor tha 75 o th margi widt an n greate tha th margi width I yo se 1/2 printline tur W justificatio off an us th defaul lin lengt i W o 6 character yo wil fin som line sprea ou t cove th widt o th pag bu mos wil b to short I othe words th actua spacin yo ge i 1 character pe inc proportiona i 1 o 13 Unfortunately hav foun n wa t determin th resultin spacin accuratel becaus i depend o wha letter eac lin has "i's tak u ver littl roo compare t "m's" An lin wit to man lon letter i i ma en u wit th printe wrappin word Sinc W inserte CR/L a th en o th line th printe wil leav dangle whil screwin u th pag forma wit a extr linefee tha W i no counting. Th botto lin abou th printer proportiona spacin mod i tha i doe i b itsel ver nicely bu WS attempt a formattin ar no ver compatible T prin non-documen tex fil us PI LST:=. ERAsin th SAMPLE.TX fil o th W dis allow roo fo PI wit singl densit drives PI ca the b use vi th WordSta comman withou leavin WS. Th pretties justificatio fro WordSta "D mod file i t tur W justifyin OFF leav th printe justifyin O an proportiona OFF an se th margin appropriately Thi techniqu make al space o eac lin equal Don' forge t reforma (^B th fil i yo wrot i wit W justificatio on Paragrap indentin wil var som an tabula dat wil no lin u exactl wit justif O becaus eac lin i stretche ou differen amoun t fil th widt o th margins On wa aroun thi proble i t se horizonta tab fo paragrap indentin o column an us specia ta characte i on o th "user function (se i u wit INSTALL) Anothe wa i t leav th justificatio of fo numbers lists o othe columna data. Configurin th printe wit th PRINTE progra i mos easil accomplishe b copyin you MBasi disk ERAsin th uneede CBasi files an puttin cop o PRINTER.BA o tha disk Whe yo ar read t prin documen o file sav i wit ^KD Tak th dis wit you tex fil ou o driv B an pu th MBasic/PRINTER.BA dis i it place Us WordStar "R comman t ru progra an typ MBASI i respons t th prompt Afte MBasi i loade typ LOA "PRINTER" Afte i ha loade typ RU an answe th program men questions D NO selec th "rea las save parameters optio th firs tim throug becaus ther wil no b PRINTER.DA fil t read sav th defaul parameter o you choice o tha firs ru an i wil creat th dat fil fo you Th printe mus b O LIN an hav pape i i (FAUL ligh OFF t accep th code yo sen it I everythin stop whe yo sen code o tex t th printer jus cycl th mod switc t OF LIN an bac t O LIN t sen "go signa t th CP/ Lis Drive protoco checker Whe th printe ha accepte th code an yo hav th MBasi promp back remov th MBasi disk pu th documen dis bac i driv B: an typ th MBasi comman SYSTEM Thi wil sen yo bac t WordSta whic ask yo t hi an key the i reload itself Thi proces i ver quic an eas i yo progra thre "specia functio keys o you W dis (us SETUP wit th command RMBASIC LOA "PRINTER",R an SYSTEM Yo mus hav driv B logge i a defaul i W fo thi procedur t wor correctl a describe (thi assume W i driv A an you tex fil i replace wit MBasi i driv B:). Tha i al ther i t it a sur yo wil wan t chang th progra t d thing you way suc a ignorin draf v correspondenc fon i yo d no hav th Sprin mod o configurin th defaul value fo us o rol pape rathe tha sheet i yo don' hav th shee feeder I shoul b relativel eas t chang cop fro th FO librar (whe i goe in o a yo ke i i yourself I yo hav som othe typ printer thi ma giv yo som idea o ho t ge i workin th wa yo want Hav fun!