Inter-Office MemorandumToDorado and Dolphin usersDateJune 24, 1982FromEd TaftLocationPARC/CSLSubjectExtended Alto Emulator opcodesFile[Indigo]ExtendedOpcodes.presson the Dorado and DolphinXEROX The Alto instruction set, as emulated on the Dorado and Dolphin, has been extended to includeseveral additional instructions. Herewith their descriptions.Note that some microcode configurations may not implement all these instructions. Software shouldbe prepared for unimplemented instructions to trap in the standard manner (see Alto HardwareManual).1. New instructions61022BWrite Printer [Dolphin only]Sends AC0 to the printer interface. The Dolphin's printer interface is incompatible with the Alto's;refer to device-specific documentation for how to use this. (Note that this opcode replaces the Alto-II DIAGNOSE1 instruction.)61023BRead Printer [Dolphin only]Reads AC0 from the printer interface. (Note that this opcode replaces the Alto-II DIAGNOSE2instruction.)61027BDisplay Field Rate [Dorado/Dolphin]Sets the display field rate according to a parameter passed in AC0, and returns the old value in AC0.For an LF display, the value 9 selects 77 hz (the normal rate), and 139 selects 60 hz. Only LFdisplays will tolerate having their field rates adjusted in this manner.61032BDisplay Width [Dorado/Dolphin]Permits a program to determine what type of display is connected (Alto-style or LF); and, in thecase of an LF display, permits switching between Alto emulation and full-screen modes.Entry:AC0=0Switch to Alto emulation mode.AC0=1Switch to full-screen mode.Exit:AC0=maximum number of words per scan line in the new mode (38 for Alto mode, 64for full-screen mode).]gpi c8q]rX-q5`r \q]r-q5`r VDq]r-q5`)]TrOsr IU H> E-C CNt B%r =uX 9 vwv t 6(rqr*3 4N 3 qr .vwvX t +rqr Aq *+r %vwvXt "r?qrqr !6\ H &vwvX t ArY V qrTqr oqr'&  ?[^Extended Alto Emulator opcodes on the Dorado and Dolphin2The exact effects of the instruction are machine-dependent. In some implementations, the displaymode may be fixedthe instruction will not change the mode but will just return information.61033BGet Memory Configuration [Dorado/Dolphin]Permits a program to obtain the size of the machine's real and virtual memory.Exit:AC0=number of 256-word pages of usable real memory.AC1=number of 64K-word banks of virtual memory.Since the Alto instruction set does not include any facilities for manipulating the virtual memory,this instruction is essentially useless in Alto emulation mode. It is included for the benefit ofprograms running on top of other emulators (Lisp, Smalltalk), which can escape to Alto emulationmode to obtain this vital information.61034BPower Off [Dorado/Dolphin]Turns off the machine's power and does not return. Manual intervention is required to turn themachine back on.61035BChecksum [Dolphin only]Computes a checksum over a block of memory, using the Pup ones-complement add-and-cyclechecksum algorithm.Entry:AC0=0 (initial checksum)AC1=address of first word of blockAC3=number of words in blockExit:AC0=result checksumAC1=address of first word beyond end of blockAC3=0This instruction is interruptible. If interrupted, it stores intermediate state in the accumulators anddoes not advance the PC. When the interrupt has been serviced, the instruction is re-executed andcompletes the operation.61036BLoad RAM [Dorado/Dolphin]Overwrites the machine's control store with new contents, and optionally starts the machine at a newmicro-PC.Entry:AC0=address of RAM image array in main memory.AC1[15]=mode flag (see below).Exit:If AC1[15]=0, resumes execution at the next (macro)instruction. If AC1[15]=1, sets themicro-PC to the value given in the End block of the RAM image.Mode 1 is used for complete microcode replacement, as in loading a new emulator. All micro-tasking is turned off (and memory refresh is done in-line on the Dolphin); and at the end the newmicrocode is started at its starting address.Mode 0 is suitable for microcode overlays, where the new microcode does not conflict with anymicrocode presently being executed. Tasking is left on, and the starting address in the RAM imageis ignored. Additionally, the address of the first word not loaded (i.e., one beyond the end of theRAM image array) is returned in AC0; if the microcode consists of multiple overlays, this is a pointer frX8G bD ` Q \vwvXt Y)rN VDqr1Tqr qr Q/4 PWO NP MO& HvwvXt ErV DZ ?vwvtX /]1Extended Alto Emulator opcodes on the Dorado and Dolphin3to the beginning of the next overlay.The format of the RAM image is machine-dependent. For the Dorado format, see [Ivy]DoradoBooting.press; for the Dolphin, [Ivy]Microcode>D0>Private>MakeLoaderFile.press.61037BSet Default Partition [Dorado/Dolphin]Sets and/or returns the current default disk partition number, which is a number in [1..2] on aDolphin and [1..5] on a Dorado.Entry:AC0=0 just returns the current default partition.AC0#0 attempts to set the default partition to that value.Exit:AC0=current default partition if AC0=0 on entry; otherwise,AC0#0 if the specified partition was legal, 0 if illegal.The effect of this instruction is instantaneous; it is the caller's responsibility not to have any diskactivity in progress at the time.61040BIO Input [Dorado only]Executes an Input operation on the Dorado's I/O bus.Entry:AC1=IO address (TIOA) in [0..377B].Exit:AC0=IO data read from that address61041BIO Output [Dorado only]Executes an Output operation on the Dorado's I/O bus.Entry:AC0=IO data to be sent.AC1=IO address (TIOA) in [0..377B].Exit:ACs unchanged.61042BHalt [Dorado only]Causes the machine to halt, by executing a micro-breakpoint. The machine may be resumed by aMidas Proceed''.61043BSet PC Sampling Histogram [Dorado only]Enables or disables emulator micro-PC sampling.Entry:AC0=address of 8192-word table to be used as a PC-sampling histogram. AC0=0disables PC sampling.Exit:ACs unchanged.When enabled, the microcode treats the table as an array of Mesa LONG CARDINALs (32-bit integersin which the low-order word is at the lower address). Every 32 microseconds, the microcodeincrements the entry whose index is the current emulator micro-PC. The caller should zero thetable before enabling PC sampling. frX8G b% _9qr4 ]T \1 WvwvXt Tr T S< PWqr/Nqr8 KqrqrJjqr7 GY F! AuvwvXt >r4 ;qrqr 8qr 4:vwvXt 1Ur5 .qqr,qrqr *qr %|vwvtX "r<! ! vwvXt r/ qrEqr9 Tqr o/q r +0 gJ " >/]oExtended Alto Emulator opcodes on the Dorado and Dolphin461044BExternal Input [Dorado only]Reads data from the Dorado's external input connector.Exit:AC0=input data61045BExternal Output [Dorado only]Sends data to the Dorado's external output connector.Entry:AC0=output data2. Other extensions and incompatibilitiesVERS instruction [Dorado/Dolphin]The VERS instruction (61014B) returns the following standard information on the Alto:AC0[0:3]Engineering numberAC0[4:7]Build numberAC0[8:15]Microcode versionThe enumeration of engineering numbers has been extended as follows:0 or 1Alto I2Alto II without extended memory3Alto II with extended memory4Dolphin5DoradoOn the Dolphin and Dorado, the build number (use of which has been discontinued on the Alto) istaken over to indicate the emulator(s) present in the current microcode:0Alto emulator only1Alto plus Alto/Mesa4Alto plus Lisp5Alto plus Smalltalk 766Alto plus Smalltalk 80The microcode version field contains unspecified information which may be machine- or emulator-dependent.Extended memory [Dorado/Dolphin]Certain configurations of the Dorado's and Dolphin's Alto emulator have a limited implementationof the Alto-II extended memory option. Specifically, they support changing the emulator task'salternate bank register and the display task's normal bank register. The former operation permitsone to make references to nonzero banks by means of the XMLDA, XMSTA, and BITBLT instructions.The latter operation permits one to move the display bit map to a nonzero bank.The extended memory emulation does not enable switching of the emulator's normal bank registerto a nonzero bank, nor does it enable the switching of any I/O device besides the display.On both Dolphin and Dorado, this capability is presently included only in the Smalltalk-76microcode configurations and, in general, is useful only to Smalltalk-76. (However, see the next twosections for a more general and widely-used capability.) frX8G bvwv t _9r6 \Tqr WvwvXt Tr5 Qqr MruX) Itxt Frqrqr9CqrBlqr @qr >D;9865 2)A 0H-,<* )4' $J #G tX rG & Q I * qrqrqr O "tr8 1)1 LF X D8 ?/\Extended Alto Emulator opcodes on the Dorado and Dolphin5Long display bit map addresses [Dorado/Dolphin]On the Dorado and Dolphin, the display bit map may be located in extended memory. It isreferenced by an extended DCB'' that differs from a normal DCB in the following ways:1.The sign bit of word 3 (scan line count) is 1 instead of 0.2.The normal bit map address in word 2 contains 177423B.3.The DCB is extended by two words, which are a Mesa LONG POINTER to the bit map (thelow-order 16 bits of the address are in the first word).Note that the DCB itself remains in bank zero. Use of extended DCBs is the preferred method ofmoving the display bit map out of bank 0 on Dorados and Dolphins.Long BITBLT [Dorado/Dolphin]BITBLT may optionally take base bit map addresses given as LONG POINTERS specified in anextended BBTable''. This differs from a normal Alto-style BBTable in the following ways:1.The sign bit of word 0 (function) is 1 instead of 0.2.The source bit map address is given as a LONG POINTER in words 20B and 21B, and thedestination bit map address in words 22B and 23B.In an extended BBTable, the base bit map addresses in words 2B and 10B and the bank bits in word0B are ignored. Extended BITBLT is the preferred means of referencing memory outside bank 0 onDorados and Dolphins.Unimplemented instructionsOn the Dorado and Dolphin, the following instructions do not work the same as on the Alto:61003BRCLKThe interpretation of the clock value returned in AC1 is thesame as on an Alto-I (see Alto Hardware Manual); however, theresolution is not the same.61007BSITSet Interval Timer: no-op.61010BJMPRAMJump to RAM: if AC1 contains an appropriate value, entersanother emulator (e.g., 420B for Mesa); otherwise it traps.61011BRDRAMRead RAM: returns a constant value.61012BWRTRAMWrite RAM: no-op61015BDREADDouble Read: traps.61016BDWRITEDouble Write: traps.61017BDEXCHDouble Exchange: traps.61022BDIAGNOSE1Diagnostic: replaced by Write Printer on the Dolphin; traps onthe Dorado.61023BDIAGNOSE2Diagnostic: replaced by Read Printer on the Dolphin; traps onthe Dorado. frX8G bt/ _9r5# ]!6 Z; W4qr U,q rS8 P(7 OA KatXxt H|qr5q r  F#8 D4 A.)qr qrqr?'qrqr <"qrqr ;Aqrqr< 9 6tX 3 rT0;q`q!r2qr!.t r!-3*Nq`q!r'iq`q!rqrqr !%qr#q`q!rqr q`q!rqr7q`q!rRq`q!rmq`q!rq`q!r>!  q`q!r+! & T>/YOExtended Alto Emulator opcodes on the Dorado and Dolphin661025BXMLDAExtended Memory Load: has its normal effect if the extendedmemory emulation is present; otherwise it traps.61026BXMSTAExtended Memory Store: has its normal effect if the extendedmemory emulation is present; otherwise it traps.On the Dolphin, execution of unimplemented opcodes in the range [61040B..77377B] may haveundefined effects rather than causing a trap.BCPL Runtime microcodeBCPL software uses stylized calls for invoking a number of runtime operations. On the Alto, thesecalls invoke either some standard runtime software (part of the Alto Operating System) or somespecial Alto microcode (BCPL Runtime package). All the calls are of the form JSR 300 through JSR337 or JSR @340 through JSR @377.To improve performance, the Dorado and Dolphin intercept many of these opcodes and executethem directlythat is, they implement the semantics of the standard runtime operations, but withoutactually executing any of the runtime software.Of course, this precludes the substitution of different runtime software providing non-standardsemantics (such as a different stack frame allocation strategy). It is possible to constructconfigurations of the Dorado and Dolphin microcode in which emulation of the BCPL runtimeoperations is disabled. frX8Gbq`q!r;!`0]q`q!r&!\10 YL2qrqrt Wr TtX Q+rV ON N#Nqrq Lrqr qr I&4 H6W F/ C_ BI? @L ?A >>/) TIMESROMAN  TIMESROMAN TIMESROMAN LOGO TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN TIMESROMAN ^#j/&$BW)ExtendedOpcodes.bravoTaft.PAJune 24, 1982 4:22 PM