ASM85: File = debhp.a 12:52 10/17/2003 Page 1 1 0000: ; DEBHP.a -- Debug Support 2 0000: ; BGLOOP copies this to C000 for execution 3 0000: ; 4 0000: ; Variant of "DEBH". This produces housekeeping packets (ApID=720) 5 0000: ; instead of writing to the debug serial port. 6 0000: 7 0000: ; Revision History 8 0000: ; 15-Dec-2002 9 0000: ; First use in ISUALFF 10 0000: ; 15-Jan-2003 11 0000: ; Modified to work with "debug.a" 12 0000: ; Added entries for HEXOUT and DECOUT 13 0000: ; Removed DEBUG_ASC, DEBUG_ASC_DEC, DEBUG_ASC_HL 14 0000: ; Added check of GBL_SOH_WAIT 15 0000: ; 17-Oct-2003 16 0000: ; new GBL.i 17 0000: 18 0000: include ioports.i 1 0000: ; ioports.i -- definitions of ISUAL DPU I/O ports 2 0000: ; 3 0000: ; 19 FEB 2002 4 0000: ; CAI 5 0000: ; Revised 20 March 2002 6 0000: ; SPG 7 0000: ; 8 0000: ; _O = output port, _I = input port 9 0000: ; 10 0000: ; Ports 00-7Fh are in the ISDPGLU Actel: 11 0000: ; 12 0000: SOFTWARE_RESET_O EQU 00h ; forces hardware reset 13 0000: INTVECTOR_STS_I EQU 00h ; C7, CF, D7, ... , FF 14 0000: IRQ_ENABLE_O EQU 01h ; set RST[7:2] interrupt request enables 15 0000: IRQ_ENABLE_I EQU 01h ; read RST[7:2] interrupt request enables 16 0000: BANK_SELECT_O EQU 02h ; memory bank select for CPU addr 4000-7FFF 17 0000: BANK_SELECT_I EQU 02h ; memory bank select for CPU addr 4000-7FFF 18 0000: WATCHDOG_PET_O EQU 03h ; pet watchdog timer, data =xx 19 0000: WATCHDOG_STS_I EQU 03h ; [7:4]=bites, [3:0]=barks 20 0000: CMD_RX_I EQU 04h ; command UART rx data 21 0000: SOH_TX_O EQU 04h ; SOH UART tx data 22 0000: CMD_SOH_CTRL_O EQU 05h ; CMD/SOH UART control 23 0000: CMD_SOH_STS_I EQU 05h ; CMD/SOH UART status 24 0000: PROM_ENBL_O EQU 06h ; PROM enable 25 0000: STATUS6_I EQU 06h ; PROM/reset/CDI/HKP/PS16 status 26 0000: IRQ_LEVELS_I EQU 07h ; RST[7:2] raw levels 27 0000: ; 28 0000: MM_IM_DCM_CTL_O EQU 08h ; MM/Imager/DCM control 29 0000: MM_IM_DCM_STS_I EQU 08h ; MM/Imager/DCM status 30 0000: IDC_RESET_I EQU 09h ; IDC Reset 31 0000: IDC_RESET_O EQU 09h ; IDC Reset 32 0000: ; (0Ah-0Bh not used) 33 0000: RES_FLAG_CLR_O EQU 0Ch ; clear SWR, POR flags 34 0000: ONE_HZ_CLR_O EQU 0Dh ; clear 1-Hz IRQ latch 35 0000: TIMER_SET_L_O EQU 0Eh ; 1024-Hz countdown timer low byte Page 2 36 0000: TIMER_SET_H_O EQU 0Fh ; 1024-Hz countdown timer high byte 37 0000: ; 38 0000: ; (10h-3Fh not used) 39 0000: ; 40 0000: CDI_DAT_LO_O EQU 40h ; CDI data low byte 41 0000: CDI_DAT_HI_O EQU 41h ; CDI data high byte 42 0000: CDI_CMD_O EQU 42h ; CDI readback command (write last) 43 0000: CDI_DAT_LO_I EQU 40h ; CDI readback low byte 44 0000: CDI_DAT_HI_I EQU 41h ; CDI readback high byte 45 0000: PWR_STS_LO_I EQU 42h ; power service [7:0] status 46 0000: PWR_STS_HI_I EQU 43h ; power service [15:8] status 47 0000: ; (44h-5Fh not used) 48 0000: ; 49 0000: MM_BADR_0700_O EQU 60h ; mass mem block base address [7:0] 50 0000: MM_BADR_1508_O EQU 61h ; mass mem block base address [15:8] 51 0000: MM_BADR_2316_O EQU 62h ; mass mem block base address [23:16] 52 0000: MM_BADR_3124_O EQU 63h ; mass mem block base address [31:24] 53 0000: MM_WADR_0700_I EQU 60h ; mass mem working address [7:0] 54 0000: MM_WADR_1508_I EQU 61h ; mass mem working address [15:8] 55 0000: MM_WADR_2316_I EQU 62h ; mass mem working address [23:16] 56 0000: MM_WADR_3124_I EQU 63h ; mass mem working address [31:24] 57 0000: ; (64h-6Fh not used) 58 0000: ; 59 0000: SC_TIME_0_O EQU 70h ; set S/C time 2^-16 seconds (write 1st) 60 0000: SC_TIME_1_O EQU 71h ; set S/C time 2^-8 seconds 61 0000: SC_TIME_2_O EQU 72h ; set S/C time 2^0 seconds 62 0000: SC_TIME_3_O EQU 73h ; set S/C time 2^8 seconds 63 0000: SC_TIME_4_O EQU 74h ; set S/C time 2^16 seconds 64 0000: SC_TIME_5_O EQU 75h ; set S/C time 2^24 seconds (write last) 65 0000: ; 66 0000: SC_TIME_0_I EQU 70h ; read S/C time 2^-16 seconds (read 1st) 67 0000: SC_TIME_1_I EQU 71h ; read S/C time 2^-8 seconds 68 0000: SC_TIME_2_I EQU 72h ; read S/C time 2^0 seconds 69 0000: SC_TIME_3_I EQU 73h ; read S/C time 2^8 seconds 70 0000: SC_TIME_4_I EQU 74h ; read S/C time 2^16 seconds 71 0000: SC_TIME_5_I EQU 75h ; read S/C time 2^24 seconds (read last) 72 0000: ; 73 0000: SCIF_CTL_O EQU 76h ; S/C I/F control (NOM/RED, PPS) 74 0000: SCIF_STS_I EQU 76h ; S/C I/F status (NOM/RED, PPS, SCT fault) 75 0000: ISDPGLU_REV_I EQU 77h ; ISDPGLU Actel revision 76 0000: ; (78h-7Fh not used) 77 0000: ; 78 0000: ; Ports 80-BFh are in the ISDPPWR Actel: 79 0000: ; 80 0000: ISDPPWR_REV_I EQU 80h ; ISDPPWR Actel revision 81 0000: FW_STS_I EQU 81h ; filter wheel position status 82 0000: FW_CNTR_O EQU 82h ; set filter wheel counter (N-1 @ 1280 Hz) 83 0000: FW_CNTR_I EQU 83h ; read filter wheel counter (N-1 @ 1280 Hz) 84 0000: FW_CTL_O EQU 83h ; filter wheel & stepper motor control 85 0000: FW_CTL_I EQU 83h ; filter wheel & stepper motor status 86 0000: 87 0000: HKP_DAT_0_I EQU 84h ; 1st housekeeping byte from power controller 88 0000: HKP_DAT_1_I EQU 85h ; 2nd housekeeping byte from power controller 89 0000: HKP_DAT_2_I EQU 86h ; 3rd housekeeping byte from power controller 90 0000: HKP_DAT_3_I EQU 87h ; 4th housekeeping byte from power controller 91 0000: AP_PWR_NOM_O EQU 84h ; set AP to nominal power 92 0000: AP_PWR_RED_O EQU 85h ; set AP to redundant power 93 0000: AP_PWR_OFF_O EQU 86h ; set AP +28V power off 94 0000: AP_PWR_ON_O EQU 87h ; set AP +28V power on 95 0000: HKP_CTL_O EQU 88h ; housekeeping transfer control Page 3 96 0000: HKP_STS_I EQU 88h ; housekeeping transfer status 97 0000: STIM_CTL_I equ 89h 98 0000: STIM_CTL_O EQU 89h ; Imager, SP stim control 99 0000: HVERR_STS_I equ 8Ah 100 0000: HVERR_CLR_O equ 8Ah 101 0000: ; (unused) equ 8Bh 102 0000: DAY_LAT_STS_I EQU 8Ch ; day sensor latch status 103 0000: DAY_LAT_CLR_O EQU 8Ch ; clear day sensor latches 104 0000: DAY_SENS_CTL_O EQU 8Dh 105 0000: DAY_SENS_STS_I EQU 8Dh ; day sensor raw status 106 0000: DAY1_THR_I equ 8Eh 107 0000: DAY1_THR_O equ 8Eh 108 0000: DAY2_THR_I equ 8Fh 109 0000: DAY2_THR_O equ 8Fh 110 0000: MCP_DAY_I equ 90h 111 0000: MCP_DAY_O equ 90h 112 0000: MCP_NITE_1_I equ 91h 113 0000: MCP_NITE_1_O equ 91h 114 0000: MCP_NITE_2_I equ 92h 115 0000: MCP_NITE_2_O equ 92h 116 0000: MCP_NITE_3_I equ 93h 117 0000: MCP_NITE_3_O equ 93h 118 0000: MCP_NITE_4_I equ 94h 119 0000: MCP_NITE_4_O equ 94h 120 0000: MCP_NITE_5_I equ 95h 121 0000: MCP_NITE_5_O equ 95h 122 0000: MCP_NITE_6_I equ 96h 123 0000: MCP_NITE_6_O equ 96h 124 0000: MCP_NITE_7_I equ 97h 125 0000: MCP_NITE_7_O equ 97h 126 0000: MCP_MAX_I equ 98h 127 0000: MCP_MAX_O equ 98h 128 0000: MCP_DAC_I equ 99h 129 0000: HV_CNTR_I equ 9Ah 130 0000: HV_CNTR_O equ 9Ah 131 0000: HV_STS_I equ 9Bh 132 0000: HV_CTL_O equ 9Bh 133 0000: PHOS_DAY_I equ 9Ch 134 0000: PHOS_DAY_O equ 9Ch 135 0000: PHOS_SPR_AUR_I equ 9Dh 136 0000: PHOS_SPR_AUR_O equ 9Dh 137 0000: PHOS_MAX_I equ 9Eh 138 0000: PHOS_MAX_O equ 9Eh 139 0000: PHOS_DAC_I equ 9Fh 140 0000: SP1_DAY_I equ 0A0h 141 0000: SP1_DAY_O equ 0A0h 142 0000: SP1_SPR_I equ 0A1h 143 0000: SP1_SPR_O equ 0A1h 144 0000: SP1_AUR_I equ 0A2h 145 0000: SP1_AUR_O equ 0A2h 146 0000: SP1_DAC_I equ 0A3h 147 0000: HV_UNLOCK_0_O equ 0A3h 148 0000: SP2_DAY_I equ 0A4h 149 0000: SP2_DAY_O equ 0A4h 150 0000: SP2_SPR_I equ 0A5h 151 0000: SP2_SPR_O equ 0A5h 152 0000: SP2_AUR_I equ 0A6h 153 0000: SP2_AUR_O equ 0A6h 154 0000: SP2_DAC_I equ 0A7h 155 0000: HV_UNLOCK_1_O equ 0A7h Page 4 156 0000: SP3_DAY_I equ 0A8h 157 0000: SP3_DAY_O equ 0A8h 158 0000: SP3_SPR_I equ 0A9h 159 0000: SP3_SPR_O equ 0A9h 160 0000: SP3_AUR_I equ 0AAh 161 0000: SP3_AUR_O equ 0AAh 162 0000: SP3_DAC_I equ 0ABh 163 0000: HV_UNLOCK_2_O equ 0ABh 164 0000: SP4_DAY_I equ 0ACh 165 0000: SP4_DAY_O equ 0ACh 166 0000: SP4_SPR_I equ 0ADh 167 0000: SP4_SPR_O equ 0ADh 168 0000: SP4_AUR_I equ 0AEh 169 0000: SP4_AUR_O equ 0AEh 170 0000: SP4_DAC_I equ 0AFh 171 0000: HV_UNLOCK_3_O equ 0AFh 172 0000: SP5_DAY_I equ 0B0h 173 0000: SP5_DAY_O equ 0B0h 174 0000: SP5_SPR_I equ 0B1h 175 0000: SP5_SPR_O equ 0B1h 176 0000: SP5_AUR_I equ 0B2h 177 0000: SP5_AUR_O equ 0B2h 178 0000: SP5_DAC_I equ 0B3h 179 0000: SP6_DAY_I equ 0B4h 180 0000: SP6_DAY_O equ 0B4h 181 0000: SP6_SPR_I equ 0B5h 182 0000: SP6_SPR_O equ 0B5h 183 0000: SP6_AUR_I equ 0B6h 184 0000: SP6_AUR_O equ 0B6h 185 0000: SP6_DAC_I equ 0B7h 186 0000: ; (B8-BF unused) 187 0000: 188 0000: ; Ports C0-DFh are on DPU and not in Actels: 189 0000: ; (0C0h-0DFh not used) 190 0000: ; 191 0000: ; Ports E0-FFh are on DPU Test Pod: 192 0000: ; (0E0h-0E3h not used) 193 0000: DTP_RX_I EQU 0E4h ; debug UART rx data 194 0000: DTP_TX_O EQU 0E4h ; debug UART tx data 195 0000: DTP_CTRL_O EQU 0E5h ; debug UART control 196 0000: DTP_STS_I EQU 0E5h ; debug UART status 197 0000: DTP_SENSE_I EQU 0E6H ; debug Sense PB and PROM status 198 0000: DTP_SCOPE_TRG_O EQU 0E6H ; debug scope trigger 199 0000: ; (0E7h-0EFh not used) 200 0000: ; 201 0000: DTP_LCD_CTL_O EQU 0F0H ; LCD control 202 0000: DTP_LCD_DAT_O EQU 0F1H ; LCD write data 203 0000: DTP_LCD_STS_I EQU 0F2h ; LCD status 204 0000: DTP_LCD_DAT_I EQU 0F3h ; LCD read data 205 0000: ; (0F4h-0FFh not used) 206 0000: ; 207 0000: ; 208 0000: ; 209 0000: ; Restart vector addresses 210 0000: ; 211 0000: RST_0 equ 00h 212 0000: RST_1 equ 08h 213 0000: RST_2 equ 10h 214 0000: RST_3 equ 18h 215 0000: RST_4 equ 20h Page 5 216 0000: TRAP equ 24h 217 0000: RST_5 equ 28h 218 0000: RST_55 equ 2Ch 219 0000: RST_6 equ 30h 220 0000: RST_65 equ 34h 221 0000: RST_7 equ 38h 222 0000: RST_75 equ 3Ch 223 0000: ; 224 0000: JMP_OPCODE equ 0C3h 225 0000: 19 0000: include gbl.i 1 0000: ; GBL.i -- global memory allocations 2 0000: 3 0000: ; Revision History: 4 0000: ; 18-Dec-2002 - SPG - ISUAL Flight Software rev 7.3 5 0000: ; First Official Release 6 0000: ; 28-Dec-2002 7 0000: ; added GBL_720 8 0000: ; 11-Jan-2003 9 0000: ; added GBL_XGS, GBL_XGS_SP 10 0000: ; 12-Jan-2003 11 0000: ; added GBL_RO_IDLE 12 0000: ; added GBL_SOH_WAIT 13 0000: ; 15-Jan-2003 14 0000: ; added GBL_EEPROM 15 0000: ; added GBL_WAIT_TIMEOUT 16 0000: ; 14-Feb-2003 17 0000: ; added GBL_TRIGGER_DELAY 18 0000: ; added GBL_DOING_TRIG_DELAY 19 0000: ; removed GBL_ARMSW 20 0000: ; 19-May-2003 ; added GBL_FLUSH_REQUEST 21 0000: ; 9-Sep-2003 ; added GBL_MM_UPSET 22 0000: ; 16-Oct-2003 ; added GBL_PVSTART 23 0000: 24 0000: ; Layout of Global Memory -- ; top 32K of RAM (8000-FFFF) 25 0000: GBL equ 8000h+96 ; (allow 96 bytes for DMON) 26 0000: ; 27 0000: ; ==byte items 28 0000: GBL_CMD_GROUP equ GBL 29 0000: GBL_CURRENT_SC_BUFFER equ GBL+1 30 0000: GBL_SC_BUF1 equ GBL+2 31 0000: GBL_SC_BUF2 equ GBL+3 32 0000: GBL_MBR_REPLY equ GBL+4 33 0000: GBL_MM_Status equ GBL+5 34 0000: ; 0 - off 35 0000: ; 1 - on 36 0000: GBL_MMCB_Status equ GBL+6 37 0000: ; 0 - not Formatted 38 0000: ; 1 - Formatted 39 0000: GBL_TM_Status equ GBL+7 40 0000: ; 0 - not allocated 41 0000: ; 1 - telemetry being generated 42 0000: GBL_DCM_Status equ GBL+8 43 0000: ; FF- not used -- raw data sent to ground 44 0000: ; 0 - off 45 0000: ; other codes set by DCM_TASK 46 0000: GBL_TT_ABORT equ GBL+9 ; 1=SAFE command aborting time-tagged 47 0000: GBL_TM_IDLE equ GBL+10 ; =1 - TM task is idle Page 6 48 0000: GBL_TLM_CHANNEL equ GBL+11 49 0000: GBL_SCIENCE_MODE equ GBL+12 50 0000: MODE_STANDBY equ 0 51 0000: MODE_AUR equ 1 52 0000: MODE_SPRC equ 2 53 0000: MODE_SPRB equ 3 54 0000: MODE_DAYSIDE equ 4 55 0000: GBL_TLM_ILK equ GBL+13 ; 0=no, 1=ilk cmd rec, 2=switching 56 0000: GBL_PPS_CTR equ GBL+14 ; incremented by PPS interrupt 57 0000: GBL_SC_SENDING equ GBL+15 ; nonzero if PVCFs being sent to SC 58 0000: ;***GBL_ARMSW equ GBL+16 ; bits used to re-arm triggers 59 0000: GBL_MM_UPSET equ GBL+16 ; =1 if MM upset detected 60 0000: GBL_MULTIPLE equ GBL+17 ; =1 allows multiple (follow-on) triggers 61 0000: GBL_PVCF_ILK equ GBL+18 ; =1 DCM task not allowed to start compress 62 0000: GBL_DCM_IDLE equ GBL+19 ; =1 - DCM task is idle 63 0000: GBL_TEST equ GBL+20 64 0000: GBL_ECHO_DISABLE equ GBL+21 ; =1 disables command echoes 65 0000: GBL_DCTIMER equ GBL+22 ; =1 downcounter timer expired 66 0000: GBL_RO_IDLE equ GBL+23 ; =1 no readouts still to be processed 67 0000: GBL_SOH_WAIT equ GBL+24 ; =1 SOH finishing hskp output 68 0000: 69 0000: ; 1-byte up-counter, incremented by the internal 1-Hz interrupt 70 0000: GBL_SECONDS_CTR equ GBL+25 71 0000: 72 0000: ; switches which direct certain packets 73 0000: ; via SOH, TM or both (default is 0 - SOH-only) 74 0000: GBL_703 equ GBL+26 ; Command Echo 75 0000: GBL_705 equ GBL+27 ; TPA 76 0000: GBL_709 equ GBL+28 ; Memory Dump 77 0000: GBL_70B equ GBL+29 ; MM Bad Section packet 78 0000: GBL_719 equ GBL+30 ; Time-Tagged List Dump 79 0000: GBL_71A equ GBL+31 ; I_IN result 80 0000: GBL_71B equ GBL+32 ; CDI read result 81 0000: GBL_71C equ GBL+33 ; Monitor 82 0000: GBL_71D equ GBL+34 ; SOH 83 0000: GBL_71E equ GBL+35 ; Event Packet 84 0000: GBL_720 equ GBL+36 ; Debug packet 85 0000: 86 0000: GBL_FLUSH_REQUEST equ GBL+37 87 0000: ; 38..40 spare 88 0000: 89 0000: ; Camera Parameters 90 0000: GBL_CAM equ GBL+41 ; (30 bytes) 91 0000: GBL_CAM_EXPOSURE equ GBL_CAM ; milliseconds (2 bytes) 92 0000: GBL_CAM_INTERVAL equ GBL_CAM+2 ; interval between exposures (seconds) 93 0000: 94 0000: ; Monitor Packet (ApID=71C) Data array 95 0000: ; 170 bytes -- offset to "checksum" minus 10 (for sec hdr) 96 0000: GBL_MON_ARRAY equ GBL_CAM+30 97 0000: GBL_MON equ GBL_MON_ARRAY-10 ; data starting after 2ndary hdr 98 0000: ; (-10 makes offsets from GBL_MON agree with 8565 document) 99 0000: ; 100 0000: ; SOH Packet Data (ApID=71D) array 101 0000: ; 236 bytes -- offset to "checksum" minus 10 (for sec hdr) 102 0000: GBL_SOH_ARRAY equ GBL_MON_ARRAY+170 103 0000: GBL_SOH equ GBL_SOH_ARRAY-10 ; data starting after 2ndary hdr 104 0000: ; (-10 makes offsets from GBL_SOH agree with 8565 document) 105 0000: 106 0000: ; assembled command (see CMD_IN.A) 107 0000: ; (max command packet is 224 bytes) Page 7 108 0000: ; assembled data is 206 = 224 - 10(sec hdr) - 6(prihdr) - 2(CK, TLR) 109 0000: GBL_ASM equ GBL_SOH_ARRAY+236 110 0000: 111 0000: ; processed command (see CMD.A) -- 208 bytes 112 0000: GBL_CMD equ GBL_ASM+206 113 0000: 114 0000: ; Bracketting Pair of TPA data 115 0000: TPA_LENGTH equ 42 116 0000: GBL_TPA1 equ GBL_CMD+208 117 0000: GBL_TPA2 equ GBL_TPA1+TPA_LENGTH 118 0000: 119 0000: ; Place to build Science Headers (256 bytes) 120 0000: GBL_SCI_HDR equ GBL_TPA2+TPA_LENGTH 121 0000: 122 0000: ; Storage used in "mmcb.a" (100 bytes) 123 0000: GBL_MMCB_MISC equ GBL_SCI_HDR+256 124 0000: 125 0000: ; Storage used in "tm.a" (30 bytes) 126 0000: GBL_TM_MISC equ GBL_MMCB_MISC+100 127 0000: 128 0000: ; Queue allocations 129 0000: ; ----------------- 130 0000: GBL_QUEUES equ GBL_TM_MISC+30 131 0000: 132 0000: ; CMD bytes input (about 10 max-sized commands) 133 0000: GBL_CMD_IN_QUEUE equ GBL_QUEUES 134 0000: GBL_CMD_IN_QUEUE_WRAP equ GBL_CMD_IN_QUEUE+2640 135 0000: ; 136 0000: ; Event queue (each element is: code, 6-byte time) 137 0000: ; (has to cover at least an SOH sampling interval) 138 0000: ; Allocate 500 elements 139 0000: evqelt equ 500*7 140 0000: GBL_EVENT_QUEUE equ GBL_CMD_IN_QUEUE_WRAP 141 0000: GBL_EVENT_QUEUE_WRAP equ GBL_EVENT_QUEUE+evqelt 142 0000: GBL_EVENT_QUEUE_STORE_PTR equ GBL_EVENT_QUEUE_WRAP ; ds 2 143 0000: 144 0000: ; 256-byte temporary re-use area for building 145 0000: ; science packet headers, memory dumps etc. 146 0000: GBL_TEMP equ GBL_EVENT_QUEUE_STORE_PTR+2 147 0000: 148 0000: 149 0000: ; [these parameters have been moved into the GBL_SOH area] 150 0000: ; 151 0000: ; Parameters used to generate the MMCBs 152 0000: ; and allocate Mass Memory 153 0000: ; 4-byte big endian Buffer Allocation sizes 154 0000: GBL_CAM_NWB EQU GBL_SOH+223 ; IDH_CAM_NWB 155 0000: GBL_SPF_NWB EQU GBL_SOH+227 ; IDH_SPF_NWB 156 0000: GBL_SPS_NWB EQU GBL_SOH+231 ; IDH_SPS_NWB 157 0000: GBL_APH_NWB EQU GBL_SOH+235 ; IDH_AP_NWB 158 0000: ; 4-byte big endian Actual Readout sizes 159 0000: GBL_CAM_NWRO EQU GBL_SOH+180 ; IDH_CAM_NWRO 160 0000: GBL_SPF_NWRO EQU GBL_SOH+184 ; IDH_SPF_NWRO 161 0000: GBL_SPS_NWRO EQU GBL_SOH+188 ; IDH_SPS_NWRO 162 0000: GBL_APH_NWRO EQU GBL_SOH+192 ; IDH_AP_NWRO 163 0000: 164 0000: ; 2-byte little endian counts of 165 0000: ; how many MMCBs to allocate 166 0000: GBL_N_CAM_MMCBS EQU GBL_SOH+161 ; IDH_N_CAM_MMCBS 167 0000: GBL_N_SPF_MMCBS equ GBL_SOH+163 ; IDH_N_SPF_MMCBS Page 8 168 0000: GBL_N_SPS_MMCBS equ GBL_SOH+155 ; IDH_N_SPS_MMCBS 169 0000: GBL_N_APH_MMCBS equ GBL_SOH+157 ; IDH_N_AP_MMCBS 170 0000: 171 0000: ; number of samples per readout 172 0000: GBL_N_EXP equ GBL_SOH+103 ; IDH_N_EXP (1 byte) 173 0000: GBL_N_SPF equ GBL_SOH+174 ; IDH_N_SPF (2 bytes, bigE) 174 0000: GBL_N_SPS equ GBL_SOH+176 ; IDH_N_SPS (2 bytes, bigE) 175 0000: GBL_N_APH equ GBL_SOH+178 ; IDH_N_APH (2 bytes, bigE) 176 0000: 177 0000: 178 0000: ; 3-byte banked memory pointers to the first and last elements 179 0000: ; of the MMCB queues (these queues change in size) 180 0000: GBL_CAM_SUPPLY_Q equ GBL_TEMP+256 181 0000: GBL_CAM_SUPPLY_QTAIL equ GBL_CAM_SUPPLY_Q+3 182 0000: GBL_SPF_SUPPLY_Q equ GBL_CAM_SUPPLY_QTAIL+3 183 0000: GBL_SPF_SUPPLY_QTAIL equ GBL_SPF_SUPPLY_Q+3 184 0000: GBL_SPS_SUPPLY_Q equ GBL_SPF_SUPPLY_QTAIL+3 185 0000: GBL_SPS_SUPPLY_QTAIL equ GBL_SPS_SUPPLY_Q+3 186 0000: GBL_APH_SUPPLY_Q equ GBL_SPS_SUPPLY_QTAIL+3 187 0000: GBL_APH_SUPPLY_QTAIL equ GBL_APH_SUPPLY_Q+3 188 0000: GBL_DCM_QHEAD equ GBL_APH_SUPPLY_QTAIL+3 189 0000: GBL_DCM_QTAIL equ GBL_DCM_QHEAD+3 190 0000: GBL_TM_QHEAD equ GBL_DCM_QTAIL+3 191 0000: GBL_TM_QTAIL equ GBL_TM_QHEAD+3 192 0000: 193 0000: ; Stacks 194 0000: stack_size equ 180 195 0000: GBL_SUPPLY_STACK equ GBL_TM_QTAIL+3 196 0000: GBL_BG_STACK equ GBL_SUPPLY_STACK+stack_size 197 0000: GBL_TM_STACK equ GBL_BG_STACK+stack_size 198 0000: GBL_SOH_STACK equ GBL_TM_STACK+stack_size 199 0000: GBL_SC_STACK equ GBL_SOH_STACK+stack_size 200 0000: GBL_DCM_STACK equ GBL_SC_STACK+stack_size 201 0000: GBL_HTR_STACK equ GBL_DCM_STACK+stack_size 202 0000: GBL_CMD_PROC_STACK equ GBL_HTR_STACK+stack_size 203 0000: 204 0000: ; Place to build Event Packets 205 0000: ; count byte 206 0000: ; 8 event times 207 0000: GBL_EVENT_DATA equ GBL_CMD_PROC_STACK+stack_size 208 0000: evdta equ 8*10 209 0000: 210 0000: ; for building a PVCF 211 0000: GBL_BPVCF equ GBL_EVENT_DATA+1+evdta 212 0000: ; (allocate 1108 bytes, plus 1 extra) 213 0000: 214 0000: GBL_SCIENCE_START_TIME equ GBL_BPVCF+1109 215 0000: 216 0000: ; 1024 byte buffer used by /I_EEPROM_TO_MM 217 0000: GBL_DSP_BUF equ GBL_SCIENCE_START_TIME+6 218 0000: 219 0000: ; Copy of GBL_SOH_ARRAY used to hold data fixed 220 0000: ; while sending SOH packet (238 bytes) 221 0000: GBL_SOH_COPY equ GBL_DSP_BUF+1024 222 0000: 223 0000: ; 4 bytes of zero 224 0000: GBL_zero equ GBL_SOH_COPY+238 225 0000: 226 0000: ; MM addr of Base Parameter List (starts with status word) 227 0000: GBL_BPL_MMADDR equ GBL_zero+4 ; (4 bytes) Page 9 228 0000: ; Contents of Base Parameter List ( 5 4-byte items) 229 0000: GBL_BPL_STATUS equ GBL_BPL_MMADDR+4 230 0000: GBL_BPL_PLB equ GBL_BPL_STATUS+4 231 0000: GBL_BPL_CMD equ GBL_BPL_PLB+4 232 0000: GBL_BPL_MMCB equ GBL_BPL_CMD+4 233 0000: GBL_BPL_DEBUG equ GBL_BPL_MMCB+4 234 0000: 235 0000: ; addr of first readout area (not part of BPL) 236 0000: GBL_RO_BASE equ GBL_BPL_DEBUG+4 237 0000: 238 0000: ; Initialization parameter array sent to DCM 239 0000: ; for packet-to-PVCF processing 240 0000: GBL_PP_OP equ GBL_RO_BASE+4 241 0000: GBL_PP_MMSC1 equ GBL_PP_OP+4 242 0000: GBL_PP_MMSC2 equ GBL_PP_MMSC1+4 243 0000: GBL_PP_MAXNPVCFS equ GBL_PP_MMSC2+4 244 0000: GBL_PP_N_SC1 equ GBL_PP_MAXNPVCFS+4 245 0000: GBL_PP_N_SC2 equ GBL_PP_N_SC1+4 246 0000: GBL_PP_VCFC equ GBL_PP_N_SC2+4 247 0000: GBL_PP_MMHDRS equ GBL_PP_VCFC+4 248 0000: 249 0000: ; workspace (16 bytes) for CLOCK time converters 250 0000: GBL_CLOCKWORK equ GBL_PP_MMHDRS+4 251 0000: 252 0000: ; IDC control bits (2 bytes) 253 0000: GBL_IDC_CTRL equ GBL_CLOCKWORK+16 254 0000: 255 0000: ; IDC Lightning and Cosmic ray 256 0000: ; threshhold parameters (CDI's 40..49) 257 0000: GBL_IDC_LTHRESH equ GBL_IDC_CTRL+2 ; 10 16-bit words 258 0000: ; Lightning Detect Control (2 bytes) 259 0000: GBL_IDC_LDETECT equ GBL_IDC_LTHRESH+20 260 0000: ; IDC SPS scaling (4 bytes) 261 0000: GBL_IDC_SPS_SCALE equ GBL_IDC_LDETECT+2 262 0000: 263 0000: GBL_CCSDS equ GBL_IDC_SPS_SCALE+4 ; 100 bytes 264 0000: GBL_PVCF_PROM equ GBL_CCSDS+100 ; 60 bytes 265 0000: 266 0000: ; workspace in CMD.A 267 0000: GBL_CMD_WORKSPACE equ GBL_PVCF_PROM+60 ; 300 bytes 268 0000: 269 0000: ; workspace for PWR routines in PROM 270 0000: GBL_PWR equ GBL_CMD_WORKSPACE+300 ; 11 bytes 271 0000: 272 0000: ; work area for HTR routines 273 0000: GBL_HTR_WORK equ GBL_PWR+11 ; 40 bytes 274 0000: 275 0000: ; number of PVCFs last sent from SC buffers 276 0000: GBL_N1 equ GBL_HTR_WORK+40 ; 2 bytes 277 0000: GBL_N2 equ GBL_N1+2 278 0000: 279 0000: ; Analog Housekeeping Buffer (128 bytes) 280 0000: GBL_IAM equ GBL_N2+2 281 0000: 282 0000: ; 128 bytes for writing pages of EEPROM 283 0000: GBL_128BYTES equ GBL_IAM+128 284 0000: 285 0000: ; 4 push levels for I_XGROUP (12 bytes) 286 0000: GBL_XGS equ GBL_128BYTES+128 287 0000: ; XGS stack pointer (2 bytes) Page 10 288 0000: GBL_XGS_SP equ GBL_XGS+12 289 0000: 290 0000: ; for use by code in "EEPROM.A" 291 0000: GBL_EEPROM equ GBL_XGS_SP+2 ; 8 bytes 292 0000: 293 0000: GBL_WAIT_TIMEOUT equ GBL_EEPROM+8 ; 1 byte 294 0000: 295 0000: ; number of milliseconds delay between trigger events 296 0000: ; (little endian) 297 0000: GBL_TRIGGER_DELAY equ GBL_WAIT_TIMEOUT+1 ; 2-bytes 298 0000: GBL_DOING_TRIG_DELAY equ GBL_TRIGGER_DELAY+2 ; switch: 1 byte 299 0000: 300 0000: GBL_PVSTART equ GBL_DOING_TRIG_DELAY+1 301 0000: GBL_END equ GBL_PVSTART+1 302 0000: ; lxi h,GBL_END 303 0000: 304 0000: 305 0000: ; Note: C000-C5FF reserved for debugger (see DEBHP.a) 306 0000: 307 0000: ; Allocate Debug Output Queue (bytes) 308 0000: GBL_DTP_OUTQ equ 0C600h 309 0000: GBL_DTP_OUTQ_WRAP equ 0CA00h 310 0000: 311 0000: 312 0000: ; 4096 bytes at top of memory 313 0000: GBL_4K equ 0F000h 314 0000: 315 0000: 20 0000: org 0C000h ; starts at C000 21 C000: C3 0000 ccsds_send: jmp 0 22 C003: C3 0000 task: jmp 0 23 C006: C3 0000 task_new: jmp 0 24 C009: C07F dw DEBUG_INIT 25 C00B: C135 dw DEBUG_PUTBYTE 26 C00D: C2CB dw DEBUG_SHOW 27 C00F: C363 dw DEBUG_DUMP 28 C011: C399 dw DEBUG_SHOWUT 29 C013: C154 dw DEBUG_SHOWA 30 C015: C334 dw DEBUG_REGSET 31 C017: C2E8 dw HEXOUT 32 C019: C30E dw DECOUT 33 C01B: 34 C01B: debug_trap: 35 C01B: F3 di ; no more interrupts 36 C01C: E3 xthl ; exchange top-of-stack with HL 37 C01D: 22 830B shld GBL_CMD ; this is where the Trap happened 38 C020: D3 00 yaagh: out 0 ; force a reset 39 C022: C3 C020 jmp yaagh 40 C025: 41 C025: 01 0007 trap7: lxi b,7 42 C028: C3 C01B jmp debug_trap 43 C02B: 01 0006 trap6: lxi b,6 44 C02E: C3 C01B jmp debug_trap 45 C031: 01 0005 trap5: lxi b,5 46 C034: C3 C01B jmp debug_trap 47 C037: 01 0004 trap4: lxi b,4 48 C03A: C3 C01B jmp debug_trap 49 C03D: 01 0003 trap3: lxi b,3 50 C040: C3 C01B jmp debug_trap Page 11 51 C043: 01 0002 trap2: lxi b,2 52 C046: C3 C01B jmp debug_trap 53 C049: 01 0001 trap1: lxi b,1 54 C04C: C3 C01B jmp debug_trap 55 C04F: 01 00A5 trap05: lxi b,0a5h 56 C052: C3 C01B jmp debug_trap 57 C055: 01 0015 trap15: lxi b,15h 58 C058: C3 C01B jmp debug_trap 59 C05B: 01 0025 trap25: lxi b,25h 60 C05E: C3 C01B jmp debug_trap 61 C061: 01 0035 trap35: lxi b,35h 62 C064: C3 C01B jmp debug_trap 63 C067: 01 0045 trap45: lxi b,45h 64 C06A: C3 C01B jmp debug_trap 65 C06D: 01 0055 trap55: lxi b,55h 66 C070: C3 C01B jmp debug_trap 67 C073: 01 0065 trap65: lxi b,65h 68 C076: C3 C01B jmp debug_trap 69 C079: 01 0000 trap0: lxi b,0 70 C07C: C3 C01B jmp debug_trap 71 C07F: 72 C07F: 73 C07F: ; =================== 74 C07F: ; Initialization 75 C07F: DEBUG_INIT: 76 C07F: 77 C07F: ; stuff all the interrupt vectors 78 C07F: ; 79 C07F: ; this will make jumps to 0000 do a Trap 80 C07F: 3E CD mvi a,0CDh ; "CALL" OPCODE 81 C081: 32 0000 sta RST_0 ; 0 82 C084: 21 C079 lxi h,TRAP0 83 C087: 22 0001 shld RST_0+1 84 C08A: ; wild RST 7 is also a trap 85 C08A: 32 0038 sta RST_7 86 C08D: 21 C025 lxi h,TRAP7 87 C090: 22 0039 shld RST_7+1 88 C093: ; 89 C093: 32 0004 sta RST_0+4 ; 0.5 90 C096: 21 C04F lxi h,TRAP05 91 C099: 22 0005 shld RST_0+5 92 C09C: ; 93 C09C: 32 0008 sta RST_1 ; 1 94 C09F: 21 C049 lxi h,TRAP1 95 C0A2: 22 0009 shld RST_1+1 96 C0A5: ; 97 C0A5: 32 000C sta RST_1+4 ; 1.5 98 C0A8: 21 C055 lxi h,TRAP15 99 C0AB: 22 000D shld RST_1+5 100 C0AE: ; 101 C0AE: 32 0010 sta RST_2 ; 2 102 C0B1: 21 C043 lxi h,TRAP2 103 C0B4: 22 0011 shld RST_2+1 104 C0B7: ; 105 C0B7: 32 0014 sta RST_2+4 ; 2.5 106 C0BA: 21 C05B lxi h,TRAP25 107 C0BD: 22 0015 shld RST_2+5 108 C0C0: ; 109 C0C0: 32 0018 sta RST_3 ; 3 110 C0C3: 21 C03D lxi h,TRAP3 Page 12 111 C0C6: 22 0019 shld RST_3+1 112 C0C9: ; 113 C0C9: 32 001C sta RST_3+4 ; 3.5 114 C0CC: 21 C061 lxi h,TRAP35 115 C0CF: 22 001D shld RST_3+5 116 C0D2: ; 117 C0D2: 32 0020 sta RST_4 ; 4 118 C0D5: 21 C037 lxi h,TRAP4 119 C0D8: 22 0021 shld RST_4+1 120 C0DB: ; 121 C0DB: 32 0024 sta RST_4+4 122 C0DE: 21 C067 lxi h,TRAP45 123 C0E1: 22 0025 shld RST_4+5 124 C0E4: ; 125 C0E4: 32 0028 sta RST_5 ; 5 126 C0E7: 21 C031 lxi h,TRAP5 127 C0EA: 22 0029 shld RST_5+1 128 C0ED: ; 129 C0ED: 32 0030 sta RST_6 130 C0F0: 21 C02B lxi h,TRAP6 131 C0F3: 22 0031 shld RST_6+1 132 C0F6: ; 133 C0F6: 32 002C sta RST_55 134 C0F9: 21 C06D lxi h,TRAP55 135 C0FC: 22 002D shld RST_55+1 136 C0FF: ; 137 C0FF: 32 0034 sta RST_65 138 C102: 21 C073 lxi h,TRAP65 139 C105: 22 0035 shld RST_65+1 140 C108: ; 141 C108: 32 003C sta RST_75 142 C10B: 21 C031 lxi h,TRAP5 143 C10E: 22 003D shld RST_75+1 144 C111: ; 145 C111: ; set TRAP vector 146 C111: 3E C3 mvi a,JMP_OPCODE ; JMP opcode 147 C113: 32 0024 sta TRAP 148 C116: 21 C01B lxi h,DEBUG_TRAP ; address of Trap handler 149 C119: 22 0025 shld TRAP+1 ; set as JMP address 150 C11C: 151 C11C: ; setup output queue for debug bytes 152 C11C: 21 C600 lxi h,GBL_DTP_OUTQ 153 C11F: 22 C179 shld qpr 154 C122: 22 C17B shld qpw 155 C125: 156 C125: ; zero packet 720 sequence counter 157 C125: 21 0000 lxi h,0 158 C128: 22 C208 shld sq20 159 C12B: 160 C12B: ; Start Debug task 161 C12B: 11 C17D lxi d,debug_task 162 C12E: 21 C2BE lxi h,debug_STACK+stack_size 163 C131: CD C006 call task_new 164 C134: C9 ret 165 C135: 166 C135: ; send byte to output queue 167 C135: ; A - the byte 168 C135: DEBUG_PUTBYTE: 169 C135: F5 push psw 170 C136: D5 push d Page 13 171 C137: E5 push h 172 C138: 173 C138: 2A C17B lhld qpw ; pointer for writing into queue 174 C13B: 77 mov M,a ; store byte in queue 175 C13C: 23 inx h ; step pointer 176 C13D: 11 CA00 lxi d,GBL_DTP_OUTQ_WRAP 177 C140: 7D mov a,l 178 C141: BB cmp e 179 C142: C2 C14D jnz nowrapw 180 C145: 7C mov a,h 181 C146: BA cmp d 182 C147: C2 C14D jnz nowrapw 183 C14A: 21 C600 lxi h,GBL_DTP_OUTQ ; back to the beginning 184 C14D: 22 C17B nowrapw: shld qpw ; store the pointer 185 C150: 186 C150: E1 pop h 187 C151: D1 pop d 188 C152: F1 pop psw 189 C153: C9 ret 190 C154: 191 C154: ; show A= as 2-digit hex 192 C154: DEBUG_SHOWA: 193 C154: F5 push psw 194 C155: C5 push b 195 C156: 47 mov b,a 196 C157: CD C2BE call send_packet_prefix 197 C15A: 3E 03 mvi a,SHOW_HEXA 198 C15C: CD C135 call debug_putbyte 199 C15F: 78 mov a,b 200 C160: CD C135 call debug_putbyte 201 C163: C1 pop b 202 C164: F1 pop psw 203 C165: C9 ret 204 C166: ; 205 C166: ; show A as 2-digit hex 206 C166: DEBUG_SHOW_HEX1: 207 C166: F5 push psw 208 C167: C5 push b 209 C168: 47 mov b,a 210 C169: CD C2BE call send_packet_prefix 211 C16C: 3E 0D mvi a,SHOW_HEX1 212 C16E: CD C135 call debug_putbyte 213 C171: 78 mov a,b 214 C172: CD C135 call debug_putbyte 215 C175: C1 pop b 216 C176: F1 pop psw 217 C177: C9 ret 218 C178: ; 219 C178: ; packet codes recognized by U 220 C178: include u.i 1 C178: ; u.i -- packet codes recognized by U 2 C178: ; 3 C178: SHOW_DECIMAL equ 1 4 C178: SHOW_HEX equ 2 5 C178: SHOW_HEXA equ 3 6 C178: SHOW_REGSET equ 4 7 C178: SHOW_DUMP equ 5 8 C178: EXIT_U equ 6 9 C178: SHOW_HEXN equ 7 Page 14 10 C178: SHOW_DECN equ 8 11 C178: SHOW_UT equ 11 12 C178: SHOW_MET equ 12 13 C178: SHOW_HEX1 equ 13 14 C178: ; 15 C178: ; 16 C178: ; command-codes recognized by DEBUG 17 C178: DC_F1 equ 4 18 C178: DC_READCLOCK equ 2 19 C178: DC_F3 equ 5 20 C178: DC_F4 equ 6 21 C178: DC_F5 equ 7 22 C178: DC_F6 equ 8 23 C178: DC_F8 equ 10 24 C178: DC_F9 equ 11 25 C178: DC_F10 equ 12 26 C178: DC_F7 equ 13 27 C178: DC_F11 equ 14 28 C178: DC_CF1 equ 15 29 C178: DC_CF2 equ 16 30 C178: DC_CF5 equ 17 31 C178: 32 C178: 221 C178: 222 C178: 00 dtp_present db 0 ; 1=DTP attached, 0=flight mode 223 C179: ; 224 C179: ; 225 C179: ; serial output queue 226 C179: qpr ds 2 ; pointer for reading the queue 227 C17B: qpw ds 2 ; pointer for writing the queue 228 C17D: ; 229 C17D: 230 C17D: 231 C17D: debug_task: 232 C17D: ; start pointer to packet data 233 C17D: 21 C3B6 lxi h,packet_data 234 C180: 22 C3B3 shld pp 235 C183: ; zero number of data bytes 236 C183: 3E 00 mvi a,0 237 C185: 32 C3B5 sta nbpkt 238 C188: 239 C188: CD C003 dtloop: call task 240 C18B: ; look for byte in output queue 241 C18B: 2A C179 lhld qpr 242 C18E: EB xchg 243 C18F: 2A C17B lhld qpw 244 C192: 7D mov a,l 245 C193: ; if the queue pointers are equal, queue is empty 246 C193: BB cmp e 247 C194: C2 C19F jnz not_empty 248 C197: 7C mov a,h 249 C198: BA cmp d 250 C199: C2 C19F jnz not_empty 251 C19C: C3 C1CE jmp queue_empty 252 C19F: 253 C19F: ; not empty; send out next byte 254 C19F: not_empty: 255 C19F: 2A C179 lhld qpr ; pointer for reading queue 256 C1A2: 7E mov a,M ; get byte Page 15 257 C1A3: 2A C3B3 lhld pp ; pointer to packet 258 C1A6: 77 mov M,a ; store byte in packet 259 C1A7: 23 inx h ; step packet pointer 260 C1A8: 22 C3B3 shld pp 261 C1AB: 262 C1AB: ; step queue pointer 263 C1AB: 2A C179 lhld qpr 264 C1AE: 23 inx h ; step the pointer 265 C1AF: ; wrap queue pointer if neccessary 266 C1AF: 11 CA00 lxi d,GBL_DTP_OUTQ_WRAP 267 C1B2: 7D mov a,l 268 C1B3: BB cmp e 269 C1B4: C2 C1BF jnz nowrapr 270 C1B7: 7C mov a,h 271 C1B8: BA cmp d 272 C1B9: C2 C1BF jnz nowrapr 273 C1BC: 21 C600 lxi h,GBL_DTP_OUTQ ; wrap to start 274 C1BF: nowrapr: 275 C1BF: 22 C179 shld qpr ; store the pointer 276 C1C2: 277 C1C2: ; increment count of bytes in packet 278 C1C2: 3A C3B5 lda nbpkt 279 C1C5: 3C inr a 280 C1C6: 32 C3B5 sta nbpkt 281 C1C9: ; if packet full, send packet 282 C1C9: FE 7F cpi 127 283 C1CB: C2 C188 jnz dtloop 284 C1CE: 285 C1CE: queue_empty: 286 C1CE: 3A C3B5 lda nbpkt 287 C1D1: FE 00 cpi 0 288 C1D3: CA C188 jz dtloop ; no bytes in packet 289 C1D6: ; send the Debug Packet 290 C1D6: ; (delay to keep Astrium happy -- see SOH.a) 291 C1D6: 3A 8078 dast: lda GBL_SOH_WAIT 292 C1D9: FE 00 cpi 0 293 C1DB: CA C1E4 jz happy 294 C1DE: CD C003 call task 295 C1E1: C3 C1D6 jmp dast 296 C1E4: happy: 297 C1E4: 3E 20 mvi a,20h ; ApID 720 298 C1E6: 01 0092 lxi b,146 ; total packet length is 146 299 C1E9: 2A C208 lhld sq20 ; this ApID's source sequence number 300 C1EC: EB xchg 301 C1ED: 21 C3B5 lxi h,nbpkt ; data after 2ndary header 302 C1F0: CD C000 call CCSDS_SEND ; send packet 303 C1F3: ; increment the source sequence count 304 C1F3: 2A C208 lhld sq20 305 C1F6: 23 inx h 306 C1F7: 22 C208 shld sq20 307 C1FA: ; zero nbytes-in-packet 308 C1FA: 3E 00 mvi a,0 309 C1FC: 32 C3B5 sta nbpkt 310 C1FF: ; start packet pointer again 311 C1FF: 21 C3B6 lxi h,packet_data 312 C202: 22 C3B3 shld pp 313 C205: C3 C188 jmp dtloop 314 C208: 315 C208: sq20 ds 2 316 C20A: Page 16 317 C20A: 318 C20A: ; 319 C20A: debug_stack ds stack_size 320 C2BE: ; 321 C2BE: ; 322 C2BE: send_packet_prefix: 323 C2BE: F5 push psw 324 C2BF: 3E FE mvi a,0FEh 325 C2C1: CD C135 call DEBUG_PUTBYTE 326 C2C4: 3E 7F mvi a,07Fh 327 C2C6: CD C135 call DEBUG_PUTBYTE 328 C2C9: F1 pop psw 329 C2CA: C9 ret 330 C2CB: ; 331 C2CB: ; display message 332 C2CB: ; HL - points to null-terminated message string 333 C2CB: DEBUG_SHOW: 334 C2CB: F5 push psw 335 C2CC: E5 push h 336 C2CD: 7E l1: mov a,M ; get byte 337 C2CE: FE 00 cpi 0 ; null? 338 C2D0: CA C2DA jz done ; yes, end of string 339 C2D3: CD C135 call DEBUG_PUTBYTE 340 C2D6: 23 inx h ; next byte 341 C2D7: C3 C2CD jmp l1 342 C2DA: E1 done: pop h 343 C2DB: F1 pop psw 344 C2DC: C9 ret 345 C2DD: ; 346 C2DD: ; 347 C2DD: 348 C2DD: FE 0A hex: cpi 10 349 C2DF: FA C2E5 jm low 350 C2E2: C6 37 adi 'A'-10 351 C2E4: C9 ret 352 C2E5: C6 30 low: adi '0' 353 C2E7: C9 ret 354 C2E8: ; 355 C2E8: ; make "U" packet to display number in HL as 4 Hex digits 356 C2E8: ; (with newline at end) 357 C2E8: HEXOUT: 358 C2E8: F5 push psw 359 C2E9: CD C2BE call send_packet_prefix 360 C2EC: 3E 02 mvi a,SHOW_HEX ; function code for "U" program in PC 361 C2EE: CD C135 call debug_putbyte 362 C2F1: 7C mov a,h 363 C2F2: CD C135 call debug_putbyte 364 C2F5: 7D mov a,l 365 C2F6: CD C135 call debug_putbyte 366 C2F9: F1 pop psw 367 C2FA: C9 ret 368 C2FB: ; 369 C2FB: ; make "U" packet to display number in HL as 4 Hex digits 370 C2FB: ; (with no newline) 371 C2FB: public DEBUG_SHOW_HEXN 372 C2FB: DEBUG_SHOW_HEXN: 373 C2FB: F5 push psw 374 C2FC: CD C2BE call send_packet_prefix 375 C2FF: 3E 07 mvi a,SHOW_HEXN ; function code for "U" program in PC 376 C301: CD C135 call debug_putbyte Page 17 377 C304: 7C mov a,h 378 C305: CD C135 call debug_putbyte 379 C308: 7D mov a,l 380 C309: CD C135 call debug_putbyte 381 C30C: F1 pop psw 382 C30D: C9 ret 383 C30E: ; 384 C30E: ; make "U" packet to display number in HL as signed decimal 385 C30E: DECOUT: 386 C30E: F5 push psw 387 C30F: CD C2BE call send_packet_prefix 388 C312: 3E 01 mvi a,SHOW_DECIMAL 389 C314: CD C135 call debug_putbyte 390 C317: 7C mov a,h 391 C318: CD C135 call debug_putbyte 392 C31B: 7D mov a,l 393 C31C: CD C135 call debug_putbyte 394 C31F: F1 pop psw 395 C320: C9 ret 396 C321: ; 397 C321: ; make "U" packet to display number in HL as signed decimal 398 C321: public DEBUG_SHOW_DECN 399 C321: DEBUG_SHOW_DECN 400 C321: F5 push psw 401 C322: CD C2BE call send_packet_prefix 402 C325: 3E 08 mvi a,SHOW_DECN 403 C327: CD C135 call debug_putbyte 404 C32A: 7C mov a,h 405 C32B: CD C135 call debug_putbyte 406 C32E: 7D mov a,l 407 C32F: CD C135 call debug_putbyte 408 C332: F1 pop psw 409 C333: C9 ret 410 C334: ; 411 C334: ; 412 C334: DEBUG_REGSET: 413 C334: F5 push psw 414 C335: C5 push b 415 C336: F5 push psw 416 C337: CD C2BE call send_packet_prefix 417 C33A: 3E 04 mvi a,SHOW_REGSET 418 C33C: CD C135 call debug_putbyte 419 C33F: C1 pop b 420 C340: 78 mov a,b 421 C341: CD C135 call debug_putbyte 422 C344: C1 pop b 423 C345: 79 mov a,c 424 C346: CD C135 call debug_putbyte 425 C349: 78 mov a,b 426 C34A: CD C135 call debug_putbyte 427 C34D: 79 mov a,c 428 C34E: CD C135 call debug_putbyte 429 C351: 7A mov a,d 430 C352: CD C135 call debug_putbyte 431 C355: 7B mov a,e 432 C356: CD C135 call debug_putbyte 433 C359: 7C mov a,h 434 C35A: CD C135 call debug_putbyte 435 C35D: 7D mov a,l 436 C35E: CD C135 call debug_putbyte Page 18 437 C361: F1 pop psw 438 C362: C9 ret 439 C363: ; 440 C363: DEBUG_DUMP: 441 C363: ; dump bytes pointed to by HL 442 C363: ; C gives number of bytes 443 C363: F5 push psw 444 C364: C5 push b 445 C365: E5 push h 446 C366: CD C2BE call send_packet_prefix 447 C369: 3E 05 mvi a,SHOW_DUMP 448 C36B: CD C135 call debug_putbyte 449 C36E: 79 mov a,c ; number of bytes to follow 450 C36F: CD C135 call debug_putbyte 451 C372: 7E ddl: mov a,M 452 C373: CD C135 call debug_putbyte 453 C376: 23 inx h 454 C377: 0D dcr c 455 C378: C2 C372 jnz ddl 456 C37B: E1 pop h 457 C37C: C1 pop b 458 C37D: F1 pop psw 459 C37E: C9 ret 460 C37F: ; 461 C37F: 462 C37F: ; display spacecraft time as hh:mm:ss 463 C37F: DEBUG_SHOWMET: 464 C37F: ; HL - points to 6 bytes of MET 465 C37F: F5 push psw 466 C380: C5 push b 467 C381: E5 push h 468 C382: CD C2BE call send_packet_prefix 469 C385: 3E 0C mvi a,SHOW_MET 470 C387: CD C135 call debug_putbyte 471 C38A: 0E 06 mvi c,6 472 C38C: 7E sml: mov a,M 473 C38D: CD C135 call debug_putbyte 474 C390: 23 inx h 475 C391: 0D dcr c 476 C392: C2 C38C jnz sml 477 C395: E1 pop h 478 C396: C1 pop b 479 C397: F1 pop psw 480 C398: C9 ret 481 C399: 482 C399: ; display ISUAL 10-byte time as hh:mm:ss.xxx 483 C399: DEBUG_SHOWUT: 484 C399: ; HL - points to 10 bytes of UT 485 C399: F5 push psw 486 C39A: C5 push b 487 C39B: E5 push h 488 C39C: CD C2BE call send_packet_prefix 489 C39F: 3E 0B mvi a,SHOW_UT 490 C3A1: CD C135 call debug_putbyte 491 C3A4: 0E 0A mvi c,10 492 C3A6: 7E sul: mov a,M 493 C3A7: CD C135 call debug_putbyte 494 C3AA: 23 inx h 495 C3AB: 0D dcr c 496 C3AC: C2 C3A6 jnz sul Page 19 497 C3AF: E1 pop h 498 C3B0: C1 pop b 499 C3B1: F1 pop psw 500 C3B2: C9 ret 501 C3B3: 502 C3B3: pp ds 2 503 C3B5: pktd ds 128 504 C435: nbpkt equ pktd 505 C435: packet_data equ pktd+1 506 C435: 507 C435: END_DPU ds 1 508 C436: 21 C435 lxi h,end_dpu 509 C439: