PAGE 1 [3.3a] 6/28/89 17:43:17 ASSEMBLY OF MISCASM.TEXT PASS 1 COMPLETE. ERRORS: 0 1 * sccs info: @(#) miscasm 8.1 84/05/04 00:18:02 * 2 3 nosyms 4 5 6 * 7 * global or common symbol declarations 8 * 9 include LOWRAM 10 * sccs info: @(#) lowram 8.1 84/05/04 00:17:54 * 11 12 ****************************************************************************** 13 * Low RAM Memory Map and Equates * 14 ****************************************************************************** 15 * F_AREA Points to an area of stolen read/write in low RAM which has 16 * the following format: 17 * 18 * (F_AREA) + 0 semi-unused (see klink) 19 * 1 RE_RDWRT.b Re-read counter 20 * 2 RESEEK.b Re-seek counter 21 * 22 * 3 FFLAGS0 23 * 4 TRKSIDE0.b Current track and side for drive 0 24 * 5 XCMDCOPY0.b Permanent copy of xcmdreg for drive 0 25 * 6 FOFFSET0.b Offset temporary 26 * 27 * 7 FFLAGS1.b 28 * 8 TRKSIDE1.b Current track and side for drive 1 29 * 9 XCMDCOPY1.b Permanent copy of xcmdreg for drive 1 30 * 10 FOFFSET1.b Offset temporary 31 * 32 * 33 ******************************System Information****************************** 34 0000 000B booleans equ 11 BOOTROM Booleans: ****************************** 35 0000 0000 h_5060 equ 0 Bit 0 50 Hz (Not 60Hz) 36 0000 0001 ram_test equ 1 Bit 1 To tell if RAM Test is Long 37 0000 0002 configure equ 2 Bit 2 To tell if in Configure Mode 38 0000 0003 attended equ 3 Bit 3 To tell if BOOT is attended 39 0000 0004 lowram_ok equ 4 Bit 4 To tell if LOWRAM is positioned 40 0000 0005 dma_p equ 5 Bit 5 To tell if DMA is present 41 0000 0006 mon_p equ 6 Bit 6 To tell if Monitor is present 42 0000 0007 bb_pres equ 7 Bit 7 Indicates BURGESS Board is present 43 0000 000C iocards equ booleans+1 32 bits one on per I/O Card present 44 ******************************Buffer To Be Set-up To Use Read Interface******* 45 0000 0010 mb_ptr equ 16 Ptr to Allocated RAM: 4 bytes 46 0000 0014 mb_size equ mb_ptr+4 Required bytes in Allocated RAM: 4 bytes 47 ******************************Items Modifiable by BOOT Extensions ************ 48 0000 0018 i_start equ 24 Address of Start of Init/Test List 49 0000 001C b_start equ i_start+4 Address of Start of BOOT List ****************** 50 0000 0000 active equ 0 51 0000 0004 next_system equ 4 52 0000 0020 d_start equ i_start+8 Address of Start of Mass Storage Driver List *** 53 0000 0000 doff equ 0 Offset to next List Element (4 bytes) 54 0000 0004 dadr equ 4 Address of Drivers (4 bytes) 55 0000 0008 dtype equ 8 MSUS type of Drivers (1 byte) 56 0000 0000 dsel equ 0 Display Select Code 57 0000 0001 dhpib equ 1 Display HP-IB Address 58 0000 0002 ddrive equ 2 Display Drive Number PAGE 2 [3.3a] 6/28/89 17:43:17 ASSEMBLY OF MISCASM.TEXT 59 0000 0003 dcomma1 equ 3 Put Comma Between Select Code and Name 60 0000 0004 dcomma2 equ 4 Put Comma Between Select Code and Addr 61 0000 0005 dvol equ 5 Split Volume number from drive number 62 0000 0024 dd_start equ i_start+12 Address of Mass Storage Device Driver List ***** 63 0000 0028 dm_start equ i_start+16 Address of Directory Manager Driver List ******* 64 0000 002C tempram equ i_start+20 Offset to Actual LOWRAM: 4 bytes 65 ******************************BOOTROM Dependent Temps follow****************** 66 ******************************Display Driver Variables************************ 67 0000 0030 winit equ 48 Display Initialization Vector 68 0000 0036 wtb equ winit+6 Write a byte in d0 to Display Vector 69 0000 003C tabxy equ winit+12 Position Printhead to X(d0),Y(d1) Vector 70 0000 0042 crtst equ winit+18 Address of 1st CRT memory word 71 0000 0046 width equ winit+22 CRT Width 72 73 * driver-specific variables 74 0000 0048 width2 equ winit+24 (26/36 ) CRT Width times 2 75 0000 0048 startoffont equ winit+24 (hi res) Pointer to 1st char in font to be used 76 0000 0048 key_lock equ winit+24 (remote) lock out key processing 77 0000 0049 key_pending equ winit+25 (remote) key pending flag 78 79 0000 004A prthead equ winit+26 Address of CRT Printhead 80 0000 004E crtlst equ winit+30 Address of End of CRT Plus one 81 0000 0052 height equ winit+34 Number of Lines in Display: 2 bytes 82 ******************************Global Booleans and Temps********************** 83 0000 0054 m_b equ 84 Booleans: 1 byte 84 0000 0000 mb_loop equ 0 bit Self-Test Loop 85 0000 0001 mb_lock equ 1 bit Lock out Resets 86 0000 0002 mb_stop equ 2 bit Pause Search 87 0000 0003 mb_current equ 3 bit GANGLIA Boolean 88 0000 0004 mb_badHiRes equ 4 bit High Resolution CRT Failed bit 89 0000 0005 mb_btemp equ 5 bit Temporary Boolean 90 0000 0006 mb_prom equ 6 bit Prom Present Boolean 91 0000 0007 mb_btemp2 equ 7 bit Temporary Boolean 92 0000 0055 r_lock equ m_b+1 Reset Lock Byte Record 93 ******************************Global Shared Mass Storage Temps*************** 94 0000 0056 m_msus equ 86 Passed msus: 4 bytes 95 0000 0056 mm_fd equ m_msus+0 byte msus format/device subfield 96 0000 0057 mm_un equ m_msus+1 byte msus unit number subfield 97 0000 0058 mm_sc equ m_msus+2 byte msus select code subfield 98 0000 0059 mm_ba equ m_msus+3 byte msus bus address subfield 99 0000 005A m_dirsec equ m_msus+4 Directory Sector Address: 4 bytes 100 0000 005E m_dirlen equ m_msus+8 Directory Length (in sectors): 4 bytes 101 0000 0062 m_dirent equ m_msus+12 Directory entry: 4 bytes 102 0000 0066 m_filesec equ m_msus+16 File Start Address: 4 bytes 103 ******************************Variables Private to Specific Drivers********** 104 0000 006A m_sarea equ 106 32 bytes for Sector Device Present Booleans 105 0000 008A m_garea equ m_sarea+32 64 booleans for Ganglia: 8 bytes 106 ***************************************************************************** 107 0000 0092 m_nxtmsus equ 146 Next msus to try: 4 bytes 108 0000 0096 led_val equ m_nxtmsus+4 Last Failure Value to be sent to test leds 109 0000 009A remote_adr equ m_nxtmsus+8 Address of Remote H.I.: 4 bytes 110 0000 009E remote_type equ m_nxtmsus+12 1 Byte: Type of Remote I/O Card 111 0000 009F remote_xoff equ m_nxtmsus+13 1 Byte: Remote Card Software Handshake Flag 112 ******************************Temps used only during Self-Test & BOOT Scanner 113 ******************************Variables Private to Specific Drivers********** 114 0000 00A0 m_sarea2 equ 160 512 bytes for Sector Device Present Booleans 115 0000 02A0 m_garea2 equ m_sarea2+512 4 bytes for Ganglia Device Present Booleans PAGE 3 [3.3a] 6/28/89 17:43:17 ASSEMBLY OF MISCASM.TEXT 116 ******************************Keyboard Input Driver Variables***************** 117 0000 02A4 rinit equ 676 Initialize Input Device Vector 118 0000 02AA rstatus equ rinit+6 Check for Input Character Available Vector 119 0000 02B0 rdb equ rinit+12 Input Character Vector 120 0000 02B6 rbuff equ rinit+18 16 byte Input Buffer 121 0000 02C6 rwait equ rinit+34 Number of Characters Waiting to be Processed 122 0000 02C8 rhead equ rinit+36 Offset to next character to be processed 123 0000 02CA rtail equ rinit+38 Offset to next free char space in queue 124 0000 02CC kbdlang equ rinit+40 Keyboard language 125 0000 02CD kbdtype equ rinit+41 Keyboard type (1: ITF, 0: old chipmonk style) 126 ******************************Temps used only during Self-Test & BOOT Scanner 127 0000 02CE tempsss equ 718 Address of Last Memory Failure 128 0000 02D2 boot_sel equ tempsss+4 Boot Sub-selector 129 0000 02D3 boot_char equ tempsss+5 Boot Selector Character 130 0000 02D4 nxt_sline equ tempsss+6 Next self_test Display line available 131 0000 02D6 midram equ tempsss+8 Pointer to Mid RAM for temporary ram before LOAD 132 0000 02DA steal equ tempsss+12 Number of 32 byte blocks to reserve in f_area 133 ******************************End of F_AREA********************************** 134 0000 02DC f_areatop equ 732 Top of f_area PAGE 4 [3.3a] 6/28/89 17:43:17 ASSEMBLY OF MISCASM.TEXT 136 * 137 * escapecodes 138 * 139 0000 0001 ec_no_device equ 1 140 0000 0002 ec_no_medium equ 2 141 0000 0003 ec_not_ready equ 3 142 0000 0004 ec_read_error equ 4 143 0000 0005 ec_bad_hardware equ 5 144 0000 0006 ec_bad_error_state equ 6 145 0000 0007 ec_bus_error equ 7 146 147 148 149 * 150 * dev field equates 151 * 152 0000 0000 mini equ 0 9826/36 internal 5.25" minifloppy 153 0000 0004 HP9895 equ 4 9895 8" floppy / 913X 5.25" micro-winchester (HP-IB) 154 0000 0005 HP8290X equ 5 82900 series 5.25" minifloppy (HP-IB) 155 0000 0006 HP9885 equ 6 9885 8" floppy (GPIO) 156 0000 0007 HP913X_A equ 7 913X A 5-megabyte 5.25" micro-winchester (HPIB) 157 0000 0008 HP913X_B equ 8 913X B 10-megabyte 5.25" micro-winchester (HPIB) 158 0000 0009 HP913X_C equ 9 913X C 15-megabyte 5.25" micro-winchester (HPIB) 159 0000 000A HP7905 equ 10 7905 hard disc (HPIB) 160 0000 000B HP7906 equ 11 7906 hard disc (HPIB) 161 0000 000C HP7920 equ 12 7920 hard disc (HPIB) 162 0000 000D HP7925 equ 13 7925 hard disc (HPIB) 163 164 0000 0010 CS80_256 equ 16 Command Set '80 devices with 256-byte blocks (HPIB) 165 0000 0011 CS80_other equ 17 all other Command Set '80 devices (HPIB) 166 167 0000 0014 EPROM equ 20 EPROM card 168 169 0000 0016 Bubbles equ 22 Bubbles card 170 171 0000 001F Unknown equ 31 used while scanning before device type is known 172 173 174 * 175 * card ID equates 176 * 177 FFFF FFFF null_sc equ -1 fake ID; null select code 178 0000 0000 no_card equ 0 fake ID; no card present 179 0000 0001 hp98624 equ 1 external HPIB 180 0000 0002 hp98626 equ 2 serial 181 0000 0003 hp98622 equ 3 gpio 182 0000 0008 hp98625 equ 8 Simon (PHI) HPIB 183 0000 0014 hp98628 equ 20 datacom 184 0000 0020 intHPIB equ 32 fake ID; actually has no real ID of its own 185 186 187 * 188 * hardware related equates 189 * 190 0047 8000 intHPIBaddr equ $478000 internal HPIB address 191 192 PAGE 5 [3.3a] 6/28/89 17:43:17 ASSEMBLY OF MISCASM.TEXT 193 PAGE 6 [3.3a] 6/28/89 17:43:17 ASSEMBLY OF MISCASM.TEXT 195 * 196 * BOOTROM stolen low RAM area pointer 197 * 198 FFFF FED4 f_area equ $FFFFFED4 199 200 201 * 202 * SYSFLAG: byte location and selected bit assignments 203 * 204 FFFF FED2 sysflag equ $FFFFFED2 attributes byte 205 206 0000 0005 sf_intHPIBabs equ 5 internal HPIB absent 207 208 209 * 210 * Import timer routines & define timer constants 211 * 212 refa delay 213 214 FFFF FEDA sysflag2 equ $FFFFFEDA second attributes byte 215 0000 0001 timer_absent equ 1 1 for no timer, 0 for timer 216 PAGE 7 [3.3a] 6/28/89 17:43:17 MISCELLANEOUS ASSEMBLY LANGUAGE ROUTINES 219 ***************************************************************************** 220 * * 221 * * * *** *** *** *** *** * * * 222 * ** ** * * * * * * * * * ** ** * 223 * * * * * * * * * * * * * * 224 * * * * * * * ***** * * * * * 225 * * * * * * * * * * * * 226 * * * * * * * * * * * * * * * 227 * * * *** *** *** * * *** * * * 228 * * 229 ***************************************************************************** 230 231 232 mname miscasm 233 234 src module miscasm; 235 src 236 src import 237 src brdecs; 238 src 239 src export 240 src 241 src procedure bit_set(anyvar boolean_array: char; byte_offset, bit_num: signed16); 242 src procedure bit_clr(anyvar boolean_array: char; byte_offset, bit_num: signed16); 243 src function bit_tst(anyvar boolean_array: char; byte_offset, bit_num: signed16): boolean; 244 src 245 src function cardADR: anyptr; 246 src function cardID: unsgn8; 247 src 248 src function file_name_matches(var filename: string255; var LIFfile_name: pac10): boolean; 249 src 250 src procedure delay(micro_seconds: integer); 251 src 252 src end; {miscasm} 253 254 255 * 256 * def's 257 * 258 def miscasm_miscasm 259 def miscasm_bit_set 260 def miscasm_bit_clr 261 def miscasm_bit_tst 262 def miscasm_cardADR 263 def miscasm_cardID 264 def miscasm_file_name_matches 265 def miscasm_delay 266 267 268 ***************************************************************************** 269 * module initialization routine * 270 ***************************************************************************** 271 272 00000000 4E75 miscasm_miscasm rts PAGE 8 [3.3a] 6/28/89 17:43:17 MISCELLANEOUS ASSEMBLY LANGUAGE ROUTINES 274 ***************************************************************************** 275 * bit_set * 276 ***************************************************************************** 277 278 00000002 6116 miscasm_bit_set bsr.s get_parm get parameters 279 00000004 01D0 bset d0,(a0) set the bit 280 00000006 4ED1 jmp (a1) return 281 282 283 ***************************************************************************** 284 * bit_clr * 285 ***************************************************************************** 286 287 00000008 6110 miscasm_bit_clr bsr.s get_parm get parameters 288 0000000A 0190 bclr d0,(a0) clear the bit 289 0000000C 4ED1 jmp (a1) return 290 291 292 ***************************************************************************** 293 * bit_tst * 294 ***************************************************************************** 295 296 0000000E 610A miscasm_bit_tst bsr.s get_parm get parameters 297 00000010 0110 btst d0,(a0) test the bit 298 00000012 56C0 sne d0 record it 299 00000014 4400 neg.b d0 form a legal PASCAL boolean 300 00000016 1E80 move.b d0,(sp) assign it 301 00000018 4ED1 jmp (a1) return 302 303 304 305 306 * 307 * get parameters routine for bit_set, bit_clr, & bit_test 308 * 309 0000001A 245F get_parm movea.l (sp)+,a2 get_parm's own return address! 310 0000001C 225F movea.l (sp)+,a1 calling routine's return address 311 0000001E 301F move (sp)+,d0 bit number 312 00000020 305F movea (sp)+,a0 byte offset 313 00000022 D1DF adda.l (sp)+,a0 plus boolean array base address 314 00000024 4ED2 jmp (a2) return PAGE 9 [3.3a] 6/28/89 17:43:17 MISCELLANEOUS ASSEMBLY LANGUAGE ROUTINES 316 ***************************************************************************** 317 * cardADR * 318 ***************************************************************************** 319 320 00000026 2078 FED4 miscasm_cardADR movea.l f_area,a0 BOOTROM stolen low RAM area ptr 321 0000002A 1028 0058 move.b mm_sc(a0),d0 select code... 322 0000002E 4880 ext d0 extended to... 323 00000030 48C0 ext.l d0 long word 324 00000032 6B1C bmi.s cADR_assign branch if null 325 00000034 B03C 0007 cmp.b #7,d0 select code 7? 326 00000038 6610 bne.s cADR_external branch if not 327 0000003A 0838 0005 btst #sf_intHPIBabs,sysflag internal HPIB absent? FED2 328 00000040 6608 bne.s cADR_external branch if so 329 00000042 203C 0047 move.l #intHPIBaddr,d0 internal HPIB card address 8000 330 00000048 6006 bra.s cADR_assign go assign the return value 331 332 0000004A 807C 0060 cADR_external or #$60,d0 complete upper word of external card address 333 0000004E 4840 swap d0 complete external card address 334 335 00000050 205F cADR_assign movea.l (sp)+,a0 pop the return address 336 00000052 2E80 move.l d0,(sp) assign rv, set CC's, & leave rv in d0.l 337 00000054 4ED0 jmp (a0) return 338 339 340 ***************************************************************************** 341 * cardID * 342 ***************************************************************************** 343 * 344 * NOTE: upon exit - a1 = card address!!! 345 * 346 00000056 598F miscasm_cardID subq.l #4,sp allocate return value space 347 00000058 61CC bsr miscasm_cardADR fetch the card adddress 348 0000005A 225F movea.l (sp)+,a1 load the card address 349 0000005C 6B22 bmi.s cID_assign branch if null (CC's set in cardADR!) 350 351 0000005E 7020 moveq #32,d0 value in anticipation of internal HPIB 352 00000060 B3FC 0047 cmpa.l #intHPIBaddr,a1 internal HPIB? 8000 353 00000066 6718 beq.s cID_assign branch if so 354 355 00000068 7000 moveq #0,d0 value in anticipation of no card present 356 0000006A 2478 FED4 movea.l f_area,a2 BOOTROM stolen low RAM area 357 0000006E 122A 0058 move.b mm_sc(a2),d1 select code 358 00000072 242A 000C move.l iocards(a2),d2 external card present booleans 359 00000076 0302 btst d1,d2 this card present? 360 00000078 6706 beq.s cID_assign branch if not 361 362 0000007A 707F moveq #$7F,d0 card ID register mask 363 0000007C C029 0001 and.b 1(a1),d0 card ID bits 364 365 00000080 205F cID_assign movea.l (sp)+,a0 pop the return address 366 00000082 3E80 move d0,(sp) assign the return value 367 00000084 4ED0 jmp (a0) return PAGE 10 [3.3a] 6/28/89 17:43:17 MISCELLANEOUS ASSEMBLY LANGUAGE ROUTINES 369 ****************************************************************************** 370 * file name matches * 371 ****************************************************************************** 372 373 0000 0086 miscasm_file_name_matches equ * 374 375 00000086 205F movea.l (sp)+,a0 pop the return address 376 00000088 225F movea.l (sp)+,a1 pop the LIF file name address 377 0000008A 245F movea.l (sp)+,a2 pop the specified file name string address 378 * 379 * determine the actual LIF file name length with trailing blanks trimmed 380 * 381 0000008C 7209 moveq #10-1,d1 max possible length-1 for a LIF file name 382 0000008E 7020 moveq #' ',d0 blank character 383 00000090 B031 1000 cmp.b 0(a1,d1),d0 this character a blank? 384 00000094 56C9 FFFA dbne d1,*-4 loop until first non-blank character 385 00000098 5241 addq #1,d1 actual LIF file name length 386 387 0000009A 2649 movea.l a1,a3 LIF file name starting address 388 0000009C 1601 move.b d1,d3 LIF file name length 389 0000009E 284A movea.l a2,a4 specified file name starting address - 1 390 000000A0 181C move.b (a4)+,d4 specified file name length 391 * 392 * compare the file names 393 * 394 000000A2 5304 fnm_loop subq.b #1,d4 specified file name chars exhausted? 395 000000A4 650E bcs.s fnm_sfnce branch if so 396 000000A6 101C move.b (a4)+,d0 load specified file name char 397 000000A8 670E beq.s fnm_match a null char is a wildcard 398 000000AA 5303 subq.b #1,d3 LIF file name chars exhausted? 399 000000AC 651C bcs.s fnm_no_match branch if so (no match) 400 000000AE B01B cmp.b (a3)+,d0 current chars match? 401 000000B0 6618 bne.s fnm_no_match branch if not (no match) 402 000000B2 60EE bra fnm_loop loop 403 404 000000B4 5303 fnm_sfnce subq.b #1,d3 LIF file name chars exhausted also? 405 000000B6 6412 bcc.s fnm_no_match branch if not (no match) 406 * 407 * match: copy the actual file name to the string variable 408 * 409 000000B8 14C1 fnm_match move.b d1,(a2)+ set actual file name length 410 000000BA 5301 subq.b #1,d1 actual length - 1 411 000000BC 6506 bcs.s fnm_ret_true branch if zero (no chars to copy) 412 413 000000BE 14D9 move.b (a1)+,(a2)+ copy a char 414 000000C0 51C9 FFFC dbra d1,*-2 loop until done 415 416 000000C4 1EBC 0001 fnm_ret_true move.b #1,(sp) assign a return value of true 417 000000C8 4ED0 jmp (a0) return 418 419 000000CA 51D7 fnm_no_match sf (sp) assign a return value of false 420 000000CC 4ED0 jmp (a0) return 421 PAGE 11 [3.3a] 6/28/89 17:43:17 MISCELLANEOUS ASSEMBLY LANGUAGE ROUTINES 423 ****************************************************************************** 424 * delay * 425 ****************************************************************************** 426 427 0000 00CE miscasm_delay equ * 428 429 * 430 * use the timer hardware if present 431 * 432 000000CE 0838 0001 btst #timer_absent,sysflag2 timer absent? FEDA 433 000000D4 6700 FF2A beq delay if not, go to timer routine 434 * 435 * else use a good 'ole processor timing loop (this one probably 10-20% slow) 436 * 437 000000D8 2F2F 0004 move.l 4(sp),-(sp) copy the argument 438 000000DC 2F6F 0004 move.l 4(sp),8(sp) position return address 0008 439 000000E2 2F40 0004 move.l d0,4(sp) save d0.l contents 440 000000E6 201F move.l (sp)+,d0 load argument 441 442 000000E8 51C8 FFFE delay_loop dbra d0,delay_loop loop till WORD exhausted 443 444 000000EC 4240 clr.w d0 prepare to... 445 000000EE 5380 subq.l #1,d0 decrement entire LONG count 446 000000F0 64F6 bcc delay_loop keep looping if necessary 447 448 000000F2 201F move.l (sp)+,d0 restore d0.l contents 449 000000F4 4E75 rts return 450 451 end PASS 1 ERRORS: 0 PASS 2 ERRORS: 0