Programmer's Guide toOrbit, the ROS Adapter, and the Dover Printerby Bob Sproullrevised by Dan SwinehartMarch 5, 1983This report presents the Orbit, ROS adapter and Dover printer hardware from theprogrammer's point of view. It is intended to contain "all you need to know" to write printingprograms using the gear. In addition to information about control of the hardware, it givesvarious techniques and tricks that were either planned or discovered. This document is for Xerox internal use onlyThis document is for Xerox internal use onlyXEROXPALO ALTO RESEARCH CENTER3333 Coyote Hill Road / Palo Alto / California 94304 Vp T Qqr P Kaq 9Ts4K5 7? 6V 4^E .tF|rX,|h,)W u)` r)` yqF4p >Qh.aProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer1IntroductionThe hardware described in this report is intended for printing pages consisting primarily of text andlines on raster-scanned printing devices. There are two main tasks that this collection of hardwareperforms: (1) image generation, in which a binary representation of a video signal is prepared at highspeed, and (2) transmission of that video signal to a raster output scanner (ROS).Although the hardware can be adapted for other uses, the report takes the view that the followingconfiguration is being used:Alto II. We begin with an Alto II computer, with which the reader is assumed to be familiar(see the "Alto Hardware Manual"). We add:Orbit, a four-card hardware device that plugs into the Alto II. The Alto II requires aspecially-wired backpanel to accommodate the Orbit cards (some Alto II's are manufacturedwith this backpanel already arranged). Orbit provides facilities for image generation: theresulting raster image can be returned to the Alto memory or can be forwarded via a "9-wirestandard ROS interface" to:TTL ROS adapter, a two-board hardware module responsible for orderly communicationamong the Orbit, ROS optics head and printing engine. This is usually mounted in, andconnected to:The Dover printer, a Xerox 7000 copier with a specially-designed laser-scanned imaging headon it. Properly controlled, this engine delivers 1 page/second (paper speed is 10 inches persecond). A modification is possible (the "extended Dover printer") that slows the transportspeed to 5 inches/second and page delivery to 1 page/2 seconds.There are numerous variations on this basic arrangement. Because the Alto II/Orbit paircommunicates with the adapter using a standard interface, it is capable of operating with otheradapters and printing engines that conform to the standard. Also, the TTL ROS adapter can be usedto control other printing engines. Some alternatives are:The Sequoia printer, a Xerox 3100 copier with a ROS head on it. It delivers 1 page/3 seconds(paper speed is 3.46 inches/second).The Puffin printer, a Xerox 6500 color copier with a ROS head on it.The Penguine printer, a Xerox 5400 duplex copier with a ROS head on it.The basic idea of the entire arrangement is that a program in the Alto II can operate all these devicesto cause pages to emerge from a printer. The remainder of this document will by and large assumethat we are operating the standard Dover printer (10 inches/second). The basic ideas will remain thesame when operating other printers, but many of the timing details will change.For the purposes of discussion, we will assume that the printer scans the page in landscape mode(mode=8, in the Press terminology). Scan-lines run from bottom to top of the page (when the pageis held in the normal portrait orientation); the first scan-line is at the left-hand side of the page.Orbit does not "know" that the video signal it is generating will be used to scan in landscape or inportrait mode, but we need to stick to one convention for the purposes of exposition.The Orbit, ROS adapter and Dover printer system is quite tightly integrated; consequently, explicationof the system is somewhat difficult. The reader is urged to bear with us, to skip sections that becomeobscure, and to read the document several times before abandoning all hope! For a first reading, thefollowing sections are recommended:Section 1, through 1.4fpX!qFpXHY gbr g^p\ g]n[ g[ sp@ gZfs p2qp gW;E gU]R;!]Q*]M@]LX(1]JR]IP&5]Gqp]Dqpqp%&]CqpB]A ]>mI]<M];e9#]9? g6+- g51<# g3*qp g2):].0qp"]-z$]*N5qp ]'#8qp g#I g"sC g I gkO g@7s gpL g8 X g.6 g0U g qpF gF! gK gx# p g )@\SProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer2Section 2, through 2.4Section 3PeopleNumerous individuals and groups have contributed to the Dover program: the design and fabricationof Orbit, the ROS adapter and the Dover printer and ROS. This document is only a condensation oftheir designs and ideas. The overall Dover Program was managed by John Ellenby. The DoverPrinter was designed by Gary Starkweather, Gary Swager, Tibor Fisli, Ed Wakida and BobbyNishimura with contributions on producibility from Abbey Silverstone and on mechanical andindustrial design from members of EOD/SPG and others on the program team. The ROS adapter wasdesigned by Ron Rider, Ken Pier and Ron Freeman. Orbit grew out of a suggestion by ButlerLampson, and was designed by Severo Ornstein, Jim Leung and Bob Sproull. The standardmicrocode and test software were devised by Bob Sproull. In the closing months of the program,Gary Swager played a key role in coordinating the system integration of the Dover printer electronics,electro-optics, and the 7000 base. Dover ROS equipment is manufactured under the direction of TiborFisli and the Dover System is manufactured and integrated by SPG under the direction of DougStewart who also supervised the design and engineering contributions of SPG. Bob Sproull and DanSwinehart produced the Spruce software that provides printing service using Orbit devices.Numerous organizations cooperated very effectively on the Dover project. The people mentionedabove came from PARC/CSL, PARC/OSL, PARC/SSL, SDD/SD, and EOD/SPG. The project was feasiblein part because flexible funding was provided by the PARC Office of the Center Director.fpX!qFpXHYb` g[s gXpJ gW; qpqp* gU7$ gT3/) gR> gQ+"qp&qp gOK gN#F gLD gKD" gI"qp7 gH=qp gFHqp gE Z gA&8 g@[q&pqp g>5qp g>?){Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer31. OrbitOrbit's main chore is that of image generation: it is designed to merge rasters at very high speed.Normally, Orbit merges raster definitions of individual character shapes into a very large raster thatdescribes an entire page of text.By a raster we mean a rectangular region of a raster-scanned image, in this case an array of 1-bitvalues. A raster is characterized by its width and height (see Figure 1-1). Although there are manyways that the data bits within a raster might be represented, we shall be interested in only thesimplest: we record a stream of bits, generated by scanning the raster in a prescribed (conventional)manner. We shall assume that rasters are scanned from bottom to top, and then from left to right.Figure 1-1 shows a tiny raster, the bit stream that results from scanning it, and the blocking of thatbit stream into 16-bit words suitable for recording in Alto memory.If we were to generate a raster representation of an entire page, and save it in memory, we would beoverwhelmed by its size. A page 8.5 by 11 inches scanned at 350 bits/inch requires 11.5 * 106 bits, orsome 710,000 words of Alto memory! Therefore, we are forced to generate the page rasterincrementally, using smaller buffers. If we wish to avoid a full-page buffer, we must of coursegenerate the scan-lines of the raster in the same order as the ROS device accepts them.The unit of buffering in Orbit is the band, a group of 16 consecutive scan-lines. We will want togenerate band images in the same order that the ROS accepts the scan-lines that comprise the bands.In the case of Dover, which scans in landscape mode, we will generate first the band corresponding tothe left-most 16 scan-lines on the page, then the next band to the right, etc. Orbit's task is to preparethe raster describing each band faster than the ROS yanks band rasters away in order to print them!Orbit contains two buffers, each of which holds one band; the buffers are labeled A and B. Whileone buffer is being used to prepare an image (the image buffer), the other, which contains an already-prepared image, is being sent to the ROS (the output buffer). After the ROS is finished accepting theband raster, the roles of the two buffers are switched. Each buffer contains 16 scan-lines; each scan-line is 4096 bits long (see Figure 1-2). We can thus think of a band buffer as a two-dimensionalarray of bits, in which the x dimension (0 through 15) indexes scan-lines, and the y dimension (0through 4095) indexes bits within a scan-line. If the total height of the raster on the page is less than4096 bits, the upper region of the band should be used (that is, the region with larger y addresses).The reason for this will appear below.1.1 Image generationOrbit excels at merging rasters represented as bit streams in the Alto memory into the image bandbuffer. Figure 1-3 illustrates one case: a character is represented by a raster in memory, characterizedby its height and width. It is to be merged into the band by placing its lower left corner at location(x,y) in the band. This is effected as follows:1. Alto microcode passes to the Orbit hardware the four parameters x, y, height and width.2. Alto microcode starts passing to Orbit the successive 16-bit words representing the bitstream for the source raster. Orbit takes each word, positions it on the proper scan-line, andat the proper vertical position, and merges the 16 bits into the raster already saved in theband. Each time Orbit finishes work on a scan-line, it increments the x position to move to anew scan-line, and decrements a width counter that counts remaining scan-lines in the sourceraster. 3a. Eventually, (at least in this example) the width counter reaches zero, indicating that thesource raster has been exhausted. The Alto microcode loop that is repeatedly passing rasterbits to Orbit is terminated when the width reaches zero.fpX!qFpXHY(ati g^psps p g](W g[! gXxsp: gVspsp+ gUpI gSs p& gRh W gP.8 gO`C gL5P gJj]JqJjp gH.* gGbs p', gE?qp gB sp8 gA.0qp $ g?41 g>&\ g<0qp0 g9w spO g72sp& g6oqpspqp g4P g3g5, g1sp6sp g0_J g.s"p"sp g-V& g*+s g'p=sp g%|P g#spsp B g"ssp,]HBs ps]p8"] Q] O]Fsp] sp0]]]!=]":]U8 g@YBandhrqw><(x,y)>4096 bits)Y (0 to 4095;X (0 to 15; 16 scan-lines)>qRaster bit stream:1 0 0 0 (padded with zeroes)1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0Last scan-lineFirst scan-linerrHeightqrWidth<>1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 0Figure 1-1: Source raster and encodingFigure 1-2: Band bufferFigure 1-3: Copying a source rasterRaster bit stream, packed into 16-bit words:qEach scan-lineis scanned inthis direction$:#%$5 2 $,sG,s+G0WHG,s#GBA$9A$9d$k $ yk k|U$VA$rH$H$H$H$ H$ VH$ H$ 9H$ H$ H$ H$ H$ rH$H$VH$H$ pF>^@(Y(%\_%:|TVT%Z&$%W$]\ $W$$)pR)|Ro)K*:NX$]*:T$pJQ3tI%:I#J9$zJ9$$N9$N9$O-9$O9O9O-9N9N9"sPJ9"sP9"sQf9"sQ9 :Q9 :Qf9 :P9 :PJ9PJ9P9Qf9Q9T-9S9S9R9"sR9"sS9"sS9"sT-9 :Vf9 :U9 :UJ9 :T9&N$$N$"sN$ :N$N$N$M $P& @$R_ $T @$V $pE 'rt9&9 O) O# pB,Lf$ |S!pT R_ PITwProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer4It commonly happens that the width of a character exceeds the width of a band, and thus thecharacter extends into subsequent bands. In this case, we need another way to terminate the loop:3b. Eventually, the last scan-line in the band (x=15) has been processed, even though the(character) width counter has not been decremented to zero. We must terminate that loopthat passes raster bits to Orbit, but we must remember enough information so that we canresume processing of the same character when it comes time to work on the next band.The "left over" information that must be remembered for the next band consists of two sorts ofinformation: basic information about the character (the height of the source raster and the ycoordinate that determines where the bottom of the source raster is to be placed in the band) and adescription of the portion of the character remaining to be generated (a new value of the widthcounter, representing the unprocessed width remaining, and a new pointer into the bit stream for thesource raster, which describes where to resume taking bits). The leftover source raster pointerrequires 20 bits, and consists of two parts: the most significant 16 bits specify which Alto memoryword is the first to take up next time, and the low order 4 bits specify which bit within the wordshould be the first to be processed.So Orbit gives us help with the inner-most loop: positioning the character raster on the band raster,and merging the bits into it. Alto microcode, however, is responsible for an orderly processing ofcharacters, for fetching source raster words and passing them to Orbit, for saving "left over"information, and for interpreting this information properly when the next band begins.The details of the "merge" operation performed by Orbit offer some flexibility. A band buffer startsout with all bits set to 0this is actually accomplished by clearing the words of the band as they areread out and passed either back to the Alto or on to the ROS. The "inner loop" of the mergeoperation is responsible for changing a particular bit in the band buffer (BAND[x,y]), based on thevalue of a particular bit of the source raster bit stream (SOURCEBIT). The algorithm is:if SOURCEBIT=1 then BAND[x,y] _ INK[x, y mod 16]where INK is a 16 by 16 bit memory in the Orbit hardware that can be set by the Alto. The intent ofthe ink memory is to permit "gray" colors to be created by spatial halftones. In most cases,characters will want to be "black," and the INK memory should contain all 1's. In light of the abovealgorithm, the proper way to view the input raster is: it is a mask, with 1 bits everywhere the"character" form lies. It is not correct to think of the 1 bits in the source raster as "data" bitstheINK memory provides the data bits.There are some special cases of the Orbit image-generation technique that deserve mention. First, itis possible to have a source raster with width=15 and height=4096. This is a useful mode ofoperation when a binary image has been pre-computed, and Orbit is being used simply as a pipe toshovel the image toward the ROS. Second, there is at least one case when it is senseless to have anactual physical representation for the source raster. This occurs when merging "rules" (or "lines")into the band raster: in this case, the raster representation of the input bit stream consists of anendless string of 1's, and we do not need to actually store this string in memory. For rules, then, it ismore convenient to provide the four parameters (x, y, width, height), but to omit the memory for thebit stream, and simply ship 1's (words with all 16 bits equal to 1) to Orbit.1.2 Reading a bufferWhile the image band buffer is being prepared with an image, the output band is being read out,either to the ROS adapter or back into Alto memory. The read-out mechanisms are similar, andrequire some explication. The basic read-out operation cycles through all 16 scan-lines (x=0 to 15),and delivers information from each scan-line beginning with y=FA*16, and ending with y=4095 (FA,which denotes "first address," is a number in the range 0 to 255 that can be set by the Alto). Afterthe last bit (4095) of the last scan-line (x=15) has been read out, Orbit will "switch the buffers" (i.e.,interchange the role of buffer A and buffer B). The next bit to be read out will come from the otherbuffer.fpX!qFpXHY gb9" g`!A]]n0sp ][X]Zf!7]X= gUN gT38sps gRp.5 gQ+Zs gOp\ gN#J gLc gKR gI$ gFkX gD7, gCcR gAV g>=( g=/] g;1qp g:''$qp g8;qp]5xsqpspqpspqpsp g2Lqp8# g07& g/Dqp5 g- )s( g,<psp4 g*qp g'I g& spsp g$I g#qp) g!}-7 g\ gt$F g0sp glN gAs gp spsp g qpL g @sp g,spqpspqp g*: g +sp. g Q g y^ g 2?]Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer5The FA mechanism has a minor effect on the way images should be generated. If the receiver of thevideo (usually the printer) is instructed to place the first bit of each scan-line at the bottom of thepage, the next slightly above it, and so forth, then the relation between vertical position on the page(yp) and address of the bit in Orbit's buffer (y) is: y = yp + (FA*16). Consequently, the number(FA*16) must be added to each desired page position (yp, measured in bits) to determine the proper yaddress to provide to Orbit. (Note: This addition can be easily excluded from the inner loop bymaking modifications to y incrementally, spacing appropriately for each character encountered.) The act of reading a buffer also writes zeroes into it: this is an economical mechanism for clearing abuffer. The normal practice, therefore, is to read a buffer thoroughly simply in order to clear it.After the buffer is read, a "buffer switch" happens, and the cleared buffer becomes the image bandbuffer.The most common use of Orbit is to drive a ROS printer. In this case, FA is simply set so that theupper portion of the buffer which is used corresponds to the desired image height for the entire page.In order to clear both Orbit buffers initially, we arrange two dummy bands of image information thatwill lie off the actual page image (i.e., to the left of the page, on Dover). Thus the first two buffersread, which may contain garbage left behind from previous operations and from lack of refreshing,will not be visible on the page. When used to drive a ROS (which requires FA to be a multiple of 4in order to communicate video data sucessfully to the ROS adapter), Orbit can deliver video data at arate of 23 MBits/sec.The other common use of Orbit is to take advantage of its fast image-generating capability, but toreturn a completed band to the Alto memory. Details of this operation are given in section 1.8.1.3 Communicating with the ROS adapterOrbit also provides functions for controlling the ROS adapter and its associated printer. Twocompletely independent mechanisms are used for sending control information and for reading ROS(and adapter) status. Orbit will accept 16-bit commands from the Alto and forward them to theadapter. It is also constantly reading the status line returning from the adapter, and is capable ofreporting 256 bits of status generated by the adapter.1.4 Orbit Programming  the common casesThe next several sections of this guide describe the operation of Orbit undertaken with the "standardmicrocode," and then the regimen for writing microcode if you so desire. This section describesthose elements of Orbit that must be understood to operate the hardware using either the standardmicrocode or specially-written code.The control of Orbit is accomplished with one Alto microtask (task 1, next to lowest priority), and anassociated collection of microcode that executes within that task. Remember that the Alto must be"bootstrapped" after loading the microcode into the RAM in order to initiate task 1's program counterto point to the proper RAM routine. (For more information about microcoding and bootstrapping, seethe Alto Hardware Manual.)The record of activity of the Orbit task is quite complicated. The task is initially inactive: the Altoprogram must initiate Orbit activity by issuing StartIO(4), which signals the Orbit hardware to activateits task. During the active period, the details of the microcode functions sent from the Alto to Orbitwill govern exactly when the Orbit task is run. However, at the termination of a sequence ofcommands the microcode usually instructs Orbit to return to the initial, inactive, state. (This last issimply a convention; the "standard microcode" normally uses this convention, but has an exception aswell.)Standard microcodefpX!qFpXHY gbqp? g`61 g_(? g]sp,spspspqp g\qp2sp "s gZpX gYspF gUR gTV<( gRXsp gQN gN#+qpqp gL51 gK/5 gIsp] gHB gF!qpqp gE 6qp " gC g@[9) g>J g;sus g8p2qp) g6N q g5xpJ g3Q g2p6 g/Ds( g,p>' g* U g)$= g'$ g$a [ g"B g!Y4qp% gqp5 gQ g&K g/9 g^ gZ g.: g6. g  gs0 g@YpProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer6The remainder of this section describes simple use of 6 functions of the standard Orbit microcode.(The standard microcode includes many additional functions for debugging and for more exotic usesof Orbit. These are taken up in subsequent sections.) The standard microcode was written toaccomodate most Orbit chores, including normal printing tasks and hardware diagnosis. Themicrocode source files can be found on [IVY]SpruceMc.Dm.When the Orbit microcode is activated, it figures out what to do by reading a control table. Toexecute a command, a pointer to the control table (which must begin at an even address) is placed inlocation 720b, and StartIO(4) is executed. When execution of the command is complete, the Orbittask stores 0 in location 720b, an event that can be detected by the Alto program. Note that duringexecution of an Orbit command, the Alto emulator program continues to runthe Orbit task and themain program are asynchronous. To allow Orbit maximum access to the Alto microprocessor, it isadvisable to curtail activities of other microtasks while printing is in progress. The display shouldcertainly be turned off; stopping disk or Ethernet activity is less beneficial.The control table is 11 words long, and has conventional names for each word:DirectiveArgument1Argument2nBandsMinus1FAwordLoTableFontTableNewCharPointerResultOrbitStatusResultCurrentCopyThe Directive is a small integer that indexes the various operations that can be performed by themicrocode; each operation is given a name of the form Programxx. When a command terminates, thecontrol table entry OrbitStatusResult is loaded with the inclusive "or" of Orbit hardware status(OrbitStatus, bits 8-15) and microcode status (FirmwareStatus, bits 0-4), described below. If anoperation returns a result, it is usually stored in the Result entry of the control table.ProgramControl (directive=0). Argument1 is passed to Orbit as a control word. In the simplesituation we are considering here, this function is used only to reset the Orbit hardware entirely(Argument1=1).ProgramXY (directive=3) and ProgramInk (directive=7). In the simple situation we areconsidering, it is necessary to set the INK memory to contain all 1's so that all characters willappear black on a white background. This can be achieved during initialization with a simpleloop that uses ProgramXY to set x, and ProgramInk to set the 16 corresponding bits of the INKmemory:for i=0 to 15 do beginExecute ProgramXY with Argument1=i * 4096 (i.e., i in leftmost 4 bits)Execute ProgramInk with Argument1=1endProgramROSCommand (directive=9). This operation sends Argument1 (16 bits) to Orbit to beforwarded to the adapter as a command. Adapter commands are discussed further in section 2.ProgramROSStatus (directive=14). This operation reads an entire word (16 bits) of ROS status.If we view the 256 status bits as lying in 16 16-bit words, numbered 0 to 15, then this functionstores in Result the current value of status word n, where Argument1 = n * 1024.fpX!qFpXHY gb.4 g`01 g_= g]A g\&q p gXC s p gW^+9 gU R gTVS gR00 gQN=" gO Z gNFO gKMGFkDCc Aqp@[>=S ;:K8 g5spT g4) rp" g2G g1r pU g/Z,_r pN*3/)W &,rpr p$(qp ,#$-0!rpspr p)q plrp5r pd9rvrp9?rvrp0qpM 2spsp  g :?ZXProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer7ProgramGeneratePage (directive=12). This function is the only complicated one, and isresponsible for image-generation and printing of an entire page. The details are presented below.The page-generation functionThe ProgramGeneratePage function is the main "workhorse," and contains the necessary facilities tokeep a printer running at high speed. It depends on a data structure for describing the placement ofcharacters on the page and for encoding the rasters that are to be printed for each character (thefont). Building this data structure will require a pass over the each page before it is printed (more onthis later). Figure 1-4 summarizes these data structures, which are explained in the followingparagraphs.Fonts. The microcode believes that there is only one font, but it may contain an enormous numberof characters (up to 215 if you can figure out where to find memory for them!). Each character in thefont is represented by a contiguous block of memory words, formated as follows:Word 0:Height (in bits) of the character. Heights of 1 to 4095 are legal.Word 1:Width1 (in scan-lines). Widths of 1 to 4096 are legal.Word 2-n:Bit stream for the encoding of the character rasterWord 0 must lie on an even memory address. The sample character given in Figure 1-1 wouldtherefore be represented as:Word 0:4Word 1:4Word 2:103126bWord 3:100000bTo verify that you understand this encoding, you should be able to compute n (answer:i(Height*Width)/16j+1).The font is indexed with a table: if the pointer to the base of the table is denoted by FontTableX,then the contents of memory location FontTableX+cc points to Word 0 of the characterrepresentation for character with code cc.Band Lists. The most interesting piece of data structure is the band list, an encoding of whereinstances of various characters should appear on the printed page. This list is divided into segments,one for each band. Each segment gives information about the characters that begin in thecorresponding band; Orbit microcode will handle the details associated with continuing the charactersinto subsequent bands if necessary.A band list segment is a table of entries of one of four kinds:1. Character. A character to be placed on the page is described by a two-word entry:Word 0[0]This bit must be 1.Word 0[1-15]Character code. This number is used to index the font table to find apointer to the character encoding for the character to be printed.Word 1[0-3]XOffset. This gives the scan-line, within the band, at which the left-mostedge of the character raster should appear.Word 1[4-15]Y. This entry gives the y address at which the bottom edge of thecharacter raster should appear.2. Rule. A rule to be placed on the page is described by a four-word entry:Word 0This word must equal 1.fpX!qFpXHYbrp  $`02 g]ns gZCprp= gXG gW; U gU36 gT3N gR gOspV gMNFqMp< gL5O2I-<2G02F$sp0 gC6$ gA2>2= 2;2: g6%Ksp g5xwpwp g2LW g0#0sp$ g/D'sp g,s psp g*43 g)Fsp g'32 g& # g"? gU]] - B] "!v+]e sp( gL]  " g ^?Z^Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer8Word 1[0-3]XOffset. This gives the scan-line, within the band, at which the left edgeof the rule should appear.Word 1[4-15]Y. This entry gives the y address of the bottom edge of the rule.Word 2Height. This entry gives the negative of the number of bits high therule should be. Heights of 1 to 4095 are legal.Word 3Width1. This gives the width, in scan-lines, of the rule. Widths of 1 to4096 are legal.3. Jump. This entry provides a conditional method for obeying or ignoring selected band list entries,to implement the "only on copy" feature in Press-format files (see further discussions below.)Word 0This word must equal 4+(Copy*32), where Copy is the copy number inwhich the following entries are to be printed. A jump will occur, omittingthese entries, if Word 0 is not equal to the CurrentCopy field in thecontrol table. A version of this command must appear in every band inwhich information conditioned on this copy number occurs. Copy must bea positive integer less than 1024.Word 1Jump distance. This must be equal to the size, in words, of the entries tobe omitted when the inequality holds.4. End-of-Band. After the last entry for the band, a two-word terminator is placed. Both wordsshould be 0.A complete band list, consisting of a contiguous sequence of band list segments (one for each band),describes an entire page. In the discussion below, we shall assume that the band list for a page ispointed to by the pointer BandListPointer; the band list must begin at an even address.In most cases, constructing the band list from a document description will require an initial pass overthe document description. One of the functions of this pass will be to map font descriptions andcharacter codes into the one-dimensional font representation used in the structures above (i.e., a single15-bit character code). Another function of this pass is to perform a sort: it will be necessary toprocess characters as they are extracted from a document description, determine the x and y positionsof the lower left corner of the character raster by consulting a font description, and build a 2-wordcharacter entry. These entries will then need to be sorted by band number (a bucket sort isparticularly reasonable for this task) in order to re-assemble the character entries into band listsegments.Left Over Table. The Orbit microcode will normally need access to a region of memory that can beused to save left-over information needed to resume image generation of characters that extendbeyond one band. The discussion below assumes that the pointer LoTablePointer points to such atable; the table must start on an even address. The left-over table can be reset to the empty state bysetting the first word to 0. Each left-over character in the table requires 4 words. Furtherunderstanding of the format of the left-over table is not essential to operate ProgramGeneratePage,but may be helpful for debugging (see Section 1.10).Arguments. This function performs image-generation chores for a number of bands, and in additionforwards the image to the ROS adapter for printing by turning on SLOTTAKE. The arguments in theOrbit control table are:Argument1 = Pointer to adapter command table (must be even; see below)Argument2 = Timeout count, in units of 2 ms.nBandsMinus1 = number of bands to generate, minus 1FAword = FA*256 (i.e., FA must be in the left byte)LoTable = LoTablePointer (left-over pointer, must be even)FontTable = FontTableX+100000b (pointer to font table, offset by 100000b)NewCharPointer = BandListPointer1 (BandListPointer must be even)CurrentCopy = 4 + (current copy number)*32fpX!qFpXHY]b +`]^ sp"]\w:Z0]X:W^ gT3 X gRJ]P9O5MspL4J5I "]F7Et% gBI5+ g@ g=U g<L g:W g7fg g5K g4^Z g2Gsp g1U/%spsp g/ Y g.M;! g,T g+E g(spQ g&W g%X g#R g" V g 4rp g4 gs p4! gRqp$qp gFB,3:qpqp qp:2I A **d g ?](Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer9The function will attempt to generate images for the specified number of bands; of course the bandlist pointed to by NewCharPointer+1 must contain an adequate number of band list segments. Thevalue in the nBandsMinus1 entry will be decremented at the end of each band, allowing the emulatorto track Orbit's progress. The timeout count is used whenever Orbit is waiting for the ROS adapter tofinish reading the output buffer: if the timeout is exceeded, the microcode completes early (as ifnBandsMinus1 were so small that it did not include the next band) and sets the firmware status bitTIMEOUTmc (bit 1) in the OrbitStatus word of the control table. The most common reason fortimeout is the failure of page sync to arrive: these issues cannot be fully discussed until the operationof the adapter is described in some detail in section 3.After the last band is generated, the ProgramGeneratePage function completes (i.e., sets location 720bto zero), even though the ROS adapter has probably not finished taking image data. In fact, theadapter can continue to request and receive data ad infinitum, but the data will eventually become allzero (recall that reading an output buffer zeroes it, and since the microcode is no longer invokingimage-generation functions, no new image data are being added to the Orbit buffers). This is aconvenient way to finish out the printing of a page with white borders. To halt the taking of imagedata, Orbit can be reset. After Orbit is reset, the ROS adapter will simply repeat the most recentvideo data it received correctly.The adapter command table (pointed to by Argument1) is used to encode commands that should besent to the ROS adapter during the generation of a page. Such a mechanism is necessary because theAlto program would not otherwise be able to signal the printer device during the page generation(because the OrbitROSCommand can be issued only by the Alto task assigned to Orbit, which isoccupied with page generation). The table must begin on an even address, and contains two-wordentries in the following format:Word 0[0-3]AdapterCommandCodeWord 0[4-12]whenBandMinus1. This entry gives the band number before which thecorresponding command will be executed. The first band is numberednBandMinus1, then nBandMinus11, etc. down to 0.Word 1AdapterArgumentThe table will be processed in the order given, i.e., the whenBandMinus1 entries should be arrangedin decreasing order. An appropriate termination entry is Word 0=177777b, which specifies anunreasonably large value for whenBandMinus1. There are presently three AdapterCommandCodesdefined:0. Send AdapterArgument to the adapter as a command (i.e., OrbitROSCommand _AdapterArgument).1. Read 4 bits of adapter status; the four bits are numbered 4n to 4n+3, whereAdapterArgument=n*256 (n is in the left byte). The resulting status is read and stored inbits 12-15 of the memory word that previously held AdapterArgument. (The exact operationsare: OrbitControl _ AdapterArgument; AdapterArgument _ OrbitStatus.)3. Wait for AdapterArgument/3 microseconds in a tight loop. This command is provided incase it is absolutely essential that two adapter commands be issued before the same band. Inthis case, we must wait 60 microseconds between issuing adapter commands to assure propercommunications with adapter.If Jump codes appear in the band list, the CurrentCopy entry must be maintained. This word mustcontain an encoding, as shown, of the number of times, plus one, that the current document has beenprinted during the current run; that is, the number of the current copy.fpX!qFpXHY gbF g`0/ g_L g]=qp g\spI gZ&< gYqpB gW _ gU8 gRrp- gQNqpC gO1s p gNF9* gLD gK>H gI4qp+ gH6! gE 6' gCqpspD gB(8 g@~ rvrp= g>*5 g=v]:K ]7 '5C40]0 g-5. g,<0, g*6$ g)4]& rvrp]$]!Y3 spsp]spsp3]Q M]r p&r p]-+]C]Y] gD gf^ gHH g?Yp{Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer10When page generation has terminated, the Result word in the control table will contain the value thatnBandsMinus1 had when word 8, bit 3 of adapter status was last on during image generation; thisword will contain the original nBandsMinus1, plus one, if the bit never comes on. This very specialfeature assists with detecting an important but elusive timing signal in the Dover printer (see thedescription of Count-H in the Dover section.)Managing the data structuresDuring the generation of a page, the three data structures (font, band list and left over table) must ofcourse be resident in memory. In order to keep a ROS running at high speed, the font and band liststructures for each page must be present in memory at the moment it is necessary to begin generatingthe image for the corresponding page. To do this requires a buffering strategy that is willing to readinformation for page i from a disk while page i-1 is being imaged. (The left over table is reasonablysmall, and can of course be re-used for subsequent pages. Consequently, we shall omit furthermention of it.)There are basically three methods of buffering (see Figure 1-5):Method 1. Font and band list structures for each page are generated on the disk, and readinto one of two memory buffers. While page i-1 is being imaged, the structures for page iare being read. (This scheme is not a particularly attractive alternative, because the complexityof a page is severely restricted by the amount of available memory.)Method 2. One font data structure will suffice for all the pages to be printed, and cantherefore remain resident in memory. The band lists are put in two buffers: while page i-1 isbeing imaged, the band lists for page i are being read. This scheme is the recommendedscheme whenever the page complexities allow the font and two band list buffers to fit inmemory. The advantage of this scheme is that it permits printers to run at high speed,without pauses between pages.Method 3. All of memory is used for one font structure and one band list. After page i-1 isimaged, it is necessary to read the font and band structures for page i before imaging maystart for that page. If used with high-speed printers, it may be necessary to stop the printerwhile page i is read in, because otherwise there would be insufficient time to complete diskactivity before imaging activity would need to begin. This scheme does have the advantagethat maximally complex pages can be printed, by allocating all of memory to the structuresnecessary for that page.Note that hybrid schemes may be used as well: methods 2 and 3 may be mixed, although it may benecessary to stop the printer as the method is being switched (for the same reason it may be necessaryto stop the printer between pages using method 3). Planning the buffering and font makeup is one ofthe less pleasant tasks of the initial pass over the document that builds band lists!The remainder of section 1 presents details that are not essential to most printingapplications. Read on only if you are (1) hardy, (2) desirous of writing microcode, (3)desirous of writing Orbit test programs, or (4) need to know how to use Orbit for non-real-time image generation help.fpX!qFpXG gb7. g`#< g_G g]7, g\sp gXs gUp J]= Rsp];%sp0]:U]8H]6]3 Msp]2L 9sp]0A]/D sp?]-.,],<H]* g'5) g& \ g$31 g#USrE SuTS(.Sm g&?PCProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer111.5 Orbit Hardware FunctionsThere are various kinds of transfers of information between the Alto microprocessor and Orbit; eachcan transfer up to 16 bits of information. Although the transfers are actually accomplished withmicrocode functions interpreted by Orbit, the functions themselves are used by higher-level languageprogrammers as well. The list below gives each transfer a name (of the form Orbitxx); thedescription assumes a 16-bit value is transferred (refer to Figure 1-6 for a tabular summary of thisinformation):Functions for status and controlOrbitControl. This function transfers 16 bits of control information to Orbit. The fields of thisvalue are as follows:FieldBitsFunctionauxControl0-7This 8-bit field has two different interpretations, depending on thesetting of the WHICH field (q.v.).ESS8This bit must be 1 to enable changing the SLOTTAKE setting (q.v.).SLOTTAKE9This bit setting, enabled by ESS above, controls the output buffer logic.Normally (SLOTTAKE=0), Orbit will not honor video data requestscoming from the adapter. As soon as SLOTTAKE is set to 1, however,output data will be passed to the adapter when it demands it.clrBEHIND11This bit clears the BEHIND indicator (see below).setGOAWAY12This bit controls microcode wakeups, and should normally be 0. (Seesection on microcoding for more information.)WHICH13This bit controls the use to which the 8-bit auxControl field is put. IfWHICH=0, auxControl is interpreted as an address (range 0 to 63) intothe adapter status memory: when OrbitStatus is next interrogated, 4status bits (with numbers 4*auxControl to 4*auxControl+3) will bereported. If WHICH=1, auxControl is used to set FA.CLRFRESH14This bit controls refresh logic, and should normally be 0. (See sectionon microcoding for more information.)RESET15This bit, if 1, will reset Orbit entirely. A reset performs at least thefollowing functions: FA_0, SLOTTAKE_0, band buffer A is assigned tothe image buffer, the status and control dialogues with the adapter arereset.OrbitStatus. This function reads 16 bits of status information from Orbit into the Alto. Thestarred status bits below (*) are generated by firmware only in some situations. The notationa_OrbitStatus denotes the hardware status-reading function, and does not include the firmwarestatus bits. The notation a_OrbitStatus+FirmwareStatus denotes the full status report. Thestatus fields are:FieldBitsFunctionIACSmc0*This bit is 1 if Orbit is "in a character segment," i.e., if Orbit needsmore OrbitFontData transfers in order to complete image-generationfor the current character. (This bit is not actually reported by Orbit tothe Alto in this way, but is inserted by the "standard microcode.")TIMEOUTmc1*(This bit is not actually reported by Orbit to the Alto, but is insertedby the "standard microcode." See the description ofProgramGeneratePage, above).unstableROSmc2*(This bit is not actually reported by Orbit to the Alto, but is insertedby the "standard microcode." See the description ofProgramROSStatus, above).fpX!qFpXG gbr g^pR g]nO g[); gZf:sp gXrp3 gW^ gT3rQs p:OLX``J ``,kI-qp Gq`p`*qpEq`p`qp)kDZ qp-kB qpkAR=?q`p`qp>q`p`;k<-:q`p`8k9Tqp4 k7 s pk6K)k4 qpqp3 q`p`.k1%/q`p`4k.qqpqp k,rpk+i(=s p4&.0%5s p7#s p%"-`Zqp`9ks pkRGk3'qp`%#kkspwqp`%#kkostsp g(?XProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer12earlyPageAbortmc3*(This bit is not actually reported by Orbit to the Alto, but is insertedby the "standard microcode.") If, at the end of a band, the adapterhas stopped accepting video information, and if the BEHIND bit(below) is set, ProgramGeneratePage terminates early (as if it hadtimed out), with this bit set.badBandEntrymc4*(This bit is not actually reported by Orbit to the Alto, but is insertedby the "standard microcode.") The ProgramGeneratePage microcodehas encountered a non-character band entry that does not specify avalid operation. It has stored additional diagnostic information in fixedmemory locations. This condition should only arise in instances ofsevere hardware or software faults. Consult the Orbit microcodelistings for further information.badROS8This bit is true if an error of some sort has been detected on theadapter status-reporting line. The adapter status cannot be trusted.The condition will be reset after the first properly-formatted statusburst is received from the adapter.INCON9This bit announces the current band buffer assignments. If it is 0,buffer A is the image buffer, and buffer B is the output buffer.Watching this bit for changes is the proper way to detect "bufferswitches."stableROS10This bit is true if a status burst is not currently arriving from theadapter. If you insist on reading some adapter status that must befrom the same burst, you can check this bit before and after a read.BEHIND11This bit is set when Orbit "gets behind." This will happen if thebuffers switch (due to output requests) before the Alto microcode hasfinished sending the next band of image-generation information toOrbit (finishing is signaled to Orbit by setting GOAWAY).ROSStatus12-15This field gives 4 bits of status reported by the adapter. See thedescription of WHICH, above.Functions for controlling image-generationThere are a number of functions for controlling image generation. There is a reasonably standardsequence of operations for transferring source rasters into Orbit. The first three functions(OrbitHeight, OrbitXY, and OrbitDBCWidthSet) are used to pass to Orbit the four parameters thatdescribe a source raster and its position in the band. The last of these (OrbitDBCWidthSet) sets aflag IACS ("in a character segment") that indicates Orbit is expecting source raster data. Then theOrbitFontData function is used to send words of source raster information to Orbit. After thecharacter is finished (or we run into the edge of the band at x=15), the two functionsOrbitDBCWidthRead and OrbitDeltaWC are used to extract from the Orbit hardware the necessaryparameters to compose a "left over" entry so that image generation for this character can be resumedin the next band.OrbitHeight. This command sends to Orbit a 12-bit field (value[4-15]) which is interpreted as thetwo's complement of the height of the source raster, in bits.OrbitXY. This command sets x_value[0-3] and y_value[4-15]. It is therefore used to set thestarting scan-line within the band (x) and the vertical position of the bottom of the copy of thesource raster (y).OrbitDBCWidthSet. This function has three purposes: First, value[0-3] is used to tell Orbit whichbit (0 to 15) of the first word of raster data is the first bit to be examined (i.e., it will play therole of SOURCEBIT for the setting of BAND[x,y], where x and y were set with OrbitXY). Second,value[4-15] is interpreted as the width of the source raster, minus 1. Third, executing this functioninitializes a mess of logic relating to transferring a source raster to Orbit and sets IACS ("in acharacter segment"). After the function is executed, it is wise to issue only OrbitFontDatafunctions until the image-generation for this character terminates (i.e, IACS becomes 0). Warning:IACS is cleared by StartIO(4); consequently it is not possible to "single step" Orbit's characterfpX!qFpXGb`%#k`""k_( qpk]spk\Zf `%#kXsp kW^1kU9kTV'kR + kQN!Oqp`-kN#'kL%kK#Isqp`&kG rprpkFk$kD C@qp`&rpkA3k@7'>qp`(k= 7 k;-k:1qp8]qp`x`P 9k6qp g3r* g0pH g.;" g-zs pspsp g+;sp g*rqpJ g(s pH g'i"rp g%sps p . g$ad g"s p-rp#.rp-sprprprprp(~ rp<rpsp,rpKVqpqprprprpsp Crp$rp!Is!sp*GQFkBD5Cc>MAspup g>r, g;p0s ps p  g:X6stsp*qp qp5UF3qp g0r-zsp6+/(sp!qpqprpqprp rp'Fsp g$r- g pK gk/0@s p$s p sp=  sps p(s p]1rp)2sp-sp  g g?[qProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer14ProgramDBCWidthSet (directive=4). This operation sets the DBC and Width counters:OrbitDBCWidthSet _ Argument1.ProgramFontData (directive=5). This operation transfers one word of font data to Orbit:OrbitFontData _ Argument1.ProgramDeltaWC (directive=6). This operation reads the word counter: Result _ OrbitDeltaWC.Because each function implemented by the standard microcode reports Orbit status oncompletion, the ProgramDeltaWC function is a fine way to read Orbit status without changingany Orbit state.ProgramInk (directive=7). This operation transfers a word to the ink memory: OrbitInk _Argument1.ProgramDBCWidthRead (directive=8). This operation reads the current settings of the DBC andWidth counters: Result _ OrbitDBCWidthRead.ProgramROSCommand (directive=9). This operation sends 16 bits to Orbit to be forwarded tothe adapter as a command: OrbitROSCommand _ Argument1.ProgramReadBlock (directive=10). This operation is used to read a sequence ofOrbitOutputData words. Argument1 gives the number of words to read; Argument2 is theaddress where the first word should be stored. The function is equivalent to the following code:for i=0 to Argument11 doArgument2!i _ OrbitOutputDataProgramCharacter (directive=11). This operation is used to pass a source raster to Orbit at highspeed, and can be described as a collection of primitive commands (note that control table entriesare used in a way that makes their names meaningless):OrbitHeight _ Argument1OrbitXY _ Argument2OrbitDBCWidthSet _ nBandsMinus1for i=0 to Abs(LoTable)1 doOrbitFontData _ FAword!iResult _ OrbitDBCWidthReadNewCharPointer _ OrbitDeltaWCNote that this operation returns two values, one of which is stored in the NewCharPointer wordof the control table (a non-standard place). The sign of the LoTable entry is used to choose oneof two inner loops (for the "for" loop above): if LoTable>0, the inner loop contains TASKmicroprocessor functions; if LoTable<0, no TASKs are included (this is to aid in hardwaredebugging).ProgramGeneratePage (directive=12). See section 1.4 for a complete description.ProgramGenerateBand (directive=13). This function is very similar to ProgramGeneratePage,but will perform the image-generation chores for only one band, and leave the results in the Orbitimage buffer: this function does not make arrangements to forward the image information to theROS adapter. The intention is that the Alto program may want to read the generated image backinto Alto memory rather than forwarding it to a ROS immediately.The arguments to the function are as follows (see section 1.4 for a description of the datastructures for fonts, left-overs and band lists):LoTable = LoTablePointer (left-over pointer, must be even)FontTable = FontTableX+100000b (pointer to font table, offset by 100000b)fpX!qFpXGbspE#Fqp`sp ]nsp([s p Xs p1s pW;)1*"Us p /T3Qs p3spO LXsp3qpJspGstsp6F$stsp Bspv(wAusp##?[(<;e s89p@6+7516(2)s p (0sp (/!sp(-,s pqp(*s()ps & p,2$6+#K q!}p+qp  sp=spsp6rp rprp5qpV0qp fK1( :( VI 0 =]^Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer15NewCharPointer = BandListPointer1 (BandListPointer must be even)The function returns Result _ BandListPointer'-1, where BandListPointer' is a version ofBandListPointer updated by processing all the entries for the one band (i.e., Result will point atthe second word of the End-of-Band entry for the processed band). The idea is thatProgramGenerateBand can be called to generate the next band by setting NewCharPointer to theResult of the current band. (See also the description below concerning refreshing.)The function ProgramGenerateBand makes no provision for reading the Orbit buffer back intothe Alto. This can be accomplished with other Programxx functions.ProgramROSStatus (directive=14). This operation reads an entire word (16 bits) of ROS status,using OrbitControl and OrbitStatus primitives. If we view the 256 status bits as lying in 16 16-bitwords, numbered 0 to 15, then this function stores in Result the current value of status word n,where Argument1 = n * 1024. The firmware status bit unstableROSmc, reported in theOrbitStatus table entry, is zero if all 16 bits of status were extracted from the same status burstemanating from the adapter.1.7 Refreshing the image bufferAs an image is being prepared in the image buffer, it may be necessary to refresh the buffer in orderto keep its contents from changing (this is because the buffer memories are implemented with MOSRAM's). Reading an image from the output buffer not only clears the buffer but also refreshes itduring the readout. When the reading completes, the buffers switch so that the output bufferbecomes the image buffer. The image buffer must be refreshed by the microcode every 2 ms. until itis once again switched to become the output buffer.The Orbit programmer must arrange so that the image buffer is refreshed if it contains valuable data.There are two cases to consider: (1) while a Programxx function is being executed, and (2) betweeninvocations of Programxx functions. Most functions are speedy enough that no provision is made forrefreshing. The ProgramGenerateBand and ProgramGeneratePage functions, on the other hand,automatically provide refreshing. If the contents of the image buffer need to be preserved between invocations of primitive functions,it will be necessary to insure that the buffer is refreshed even while the Alto program is away doingother things (e.g., when the refreshing provided by ProgramGenerateBand is not functioning). Tohelp with this requirement, the standard microcode has provision for performing the refresh dutieseven when no Programxx function is being executed. Thus, rather than turning off the Alto Orbit-controlling task between functions, the task remains active, waking up and refreshing the image bufferwhenever it is appropriate. This refresh idling function can be specified by turning on bit 0 (100000b)in the Directive word of the control table, in addition to specifying a Programxx function number inthe directive. In this case, when the function terminates, the image buffer will continue to berefreshed. Enabling the idling activity in no way alters the invocation of the next Programxxfunction.1.8 Reading a buffer into the AltoOrbit has provisions for reading the output buffer back into Alto memory rather than shipping it tothe ROS adapter. This is useful for for image-generation that is so complicated it cannot keep pacewith the printing device: the buffers can be returned to the Alto, and buffered again on a big disk. Asecond pass is used to transmit the disk buffers (via Orbit) to the ROS. The read-back is also vital fordebugging Orbit.Basically, the function OrbitOutputData reads 16 bits from the output buffer into the Alto. Thestandard microcode interfaces ProgramOutputData and ProgramReadBlock are provided to giveaccess to this function.fpX!qFpXG(bA_7!])9\BZspBYSU sp:TV/sp Q+stsp5 qpOs ps p2N#XrpLrp"qpKCI gFkr gC@pF gA3*q g@7p^ g>0- g=/=& g;3 g8$A g6-sp g5xsp4 g3spsp g2p" g/D.6 g-Q g,<sp g*(: g)4r vrp0 g'42 g&,"rp8 g$3sp g#$"> g!+*sp g  gr" gp%rp , gAqp@ gU g9?qp" g gsp9 gspsp g 0 g :@ZProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer16The programmer needs to be aware of two tricky details concerning readout:1. There is a 16-bit buffer (ROB) that sits between the addressing mechanism described above and the outsideworld (the taker of data: the Alto or the ROS adapter). As a result, immediately after the buffers "switch," theROB contains the last 16-bits of data from the previous buffer (x=15, y=4080 through y=4095). The usualconvention is to read out this one last word. This leaves the first word of the new buffer in ROB.2. The output band buffer will not be refreshed because no readout is in progress. Because the buffer isimplemented with dynamic MOS RAM's, the lack of refreshing will cause errors in the data to appear beginningabout 2 ms. after the buffer switch. This data "rotting" happens rather slowly, but is nonetheless irksome. Toavoid trouble, reading the output buffer should begin within the alotted 2 ms. after the buffer switch. As soonas reading begins, the reading itself serves to refresh the memory.The scheme is as follows: (1) The Alto reads the output band buffer entirely (buffer A, say), therebyclearing it and also causing the buffers to switch; (2) Now the Alto invokes image-generation to fillthe buffer (A) with an image; (3) The Alto reads the output buffer (B) as quickly as possible, simplyto cause the buffers to switch; (4) The Alto reads the output buffer (A) and saves the image. Notethat step 4 can also serve the same role as step 1. We could leave FA set to some fixed valuethroughout these steps, but this will cause step (3) to require more time than necessary. Somedetailed analysis shows how to avoid this:The setting of FA provided by the Alto is examined only when Orbit reads out the last 16 bits of a scan-line,and must prepare to begin reading the next scan-line. If you wish to control FA carefully, you must anticipatethe moments at which Orbit will load its address register from FA. The most common case in which carefulsynchronization is needed is when you wish to induce a buffer switch with minimum effort.Let us describe the handling of FA for the 4-step example above. Define FAimage to be the FA thatcorresponds to the image you wish to read. First, we need to get "in sync:"set Orbit's FA _ FAimageuntil buffers switch do [ read a word from the output band buffer ]read a final word from the output band buffer (because of ROB)This sequence guarantees FA has been set to FAimage, and that we are ready to begin reading a buffer. Step 1(or step 4) becomes:read (256-FAimage)*162 words from the output band bufferset Orbit's FA _ 255read the last two words from the output band bufferStep 3 then becomes:read (256-255)*162 words from the output band bufferset Orbit's FA _ FAimageread the last two words from the output band buffer1.9 MicrocodingThis section presents some additional information on microcoding the Orbit. It refers generously topreceding sections, in which the basic data transfers (Orbitxx functions) have been described. Thereader should be familiar with Alto microcode (see the Alto Hardware Manual), and may wish torefer to the Orbit functional description. The serious reader is urged to retain a copy of the standardmicrocode at his/her elbow as an example of how things can be done.Assignment of functions. Each of the Orbitxx functions described above is assigned a value of theAlto F1 or F2 fields: Orbit decodes these fields to decide what to do. Definitions at the beginning ofOrbitMc.Mu establish some conventional names for these functions. The assignment is as follows:OrbitControlF2=15bOrbitStatusF1=17b *OrbitHeightF2=12b *OrbitXYF2=11bOrbitDBCWidthSetF2=10bOrbitFontDataF2=13bfpX!qFpXG]bAqJ]_\\]^X]\+wqwq wq][w q7]Xwqwq, ]WT]VDm]UN"]SC gPzpW gN;* gMr05 gK21 gJjDqp gH? gGb*]DZqPwq]CO]A>+]@Y]=\]<L(:(8C(7>]5S]3(1U9(0(.3],_()5((('i3 g$ar g!6p40 g7sp' g.6' g_ g&C grp sp7 gvqpqpF gA]s &qp]Cs &qpX]s &qp] ;s&qp] s&qp] 3s &qp g ?^wProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer17OrbitDBCWidthReadF1=15bOrbitDeltaWCF1=14bOrbitROSCommandF2=16bOrbitOutputDataF1=16bOrbitInkF2=14bOrbitBlock (see below)F1=3The starred items (*) may cause microcode branches. OrbitStatus sets NEXT[7] if IACS is not on, i.e.,if Orbit is not in a character segment. OrbitHeight sets NEXT[7] if the refresh timer has expired, i.e. ifthe image buffer needs refreshing.Whenever one of the microcode functions (Orbitxx) is executed, the Alto clock may not stop duringits execution. The microcoder must arrange the microcode so that, for example, memory waits do notoccur on cycles in which Orbitxx functions are executed. The standard microcode has comments(//// in the comment field) whenever instructions have been inserted to observe this timingrestriction.Wakeups. Orbit is controlled by a single Alto microtask (task number 1, next lowest priority to theemulator). Consequently, the Orbit hardware must generate a "wakeup signal" to govern theexecution of microinstructions in the Orbit task: the wakeup should be generated when the Orbithardware requires service of some sort.The wakeup condition is very simply expressed in hardware, but deserves a more discursive treatmenthere. There are a number of considerations:1. The RUN flip-flop. We want Orbit's wakeups to be filtered by a single RUN condition, thatsays whether Orbit is idle or is expected to be doing things. Whenever the Alto is reset(bootstrapped), the RUN condition is turned off. The emulator program may executeStartIO(4) to turn the RUN condition on (note that StartIO is simply the name of a softwarefunction that executes the emulator SIO function). The RUN condition is turned off by theexecution of the OrbitBlock function by the Orbit task itself.2. Executing miscellaneous functions (e.g., OrbitROSCommand). We would like the Orbit taskto be normally active (i.e., requesting wakeup) so that various utility functions can beaccomplished. When the function terminates, we can always deactivate the Orbit task withOrbitBlock.3. Performing image generation. Again, we would like the Orbit task to be normally active,so that parameters and source raster data words can be shipped to Orbit at high speed.However, if Orbit's FIFO that contains font data words (shipped with OrbitFontData) becomesfull, the Orbit task should be temporarily suspended until the FIFO entries are processed byOrbit and there is once again room. When image generation for a character segmentterminates (IACS becomes 0), we want to get service no matter what the FIFO contains.4. Waiting for the ROS to take a buffer. After image generation for a band is complete, Orbitusually needs to "wait" until the ROS has emptied the other (output) buffer. During thisperiod, the Orbit task should not be requesting wakeups, so that the Alto microprocessor maybe devoted to other tasks. To achieve this "dormant" state, the Orbit task sets thesetGOAWAY bit in the control word: this tells Orbit to "go away" until a buffer switch occurs.The buffer switch will turn off GOAWAY, and consequently allow wakeups again.5. Refreshing the image buffer periodically. If the image buffer memory is to be kept valid,it must be periodically refreshed. Consequently, we need to have a provision for waking upOrbit for refreshing even when Orbit is dormant (waiting for a buffer switch, as in (4) above).For this purpose, there is a REFRESH condition that indicates refreshing is needed: it is setevery 2 ms. (approximately), and may be cleared by the CLRFRESH bit in the control word.Even though GOAWAY has been set, Orbit will be awakened when the REFRESH conditionbecomes true.fpX!qFpXG]bs&qp]`s &qp]_sts&qp]]s&qp]\s&qp]Zs p &qxp gW^3s pqpqprp gUs pqp- gTV" gQ+)sp0 gO9* gN#sp? gL6% gK gGrp7& gFkO gDC gCc' g@7G g>,];qp 5qp]:)0]8qp']6qpA]5x qpqp]3s p r]0p+stsp]/DQ]-I], 0 do beginwhile (Argument1!0nBandsMinus1) and 7777b = 0 do begina_(Argument1!0 and 30000b)b_Argument1!1Argument1 _ Argument1+2if a = 0 then OrbitROSCommand _ b elseif a = 10000b then beginOrbitControl _ bfpX!qFpXG gbD]^q`pX`]ns ]Zq`ps`Y)p7`Wxrp`V!9]S_q`p`Qqps ]Oq`p qps `Mp/ gI]FkqpX]Dqp qp]Ccqpqp g?dr pG g=14 g<\D g:;$ g9T6]5Usp]3s p" ]2Lsp" ]0qps p g,rvrv g)pf g(L g&^ g%7 g"-q pqp g!6 qp7qp g 4qp ! g.sp qpsp g2t q2dt q*2' g>2n17(( (x( ; tq(  t q g ?]nLProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer19Argument1!1 _ OrbitStatusend elseif a = 30000b then wait b/3 microsecondsendNow call the DOBAND subroutine to compose the image for this band.call DOBANDOrbitControl _ 10b (set GOAWAY)if AdapterStatus.SendVideo = 0 and OrbitStatus.BEHIND = 1 thenreturn from ProgramGeneratePage with earlyPageAbortmc bit setif AdapterStatus.(word 8, bit 3) = 1 then bandResult _ nBandsMinus1a _ Argument2until bands switch do beginwait until refreshing needed or bands switchif a < 0 then return from ProgramGeneratePage with TIMEOUTmc bit setcall REFRESHa _ a1endnBandsMinus1 _ nBandsMinus11endResult _ bandResultreturnThe DOBAND subroutine is responsible for sequencing through the band lists and leftovers:DOBAND:LORP_LoTable1LOWP_LoTable1(LOWP is the write pointer for new leftovers)First, process the left-over list remaining from last time. Each entry is four words long, containing the height, the XYsetting (with X=0), the remaining width and the memory address of the first source raster word to send to Orbit. Notethat the height and XY information is also saved in registers (HEIGHT, XY) so that TFRCHR can build a new left-overlist:while LORP!1 = 0 do beginif refreshing needed then call REFRESHOrbitHeight _ HEIGHT _ LORP!1OrbitXY _ XY _ LORP!2OrbitDBCWidthSet _ LORP!3FONTADR _ LORP!4call TFRCHRLORP _ LORP+4endNow go through the new character list (band list) for this band, and decode the entries. Character entries are looked up inthe font index; rule parameters are simply passed on to Orbit. (Note that the "refreshing needed" test is a part ofOrbitHeight, and is consequently done in a slightly different place in the actual microcode.)while true do beginif refreshing needed then call REFRESHa _ NewCharPointer!1XY _ NewCharPointer!2NewCharPointer _ NewCharPointer+2if a < 0 then beginOrbitXY _ XYFONTADR _ FontTable!aOrbitHeight _ HEIGHT _ FONTADR!0OrbitDBCWidthSet _ FONTADR!1FONTADR _ FONTADR+2end else case a% of begincase 1: beginOrbitXY _ XYFONTADR _ 0OrbitHeight _ HEIGHT _ NewCharPointer!1OrbitDBCWidthSet _ NewCharPointer!2NewCharPointer _ NewCharPointer+2endcase 4: beginif a = CurrentCopy then NewCharPointer_NewCharPonter+XY;repeat the loopfpX!qFpXGbAqt aq(_(^ g\BY XUt qWtqtq(U tqTt q2S_ R"(P,(Otq(Ni (M,K2J2Is2H62F gCpqpO g@q( 2? - g=/O* g;E1 g:Y g9w26 uq 5x&4:t q2tq 1tq0/D . 2, g*Nv g)k g't qR2%X$&"! b!%(tq((lt q(/tq ((v 9tq t qtqCq!(  guq2  g ?](;Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer20endcase 0: exit the loopall other cases: return from ProgramGeneratePage with badBandEntrymc bit setendcall TFRCHRendLOWP!1 _ 0The TFRCHR subroutine transfers a character to Orbit. If the character does not exhaust its width inthis band, a left-over entry is made. The variable FONTADR usually contains the address of a sourcefont word, but if it is zero, we are transferring a "rule" to Orbit.TFRCHR:if FONTADR=0 then beginuntil IACS=0 do OrbitFont _ -1FONTADR _ - OrbitDeltaWCend else beginp _ FONTADRuntil IACS=0 do beginOrbitFont _ p!0p _ p+1endendNow check to see if the charcter requires a left-over (width=7777b):p _ OrbitDBCWidthRead and 7777bif p = 7777b then beginLOWP!1 _ HEIGHTLOWP!2 _ XY and 7777b (this sets X_0, but preserves Y)LOWP!3 _ OrbitDBCWidthReadLOWP!4 _ FONTADR + OrbitDeltaWCLOWP _ LOWP+4endAnd finally, the REFRESH subroutine performs the refreshing chore:REFRESH: OrbitXY _ 0OrbitHeight _ 6000bOrbitDBCWidthSet _ 0until IACS=0 do OrbitFont _ 0fpX!qFpXGbAq(a(_tq^]K 2\2Y gVpqp P gU4qp) gSD gPzq(O=tqM t 2Lq K JG(I tq(GF2EQ gB=S6<t:qt 9q 289 g5pqp* g2qtq20t q2/tq2.Mtq g.*?9Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer212. ROS AdapterThe ROS adapter is a general-purpose interface between EIP's (Electronic Image Processors; Orbit isone) and raster-scanned output devices. The motivation underlying its design is that one adapter canserve to connect the "9-wire ROS interface standard" to a number of similar ROS devices. There aretwo slightly different versions of the adapter. Dover systems come with a "TTL adapter," hereafterabbreviated T. A high-speed version of the adapter has been built by SDD using MECL 10K logic,called the "MECL adapter," hereafter abbreviated M. In mid-1978, the T adapter was redesigned, witha few minor "visible" effects. This revision will be referred to as the "Version II" adapter.The adapter contains logic to control fully the raster output scanner (ROS) itself, including of coursegenerating a video signal. It also contains a mechanism to receive printer commands from the EIPand forward them to the printing engine, as well as a mechanism for receiving engine status andforwarding it to the EIP. (The standard Orbit microcode provides access to the adapter with theProgramROSCommand and ProgramROSStatus functions.)2.1 Basic imaging techniqueThe EIP delivers raster images of pages to the adapter, which is responsible for formatting it properlyon the output device, and for timing signals properly. The adapter is basically a massivesynchronization aid: it receives timing information from the printing engine and the ROS equipment,and generates requests for video data (to the EIP) in order to keep up. The video data it receivesmust be converted into a serial video signal, timed properly with respect to the scanning motion, sothat the image appears in the proper location on the "page."A simple conceptual model of the imaging process will help in the discussion of the rather intricatechores of the adapter. Although the model is somewhat oversimplified, it includes the basic ideascommon to all the devices that the adapter can drive. Figure 2-1 shows the model schematically:there is a single scanning beam that scans in a fixed plane, under which a continuous sequence of"page image frames" is being moved. If we properly time the modulation of the scanning beam, wewill leave behind within each page image frame an image that corresponds to the raster prepared bythe EIP. A number of timing problems must be solved for this to happen properly.Engine operation. The printing engine reports a signal PrintMode to the adapter whenever its drivemotors are running: this indicates that "page motion" in our conceptual model is in progress, eventhough pages may not be flowing under the ROS beam yet.Page timing. We will need to know when the leading edge of a page image frame passes under thescanning beam. It is at this instant that we must begin acquiring raster data from the EIP and using itto modulate the scanning beam. This timing information can only be acquired with the help of theprinting engine itself, for it is responsible for sequencing pages. The engine generates a signal calledPageSync some fixed time before the page frame passes under the beam. Once inside the adapter,this signal is delayed to generate a timing signal called SendVideo which is true while a page imageframe lies under the beam, and false in the inter-page gaps. The adapter will process EIP raster dataonly when SendVideo is true.On the M adapter, SendVideo is named "DelayedPageSync" for historical reasons.We mentioned above that Orbit needs to write the first few bands of raster information in a spot that will not bevisible on the page, as they may contain garbage that has accumulated because refreshing has not occurred. Inthis case, Orbit should arrange to have SendVideo occur slightly before the actual page frame would pass underthe beam.The normal sequence of events, then, is roughly as follows: (1) The EIP issues commands to theprinting engine to start pages feeding. (2) The EIP waits for SendVideo to disappear (the reason forthis will appear later). (3) The EIP resets the adapter buffer mechanism and starts generating rasterdata. (4) When SendVideo becomes true as the first page frame passes under the beam, the adapterwill begin requesting raster data from the EIP, and continue to do so as needed to control the beamfpX!qFpXG%ari g^pqp'qp) g](e g[qp qp gZ Lqp gX qp*qpqpqp gW qp!qpqp gU] gRh3qp gPCq gO`pT gMqp( gLXstspstsp gI-u gFpqpI gD} $!5 gBAqp gAu-qp2 g?S g>m< g;AL g9-5 g89*6 g6B g513- g3(: g2)qpJ g.up4 g-zG g+*qp g(u pB g'FFqp g%R g$>R g"G g!6Y gI qp g.]&qN]A`]N]@.]e g:pCqp g0qp ' g2!qp. g J g *! qp5 g ?](Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer22modulation. Now one of two things can happen: (5a) SendVideo falls, signaling the end of the pageframe. The adapter will cease requesting data from the EIP. Or (5b) the EIP refuses to honor a datarequest from the adapter, in which case the adapter will simply repeat the last data it received untilSendVideo goes false. (6) To print the next page, the EIP returns to step (2), and may also need tocontract with the printing engine to keep feeding paper. The reason for step 2 now becomes clear:without step 2, situation 5b might cause video for the next page to appear at the trailing end of thecurrent page, because SendVideo is still on.Scan-line timing. An even more intricate timing problem is posed by the scanning beam: we mustcarefully synchronize the video signal generated by serializing the raster data coming from the EIP sothat it appears at the proper position along the scan-line. This involves two issues: (a) determininghow to divide the scan-line into units that will correspond to each video bit, and (b) determining theabsolute time at which video bits should be passed to the beam modulator.A servo system and two detectors are used to solve this problem. The scanning beam passes first overa "start-of-scan" (SOS) detector, then over the page image frame, and then over an "end-of-scan"(EOS) detector. This sequence is repeated very fast: soon after EOS is generated for one scan-line, SOSfor the next scan line occurs. The adapter divides the time between SOS and EOS into equal intervals(the exact number of intervals is a parameter set by the EIP): each one will correspond to one bit ofvideo information. So now we have divided the scan-line into "bits."The EIP generally produces raster data only for the portions of scan-lines that correspond to regions ofactivity on the page: the adapter is expected to supply "white" margins above and below this activeregion. Consequently, the adapter will need to know how the video data supplied by the EIP shouldbe placed within the scan-line. The adapter implements a "bottom margin" by a counter that isstarted at SOS with a value specified by the EIP, and counted as "white margin" bits are sent to themodulator. When the count becomes 0, video data from the EIP is sent to the modulator, andcontinues to be sent until an "end of scan-line" indication arrives with data from the EIP. Thereafter,the adapter supplies "white margin" bits that will correspond to the "top margin."Note: The number of bits of raster data provided by the EIP for each scan-line must be a multiple of64. (With Orbit, this means that FA must be a multiple of 4.)The servo that synchronizes scan-lines requires SOS and EOS pulses to arrive. Consequently, the adapter controlmust arrange that the laser beam is "on" as it passes over the detectors, or a pulse will be missed. When theservo is operating in equilibrium, the adapter ensures that the beam will be on for the detectors by anticipatingwhere the beam is. However, in order to get the servo going initially, the beam must be completely on for ashort while. This is accomplished by turning the beam on whenever PrintMode is true but SendVideo is not, i.e.,in the inter-page gaps and while the engine is cycling up. This has the added virtue of "writing down" thephotoreceptor in unused areas, thus preventing toner dumping.Motor speed. The speed of the motor that drives the scanning polygon is carefully controlled by afrequency synthesizer. The adapter provides the basic timing signal to which the electronics locks thepolygon motor.2.2 ParametersAll of these timing and synchronizing features are governed by parameters that can be set by the EIP.Some of the parameters can be related by physical observations. The next few paragraphs areintended to provide enough information to permit calculation of the parameters!Let us first define some parameters of the output image:SThe number of scan-lines per inch on the pageBThe number of bits per inch along the scan-lineNow define some parameters of the ROS and printing engine (see section 3 for the values applicableto the Dover printer):fpX!qFpXG gb V g`8qpqp g_` g]7qp" g\=% gZ Y gY, gUup6 gTVJqp gRZ gQNDup gOI gL23 gKqp9 gIqp6qp!q gHp8upqpqp gF9qp gE E gAqpa g@[Q g>Xqp g=SL g; qpqp/ g:K%qp g8Hqp g7BR g48qp g2"qp]/q b].MI%]-&K]+G%]*e ])Wk]'= g$u pR g#GP g! gu glpRqp g%7 gdO g98] uSp-]uSp/ g ^"qp$ g \ g @\xProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer23pPaper speed, measured in inches per secondfNumber of facets on the polygonrNumber of polygon motor clock pulses/polygon revolutiondDuty cycle (i.e., SOS-EOS time/SOS-SOS time)hEffective distance between SOS and EOS detectors,measured at the paper surface.xScan-line expansion factor: some ROS adapters are setup to double scan-lines (x=2). If this parameter is not specified,it is assumed to be 1.From these we will need to calculate the relevant adapter parameters (ranges are given inparentheses):MotorSpeed (0 to 4095)MotorScale (0 to 7)BitClock (0 to 4095)BitScale (0 to 7)LineSyncDelay (0 to 4095)PageSyncDelay (0 to 4095)VideoGate (0 to 4095 -- T version only)We need to define two parameters that differ on the different adapter versions.. The first is bcMax,the maximum frequency of the bit clock. The other is crystalClock, the frequency of an internaladapter timing oscillator.M versionT versionbcMax90 * 10630 * 106crystalClock25 * 10612.5 * 106Define a function Scale(x)=2x.Now we can calculate the scanning motor speed in revolutions per second:MotorRPS = crystalClock * Scale(MotorScale) / ( r * (4096-MotorSpeed) * 28)Consequently, we can get the number of scan-lines per inch:S = f * MotorRPS / (p * x)These two equations allow us to determine MotorSpeed and MotorScale settings from the desiredvalue of S.The scan-line control is somewhat more complicated. The basic servo is controlled by the relation:B = 4 * (4096-BitClock) / hThe peak bandwidth required from the adapter (and consequently from the EIP as well) is:BitRate = f * MotorRPS * B * h / dbits per second. (If Orbit is driving the adapter, it can deliver at most 23 * 106 video bits persecond.)An important side condition governs the setting of BitScale so that the bit clock servo operates in areasonable range:fpX!qFpXG]buSp*]`uSp]_uSp7]]uSpqpqp]\uSpqpqp SZ]YuSp!qpSWup(SU gRG gQN ]N#]L]K]I]H]F]E qp gAD g@[D g>;qxp)qPp]9:nq)9p:nq]8p 8q)8p8q g4p5x4 g1H].qp(up/!q.p g+i;](=upupqpupup g%C g#up g bG]7upu g pHqp ] upu gpBBqp g1 g'> g J g :?ZAProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer241/2 < 27 * BitRate / (bcMax * Scale(BitScale)) < 1The remaining parameters are more easily calculated. LineSyncDelay is simply (4096-n/4), where n isthe number of bits of white margin to leave at the bottom of the page (after the SOS detector).PageSyncDelay is (4096-n/i), where n is the number of scan-lines to pass up after receiving PageSyncfrom the engine before starting SendVideo, and i is 1 for version II adapters, 4 for older ones.(Version II adapters are those with serial numbers >512 decimal). And VideoGate is (4096-n/4),where n is the number of scan-lines to pass up after SendVideo starts before stopping SendVideo (onthe M adapter, VideoGate is not provided, and the falling of SendVideo is controlled by the printingengine). 2.3 Adapter commandsControl of the adapter, ROS and printer is accomplished with 16-bit commands. The high-order 4 bitsof the command give a command code; the remaining 12 bits are used as an argument to thecommand. The command codes are:0Buffer reset.1Set scales.BitScale _ command[4-6]MotorScale _ command[7-9]ExtendVideo _ command[10] (T version only)TestPageSync' _ command[12] (should normally be =1)CommandLocal _ command[13]CommandBeamOn _ command[14]TestMode _ command[15]2Set bit clock register.BitClock _ command[4-15]3Set motor speed register.MotorSpeed _ command[4-15]4Set line sync delay register.LineSyncDelay _ command[4-15]5Set page sync delay register.PageSyncDelay _ command[4-15]6External command 1 (forwarded to printing engine)ExternalCommand1 _ command[4-15] (a register is set)7External command 2 (M version only) ExternalCommand2 _ command[4-15] (a register is set)Set video gate (T version only) VideoGate _ command[4-15]10b-17bSpare2.4 Adapter statusThe adapter constantly reports 256 status bits to the EIP. These bits are normally viewed as consistingof 16 16-bit words. The first 8 words of status are reasonably independent of the kind of adapter (Tor M) or the exact kind of printer attached to the adapter:fpX!qFpXG]avpbAqap'vp g^!3up up g]J3S<S;AS9]6SS51]2)SS0]-SS,])SS']$S1S#x4]Sqp Stx6Sqp Sl]d g9u g p6qp. g40q gpqp7 g@YM0Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer25WordBitsFunction0Special status from the ROS0SendVideo (sometimes called DelayedPageSync)1PrintMode2Local3BeamEnable4StatusBeamOn5StatusPowerEnable (M version only)1Command register0-15A copy of the command most recently received by the adapter2Bit clock0VideoPolarity (the setting of a switch)1-3BitScale (register set with command code 1)4-15BitClock (register set with command code 2)3Motor speed0SelectLeadEdge (the setting of a switch)1-3MotorScale (register set with command code 1)4-15MotorSpeed (register set with command code 3)4Line sync delay0Switch3 (the setting of a switch)2ExtendVideo (register set with command code 1 -- T version only)3TestPageSync' (register set with command code 1)4-15LineSyncDelay (register set with command code 4)5Page sync delay0Switch4 (the setting of a switch)1CommandLocal (register set with command code 1)2CommandBeamOn (register set with command code 1)3TestMode (register set with command code 1)4-15PageSyncDelay (register set with command code 5)6External command 10LineNoise1CompareError2BufferUnderflow3PacketsOK4-12ExternalCommand1 (register set with command code 6)70-3LineCount4-15ExternalCommand2 (register set with command code 7; M version only)4-15VideoGate (register set with command code 7; T version only)The remaining 8 words of status are normally used for external (engine) status of various kinds. TheTTL adapter organizes these words as follows:WordBitsFunction80-15Special status bits 0-15 (see printer documentation for interpretation)90-15Special status bits 16-31 (see printer documentation for interpretation)100-15ID (16 bits). This identifies the engine type.110-15Serial number (16 bits). This specifies the serial number of the engine.12-150-15Additional engine-dependent values, used by some printers.fpX!qFpXG gb]S g_Sq]]pS,]\S]ZS]YS ]WS ]USqp gRS]QqS; gNiS]LS']KaS+]IS+ gFS ]EQS(]CS-]BIS- g?AS]=S!]<8S1qp ]:S0]90S0 g6(S]4S!]3 S/]1S0]0S+].S0 g+S]*S](S ]'S]%|S]#S3 g ]kS]S4qp ]cS-qp g8 X gqp* ]S ]SXG ]SH x]S/ ]SI p]S:: )?\EProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer262.5 Additional adapter featuresThere are a number of additional adapter features, chiefly for providing various kinds of diagnosticand debugging help.The ExtendVideo flag (T version only) can be used to override the action of the VideoGate counter.Once SendVideo comes on, it will stay on until ExtendVideo is turned off and then the VideoGatecounter reaches zero.There are two variations of "local" operation for checking out the printing engine. The machine maybe switched to Local by a switch on the engine (and reported as a status bit), or may be set into thismode by setting CommandLocal. In the first case, the adapter extracts commands from a PROM thatare intended to start paper motion and printing. Two switches (Switch3 and Switch4) govern theselection of one of four local command sequences that is extracted from the PROM. In both localcases, the adapter will generate "graph paper" video signals governed by the video gate counter(VideoGate) and the line sync delay register (LineSyncDelay). In order to see graph paper cover thepage, VideoGate and LineSyncDelay must be set in such a way that they are counting as the beampasses all spots on the page.To aid debugging the adapter itself, the TestMode bit may be set. This permits the crucial printerand ROS timing signals to be generated in the adapter rather than in the engine. If TestMode is set,PageSync is taken from the complement of the control bit TestPageSync', and line sync (analogous tostart-of-scan) is generated by the motor control circuitry: on the M adapter, it will be on for (15/16) *(4096-MotorSpeed) / crystalClock seconds and off for (1/16) * (4096-MotorSpeed) / crystalClockseconds; on the T adapter, it will be a signal on for 4 * (4096-MotorSpeed) / crystalClock secondsand off for the same amount of time. The "on" portions of these signals simulate scan-lines of thecorresponding durations.The BeamEnable status bit means that the doors to the ROS housing and/or printing engine areclosed, and the interlocks have engaged.To force the laser beam on, and consequently to allow the servos to settle down, eitherCommandBeamOn or StatusBeamOn may be set. CommandBeamOn may be set by the EIP, andStatusBeamOn can be set with a switch in the ROS housing (M adapter).There are four switches on the adapter module that can be used to alter the operation slightly. TheVideoPolarity switch will invert the sense of the binary signal sent to the beam modulator.SelectLeadEdge is a switch that selects either leading or trailing edges of the SOS and EOS signals forcareful timing purposes (different ROS boxes operate differently).Adapter errors. The adapter keeps track of various kinds of errors that may occur during its operation,and reports some status bits. If the adapter detects errors on the line that delivers commands to theadapter, it sets LineNoise or CompareError and ignores the command. If the EIP fails to providevideo data fast enough, the adapter sets BufferUnderflow (this condition is reset by the Buffer resetcommand). The PacketsOK condition is set by the Buffer reset command, and cleared whenever animproperly-formatted video data packet is received from the EIP.fpX!qFpXG gbu g^p(< g]n gZCqp4 gXHupup gW; gT[ gR33 gQ5"qp gOJ gM4qp gL{L gJG gIsK gG gDS gC@qp? gAu p/ g@7Cqp% g>O g=/qpQ g;H g:' g66qp g5x( g2L 9! g0Kqp g/D-qp qp g,E g**1 g)Pqpqp g'#qp g$aupW g"b g!YGqp g8- gQR g1024 use a "Hesso ROS," which has parameters f=12, r=12.Typical settings in the T adapter for S=B=350 bits/inch are:BitRate=17 * 106MotorRPS=109.38MotorSpeed=1707MotorScale=7BitClock=3002BitScale=7LineSyncDelay=4046 (3008 for entire line for graph paper)PageSyncDelay=3971 (3596 on Version II)VideoGate=33523.2 Engine timingThe engine timing for Dover is somewhat intricate, as there is a substantial "pipeline" effect in thepaper path. The philosophy used in designing the engine control electronics has been to make themsimple, and to require the EIP program controlling the engine responsible for sorting out most of thetiming details.There is only one signal used to instruct the Dover engine: a PrintRequest signal that is generated bya 0-to-1 transition of the low order bit of ExternalCommand1. Thus two successive adaptercommands (first 60001b, and then 60000b) are normally used to cause the PrintRequest signal. ThePrintRequest signal is used by Dover to feed sheets; be warned, however, that initiating andterminating a printing sequence are both a bit tricky, and require careful thinking (more on thisbelow).Dover generates only one timing signal of interest: CS-5, which is transmitted to the adapter as thePageSync signal. All timing information relevant for paper-path motion is derived from this signal.For purposes of discussion, it is helpful to "number" each of the CS-5 pulses generated by theengine, starting with CS-5(0), the first to be generated as the machine cycles up.We shall describe the operation of Dover by describing the various sequences involved: (a) a coldstart assuming the motor is presently off (PrintMode is off); (b) the "inner loop," in which paper ishappily flowing through the engine, and page after page is being printed; (c) the runout shut-downsequence; and (d) the malfunction shut-down sequence.fpX!qFpXG$%ari g^p2qp g](upA g[(= gZ *8 gX!up* gUpu gREp M]OuSp]MuSp]LuSp]JuSp]I uSp gEvpqpupup gBqp upup]?@q]>p]<]: ]9w ]7 ]6o9]4']3g g0;u g-pe g+P g*qpF g( g%XQ g#R g"PT g X gHS g gQ gW g R g R gB g]A$ g#? gU5 Z g@Y2Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer28Inner loop. We shall begin by describing the inner loop, as it is the simplest sequence. Referto Figure 3-1 for an illustration of the timing. Let us assume that CS-5(n) has just occurred.Approximately 250 ms. later, the adapter should begin sending video to the ROS that willcorrespond to the leading edge (left-hand edge) of the paper. This time will vary a little frommachine to machine, and can be controlled with the help of the PageSyncDelay register inthe adapter. Imaging the page persists for about 850 ms. Approximately 896 ms. after CS-5(n), the Count-H status signal is generated and persists until the next CS-5 (Empirically,Count-H is on for only about 20ms. in older adapters; it is much wider in Dover II adapters.Special provisions in the standard microcode provide help in detecting this signal reliably.)This signal indicates that paper was successfully fed to hold the image for the page that isbeing imaged on the drum. If Count-H does not appear at the proper time, it is likely thatsome malfunction has, or is about to, occur. Within 990 ms. after CS-5(n), it is necessary toissue a new PrintRequest (i.e., to send the adapter a "set External Command 1" command) ifanother sheet is to be fed (i.e., if you desire to keep printing at high speed).Cold start. In order to initiate printing, the EIP issues a PrintRequest (again, by issuing the"set External Command 1" command to the adapter). PrintMode should come on, verifyingthat power has been applied to the main motor. About 250 ms. after the print request, CS-5(0) is generated. This first CS-5 identifies a machine cycle that will not result in an outputpage: if you were to interpret CS-5(0) in the fashion described above for the inner loop, thefirst image you delivered would not be blessed with a sheet of paper to receive it. However,if you issue a second PrintRequest within 990 ms. of CS-5(0), the machine will cycle again,and generate CS-5(1). This CS-5 does in fact correspond to a sheet of paper -- now you mayenter the inner loop.A convenient way to think of the cold start sequence is to start the inner loop with CS-5(0),with two additional features on the first page imaged: (1) it will not be transferred to paper,and should therefore be "white" (in order to insure the bit clock servo is running properly),and (2) the Count-H signal will not be generated, because no sheet of paper was actually fed.Runout shut-down. Dover begins shut-down whenever it fails to receive a PrintRequest intime (i.e., within 990 ms. of a CS-5). The machine must continue to operate for some time,however, in order to allow the last sheet of paper to be fused and transported to the outputhopper. There will be 7 gratutitous CS-5 pulses generated after the last CS-5 that wasproduced by a PrintRequest. At the end of this sequence, PrintMode is turned off, indicatingthat paper path motion has stopped. In order to re-start the machine, a cold-start sequence isrequired.If you wish to resume printing before the 7th CS-5 has passed, you may resume issuingPrintRequests, just as if you were in the inner loop (i.e., the first CS-5 after yourPrintRequest will be blessed with a corresponding sheet of paper).Malfunction shut-down. When a malfunction is detected, the Dover printer shuts downimmediately, and does not wait for paper to be transported out of the machine. Anappropriate malfunction status bit will be turned on (see next section), and the machine willhalt (PrintMode goes away; no more CS-5's will happen). After an operator has corrected theproblem, the machine must be restarted with the cold-start sequence.3.3 Engine status indicationsDover may report up to 32 bits of status to the EIP via the adapter. Most of these bits are unused.The table below gives the name of each status bit and a short description of its purpose. The variousmalfunction indications are followed by a quoted string in italics; this is the recommended operatormessage for the condition (adherence to standard messages simplifies the job of the trouble-shooter).WordBitSignalfpX!qFpXG]bu pE]`?]_/qp ]]/1]\>]Z<]YC]W@]UH]Ty\]R8#]QqN]OB]NiP]K>u p%qp$]I I]H6V]FBup]E-E]C3*]B%I]@up@]?];@]:n_]8;"]7fV]4:upG]2'4]12K]/$3].*M],_]+"]'6]&s J ]$B]!up*] ?O]L]7J]D gu g\pT g^ gT:* g$A g qxBP g @ZfProgrammer's Guide to Orbit, the ROS Adapter, and the Dover Printer2983Count-H. This signal is raised if a sheet has been successfully fed to receive the image for the page beingimaged. Count-H comes on 896 ms. after CS-5 and persists until the next CS-5.85PTDisorder. This signal is active when the paper tray is not in the up position or when the paper traycover is open. It persists until the condition is corrected. This is the "or" of (not LS4) and (notLS24&LS31). "Paper tray open."88* LS4. This signal is active when there is adequate paper in the paper tray. A zero value will also assertPTDisorder.810LS27. This signal is active when progress from the A transport to the register stop module is not normal.It persists until the paper is cleared. "Jam--paper feed."811* LaserOn. This signal is active when the laser power supply is on, and the beam is available for use."Laser is off." (Applies when the status bit is not present.)812* LS22. Malfunction Reset. Left as an exercise to the reader.813ReadyTemp. This signal is active when the fuser temperature is above 285 degrees F. This corresponds tothe minimum temperature needed to fuse the toner to the paper. "Fuser not warm." (Applies when thestatus bit is not present.)814LostPower. This signal is active when machine power is turned off when PrintMode was active (i.e., themain drive motor was energized). It persists until the paper is cleared. "Lost engine power."815* ModeCont. This signal is active if the machine is set to run in its "extended", or half-speed,configuration.91PhotoCellOut. This signal is active when a sheet of paper has not been knocked off the drum duringmachine operation. It persists until the paper is cleared. "Jam--paper on drum."92PreSeq. This signal is active if a malfunction occurs before the first page is imaged (i.e., during the power-up sequence). "Jam--startup sequence."94* LS9. Two pieces of paper were fed. "Jam--two sheets fed."95ACMonitor. This signal is active when the machine is powered up. It is possible to have ReadyTemp-Hactive even though the ACMonitor-H is not. "Engine not powered up." (Applies when status bit is notpresent.)96LS38. This signal is active when a sheet of paper is jammed on the fuser roll. "Jam--paper on fuser roll."98* LS1. B Transport Jam. "Jam--B Transport."99Malfunction. This is a general-purpose signal that is the "or" of all the possible error indications givenabove (PTDisorder, LS27, LS22, LostPower, PhotoCellOut, PreSeq, LS38, LS1, LS3).910LS3. This signal is active when a sheet is not knocked off the drum and PhotoCellOut-H does not catch it.It persists until the paper is cleared. "Jam--paper on drum."913* LS24&LS31. Paper tray is up and sensing bar is in place. Normally active. A zero value will also assertPT-Disorder.* Meaningful for Version II adapters only.fpX!qFpXG gbAqB$H@aN g^Bg@]n_@\1 w gYqBN@X gVDB^ @T(w gRhqBa@Q+wq!wq gNB= gL{Bf@K>3 wq@J wq gGBB%@FkJw gDqBT @B g@~BF@?A=w g11632*>11632*>11632*88748>1026011137105460>75607980123618>6300<6365142622>45034731Landscape:6>14000*>14000*>14000*88576>11008<11124105508>82148724<9030123735>5058>6516142652>4900>5035Explanation. The nominal number of characters per page is the number of characters of the givensize that fit comfortably (without squeezing or overprinting) on a page. These numbers comparereasonably well with typical pages printed on EARS. The third and fourth columns give Orbit'smeasured capacity. The third column is measured with disk activity present (the assumption is thatwhile printing a page of a given complexity, you must be reading from the disk into another buffer adescription of the next page, so that printing at the given capacity can continue uninterrupted). Thefourth column is measured with disk activity absent. Note that absence of disk activity increasescapacity only slightly. (Starred items exceeded character sort size in my test program.)Storage capacityCharacterFont storagepoint sizein words/characterPortrait:624.3839.81059.11283.714111.Landscape:623.9839.41058.61282.914111.The table above gives storage requirements for a single character, including the necessary index table.Note that with Orbit, it is straightforward to economize on font storage by including only thoseindividual characters known to be used on the page.fpX!qFpXG&ari g^p9- g]n=( g[3* gZf! gW\ gU Y gTy1) gR$> gQq= gNs]Kq#,]JG  ]G]F#,]EQ#,]D#,]B#,]A#,]? ]=#,]<#,];e#,]:'#,]8#, g5u p= g4^B g2-qp, g1U'< g/,8 g.MD" g,:( g+EX g(s]%q# ]# #]!Y] #]#]#]c#]&#] ]m#]0#]#]#]w# gop07 g K g g3  g @[Programmer's Guide to Orbit, the ROS Adapter, and the Dover Printer31Storage requirements for a "page description" (i.e., information about which characters are to appearwhere) are:2 words/character +4 words/rule (horizontal and vertical lines) +st/8where st is the total number of scan-lines on the (active) part of the page.Rule of thumbThere is a model (the details of which I will avoid stating here) that can be used to estimate thenumbers given above. Let r be the resolution of the ROS in bits/inch. Let s be the point-size ofcharacters. Let p be 1.0 for fixed-pitch fonts and .6 for proportionally-spaced fonts. Let t be the totalimaging time in seconds (.85 for Dover).The number of font storage words per character is roughly 3 + 7.2*10-6 p (rs)2. The maximumcapacity of Orbit in characters per page is roughly 2.1*106 t/(2.1*10-5 p (rs)2 + 2.3*10-2 p rs - 6).5. MiscellaneousA pattern generator for gray (shaded) areas. A simple algorithm will generate acceptable gray patcheson most printers. The scheme, devised by Mike Wilmer, is used to compute an 8-by-8 bit patternthat can be replicated laterally to produce the shade (the INK memory can help with this). If youwant a darkness D, where 0 corresponds to white, and 63 to black, a bit of the pattern should be 1(black) if D is greater than the entry in the following 8-by-8 table:44 39 31 17 09 25 37 5220 26 33 41 49 35 28 1200 10 50 57 61 46 22 0206 18 42 58 62 54 14 0408 24 36 53 45 38 30 1648 34 29 13 21 27 32 4060 47 23 03 01 11 51 5662 55 15 05 07 19 43 59 ReferencesSpruce printing program sources, saved on [ivy].Severo Ornstein, "Orbit General Description," PARC/CSL Memo.Orbit Logic DrawingsP* Protocol and SoftwarefpX!qFpXG gbF g` ?]?\.?Z gWL gTVs gQ+pR gOupqpup gN#upJup gL( gIsDJqIspupupJqIsp gG:H5qGpupH5qGpupupH5qGpH5qGpup%Bri g?pN g>&S g<;qp g;upH g9 up9S6oS4S3gS1S0_S.S-VS+''r g#p8 g .qp g g gu?MFigure 1-5: Alternative memory-management schemesFigure 1-4: Page generation data structurescode (6)10000110010101101000------------4 (Width-1)-4 (-Height)>Font character (A)Font TableqrCharacterBand List1612201400The band list shows a single character (code=6, x=12, y=2014),FFFFBBBBBiiiiii-1i-1i-1123>Another font characterfollowed by an end-of-band indicator. Memory addresses increase upward. t 12l+pH_8PG8OGIOG +8XG8T-G8QG8V$9;T9;W :G : +G)dG :&G3&G<dG3 +G3G VG V +G:dG V&G V%$ :%$ :$3$r$r"$t$$"6t! 3##36tp#VA%:7 8V]$]t$78JtGIAG +8AG8AG7pBB+B ]$9;B 7lH 9BLWHICH (if 0, auxControl set status address;Figure 1-6: Orbit functionsbadROS (error in adapter status)stableROS (no arriving adapter status)BEHIND (buffers switched before GOAWAY)ROS status (addressed by OrbitControl)if 1, auxControl sets FA)ESS (enables setting SLOTTAKE)SLOTTAKE (routes output data to ROS)clrBEHIND (clears BEHIND indicator)CLRFRESH (clears refresh indicator)RESETOrbitControlF2=15boutOrbitStatusF1=17binOrbitHeightF2=12boutOrbitXYF2=11boutOrbitDBCWidthSetF2=10boutOrbitFontDataF2=13boutOrbitDBCWidthReadF1=15binOrbitDeltaWCF1=14binOrbitROSCommandF2=16boutOrbitOutputDataF1=16binOrbitInkF2=14boutOrbitBlockF1=3--Ink dataData from Orbit output buffer16-bit command for ROS adapterNo. of full words processedDelta BC(Width-1) remaining16-bit word from source raster dataDelta BC(Width-1) for characterXY (of lowest edge)-HeightauxControlsetGOAWAY(signals end of image generation)INCONunstableROSmcTIMEOUTmcIACSmcearlyPageAbortmcbadBandEntrymc+WR_+st +Wp5{ +W9&+W<%'+W>^&6 $< 9$<$r$>$$?$9AI$9sAI$9:AI$9AI$9AI$9C_#$A&$]A&#$(AI$9,sP&+WGB+WI{$+WK#+WT#+WVG$G$J $J-$LB 9$Lf$ V N{ $ N$ #R$#S$%:U&$%:UJ$r'sW_U$'sW$9a$_ $_$] _ $ a$a$_ $_ $(_$9a$ _k9_k9_k99_$9 r_$9 _$9_$9V_$9_$9_$9:_$9s_$9!_$9$_$9&W_$9.A#$(,,$9, #$, $]-Z =ZFZ-BB =BBFBB-0z =0zF0z--%=-%F-%-)=)F)-&z =&zF&z-#%=#%F#%- =F-z=zFz-$=$F$-=F-y =yFy/^$]/^#$(/$91#$[#$(Y$9Y#$Y$]*#$(($9(#$($]%^$]%^#$(%$9'#$$A#$(",$9"#$"$]$]#$($9 #$#$($9]#$]$]$]#$(+$9A#$#$($9#$$]A  9 $9A ",$9"r" %# ($9)A)A ,,$9V,V, /$9/Y$9Y$9:Y$9sY$9Y$9!Y$9$Y$9&WY$9Z& +WM*!^.k:^.k^.k ^.k9^.k(^.ki.$9AI$9 rAI$9 AI$9 AI$9 <$r <U$ :{$V8B$6,$ 6 $+W79 7 5{AI$9V8e$ :$?$9>$8B$V:{r$?$?$6,$8e$<%>^V=f$V:$L[ of scan-lines.and then counting VideoGate before terminating SendVideo. All counting is done in termsSendVideo is generated in the adapter by counting PageSyncDelay after CS-5 arrives,>Scanning beam Figure 2-1: Conceptual model of the imaging processFigure 3-1: Dover printer timingooEnd of scan detectorStart of scan detector><896 ms.<850 ms.><1000 ms.>CS-5(n)Image for page nPage sync delayVideo gateDover IIDover II  X S:KsLBU$rLBJ$VtE3 ]pN]]5z\N{ \<8GP:G0QC$ $0QC $9Qf$ 0[C$<[C$DQf$ <QC $<QC$ $QC$ $QC $"sQf$ [C$r[C$VQf$ rQC $rQC$ $%:[C$.Qf$ %:QC $%:QC$ $-%+$$+$y/: $$DX/:9$?W+$DX+$ys; (0z^9_J9_9J9J-9I9V2.e+z <($=($>;($?W($@t($A($B(H$B',$B%$ %$ ',$ (H$ :($($($($($($!Vx&B&FII{ HELVETICA HELVETICA HELVETICA  HELVETICA  HELVETICALOGO TIMESROMAN  TIMESROMAN TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN TIMESROMANMATH  HELVETICA HELVETICA  HELVETICA  Gates  TIMESROMAN  TIMESROMAN TIMESROMAN  TIMESROMAN  TIMESROMANMATH  TIMESROMAN  TIMESROMAN TIMESROMAN  TIMESROMAN TIMESROMAN  TIMESROMAN  TIMESROMAN TIMESROMAN MATH  TIMESROMAN I h O* {4 =E }O Y b Ck v~ q ?B U q  |i 9_|=5;]X%39W-3M1 =)]K=(Z$"9 :  %A9a9`E<"$9[9ZB$=5]W: %S9P9O = )%AE_%^) E\%=[iX=C]R%=C%9OP B" -Ei%^9^B"j/!%orbitguide.pressSproull 5-Apr-83 12:45:07 PST: