066010303050000132002006006010000
11
2#1
F0110000001
9[...................................................]0110
PRINTTODISKaccessory
Version1.0

UsersGuideAndDescriptionOfItsOperation

1.WhatisPRTODISK.ACC?

     PRTODISK.ACCisashortaccessory,whichallowsyouto
redirectprinting,practicallyfromallprograms,fromaprinter
toadiskfile.Allotherfunctionsoftherunningprogramremain
withoutanychange.Forexample,printercontrolcharactersare
notchangedandthereforeispossibletousePRTODISKforany
printer.


     2.ForwhichpurposeisPRTODISKsuitable?

     Firstofallfortheownprintingtothefile.Thenitis
veryeasytorealizeanytextorprintdocumentathomeandthe
ownprintingisdonelaterelsewhere.Thismaybeadvantageous
eitherincaseyouhavenoprinterorwhenyoudemandbetter
qualityoftheprint(forexampleonalaserprinter,whichyou
probablyhaven'tathome).
     TheothercaseinwhichyoucantakeadvantageofPRTODISK
issuchsituationwhenyouwanttodosomechangesintheready
printfilelaterandwithoutnecessitytoprintthisdocument
again.Youcansimplymodifytheprintfilebyatexteditorand
thenyoucanprintitdirectly.
     PRTODISKisalsotheonlyhelpincaseyourprinterisnot
compatiblewithsomeworldstandard.Insuchcaseitisnot
possibletousetheprintmodeofprofessionalprogramsbecause
youhavenotthecorrespondingprinterdriver.Butwhenyouhave
PRTODISKyouarelucky.Youmayprintafiletoadiskusingsome
standarddriverandforprintingonyournon-standardprinteryou
canuseasimpleprintprogramwhichprovidesexchangeofcontrol
charactersforcodeswhichusesyourprinter.

     3.HowtousePRTODISK?

     Itisveryeasy.Copytheaccessorytotherootdirectory
ofyourbootdisk(thesamewaylikeeveryotheraccessory).
Afterloadingtheprogramfromwhichyouwanttoprintand,of
course,alsoyourdocument,requiredfontsetc.Justbefore
printingyoucallPRTODISKfromtheaccessorymenuusingmouse
andchooseOPEN.Afterenteringthefilenamestartprinting.
ImmediatelyafterprintingisdoneyouagaincallPRTODISKand
chooseCLOSE.Andsothewholeprintingtodiskisover.

     4.Well.MustItakeespeciallycareaboutanything?

     Yes,itisverygoodtofindoutifyouhaveenoughfree
spaceonthefloppydisktowhichyouwanttoprint.Thegraphic
modeoutputsareusuallyverybigandfull-pagegraphicoutputs
forlaserprintershasuptoonemegabyteandyoumustcalculate
withthisfact.
     Itisalsoveryimportanttoreducetominimumthetimein
whichisactiveprintingtoafile(seebelow).Duringthe
printingtothefile(i.e.printfileisopened)isnotpermitted
tostartanyprogramorexitit(theaccessorydetectssuchcase
andRESETisonlypossiblewaytocontinue).
     Payattentionthatduringprintingtoafileyourprinter
mustbeswitched-off(orbetterdisconnected).Ifyoudon'twant
todisconnectorswitch-offtheprinteritissuitabletoswitch
ittotheOFF-LINEmode.
     NextImustnoteoneimportantfeaturesofPRTODISK.The
majorityofprogramsforSTcomputersdoesnotusethesystem
serviceforprintingoutputbutcontrolsdirectlyappropriate
integratedcircuitstoobtainfasterprinting.Thereforeitis
notsimple"tocatch"allwhattheprogramssendtothe
printer becauseincorrectaccessusedinsomeprogramsdoesnot
allowit.ThemethodsusedinPRTODISKarefromthispointof
viewalsoincorrectaccordingtoSToperatingsystem.Therefore
theauthordoesnotguaranteethefaultlessfunctionofthe
accessoryPRTODISKwithallvariousprogramsandprinterdrivers.
Authorrecommendstotestallonadisktowhichyoucopyall
necessarybeforestartingtousePRTODISK.Authorisnot
responsibleforeventualdamagesmadethroughunsuitableuseof
theaccessoryPRTODISK.


     5.HowdoesPRTODISKoperate?

     ThispartisintendedformoreadvancedSTuserswhoalready
knowsomethingaboutitsoperatingsystemTOS.Afterinstalling
tothememory,inboottime,PRTODISKdoesnotdoanythingelse
thanitiswaitingtoitsactivationfromtheaccessorymenu.It
doesnotchangeanysystemvectors,interruptionetc.Theother
situationcomesinthetimewhenprintingtothefileis
activated(i.e.aftertheprintfileisopened).Inthistime
PRTODISKis"hanged"ontheoperatingsystemtocatchallwhat
issenttoaprinter.Thistimeisalittlebitdangerousforthe
correctfunctionofthecomputerincasethattherunningprogram
hasaveryincorrectbehaviorbecausethesystemvectorsare
overwritten.Thereforeyoushouldtrytominimizethisdangerous
time.Thementioned"hanging"tothesystemisrealizedinthe
followingthreelevels:
     1.Thesystemlevel.ThisisdonebyredirectingofGEMDOS
andBIOSvectors.InthismodePRTODISKcatchallwhatissent
toaprinterbyTOS.Thismethodiscleanfromthepointofview
ofaprogrammerbutitisnotoftenusefulbecausethemajority
ofSTprogramsdoesnotusethismode(seeabove).
     
     2.Thehardwarelevel.Itprovidesprintingfromprograms
whichcontroldirectlySThardware.ForPRTODISKauthorproposed
severalmethodsforthedetectionofanirregularaccessto
hardwareregistersbutnoneofthesemethodsisperfectandwell
usefulinallcases.ThemethodusedinPRTODISKoperatesthe
followingway:
     -ifsomeprogramattemptstoswitchtheprocessorto
theSUPERVISORmodethedesiredswitchingisnotrealized
andtheprocessorwillstayintheUSERmode.
     -duringtheprogramaccesstothecomputerhardware
theBUSERRORsignalwillbegenerated(processorisinUSER
mode!)whichcausesthejumptoPRTODISK.Thereisprovided
storingofimportantdataandthentheTRACEmodeis
activatedandtheinstruction,whichisprovidingI/O
operation,isemulatedintheSUPERVISORmode.Asthennext
thestoringofthedatatotheprintfileisdone(ofcourse
onlyinsuchcaseifthetracedinstructionhassomethingto
dowiththeoutputtoaprinter).PRTODISKalsomusttake
careaboutBUSYsignal.Theprogrammustthinkthatthe
printerisREADYwhiletherealityisanother.
     -PRTODISKmustalsotakecareaboutalltriesof
executingtheotherprivilegedinstructions.Thenext
problemtodealwithissupervisorstackbecauseprocessor
isintheUSERmodeandnormallyusestheuserstack.
     -FrompreviousinformationitisclearthatPRTODISK
changetheBUSERROR,TRACEandPRIVILEGVIOLATIONvector.
     
     3.Interruptlevel.Itisclearthatallprivileg
instructionsandallinstructionswithaccesstohardware
registersareemulatedbyPRTODISK.Thereforethetimetakenfor
printingismuchlonger.SoauthorofPRTODISKinventedthethird
methodofprintingtofile.Thismethodiseffectiveandcorrect
fromtheTOS'spointofview.Unfortunatelythismethodusesa
littlehardwaresupplementwhichispluggedintotheCENTRONICS
port.Withmentionedsupplementitispossibletogenerate
interrupt(viaMFP)eachtimethebyteissenttotheCENTRONICS
port.Theinterrupthandlerprovidessafestoringofthatbyte.
Mentionedmethodissoftwarecleanandthereisnodangerouspart
likeinmethodusedsoftwareemulation.Butthisisnotuniversal
becausethereisonecriticalpoint-interrupt.Whenprinter
handlersetstheinterruptpriorityleveltoseven(whatsome
programsdo)thentheincominginterruptcannotbeexecutedand
PRTODISK,usingthismethod,isnotabletoprintanythingtoa
file.
     Howeveritispossibletosaythatatleastoneofthe
mentionedmethodsisusableforeachprogram.
     Authorknowsthatusedprincipleisnotquitecleanhowever
itisonlypossibleprinciple.SuchsmallexcuseisthatPRTODISK
putsbackallchangedvectorsandregistersinorderasifitwas
noteverincomputer.


     6.Isthereanypossibilityofconsultingmyproblems?

     Yes,itis.AuthorofPRTODISKisreadytohelptoall
PRTODISKusers.Thereisnotsuchproblemthatcannotbesolved.
Itisclearthatregisteredusershaverighttoobtainfree
higherandhopefullybetterversions.Bythewayauthorsoon
planstoreleasenewerversionofPRTODISKwithintegrated
packer,whichsavesyourdiskspace,alongwithshortprinting
programsforSTandIBM PC.Thisprintingprogramtakespacked
filefromPRTODISKandprintsittoaprinter.

Anyquestiontoauthoraddressto:
GeorgeLAMAC
FIDONET2:420/14.0
phone++42-2-842424
address:JiriLamac
Predborska8
18200Prague8
Czechoslovakia

Onthesameaddressthementionedhardwaresupplementis
available.
