;************************************************************************* ;************************************************************************* ;** ** ;** FILENAME: UVS_SRC.6P2 (UVS Flight Software Version 6.2) ** ;** PURPOSE: This is the Flight software for the Galileo Ultra- ** ;** Violet Spectrometer Subsystem (UVS). This is a major ** ;** revision because of the failure of the High Gain ** ;** Antenna on the S/C. The new software has been dubbed ** ;** Phase II S/W. Thus, this is the first round of GLL ** ;** UVS Phase II S/W. It is built upon the as yet, ** ;** untested, Version 6.0. We determined that 6.0 worked ** ;** well enough and we still had room for further enhance- ** ;** ments, and thus this version 6.1. Version 6.2 corrects ** ;** a couple of bugs found in the "STEP" routine. ** ;** See the notes below for further information. ** ;** DIRECTORY: LASP PISCES::[white.galileo.uvs.phase_II]UVS_SRC.6P1 ** ;** ** ;** AUTHOR: N. White 3-4-89 ** ;** REVISED: N. White 9-30-96 ** ;** ** ;************************************************************************* ;************************************************************************* TITLE Galileo UVS Flight Software Version 6.2 SUBTITLE Introduction ; Revision 6.2 September 24, 1996 ; Corrected a bug in the software in the "STEP" routine. The 5.1 ; version contained a mask which limited the total number of steps ; to 9 bits (i.e. 511 steps). This fact was not caught in the ; new 6.1 version. Since in version 6.1 we are supposed to be ; able to take up to 10 bits worth of steps, the mask in the ; "STEP" routine needs changed. So in "STEP" this revision ; changes the mask of 01 hex to 03 hex for the most significant ; byte of the step count register. Also, since the 16 bit register ; RB (Step Count Register) is tested in two halves, and interrupts ; are enabled, especially NEW_MODE_INTERRUPT, it is possible RB can ; change in the middle of testing to see if it's zero. So, this ; version remporarily disables interupts during this time. THESE ; ARE THE CHANGES FROM VERSION 6.1. The only other differences ; between 6.1 and 6.2 are updating some comments, and the last byte ; which contains the version number (changed from a 61 hex to ; a 62 hex. ; Revision 6.1 August 15, 1994 ; This revision is an enhancement to version 6.0. This revision ; provides all capabilities from version 6.0, but provides one ; additional capability. This is to allow for different sized ; mini-scans for the even and odd science frames. The "Opcode" ; byte (byte 1) and the most significant 6 bits of byte 5 point to ; a look-up table (low order only) which contains the size of the ; even and odd science frames mini-scan size respectively. Also, ; threw away all previous interpretation of the opcode byte, ; specifically opcode=0 and opcode=7, which previously were ; interpreted as mini-scan sizes of 16. ; Revision 6.0 July 27, 1994 ; This is a major revision of the software to modify if for Phase II ; of the mission due to the failure of the High Gain Antenna. ; There are four major requirements for this revision: ; 1) Eliminate use of R3 as a program counter, ; 2) Only allow one and two position mini-scan modes (i.e. ; eliminate 3 and 4 position mini-scans), ; 3) Allow mini-scan modes to alternate between two detectors ; similar to scan modes, ; 4) All modes must be symmetrical around a two science frame ; buffer in CDS. (I.E. in past versions of the S/W, during ; say, a two channel mini-scan, the mini-scan position ; went as 1, 2, 2, 1 [symmetrical around 4 science frames]. ; We now require this sequence to be 1, 2, 1, 2,...) ; These changes will basically be made in such a way that there ; is minimal changes to the S/W so that we maintain as much of ; the old code as possible in order to keep the probability of ; operational success high (reduce risk). PAGE ; Implementation: ; 1) R3 and R6 functions will be swapped ; 2, 3, and 4) Because there are now only two mini-scan positions, ; and because we now want two channel mini-scans, the science ; frame interrupt processing becomes almost identical for both ; the mini-scan and scan modes. Therefore, there are whole blocks ; of mini-scan S/W removed, and other blocks of the old scan S/W ; that become generic. ; Because of the similarities between the two modes, and because we ; no longer need four deltas, the command words will be changed. ; Basically, the 9 bit initital position field will fully occupy ; the first two delta words (words 4 & 5) zero filled. The ; positive delta * 4 will occupy word 6 (now a full 8 bit field), ; and the negative delta * 4 will occupy word 7 (8 bit field). ; In order to make things simpler, I have made the Mini-Scan ; Counter register a "Steps Counter" that is 16 bit wide, so it ; could be used generically in both scan and mini-scan modes. This ; necessitated making both R3 and R9 16 bit registers, which in turn ; forced me to give up the "Zero" register, and moving the UP/DOWN ; register to RA.1. PAGE ; Old Introduction - Not necessarily relevant to Phase II S/W ; This FLIGHT software incorporates the mini-scan mode, N-G scan mode, ; and adds the capability of commandable deltas in scan modes. ; NOTE: INCONSISTANCIES IN SCAN MODE DELTAS, DUE TO AN EXTRA "STEP" ; INTERRUPT AT THE END OF EACH SCIENCE FRAME FORCING ONE EXTRA STEP, ; HAVE BEEN CORRECTED. THIS MEANS THAT CALIBRATION DATA TAKEN PREVIOUSELY ; WILL HAVE DOWN SCANS DIFFERENT THAN SCANS PRODUCED WITH THIS SOFTWARE. ; Revision 5.1 Mar. 29, 1989 ; Rev. 5.1 Is simply a bookeeping revision, in that, Version 5.0 was ; delivered to JPL before being tested. Version 5.0 did have a bug, ; so this new version was created so that no two disks, both labled ; UVS_SRC.5P0 would not be floating around at JPL, an we would ; accidently get loaded the wrong revision. ; Revision 5.0 Mar. 4, 1989 ; Adds commandable deltas to scan modes. Uses the 'Initial Position' ; delta field (9 bits) in the command format as an inital delta to ; position the grating. This delta will be taken from the zero position ; (scan start) to the bottom of the first commanded channel to turn on ; in the SCAN MODE ONLY. Also, the 'Second Position' delta will step ; the grating in the same direction as the previous scan four times the ; value contained in this 7 bit field. At the end of this delta, the ; direction will be toggled, and integration of the next science frame ; will scan opposite to the previous scan plus delta. If this field ; is zero, then the software will look to the 'Third Position' field ; for a delta to move the grating in a direction opposed to the motion ; taken during the previous scan. This delta will also be four times the ; value in the 'Third Position' field before starting integrating the ; next science frame. The following diagram is a brief attempt to ; show this motion, and the effects of the various fields. ; Scan Start Position 100 Position 627 ; |-->-->-->-->-->|==>==>==>==>==>==>==>==>==>==>==>| ; 'Initial Pos.'=100 -^ \ \ ; \ <--'Second Position' GT 0 --> \ ; \ \ ; |<==<==<==<==<==<==<==<==<==<==<==| ; Scan Start Position 100 Position 627 ; |-->-->-->-->-->|==>==>==>==>==>==>==>==>==>==>==>| ; 'Initial Pos.'=100 -^ / / ; / <-- 'Third Position' GT 0 --> / ; / / ; |<==<==<==<==<==<==<==<==<==<==<==| ; Revision 4.1 Oct. 20, 1987 ; -30 C cold problems necessitated an extra NOP in the interrupt routine ; to slow down things when the clock runs faster. (7/25/94 - I believe ; this has to do with the H/K Mux. The "internal" cold-start gererated ; MF=0 pulse starts the cycle which samples the 8 A/D channels. If the ; uP generated MF=0 signal comes along in the middle of this, it messes ; up the sample sequence. I did not go back and do an exhaustive analysis ; at this time, but this all rings a bell, and I was able to find an old ; cold-start schematic marked up from a previous analysis which indicates ; this scenario. Also, see "Misc. Notes about the Hardware and Software," ; specifically item #2 below) ; Revision 4.0 Jan. 22, 1986 ; Modified the code to use the opcode byte as a mini-scan size register. ; i.e. instead of this byte always being set to 7, it can now contain a ; value for the software to use as the number of steps to take in each ; direction before changing directions in the mini-scan mode. ; Revision 2.2 Oct. 4, 1985 ; The code has been optimized to eliminate problems between H/W and S/W ; RTI = Minor Frame = 0 (zero). This includes removal of the STCR ; subroutines, being replaced by direct register call and returns. ; The code was also modified to correct for errors in the number of ; steps taken in the miniscan modes. ; Revision version 2.1 Aug. 28, 1984 ; Eliminates the clearing and setting of the opcode in the command ; table. This bought us extra code, forced flybacks (reinitialization) ; of the grating, and other hardware to be reset to overcome glitch ; conditions. page subtitle BUFFER DEFINITIONS AND EXPLANATIONS ; BUFFER DEFINITIONS ; 1) CURRENT COMMAND BUFFER (CUR.CMD.BUFF) ; The Current Command Buffer is used by the microprocessor ; as an indication of the current mode of the hardware, ; i.e. what channels are used, what the integration time ; is, how many wavelengths are used, etc. The bit defin- ; itions have a Bit-For-Bit correspondence with those ; given is GLL-3-290 Rev. B, Table 3.3 UVS Command Bit ; Definitions (Pages 312-316). Note that current command ; Buffer Mode byte is equivelent with byte 2 of the ; bus command words format and the channel select byte is ; equivelent with byte 3. ; 2) RTI BUFFER ; The information about spacecraft time that is sent to ; the UVS across the bus is held in the RTI Buffer. ; See GLL-3-290 Rev. B, Figure 19, Command Time Field ; (Page 47) for definitions. ; 3) MOTOR BUFFER (MOT.BUFF.) ; The Motor Buffer is used to store the exact state of ; the hardware at any instant in time, i.e. which channel is ; on, what is the integration time, which wavelength is the ; grating positioned at, etc. The Motor Buffer also holds ; a copy of the positive and negative delta step registers. ; NOTE: The only differences will be: ; A) Motor Buffer Byte 1, Bits 7 and 8 indicate the ; current grating position where the Bus Command Byte ; 2, bits 7 and 8 indicate the total number of ; wavelength positions for this particular wave- ; length mode (For Ver. 6 and later, bits 7 & 8 must ; be 0 & 1 respectively FOR ALL MODES). ; B) Motor Buffer Byte 2, bits 1,2, and 3 will indicate ; which channel is currently ON, where Bus Command ; Byte 3, bits 1,2, and 3 indicate which one or two ; channels will be used in the given mode. ; C) The Initial Step Position (GLL-3-290 Rev. B, ; Table 3.3 UVS) is not needed after any ; mode is entered, therefore it is not retained. ; MOT.BUFF.BYTE 3 = Bus Command Byte 6 ; shifted 1 bit) ; MOT.BUFF.BYTE 4 = Bus Command Byte 7 ; MOT.BUFF.BYTE 5 = Not used ; 4) COMMAND BUFFER (COM.BUFF) ; The Command Buffer holds the information relevent to ; executing a new command. It will always contain the last ; mode transmitted across the spacecraft bus. It's bit ; designations are defined in GLL-3-290 Rev. B, Table 3.3. ; NOTE: The UVS microprocessor uses this table as a read ; only buffer and will never alter it's contents, ; thus CDS is the only subsystem that will change ; these 7 bytes. page subtitle Command Byte Format ; -------------------------------------------------------------------------- ; |Byte/Bit| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ; |========+=======+=======+=======+=======+=======+=======+=======+=======| ; | Byte 1 | Even Science Frames Low Order Pointer | ; |--------+-------+-------+-------+-------+-------+-------+-------+-------| ; | Byte 2 | Mode | F HV | N HV | G HV | Change| Motor | Don't | Don't | ; | | | Ovrd | Ovrd | Ovrd |Grating| Dir. | Care | Care | ; |--------+-------+-------+-------+-------+-------+-------+-------+-------| ; | Byte 3 | F | N | G | HV Off| Stim | Limb | IP | IP | ; | |Channel|Channel|Channel| / ~On | Lamp | Ovrd | MSB | LSB | ; |--------+-------+-------+-------+-------+-------+-------+-------+-------| ; | Byte 4 | Least Significant 8 Bits of Initial Position Delta | ; |--------+-------+-------+-------+-------+-------+-------+-------+-------| ; | Byte 5 | Odd Science Frames Low Order Pointer | Byte 4| Byte 4| ; | | | MSB | MSB-1 | ; |--------+-------+-------+-------+-------+-------+-------+-------+-------| ; | Byte 6 | 0 | 0 | 0 | 0 | 0 | Delta | Delta | Delta | ; | | | | | | | Sign | MSB | MSB-1 | ; |--------+-------+-------+-------+-------+-------+-------+-------+-------| ; | Byte 7 | Delta LSByte | ; -------------------------------------------------------------------------- ; Note: Delta Sign: 0 = Same Direction as previous scan ; 1 = Opposite Direction as previous scan page subtitle Register definitions ; REGISTER DESIGNATION: ; ------------------------------------------------- ; |MSB HIGH ORDER LSB|MSB LOW ORDER LSB| ; |-----------------------|-----------------------| ; R0 | UNUSED | UNUSED | ; |-----------------------|-----------------------| ; R1 | INTERRUPT P.C. HIGH | INTERRUPT P.C. LOW | ; |-----------------------|-----------------------| ; R2 | STACK POINTER HIGH | STACK POINTER LOW | ; |-----------------------|-----------------------| ; R3 | SCAN SIZE MSB | SCAN SIZE LSB | ; |-----------------------|-----------------------| ; R4 | TOGUD P.C. HIGH | TOGUD P.C. LOW | ; |-----------------------|-----------------------| ; R5 | STEP P.C. HIGH | STEP P.C. LOW | ; |-----------------------|-----------------------| ; R6 | PROGRAM COUNTER HIGH | PROGRAM COUNTER HIGH | ; |-----------------------|-----------------------| ; R7 | MFZTST P.C. HIGH | MFZTST P.C. LOW | ; |-----------------------|-----------------------| ; R8 | 16 BIT POINTER HIGH | 16 BIT POINTER LOW | ; |-----------------------|-----------------------| ; R9 | STEPS COUNTER MSB | STEPS COUNTER LSB | ; |-----------------------|-----------------------| ; RA | UP/DOWN REGISTER | MISC USE | ; |-----------------------|-----------------------| ; RB | STEP COUNT HIGH | STEP COUNT LOW | ; |-----------------------|-----------------------| ; RC |CUR.CMD.BUFF.MODE BYTE | CUR.CMD.BUFF. CHANNEL | ; |-----------------------|-----------------------| ; RD | RTI BUFF. PNTR. HIGH | RTI BUFF. PNTR. LOW | ; |-----------------------|-----------------------| ; RE | MOT.BUFF.PNTR. HIGH | MOT.BUFF.PNTR. LOW | ; |-----------------------|-----------------------| ; RF | COM.BUFF.PNTR. HIGH | COM.BUFF.PNTR. LOW | ; ------------------------------------------------- ; NOTES: 1) The Up/Down register holds the real time direction of the ; grating in bit 2, where 1 = Up (away from fiducial) and ; 0 = Down. ; 2) The Steps Counter keeps track of how many steps have been ; issued in the current Science Frame. ; 3) The Step Count Register is used in the "STEP" subroutine ; as a counter of how many steps to move the grating. ; 4) The Scan Size register tells the Interrupt routine how many ; steps to take in the current Science Frame before turning ; around. page subtitle I/O Port definitions ; INPUT PORT DESIGNATION: No Input Ports are used ; OUTPUT PORT DESIGNATION: ; OUTPUT PORT 1...UNUSED ; OUTPUT PORT 2...UNUSED ;---------------------------------------------------------------- ; OUTPUT PORT 3 ; BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 | BIT 0 | ;-------|-------|-------|-------|-------|-------|-------|-------| ; MODE | F HVOR| N HVOR| G HVOR| RTI=0 | MICRO |W/L POS|W/L POS| ;---------------------------------------------------------------- ; OUTPUT PORT 4 ; BIT 7 | BIT 6 | BIT 5 | BIT 4 | BIT 3 | BIT 2 | BIT 1 | BIT 0 | ;-------|-------|-------|-------|-------|-------|-------|-------| ; F CH | N CH | G CH | HV | STIM |LIMB OR| INT. | INT. | ; | | | ON/OFF| | |TIME A |TIME B | ;---------------------------------------------------------------- ; OUTPUT PORT 5 ; The gratings are automatically toggled whenever you output ; to this port. I.E., toggling is done on the 1853 N-Line ; decoded output. ;--------------------------------------------------------------------- ; OUTPUT PORT 6 ; Flyback commands are issued in the same manner as Output ; Port 5. ;--------------------------------------------------------------------- ; OUTPUT PORT 7 ; Bit 2 is used as the Up/Down Motor Control bit. ; EVENT FLAG DESIGNATION: EF1... At-Zero Indicator ; EF2... Motor Step Interrupt ; EF3... RTI Interrupt ; EF4... Science Frame Interrupt ; The 'Q' line is used to step the motor. page subtitle Misc. Notes About The Hardware and Software ; 1) During the testing of this software it has been determined that ; the wavelength scale of the Galileo UVS instrument is different ; when the grating drive is traveling up verses when it is traveling ; down. The total change is approximately one large grating step ; (or about 6 small grating steps). This appears to be because the ; the grating has not had enough time to settle to a steady state ; condition by the time the integration period has begun. ; 2) Due to hardware interactions, the microprocessor Minor Frame = Zero ; pulse must be issued no sooner than 124 microseconds after the true ; (hardware generated) Minor Frame Zero pulse. This pulse must also ; be issued before 240 microseconds after the hardware generated pulse. ; Software changes have now been incorporated to satisfy these require- ; ments. Note that the symptoms that are caused if this requirement ; is not met is that the digital status bytes will be one short (i.e. ; 9 digital status words instead of 10 digital status words). Further ; information on this phenominon can be found in the UVS Software ; Description Document. ; 3) Changes were made to the software in the time that the direction ; control to the grating drive is being issued. In previous versions ; the direction control was output after calls to the step routine. ; If the direction gets changed before the grating motion catches up ; to the step commands, a position error will occur. To correct this ; the desired direction is stored in registers, and is output now ; BEFORE the "STEP" subroutine is called. ; 4) The miniscan step uses the following sequence: ; ----|---- ----|---- ----|---- ; / \ / \ / \ ; ---- ----|---- ----|---- ----|... ; Where: ---- = Integration period(s) ; / = Forward step(s) ; \ = Backward step(s) ; | = No grating movement PAGE SUBTITLE Macro Definitions FILL: .MACRO ARG1,ARG2 ; Macro Definition COUNT: .VAR ARG1 ; Store number of bytes to save .IFZ COUNT ; Check for done .IFCLEAR ; Check the pending IF .MACEXIT ; And get out .ENDIF COUNT: .VAR COUNT-1 ; Else decrement byte count .BYTE ARG2 ; Reserve the byte FILL COUNT,ARG2 ; Loop through recursively .MACEND DSI: .MACRO ARG1 ; Disable interrupts immediate macro DIS .BYTE ARG1 ; X and P after disable .MACEND RTI: .MACRO ARG1 ; Return from interrupts immediate macro RET .BYTE ARG1 ; X and P after Return .MACEND LADR: .MACRO ARG1,ARG2 ; Load 16 bit address into register LDI >ARG2 ; First load high order address PHI ARG1 ; Save in high order of the desired register LDI BEGIN ; (Will be 00h by definition) PHI R6 SEP R6 BEGIN: PHI R1 ; Init. High Order of 'INTERRUPT' P.C. PHI RB ;... High Order of STEP COUNT Register PHI RC ;... CUR.CMD.BUFF Mode Byte to zero LDI STACK_PNTR ;... High Order of Stack Pointer PHI R2 PHI R4 ;... High Order 'TOGGLE_UP_DOWN' Subroutine P.C. PHI R5 ;... High Order 'STEP' Subroutine P.C. PHI R7 ;... High Order Minor-Frame = Zero Sub. P.C. PHI RD ;... High Order RTI Buffer Pointer PHI RE ;... High Order Motor Buffer Pointer PHI RF ;... High Order Command Buffer Pointer page subtitle Monitor ;************************************************************************ ;* * ;* SECTION: Monitor * ;* PURPOSE: This routine sits in a loop waiting for interrupts. * ;* If an interrupt occurs, the "INTERRUPT" routine is * ;* called. * ;* ENTRY: PC = R6 * ;* EXIT: None * ;* * ;************************************************************************ ENABLE: RTI 66H ; Enable Interrupts: PC=R6 X=R6 NOCMD: BR NOCMD ; Wait for Interrupts page subtitle Interrupt Polling ;************************************************************************ ;* * ;* SECTION: Main Interrupt Routine * ;* PURPOSE: When an Interrupt occurs, this routine reads the 1802 * ;* Event Flags to determine which of the three interrupts * ;* needs servicing. The number before each description is * ;* the 1802 Event Flag for that interrupt. A high level * ;* (=1) is the active state for each of these three pins. * ;* (Note that this is inverted to the 1802 Event Flag * ;* states). * ;* * ;* 2) If a Motor Step Interrupt occurs, the CPU determines * ;* which mode the instrument is commanded into. If the * ;* mode is a wavelength, the grating will be scanned * ;* back and forth a delta of 'MINI_SCAN_SIZE' steps, * ;* one step each Motor Step Interrupt. If the mode is a * ;* scan mode, the motor (grating) will be stepped once * ;* each Motor Step Interrupt. * ;* * ;* 3) If a RTI interrupt needs servicing, this routine * ;* will check to see if the Minor Frame Count = 90 and * ;* the RTI Count = 9. If not, processing will continue. * ;* If so, it will increment the RTI Counter and will * ;* continue normal processing. The next RTI Interrupt * ;* will be detected as Minor Frame = 0, and RTI = 0 and * ;* will output this fact to the Cold Start Logic. * ;* * ;* 4) If a Science Frame Interrupt occurs, then the * ;* Science Frame Subroutine is called. * ;* * ;* ENTRY: PC = R1; X = R2 * ;* 'INTERRUPT' Pin has gone low (Active) * ;* EF2, EF3 and EF4 have been latched, indicating which * ;* one or more of the interrupts are active. * ;* EXIT: PC = R6; X = R6 * ;* All Interrupts have been serviced. * ;* * ;************************************************************************ INTERRUPT: B3 CHANGE_PC ; Check for a RTI Interrupt, Branch if inactive NOP ; Slow down the response so we don't overrun the NOP ;... hardware. )See General Notes above. SEP R7 ; Check for Minor-Frame = Zero and Output CHANGE_PC: LDI POSITION_TABLE ; Point to the position table PHI R9 LDA RF ; Get the even scan low order pointer from ;... command buffer PLO R9 ; Put in pointer register LDA R9 ; Get high order mini-scan size off table STR R8 ; Put high order in the even mini-scan reg. PHI R3 ; Put it in the current size reg. for the 1st ;... mini-scan INC R8 ; Point to low order of the even mini-scan reg. LDN R9 ; Do likewise for the low order mini-scan size STR R8 ;... off table PLO R3 INC R8 ; R8 now points to the odd mini-scan size reg. SEX RF ; Make X point to the Command buffer. TOGGLE_GRATINGS?: LDN RF ; Prepare to copy the mode byte to the Current ;... Command Buffer. ANI 08H ; But first, Do the Gratings need toggled? LSZ ; NO.... Skip the next two instructions OUT 5 ; Send a toggle pulse to the gratings DEC RF ;... Restore Command buffer pointer LDN RF ; Get the mode byte back from the Command Buffer ANI 0F7H ; Clear the 'Toggle Gratings' bit PHI RC ; Save mode in Current Command Buffer STR RF ; Also, save modified mode byte back in Command ;... Buffer so the gratings don't get toggled ;... every Major frame when the mode gets re- ;... initialized. ANI 0F4H ; Clear wavelength position bits STR RE ; Store Mode byte in Motor Buffer SEX RE ; Output Mode Byte to Cold Start Logic OUT 3 OUT 6 ; Issue Flyback DEC RE ; RE now points to where the Channel Byte should ;... go in the Motor Buffer INC RF ; Point to the Channel Byte in Command Buffer LDA RF ; Store Channel Select Byte in the Current PLO RC ;... Command Buffer ; Accumulator contains the channel byte SHL ; NO.... Does the mode use the F-Channel? BNF N_OR_G ; NO.... Execute a N or G Channel mode GLO RC ; YES... Get the channel select byte back from ANI 9FH ;... the Current Command Buffer. Mask out N and ;... G Channels from mode so F is the only one ;... turned on. BR NEW_DELTA ; Branch to move grating to initial w/l position N_OR_G: SHL ; Does the new mode use the N-Channel? BNF G_ONLY ; NO.... Then it's a 'G-Channel' only mode GLO RC ; YES... Get the channel select byte back from ANI 5FH ;... the Current Command Buffer. Mask out F and ;... G Channels from mode so N is the only one ;... turned on SKP ;... Skip the GLO when G is the only channel G_ONLY: GLO RC ; If we're here, the mode is a G only mode NEW_DELTA: STR RE ; Store the currently used channel byte in the ;... Motor Buffer OUT 4 ; Output channel byte to the Cold Start Logic ;... RE now points to the Initial Position Delta LDA RF ; Load LSB of initial position delta, Point to MSB PLO RB ; Load Step Count Register with Initial Step ;... Delta LDN RF ; Get MSB of Initial Position delta, point to the ;... Positive delta register ANI 03H ; (Need to mask off unwanted stuff) PHI RB ; Save High Order step count in Step count reg. LDA RF ; Get back the pointer to the odd mini-scan size ; **** Note: the following instruction is not necessary, but will be left in in version ; 6.2 to maintain coonsistancy with version 6.1. ANI FCH ; Throw away unwanted stuff SHR ; Align pointer value into LSB SHR ORI C0H ; Mask in MSBs to what they need to be PLO R9 ; Save it away for a pointer LDA R9 ; Get the high order of the odd mini-scan size STR R8 ; Save it in the odd mini-scan size register INC R8 ; Point to the low order mini-scan size LDN R9 ; Do low order as above STR R8 LDA RF ; Copy MSByte of delta in motor buffer, point to LSByte of STR RE ;... delta INC RE ; Point to LSByte of delta register in Motor Buffer LDN RF ; Get LSByte of delta STR RE ; Store LSByte of delta in Motor Buffer LDI