PAGE 1 [3.3a] 6/29/89 08:33:30 ASSEMBLY OF BOOTROM1.TEXT PASS 1 COMPLETE. ERRORS: 0 1 * sccs info: @(#) bootrom1 8.1 84/05/04 00:13:23 * 2 3 nosyms 5 ****************************************************************************** 6 ****************************************************************************** 7 ****************************************************************************** 8 ***** ***** 9 ***** 3.0 BOOTROM Greg Lawson $0000-$BFFF Ver: 7/31/82 ***** 10 ***** ***** 11 ***** BOOTROM1: ***** 12 ***** Global Definitions ***** 13 ***** BOOTROM0: ***** 14 ***** Low RAM Exception Vectors and Jump Tables ***** 15 ***** Power Up Supervisor ***** 16 ***** Booter ***** 17 ***** Initialization/Test Vectors ***** 18 ***** Test Utilities ***** 19 ***** BOOTROM1: ***** 20 ***** PROM Drivers ***** 21 ***** Read Interface ***** 22 ***** External Disc Boot Mass Storage Driver Support ***** 23 ***** Bubble Memory Boot Mass Storage Driver Support ***** 24 ***** BOOTROM3: ***** 25 ***** Extended Jump Table Entries ***** 26 ***** Mass Storage Driver Lists ***** 27 ***** Boot Entries Part I ***** 28 ***** Boot Entries Part II ***** 29 ***** Dummy Mass Storage Drivers ***** 30 ***** Mini-Floppy Boot Mass Storage Drivers ***** 31 ***** EPROM Boot Mass Storage Drivers ***** 32 ***** Rom Boot Mass Storage Drivers ***** 33 ***** GANGLIA Boot Mass Storage Driver Support ***** 34 ***** Battery Hardware Drivers ***** 35 ***** HPIB Hardware Drivers ***** 36 ***** SIO Hardware Drivers ***** 37 ***** Moon Unit Hardware Drivers ***** 38 ***** Miscellaneous Utilities ***** 39 ***** Exception Handlers ***** 40 ***** LIF Internal Minifloppy Loader Utilities ***** 41 ***** BOOTHI: ***** 42 ***** Human Interface Drivers ***** 43 ***** BOOTRHI: ***** 44 ***** Remote Human Interface Drivers ***** 45 ***** BTMIMIDRV: ***** 46 ***** Internal Minifloppy Drivers ***** 47 ***** ***** 48 ***** ***** 49 ****************************************************************************** 50 ****************************************************************************** 51 ****************************************************************************** PAGE 2 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM (BOOTROM1)" 53 ****************************************************************************** 54 ****************************************************************************** 55 *** *** 56 *** Global Definitions *** 57 *** *** 58 *** High RAM Memory Map *** 59 *** Low RAM Memory Map (F_AREA) *** 60 *** Mid RAM Memory Map *** 61 *** Hardware Peripherals *** 62 *** Fixed Software (Monitor and TestROM) *** 63 *** Instruction Equates *** 64 *** Self-test LED Error Code Equates *** 65 *** PROM Memory Offsets *** 66 *** Module REFs and DEFs *** 67 *** *** 68 ****************************************************************************** 69 ****************************************************************************** PAGE 3 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HIGH RAM MEMORY MAP AND EQUATES (BOOTROM1)" 72 sprint 73 ****************************************************************************** 74 * High RAM Memory Map and Equates * 75 ****************************************************************************** 76 FFFF FFFA BUSERRV EQU $FFFFFFFA Bus Error Soft Vector 77 * $FFFFFFF4 Address Error Soft Vector 78 * $FFFFFFEE Illegal Instruction Soft Vector 79 * $FFFFFFE8 Divide by Zero Trap Soft Vector 80 * $FFFFFFE2 CHK Trap Soft Vector 81 * $FFFFFFDC TRAPV Trap Soft Vector 82 * $FFFFFFD6 Privilege Violation Soft Vector 83 FFFF FFD0 TRPTRC EQU $FFFFFFD0 TRACE Trap Soft Vector 84 * $FFFFFFCA 1010 Opcode Soft Vector 85 FFFF FFC4 OP1111 EQU $FFFFFFC4 1111 Opcode Soft Vector 86 FFFF FFBE LVL1V EQU $FFFFFFBE Interrupt Level 1 Soft Vector 87 FFFF FFB8 LVL2V EQU $FFFFFFB8 Interrupt Level 2 Soft Vector 88 FFFF FFB8 FLPYVCTR EQU $FFFFFFB8 Interrupt Level 2 Soft Vector 89 FFFF FFB2 LVL3V EQU $FFFFFFB2 Interrupt Level 3 Soft Vector 90 FFFF FFAC LVL4V EQU $FFFFFFAC Interrupt Level 4 Soft Vector 91 FFFF FFA6 LVL5V EQU $FFFFFFA6 Interrupt Level 5 Soft Vector 92 FFFF FFA0 LVL6V EQU $FFFFFFA0 Interrupt Level 6 Soft Vector 93 FFFF FF9A LVL7V EQU $FFFFFF9A Interrupt Level 7 Soft Vector 94 FFFF FF94 TRAP0V EQU $FFFFFF94 TRAP 0 Soft Vector 95 FFFF FF8E TRP1 EQU $FFFFFF8E TRAP 1 Soft Vector 96 FFFF FF88 TRP2 EQU $FFFFFF88 TRAP 2 Soft Vector 97 FFFF FF82 TRP3 EQU $FFFFFF82 TRAP 3 Soft Vector 98 FFFF FF7C TRP4 EQU $FFFFFF7C TRAP 4 Soft Vector 99 FFFF FF76 TRP5 EQU $FFFFFF76 TRAP 5 Soft Vector 100 FFFF FF70 TRP6 EQU $FFFFFF70 TRAP 6 Soft Vector 101 FFFF FF6A TRP7 EQU $FFFFFF6A TRAP 7 Soft Vector 102 FFFF FF64 TRP8 EQU $FFFFFF64 TRAP 8 Soft Vector 103 FFFF FF5E TRP9 EQU $FFFFFF5E TRAP 9 Soft Vector 104 FFFF FF58 TRP10 EQU $FFFFFF58 TRAP A Soft Vector 105 FFFF FF52 TRP11 EQU $FFFFFF52 TRAP B Soft Vector 106 FFFF FF4C TRP12 EQU $FFFFFF4C TRAP C Soft Vector 107 FFFF FF46 TRP13 EQU $FFFFFF46 TRAP D Soft Vector 108 FFFF FF40 TRAP14VEC EQU $FFFFFF40 TRAP E Soft Vector 109 FFFF FF3A TRP15 EQU $FFFFFF3A TRAP F Soft Vector 110 FFFF FF34 KBD_RESETV EQU $FFFFFF34 RESET From Keyboard Soft Pseudo Vector 111 FFFF FF2E KBD_FASTV EQU $FFFFFF2E Fast Handshake Interrupt Soft Pseudo Vector 112 FFFF FF2E KBD_TIMERV EQU $FFFFFF2E Keyboard timer vector 113 FFFF FF28 BATTERYVECTOR EQU $FFFFFF28 Battery NMI Soft Pseudo Vector 114 FFFF FF22 OTHER_NMI_V EQU $FFFFFF22 Backplane NMI Soft Pseudo Vector 115 * $FFFFFF1C Spurious Interrupt Soft Vector 116 * $FFFFFF16 Vectored Interrupt Level 0 Soft Vector 117 * $FFFFFF10 Vectored Interrupt Level 1 Soft Vector 118 * $FFFFFF0A Vectored Interrupt Level 2 Soft Vector 119 * $FFFFFF04 Vectored Interrupt Level 3 Soft Vector 120 * $FFFFFEFE Vectored Interrupt Level 4 Soft Vector 121 * $FFFFFEF8 Vectored Interrupt Level 5 Soft Vector 122 * $FFFFFEF2 Vectored Interrupt Level 6 Soft Vector 123 * $FFFFFEEC Vectored Interrupt Level 7 Soft Vector 124 * $FFFFFEE6 Reserved Soft Pseudo Vector 125 * $FFFFFEE0 Reserved Soft Pseudo Vector 126 FFFF FEE0 LASTVECTOR EQU $FFFFFEE0 Soft vector start addr 127 * $FFFFFEDF Default MSUS Primary HP-IB Address if HP-IB 128 * $FFFFFEDE Default MSUS Select Code if not internal mini PAGE 4 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HIGH RAM MEMORY MAP AND EQUATES (BOOTROM1)" 129 * $FFFFFEDD Default MSUS Drive Number 130 * $FFFFFEDC Default MSUS Type of Mass Storage Device: 131 * 0 = LIF Internal mini-floppy 132 * 1,2,3 = Reserved for future Internals 133 * 4 = LIF 9895 134 * 5 = LIF 8290x series drives 135 * 6 = LIF 9885 136 * 7-255 = Reserved for future use 137 FFFF FEDC DEFAULT_MSUS EQU $FFFFFEDC Long Word Specifying Default Mass Storage MSUS 138 FFFF FEDB DRVR_KEY EQU $FFFFFEDB Disable Reads to Default MSUS Thru Mini-Floppy 139 * (Ignored by this BOOTROM, but modified by 140 * some systems) 141 FFFF FEDA SYSFLAG2 EQU $FFFFFEDA Attribute byte: 142 0000 0000 prom_ok equ 0 bit 0 = 0 For No PROM or Bad PROM 143 * 1 For Good PROM Present 144 0000 0001 timer_absent equ 1 bit 1 = 0 has processor board timer 145 * 1 for no processor board timer 146 0000 0002 M68000 equ 2 bit 2 = 0 for processor other than 68000 147 * 1 has 68000 processor 148 * bits 7-3 = Reserved at 0100 1 149 FFFF FED9 RETRY EQU $FFFFFED9 Used for Something 150 FFFF FED8 NDRIVES EQU $FFFFFED8 Number of drives minus one (255 means no drives) 151 FFFF FED4 F_AREA EQU $FFFFFED4 Pointer To Stolen BOOTROM RAM in Low RAM 152 FFFF FED3 DRIVE EQU $FFFFFED3 Drive number 153 FFFF FED2 SYSFLAG EQU $FFFFFED2 Attributes byte: 154 * Bit 0 = 0 For 80 character wide screen 155 * 1 For 50 156 * 1 = 0 For 400 x 300 graphics 157 * 1 For 512 x 390 158 * 2.xor. bit 1 = Highlight bit 159 * 3 = 0 For keyboard 8041 present 160 * 1 For keyboard 8041 not present 161 * 4 = 0 For No CRT Config. Reg. present 162 * 1 For CRT Config. Reg. present 163 * 5 = 0 For Internal HP-IB present 164 * 1 For No Internal HP-IB present 165 * 6 = 0 For No Internal Gator (hi res crt) 166 * 1 For Internal Gator (hi res crt) 167 * 7 = Reserved at Zero 168 FFFF FDD2 FUBUFFER EQU $FFFFFDD2 256 byte universal buf 169 FFFF FDCE LOWRAM EQU $FFFFFDCE Lowest usable RAM addr 170 FFFF FDCD BATTERY EQU $FFFFFDCD 0 = No battery backup. 1 = Battery installed 171 FFFF FDCC BLFLAGS EQU $FFFFFDCC Booter temp flags: 172 * Bit 0 = 1 means System Not Found 173 * Bit 1 = 1 means Error During Load 174 * Bit 2 = 1 means Load Only Soft System 175 FFFF FDC2 SYSNAME EQU $FFFFFDC2 Name of system to boot (10 bytes) 176 FFFF FDC0 BOOTTYPE EQU $FFFFFDC0 Tells what caused boot: 177 * Values are 6 apart for jump table indexing 178 * 0 = power on 6 = crash recovery 179 * 12 = re-boot requested 18 = boot/system switch 180 FFFF FDBC START_ADDR EQU $FFFFFDBC System start address for soft systems 181 ****************************************************************************** 182 * Locations above this are preserved for all time * 183 * Locations below this are preserved up till the time a loaded system starts * 184 * running. (I.e. systems can use this space for variables and stacks.) * 185 ****************************************************************************** PAGE 5 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HIGH RAM MEMORY MAP AND EQUATES (BOOTROM1)" 186 FFFF FDB8 SAVED_KBD EQU $FFFFFDB8 Saved copy of KBD vect 187 FFFF FDB4 BDSTART EQU $FFFFFDB4 Directory start sector 188 FFFF FDB0 BDLENGTH EQU $FFFFFDB0 Directory length 189 FFFF FDAC BCATENTRY EQU $FFFFFDAC Address of catalog entry 190 FFFF FDAC BOOT_STACK EQU $FFFFFDAC Booter stack space 191 FFFF FAC0 MINRAM EQU $FFFFFAC0 Bottom of booter RAM 192 FFFF C000 TOPRAM EQU $FFFFC000 Bottom of RAM heavily tested immediately 193 FFFF F40C UVEC EQU $FFFFF40C Beginning of 6*130 byte User Vector area +12 194 ****************************************************************************** 195 * Systems should never load over location $FFFFFAC0 or higher * 196 ****************************************************************************** PAGE 6 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW RAM MEMORY MAP AND EQUATES (LOWRAM)" 199 include ../BROM/LOWRAM 200 * sccs info: @(#) lowram 8.1 84/05/04 00:17:54 * 201 202 ****************************************************************************** 203 * Low RAM Memory Map and Equates * 204 ****************************************************************************** 205 * F_AREA Points to an area of stolen read/write in low RAM which has 206 * the following format: 207 * 208 * (F_AREA) + 0 semi-unused (see klink) 209 * 1 RE_RDWRT.b Re-read counter 210 * 2 RESEEK.b Re-seek counter 211 * 212 * 3 FFLAGS0 213 * 4 TRKSIDE0.b Current track and side for drive 0 214 * 5 XCMDCOPY0.b Permanent copy of xcmdreg for drive 0 215 * 6 FOFFSET0.b Offset temporary 216 * 217 * 7 FFLAGS1.b 218 * 8 TRKSIDE1.b Current track and side for drive 1 219 * 9 XCMDCOPY1.b Permanent copy of xcmdreg for drive 1 220 * 10 FOFFSET1.b Offset temporary 221 * 222 * 223 ******************************System Information****************************** 224 0000 000B booleans equ 11 BOOTROM Booleans: ****************************** 225 0000 0000 h_5060 equ 0 Bit 0 50 Hz (Not 60Hz) 226 0000 0001 ram_test equ 1 Bit 1 To tell if RAM Test is Long 227 0000 0002 configure equ 2 Bit 2 To tell if in Configure Mode 228 0000 0003 attended equ 3 Bit 3 To tell if BOOT is attended 229 0000 0004 lowram_ok equ 4 Bit 4 To tell if LOWRAM is positioned 230 0000 0005 dma_p equ 5 Bit 5 To tell if DMA is present 231 0000 0006 mon_p equ 6 Bit 6 To tell if Monitor is present 232 0000 0007 bb_pres equ 7 Bit 7 Indicates BURGESS Board is present 233 0000 000C iocards equ booleans+1 32 bits one on per I/O Card present 234 ******************************Buffer To Be Set-up To Use Read Interface******* 235 0000 0010 mb_ptr equ 16 Ptr to Allocated RAM: 4 bytes 236 0000 0014 mb_size equ mb_ptr+4 Required bytes in Allocated RAM: 4 bytes 237 ******************************Items Modifiable by BOOT Extensions ************ 238 0000 0018 i_start equ 24 Address of Start of Init/Test List 239 0000 001C b_start equ i_start+4 Address of Start of BOOT List ****************** 240 0000 0000 active equ 0 241 0000 0004 next_system equ 4 242 0000 0020 d_start equ i_start+8 Address of Start of Mass Storage Driver List *** 243 0000 0000 doff equ 0 Offset to next List Element (4 bytes) 244 0000 0004 dadr equ 4 Address of Drivers (4 bytes) 245 0000 0008 dtype equ 8 MSUS type of Drivers (1 byte) 246 0000 0000 dsel equ 0 Display Select Code 247 0000 0001 dhpib equ 1 Display HP-IB Address 248 0000 0002 ddrive equ 2 Display Drive Number 249 0000 0003 dcomma1 equ 3 Put Comma Between Select Code and Name 250 0000 0004 dcomma2 equ 4 Put Comma Between Select Code and Addr 251 0000 0005 dvol equ 5 Split Volume number from drive number 252 0000 0024 dd_start equ i_start+12 Address of Mass Storage Device Driver List ***** 253 0000 0028 dm_start equ i_start+16 Address of Directory Manager Driver List ******* 254 0000 002C tempram equ i_start+20 Offset to Actual LOWRAM: 4 bytes 255 ******************************BOOTROM Dependent Temps follow****************** PAGE 7 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW RAM MEMORY MAP AND EQUATES (LOWRAM)" 256 ******************************Display Driver Variables************************ 257 0000 0030 winit equ 48 Display Initialization Vector 258 0000 0036 wtb equ winit+6 Write a byte in d0 to Display Vector 259 0000 003C tabxy equ winit+12 Position Printhead to X(d0),Y(d1) Vector 260 0000 0042 crtst equ winit+18 Address of 1st CRT memory word 261 0000 0046 width equ winit+22 CRT Width 262 263 * driver-specific variables 264 0000 0048 width2 equ winit+24 (26/36 ) CRT Width times 2 265 0000 0048 startoffont equ winit+24 (hi res) Pointer to 1st char in font to be used 266 0000 0048 key_lock equ winit+24 (remote) lock out key processing 267 0000 0049 key_pending equ winit+25 (remote) key pending flag 268 269 0000 004A prthead equ winit+26 Address of CRT Printhead 270 0000 004E crtlst equ winit+30 Address of End of CRT Plus one 271 0000 0052 height equ winit+34 Number of Lines in Display: 2 bytes 272 ******************************Global Booleans and Temps********************** 273 0000 0054 m_b equ 84 Booleans: 1 byte 274 0000 0000 mb_loop equ 0 bit Self-Test Loop 275 0000 0001 mb_lock equ 1 bit Lock out Resets 276 0000 0002 mb_stop equ 2 bit Pause Search 277 0000 0003 mb_current equ 3 bit GANGLIA Boolean 278 0000 0004 mb_badHiRes equ 4 bit High Resolution CRT Failed bit 279 0000 0005 mb_btemp equ 5 bit Temporary Boolean 280 0000 0006 mb_prom equ 6 bit Prom Present Boolean 281 0000 0007 mb_btemp2 equ 7 bit Temporary Boolean 282 0000 0055 r_lock equ m_b+1 Reset Lock Byte Record 283 ******************************Global Shared Mass Storage Temps*************** 284 0000 0056 m_msus equ 86 Passed msus: 4 bytes 285 0000 0056 mm_fd equ m_msus+0 byte msus format/device subfield 286 0000 0057 mm_un equ m_msus+1 byte msus unit number subfield 287 0000 0058 mm_sc equ m_msus+2 byte msus select code subfield 288 0000 0059 mm_ba equ m_msus+3 byte msus bus address subfield 289 0000 005A m_dirsec equ m_msus+4 Directory Sector Address: 4 bytes 290 0000 005E m_dirlen equ m_msus+8 Directory Length (in sectors): 4 bytes 291 0000 0062 m_dirent equ m_msus+12 Directory entry: 4 bytes 292 0000 0066 m_filesec equ m_msus+16 File Start Address: 4 bytes 293 ******************************Variables Private to Specific Drivers********** 294 0000 006A m_sarea equ 106 32 bytes for Sector Device Present Booleans 295 0000 008A m_garea equ m_sarea+32 64 booleans for Ganglia: 8 bytes 296 ***************************************************************************** 297 0000 0092 m_nxtmsus equ 146 Next msus to try: 4 bytes 298 0000 0096 led_val equ m_nxtmsus+4 Last Failure Value to be sent to test leds 299 0000 009A remote_adr equ m_nxtmsus+8 Address of Remote H.I.: 4 bytes 300 0000 009E remote_type equ m_nxtmsus+12 1 Byte: Type of Remote I/O Card 301 0000 009F remote_xoff equ m_nxtmsus+13 1 Byte: Remote Card Software Handshake Flag 302 ******************************Temps used only during Self-Test & BOOT Scanner 303 ******************************Variables Private to Specific Drivers********** 304 0000 00A0 m_sarea2 equ 160 512 bytes for Sector Device Present Booleans 305 0000 02A0 m_garea2 equ m_sarea2+512 4 bytes for Ganglia Device Present Booleans 306 ******************************Keyboard Input Driver Variables***************** 307 0000 02A4 rinit equ 676 Initialize Input Device Vector 308 0000 02AA rstatus equ rinit+6 Check for Input Character Available Vector 309 0000 02B0 rdb equ rinit+12 Input Character Vector 310 0000 02B6 rbuff equ rinit+18 16 byte Input Buffer 311 0000 02C6 rwait equ rinit+34 Number of Characters Waiting to be Processed 312 0000 02C8 rhead equ rinit+36 Offset to next character to be processed PAGE 8 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW RAM MEMORY MAP AND EQUATES (LOWRAM)" 313 0000 02CA rtail equ rinit+38 Offset to next free char space in queue 314 0000 02CC kbdlang equ rinit+40 Keyboard language 315 0000 02CD kbdtype equ rinit+41 Keyboard type (1: ITF, 0: old chipmonk style) 316 ******************************Temps used only during Self-Test & BOOT Scanner 317 0000 02CE tempsss equ 718 Address of Last Memory Failure 318 0000 02D2 boot_sel equ tempsss+4 Boot Sub-selector 319 0000 02D3 boot_char equ tempsss+5 Boot Selector Character 320 0000 02D4 nxt_sline equ tempsss+6 Next self_test Display line available 321 0000 02D6 midram equ tempsss+8 Pointer to Mid RAM for temporary ram before LOAD 322 0000 02DA steal equ tempsss+12 Number of 32 byte blocks to reserve in f_area 323 ******************************End of F_AREA********************************** 324 0000 02DC f_areatop equ 732 Top of f_area PAGE 9 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW RAM MEMORY MAP AND EQUATES (LOWRAM)" 326 * 327 * escapecodes 328 * 329 0000 0001 ec_no_device equ 1 330 0000 0002 ec_no_medium equ 2 331 0000 0003 ec_not_ready equ 3 332 0000 0004 ec_read_error equ 4 333 0000 0005 ec_bad_hardware equ 5 334 0000 0006 ec_bad_error_state equ 6 335 0000 0007 ec_bus_error equ 7 336 337 338 339 * 340 * dev field equates 341 * 342 0000 0000 mini equ 0 9826/36 internal 5.25" minifloppy 343 0000 0004 HP9895 equ 4 9895 8" floppy / 913X 5.25" micro-winchester (HP-IB) 344 0000 0005 HP8290X equ 5 82900 series 5.25" minifloppy (HP-IB) 345 0000 0006 HP9885 equ 6 9885 8" floppy (GPIO) 346 0000 0007 HP913X_A equ 7 913X A 5-megabyte 5.25" micro-winchester (HPIB) 347 0000 0008 HP913X_B equ 8 913X B 10-megabyte 5.25" micro-winchester (HPIB) 348 0000 0009 HP913X_C equ 9 913X C 15-megabyte 5.25" micro-winchester (HPIB) 349 0000 000A HP7905 equ 10 7905 hard disc (HPIB) 350 0000 000B HP7906 equ 11 7906 hard disc (HPIB) 351 0000 000C HP7920 equ 12 7920 hard disc (HPIB) 352 0000 000D HP7925 equ 13 7925 hard disc (HPIB) 353 354 0000 0010 CS80_256 equ 16 Command Set '80 devices with 256-byte blocks (HPIB) 355 0000 0011 CS80_other equ 17 all other Command Set '80 devices (HPIB) 356 357 0000 0014 EPROM equ 20 EPROM card 358 359 0000 0016 Bubbles equ 22 Bubbles card 360 361 0000 001F Unknown equ 31 used while scanning before device type is known 362 363 364 * 365 * card ID equates 366 * 367 FFFF FFFF null_sc equ -1 fake ID; null select code 368 0000 0000 no_card equ 0 fake ID; no card present 369 0000 0001 hp98624 equ 1 external HPIB 370 0000 0002 hp98626 equ 2 serial 371 0000 0003 hp98622 equ 3 gpio 372 0000 0008 hp98625 equ 8 Simon (PHI) HPIB 373 0000 0014 hp98628 equ 20 datacom 374 0000 0020 intHPIB equ 32 fake ID; actually has no real ID of its own 375 376 377 * 378 * hardware related equates 379 * 380 0047 8000 intHPIBaddr equ $478000 internal HPIB address 381 382 PAGE 10 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW RAM MEMORY MAP AND EQUATES (LOWRAM)" 383 INCLUDE GREG:BOOTROM0 384 385 * sccs info: @(#) bootrom0 8.1 84/05/04 00:22:15 * 386 PAGE 11 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MID RAM MEMORY MAP AND EQUATES (BOOTROM0)" 389 ****************************************************************************** 390 * Mid RAM Memory Map and Equates * 391 ****************************************************************************** 392 FFFF FFF4 bootpass equ -12 Must be -10 reserved for Pascal Recover Block 393 FFFF FFF0 msus equ -16 394 FFFF FFEC zilch equ -20 395 FFFF FFEA found_msus equ -22 396 FFFF FFE6 found_list equ -26 Address Found LIST ******* Found Element: ****** 397 0000 0000 fnext equ 0 Next Element Address 398 0000 0004 fsel equ 4 Sub-selector (one byte) 399 0000 0005 fchar equ 5 Selector character (one byte) 400 0000 0006 fmsus equ 6 MSUS (4 bytes) 401 0000 000A fname equ 10 Filename (1 byte length) (1-255 bytes str) 402 FFFF FFE4 init equ -28 403 FFFF FEE4 filename equ -284 404 FFFF FEE0 disp_msus equ -288 Current Msus displayed by menu 405 FFFF FEDE sftype equ -290 File Type 406 FFFF FEDC disp_wrap equ -292 First wrap around of menu has not happened yet 407 FFFF FEDA next_line equ -294 Next available menu line PAGE 12 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HARDWARE PERIPHERALS EQUATES (BOOTROM0)" 410 ****************************************************************************** 411 * Hardware Peripherals Equates * 412 ****************************************************************************** 413 0044 E000 FBUFFER EQU $44E000 Floppy RAM buffer 414 0044 5000 XCMDREG EQU $445000 Extended CMD register 415 0044 5400 CLRXSTUS EQU $445400 Clear extended status 416 0044 C000 CMDREG EQU $44C000 Command register 417 0044 C002 TRKREG EQU $44C002 Track register 418 0044 C004 SECREG EQU $44C004 Sector register 419 0044 C006 DATAREG EQU $44C006 Data register 420 0000 0001 RESTORE EQU 1 RESTORE - TRACK 0 421 0000 0051 STPINU EQU $51 STEP IN & UPDATE 422 0000 0071 STPOUTU EQU $71 " OUT " 423 0000 00E0 RDTRK EQU $E0 READ TRACK 424 * 425 0042 8003 KCMDADDR EQU $428003 Keyboard CMD register 426 0042 8003 KBDSTATUS EQU $428003 Keyboard status register 427 0042 8001 KBDDATA EQU $428001 Keyboard data register 428 * 429 0047 8005 INT_HPIBSTATUS EQU $478005 INTERNAL HPIB STATUS BYTE (KBD NMI Decode) 430 0047 8003 INT_HPIB3 EQU $478003 INTERNAL HPIB STATUS BYTE (MARMOT CRT Decode) 431 0047 8000 INT_HPIB EQU $478000 SELECT CODE 432 0000 0011 INT0STAT EQU $11 INTR STAT 0 433 0000 0013 INT1STAT EQU $13 " " 1 434 0000 0011 INT0MASK EQU $11 435 0000 0013 INT1MASK EQU $13 436 0000 0017 BUSSTAT EQU $17 437 0000 0015 ADDRSTAT EQU $15 438 0000 0005 EXT_STAT EQU 5 IO CARD STATUS 439 0000 0007 SC EQU 7 SYS CNTRLR BIT 440 0000 0006 AC EQU 6 ACT CNTRLR BIT 441 0000 0019 ADDRESS EQU $19 PRIMARY ADDR REG 442 0000 0017 AUXCMD EQU $17 443 0000 0080 SWRST1 EQU $80 RESET CMD ON 444 0000 0000 SWRST0 EQU 0 " " OFF 445 0000 008F SIC1 EQU $8F SEND INTER CLEAR 446 0000 000F SIC0 EQU $F " " " OFF 447 0000 000C TCA EQU $C TAKE CNTRL ASYNC 448 0000 000B GTS EQU $B GO TO STANDBY 449 0000 0090 REN1 EQU $90 REMOTE ENABLE 450 0000 0010 REN0 EQU $10 " " OFF 451 0000 008A TON1 EQU $8A TALKER ONLY 452 0000 000A TON0 EQU $A " " OFF 453 0000 0089 LON1 EQU $89 LISTEN ONLY 454 0000 0009 LON0 EQU 9 " " OFF 455 0000 0093 DAI1 EQU $93 DISABLE INTERRUPTS 456 0000 0013 DAI0 EQU $13 " " OFF 457 * 458 0051 0000 CSEL EQU $510000 CRT SELECT CODE 459 0051 FFFE CRTID EQU $51FFFE CRT Configuration Identification Register 460 0053 0000 GSEL EQU $530000 CRT GRAPHICS SELECT CODE 461 0053 8000 GOFF EQU GSEL+$8000 CRT GRAPHICS OFF SELECT CODE 462 0051 FFFD CGRPHOFF EQU $51FFFD 9836C Color Graphics Off Location 463 0052 0000 CGRPHSTART EQU $520000 9836C Color Graphics RAM 464 0051 6004 SET60HZ EQU $516004 Read this location to set CRT to 60 Hz for A 465 0051 6000 SET50HZ EQU $516000 Read this location to set CRT to 50 Hz for A 466 0051 4001 BSET16MHZ EQU $514001 Set Burgess Board Oscillator for 80 wide PAGE 13 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HARDWARE PERIPHERALS EQUATES (BOOTROM0)" 467 0051 5001 BSET10MHZ EQU $515001 Set Burgess Board Oscillator for 50 wide 468 0051 0000 CRTC EQU CSEL 469 0051 2001 ALPHSTRT EQU $512001 470 0051 3001 ALPHSTP EQU $513001 471 0051 2704 CRTMA EQU CSEL+$2704 472 0051 21A0 CRTMB EQU CSEL+$2704-1380 473 0051 3140 CRTENDB EQU CRTMB+4000 474 0000 0064 CRTLLENA EQU 100 2 X LINE LENGTH FOR CRT 475 0000 00A0 CRTLLENB EQU 160 476 * 477 0056 0000 HRSEL EQU $560000 Gator (High Res CRT) INTERNAL select code 478 479 * HARD OFFSETS TO HRSEL (all are word) 480 481 0000 6001 REGSELECT EQU $6001 Offset to 6845 Register select (CRT proc. depdt.!) 482 0000 6003 REGVALUE EQU $6003 Offset to 6845 Register (CRT processor dependent!) 483 484 * ROM OFFSETS TO HRSEL (all are 2 bytes) 485 486 0000 0001 G_ID EQU $1 Offset to gator ID register 487 0000 0005 G_WIDTH EQU $5 Offset to width of frame buffer in pixels 488 0000 0009 G_HEIGHT EQU $9 Offset to height of frame buffer in pixels 489 0000 000D G_DWIDTH EQU $D Offset to width of displayed area in pixels 490 0000 0011 G_DHEIGHT EQU $11 Offset to height of displayed area in pixels 491 0000 001D G_IDREV EQU $1D Offset to gator ROM ID revision number 492 0000 0023 G_00 EQU $23 Offset to offset of ROM initialization region 0 493 0000 0027 G_01 EQU $27 Offset to offset of ROM initialization region 1 494 0000 002B G_10 EQU $2B Offset to offset of ROM initialization region 2 495 0000 002F G_11 EQU $2F Offset to offset of ROM initialization region 3 496 0000 003B G_FONT EQU $3B Offset to start of font space 497 0000 4001 GSTAT EQU $4001 Offset to gator status register 498 0000 4008 G_RRR EQU $4008 Offset to gator Replacement Rule Register 499 0000 400C G_WWR EQU $400C Offset to gator Window Width Register 500 501 * OFFSETS TO START OF A GIVEN FONT (all are single bytes) 502 503 0000 0000 CELLHEIGHT EQU $0 Offset to height of cell in pixels 504 0000 0002 CELLWIDTH EQU $2 Offset to width of cell in pixels 505 0000 0004 FONTDEPTH EQU $4 Offset to depth of cell in pixels 506 0000 0006 STARTCHAR EQU $6 Numeric value of fisrt character in font 507 0000 0008 ENDCHAR EQU $8 Numeric value of last character in font 508 0000 0010 FONTSTART EQU $10 First character in font 509 510 * 511 0045 8021 BATTERYSTATUS EQU $458021 BATTERY STATUS BYTE 512 0045 8001 BATTERYDATA EQU $458001 BATTERY DATA BYTE 513 * 514 0001 FFFF LEDS EQU $1FFFF Address of Test L.E.D.s 515 * 516 005F 0001 prom EQU $5F0001 Byte Address of PROM 517 005F 0000 PROCID EQU $5F0000 Address of Processor Configuration Register 518 0000 0000 T_LOOP EQU 0 Self-Test Loop Bit 519 0000 0001 RAM_L EQU 1 RAM_TEST is Long Bit 520 * 521 005F 4002 MMU_SSTP EQU $5F4002 SYSTEM SEGMENT TABLE POINTER 522 005F 4006 MMU_USTP EQU $5F4006 USER SEGMENT TABLE POINTER 523 005F 400A MMU_TLBP EQU $5F400A TRANSLATION LOOKASIDE BUFFER PURGE PAGE 14 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HARDWARE PERIPHERALS EQUATES (BOOTROM0)" 524 005F 400E MMU_CASR EQU $5F400E CONTROL AND STATUS REGISTER 525 * 526 0050 0000 DMA_DISARM0 EQU $500000 DMA Channel 0 Disarm address 527 * 528 0000 0080 DLAB EQU $80 529 0000 0016 LCR EQU $16 530 0000 0018 MCR EQU $18 531 0000 0012 UDIV EQU $12 532 0000 0010 LDIV EQU $10 533 0000 0010 SIODATA EQU $10 534 0000 001F ECHO EQU $1F PAGE 15 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM FIXED SOFTWARE (MONITOR AND TESTROM) (BOOTROM0) 537 ****************************************************************************** 538 * Fixed Software (Monitor and TestROM) * 539 ****************************************************************************** 540 0088 0000 MONITOR EQU $00880000 Monitor start address 541 0088 0024 MONITOR_ENTRY EQU $00880024 Rentry to Monitor 542 0081 0000 TESTROM EQU $00810000 TEST ROM Start 543 0081 0000 TESTROM_ENTRY EQU $00810000 TEST ROM Start Execution Address 544 0081 87FA TBUSERRV EQU $008187FA TEST ROM Bus Error Handler 545 0080 8000 REDBOARD1 EQU $00808000 Take Exception to RED Board 546 0080 1D7C REDBOARD2 EQU $00801D7C Take Exception to RED Board 547 0000 0100 FAKE_STACK EQU $00000100 Stack for Bus Error Handling without RAM 548 0001 0000 BOOT_END EQU $00010000 End of BOOTROM+1 (64K Bytes for Now) 549 0001 0000 ROM_START EQU $00010000 ROM Space Start (64K Bytes for Now) 550 E0FF FFFF rom_msus equ $E0FFFFFF Mass Storage Specifier for a ROM System 551 0000 FFFF mini0_msus equ $0000FFFF Mass Storage Specifier for Internal Drive 0 552 0500 0700 minext_msus equ $05000700 Mass Storage Specifier for M700,0 553 0000 0000 sysglobals equ 0 For PASCAL routines called in BOOTROM 554 555 ****************************************************************************** 556 * Instruction Equates * 557 ****************************************************************************** 558 0000 4EF9 JMPOP EQU $4EF9 JUMP LONG OPCODE 559 0000 4EB9 JSROP EQU $4EB9 JSR LONG OPCODE 560 0000 4E75 RTSOP EQU $4E75 RTS OPCODE 561 562 ****************************************************************************** 563 * ASCII Character Set Equates * 564 ****************************************************************************** 565 0000 0005 ENQ EQU 5 566 0000 0006 ACK EQU 6 567 0000 000D CR EQU 13 568 0000 0011 DC1 EQU 17 569 0000 0013 DC3 EQU 19 570 PAGE 16 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM FIXED SOFTWARE (MONITOR AND TESTROM) (BOOTROM0) 572 ****************************************************************************** 573 * Self-test LED Error Code Equates * 574 * LEDs are Negative True (e.g. FF is all off, 00 is all on) * 575 * (Comments Below are Positive True.) * 576 * Failure Indications: * 577 * State Indication Only: * 578 * 00SS SSSS Where SS SSSS Indicates State of Power-up * 579 * Required Device Missing or DTCK Failure: * 580 * 01SS SSSS Where SS SSSS Indicates Device * 581 * Failing Device: * 582 * 10SS SSSS Where SS SSSS Indicates Device * 583 * Unused Codes: * 584 * 11SS SSSS 64 Unused Codes * 585 * Special Codes: * 586 * 1111 1111 LEDs Never Accessed (or Unused Code) * 587 * 0111 1111 LEDs Failed to DTCK (or I/O 31 Missing) * 588 * State or Device Codes: * 589 * Highest Priority Miscellaneous: * 590 * XX00 MMMM Where MMMM indicates Failure * 591 * Internal Peripheral Failure: * 592 * XX01 PPPP Where PPPP is Peripheral Number * 593 * I/O Card Failure: * 594 * XX1S SSSS Where S SSSS is Select Code * 595 ****************************************************************************** 596 0000 0000 offf equ 0 All Led's OFF, no Failure 597 598 * Miscellaneous: XX00 MMMM Where MMMM Indicates Failure 599 0000 0001 regf equ 00+1 CPU Register Test failure 600 * equ 00+2 *** Spare 1 601 0000 0003 romf equ 00+3 Boot ROM Checksum Failure 602 0000 0004 tramf equ 00+4 Top RAM test Failure 603 * equ 00+5 *** Spare 2 604 0000 0006 bootf equ 00+6 Searching for BOOT Extension ROMs 605 0000 0007 testf equ 00+7 Starting Test Vector List 606 0000 0008 rampf equ 00+8 Preloading RAM 607 0000 0009 ramf equ 00+9 RAM Failure 608 0000 000A ramsf equ 00+10 Insufficient RAM failure 609 0000 000B promf equ 00+11 PROM Failure 610 * equ 00+12 *** Spare 3 611 0000 000D romcf equ 00+13 ROM System Failure 612 * equ 00+14,15 *** Spares 4-5 613 614 * Internal Peripheral: XX01 PPPP Where PPPP is Peripheral Number 615 * equ 16+0 *** Spare 6 616 * equ 16+1 *** Spare 7 617 0000 0012 keyf equ 16+2 Keyboard Failure 618 * equ 16+3 *** Spare 8 619 0000 0014 hpibf equ 16+4 Internal HPIB Failure 620 * equ 16+5 *** Spare 9 621 0000 0016 flopf equ 16+6 Internal Mass Storage Failure 622 * equ 16+7 *** Spare 10 623 0000 0018 dmaf equ 16+8 DMA Card Failure 624 * equ 16+9 *** Spare 11 625 0000 001A batf equ 16+10 Battery Failure 626 * equ 16+11 *** Spare 12 627 0000 001C nofont equ 16+12 High Resolution CRT has no font 628 0000 001D gatorf equ 16+13 Internal Hi Res CRT (Gator) Failure PAGE 17 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM FIXED SOFTWARE (MONITOR AND TESTROM) (BOOTROM0) 629 0000 001E crtf equ 16+14 CRT Failure 630 0000 001F grphf equ 16+15 Graphics Failure 631 632 * External I/O Card: XX1S SSSS Where S SSSS is Select Code Number 633 0000 0020 iocardf equ 32+0 I/O Card Failure on Select Code 0 634 * equ 32+1 I/O Card Failure on Select Code 1 635 * equ 32+2 I/O Card Failure on Select Code 2 636 * ... ... ... 637 * equ 32+31 I/O Card Failure on Select Code 31 638 PAGE 18 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM FIXED SOFTWARE (MONITOR AND TESTROM) (BOOTROM0) 640 ****************************************************************************** 641 * PROM Memory Offsets * 642 ****************************************************************************** 643 0000 0000 prom_chksm equ 0 Two bytes of Prom checksum 644 0000 0004 prom_size equ 4 Prom size byte 645 0000 0006 prom_serial equ 6 11 ASCII Serial Digits 646 0000 001C prom_prod equ 28 7 ASCII Product Name characters 647 0000 002A prom_proc equ 42 Processor ID Register Byte 648 0000 002C prom_per equ 44 16 Bytes of Required Peripherals 649 0000 004C prom_mem equ 76 4 Bytes of Required Memory 650 0000 0054 prom_io equ 84 32 Bytes of Required I/O Cards 651 0000 0094 prom_msus equ 148 4 Byte Boot MSUS 652 0000 009C prom_filename equ 156 STRING[16] Boot Filename 653 0000 00BE prom_wait equ 190 4 Byte Millisecond pre-boot delay 654 0000 00C6 prom_id equ 198 Owner Byte: Zero means it's HP DCD 655 0000 00C8 prom_rev equ 200 1 Byte PROM Rev # PAGE 19 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MODULE REFS AND DEFS (BOOTROM0)" 658 ****************************************************************************** 659 * Module REFs and DEFs * 660 ****************************************************************************** 661 refr miscasm_delay processor/timer independent delay routine 662 refr sr_init_links Init Device Driver and Dir. Manager Lists 663 lmode sr_init_links 664 refa d_sodlif Driver List entry for Logical Interchange Format 665 refa d_sodsdf Driver List entry for Mid-Range Format 666 refa d_sodunix Driver List entry for Unix Format 667 refa SPSOD_extd_active1 668 refa SPSOD_extd_active2 669 refa SPSOD_mini_active1 670 refa SPSOD_mini_active2 671 refa spsod_eprom_active1 672 refa spsod_eprom_active2 673 refa SPSOD_bubl_active1 674 refa SPSOD_bubl_active2 675 refa SPSOD_next_system 676 refa ganglia_init 677 refa ganglia_fopen 678 refa ganglia_read 679 refa ganglia_fclose 680 refa ganglia_active1 681 refa ganglia_active2 682 refa ganglia_next_system 683 * Mini-Floppy Device Driver Entries 684 def ddmini_setdevicename Return Name of Device 685 def ddmini_deviceread Read Bytes 686 def ddmini_unit_init Initialize Device 687 * EPROM Memory Device Driver Entries 688 def ddeprom_setdevicename 689 def ddeprom_deviceread 690 def ddeprom_unit_init 691 * Mass Storage Error Display 692 def dsp_ri_error 693 * 694 def sysglobals 695 * Processor type dependecy stuff PAGE 20 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW ROM EXCEPTION VECTORS AND JUMP TABLES (BOOT 698 ****************************************************************************** 699 ****************************************************************************** 700 *** *** 701 *** Low ROM Exception Vectors and Jump Tables *** 702 *** *** 703 ****************************************************************************** 704 ****************************************************************************** 705 706 ****************************************************************************** 707 * Low ROM Exception Vectors * 708 ****************************************************************************** 709 00000000 RORG $0 {gll} 710 0000 0000 BOOTSTART EQU * {gll} 711 0000 0000 START * {gll} 712 00000000 0000 0100 DC.L FAKE_STACK {gll} 713 00000004 0000 0408 DC.L RESET_START {gll} 714 00000008 0000 4DD6 DC.L HBUSERROR BUS ERROR 715 0000000C FFFF FFF4 DC.L $FFFFFFF4 ADDRESS ERROR 716 00000010 FFFF FFEE DC.L $FFFFFFEE INSTRUCTION ERROR 717 00000014 FFFF FFE8 DC.L $FFFFFFE8 ZERO DIVIDE 718 00000018 FFFF FFE2 DC.L $FFFFFFE2 CHK TRAP 719 0000001C FFFF FFDC DC.L $FFFFFFDC TRAPV 720 00000020 FFFF FFD6 DC.L $FFFFFFD6 PRIVILEGE VIOLATION 721 00000024 FFFF FFD0 DC.L $FFFFFFD0 TRACE TRAP 722 00000028 FFFF FFCA DC.L $FFFFFFCA INSTRUCTION 1010 723 0000002C FFFF FFC4 DC.L $FFFFFFC4 INSTRUCTION 1111 724 00000030 0000 0000 DC.L 0,0,0,0,0,0,0,0,0,0,0,0 'RESERVED' VECTORS 725 00000060 FFFF FF1C DC.L $FFFFFF1C SPURIOUS INTERUPT 726 00000064 FFFF FFBE DC.L $FFFFFFBE INTERUPT LEVEL 1 727 00000068 FFFF FFB8 DC.L $FFFFFFB8 LEVEL 2 728 0000006C FFFF FFB2 DC.L $FFFFFFB2 LEVEL 3 729 00000070 FFFF FFAC DC.L $FFFFFFAC LEVEL 4 730 00000074 FFFF FFA6 DC.L $FFFFFFA6 LEVEL 5 731 00000078 FFFF FFA0 DC.L $FFFFFFA0 LEVEL 6 732 0000007C FFFF FF9A DC.L $FFFFFF9A LEVEL 7 733 00000080 FFFF FF94 DC.L $FFFFFF94 TRAP 0 734 00000084 FFFF FF8E DC.L $FFFFFF8E 1 735 00000088 FFFF FF88 DC.L $FFFFFF88 2 736 0000008C FFFF FF82 DC.L $FFFFFF82 3 737 00000090 FFFF FF7C DC.L $FFFFFF7C 4 738 00000094 FFFF FF76 DC.L $FFFFFF76 5 739 00000098 FFFF FF70 DC.L $FFFFFF70 6 740 0000009C FFFF FF6A DC.L $FFFFFF6A 7 741 000000A0 FFFF FF64 DC.L $FFFFFF64 8 742 000000A4 FFFF FF5E DC.L $FFFFFF5E 9 743 000000A8 FFFF FF58 DC.L $FFFFFF58 A 744 000000AC FFFF FF52 DC.L $FFFFFF52 B 745 000000B0 FFFF FF4C DC.L $FFFFFF4C C 746 000000B4 FFFF FF46 DC.L $FFFFFF46 D 747 000000B8 FFFF FF40 DC.L $FFFFFF40 E 748 000000BC FFFF FF3A DC.L $FFFFFF3A F 749 000000C0 0000 0000 DC.L 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 'RESERVED' VECTORS 750 ****************************************************************************** 751 * User Interrupt Vectors 64-72 * 752 * These Vectors are available in previous BOOTROMs also * 753 ****************************************************************************** 754 00000100 FFFF FF16 DC.L $FFFFFF16 I/O VECTOR 0 PAGE 21 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW ROM EXCEPTION VECTORS AND JUMP TABLES (BOOT 755 00000104 FFFF FF10 DC.L $FFFFFF10 1 756 00000108 FFFF FF0A DC.L $FFFFFF0A 2 757 0000010C FFFF FF04 DC.L $FFFFFF04 3 758 00000110 FFFF FEFE DC.L $FFFFFEFE 4 759 00000114 FFFF FEF8 DC.L $FFFFFEF8 5 760 00000118 FFFF FEF2 DC.L $FFFFFEF2 6 761 0000011C FFFF FEEC DC.L $FFFFFEEC 7 PAGE 22 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW ROM EXCEPTION VECTORS AND JUMP TABLES (BOOT 763 ****************************************************************************** 764 * Low ROM Jump Tables * 765 * These Stomp over User Interrupt Vectors 73-122 to remain compatible * 766 * with previous BOOTROMs and Software. * 767 ****************************************************************************** 768 * JUMP TABLE FOR FLOPPY DRIVERS 769 00000120 4EFA 71EA JMP FLPYREAD ONE SECTOR READ WITH MOVE 770 00000124 4EFA 763A JMP FLPY_WRT ONE SECTOR WRITE 771 00000128 4EFA 77EC JMP FINTRUPT ISR FOR MINI FLOPPY 772 0000012C 4EFA 78B2 JMP FLPYINIT MINI FLOPPY FORMAT (INITIALIZE) 773 00000130 4EFA 6E72 JMP FLPYMREAD MULTI SECTOR READ WITH MOVE 774 00000134 4EFA 6EFC JMP FLPYMWRITE MULTI SECTOR WRITE 775 00000138 4EFA 6EBC JMP FLPYSREAD ONE SECTOR READ NO MOVE 776 0000013C 4EFA 5106 JMP CRTINIT Initialize CRT registers R0-R11 777 00000140 4EFA 42C4 JMP GO START A SYSTEM 778 00000144 4EFA 74DC JMP FLPY_RST INITIALIZE THE FLOPPY DRIVERS 779 * JUMP TABLE FOR CRT UTILITIES 780 00000148 4EFA 528A JMP CRTCLEAR CRT INIT AND CLEAR 781 0000014C 4EFA 5274 JMP CRTBLANK CRT RAM CLEAR (BLANK) 782 00000150 4EFA 53A6 JMP CRTMSG PUT SINGLE LINE OF TEXT ON CRT 783 00000154 0000 6186 DC.L KTRANS KEYBOARD CONVERSION TABLE 784 00000158 4EFA 53A4 JMP GRPHCLEAR BLANK(ZERO) GRAPHICS RAM 785 * JUMP TABLE FOR KEY BOARD UTILITIES 786 0000015C 4EFA 5E9E JMP KBD_NO_INT WAIT FOR INTERUPT TO CLEAR (AFTER NMI CLEAR) 787 00000160 4EFA 5EB2 JMP KBD_CWAIT WAIT FOR LAST COMMAND 788 00000164 4EFA 5F16 JMP KBD_WCMD WRITE COMMAND 789 00000168 4EFA 5F1E JMP KBD_WDATA WRITE DATA 790 0000016C 4EFA 5F28 JMP KBD_RDATA READ DATA 791 * JUMP TABLE FOR BATTERY COMMANDS 792 00000170 4EFA 47B0 JMP CHK_BATTERY CHK FOR BATTERY (SETS BATTERY FLAG) 793 00000174 4EFA 4806 JMP BAT_NO_INT WAIT FOR INTERUPT TO CLEAR (AFTER NMI CLEAR) 794 00000178 4EFA 4888 JMP BAT_CWAIT WAIT FOR LAST COMMAND 795 0000017C 4EFA 48F8 JMP BAT_WCMD WRITE COMMAND 796 00000180 4EFA 4902 JMP BAT_WDATA WRITE DATA 797 00000184 4EFA 4910 JMP BAT_RDATA READ DATA 798 * JUMP TABLE FOR LIF / LOADER UTILITIES 799 00000188 4EFA 4D94 JMP SOFTLOAD DIRECT CALL TO LOADER 800 0000018C 4EFA 4E60 JMP LIFHEAD VALIDATE LIF HEADER 801 00000190 4EFA 4ECA JMP FINDFILE FIND LIF FILE OF GIVEN NAME AND TYPE 802 00000194 4EFA 4F3C JMP LOADFILE LOAD A FILE OF 'BLOCKS' 803 00000198 4EFA 4F4E JMP BLOCKLOAD LOAD A SINGLE BLOCK 804 * JUMP TABLE FOR MISCELANEOUS UTILITIES 805 0000019C 4EFA 0266 JMP reset_test TEST ROM JUMPS HERE WHEN DONE {ag} 806 000001A0 4EFA 4CA4 JMP RTN_TO_MONITOR SYSTEM COMES HERE ON CTL SHIFT PAUSE 807 000001A4 4EFA 3F06 JMP REQ_REBOOT SYSTEM REQUESTED REBOOT 808 000001A8 4EFA 4AEC JMP BIN_TO_DEC D0 TO DECIMAL CONVERSION 809 000001AC 4EFA 4B18 JMP PNT8HEX D0 TO ASCII HEX CONVERSION 810 000001B0 0000 4E80 DC.L NMI_DECODE ADDRESS OF NMI DECODE ISRi 811 000001B4 4EFA 4C52 JMP BOOT_BUSERROR BUS ERROR SERVICE ROUTINE 812 000001B8 4EFA 4D02 JMP CRASH SYSTEM CALLED CRASH ROUTINE 813 000001BC 4EFA 6EC8 JMP FMSGS FLOPPY ERROR MESSAGES 814 000001C0 4EFA 3F1E JMP REQ_BOOT SYSTEM SWITCH 815 000001C4 4EFA 5F4C JMP READ_KEYS READ AND TRANSLATE A KEY 816 000001C8 4EFA 624C JMP BEEP COMMAND TO KBD BEEPER 817 * JUMP TABLE FOR FLOPPY TEST PROGRAM ACCESS TO LOW LEVEL UTILITIES 818 000001CC 4EFA 7718 JMP FWAITINR 819 000001D0 4EFA 75C8 JMP F_SET_UP PAGE 23 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW ROM EXCEPTION VECTORS AND JUMP TABLES (BOOT 820 000001D4 4EFA 7222 JMP FMOTORON 821 000001D8 4EFA 7796 JMP F_CLOCK 822 000001DC 4EFA 7A7C JMP FTRKINIT 823 000001E0 4EFA 7C7A JMP FSECTBLE 824 000001E4 4EFA 73E6 JMP FRESET 825 000001E8 4EFA 6D7C JMP FSETDRIVE LINK TO SET FLOPPY CONTROLLER TO DRIVE 826 827 ****************************************************************************** 828 * User Interrupt Vectors Reserved for Monitor (123-124) * 829 * These are reserved for use by a Hardware Monitor. * 830 * The 1.0 and 2.0 BOOTROMs did not have these. * 831 ****************************************************************************** 832 000001EC 0080 8000 dc.l redboard1 123: Red Board Monitor 833 000001F0 0080 1D7C dc.l redboard2 124: Red Board Monitor 834 835 ****************************************************************************** 836 * User Interrupt Vectors (125-255) * 837 * These vectors were not available in the 1.0 and 2.0 BOOTROMs. * 838 ****************************************************************************** 839 000001F4 FFFF F400 dc.l uvec-12 User Interrupt Vector 125 840 000001F8 FFFF F406 dc.l uvec-6 User Interrupt Vector 126 841 000001FC FFFF F40C dc.l uvec User Interrupt Vector 127 842 00000200 FFFF F412 dc.l uvec+6 128 843 00000204 FFFF F418 dc.l uvec+12 129 844 00000208 FFFF F41E dc.l uvec+18 130 845 0000020C FFFF F424 dc.l uvec+24 131 846 00000210 FFFF F42A dc.l uvec+30 132 847 00000214 FFFF F430 dc.l uvec+36 133 848 00000218 FFFF F436 dc.l uvec+42 134 849 0000021C FFFF F43C dc.l uvec+48 135 850 00000220 FFFF F442 dc.l uvec+54 136 851 00000224 FFFF F448 dc.l uvec+60 137 852 00000228 FFFF F44E dc.l uvec+66 138 853 0000022C FFFF F454 dc.l uvec+72 139 854 00000230 FFFF F45A dc.l uvec+78 140 855 00000234 FFFF F460 dc.l uvec+84 141 856 00000238 FFFF F466 dc.l uvec+90 142 857 0000023C FFFF F46C dc.l uvec+96 143 858 00000240 FFFF F472 dc.l uvec+102 144 859 00000244 FFFF F478 dc.l uvec+108 145 860 00000248 FFFF F47E dc.l uvec+114 146 861 0000024C FFFF F484 dc.l uvec+120 147 862 00000250 FFFF F48A dc.l uvec+126 148 863 00000254 FFFF F490 dc.l uvec+132 149 864 00000258 FFFF F496 dc.l uvec+138 150 865 0000025C FFFF F49C dc.l uvec+144 151 866 00000260 FFFF F4A2 dc.l uvec+150 152 867 00000264 FFFF F4A8 dc.l uvec+156 153 868 00000268 FFFF F4AE dc.l uvec+162 154 869 0000026C FFFF F4B4 dc.l uvec+168 155 870 00000270 FFFF F4BA dc.l uvec+174 156 871 00000274 FFFF F4C0 dc.l uvec+180 157 872 00000278 FFFF F4C6 dc.l uvec+186 158 873 0000027C FFFF F4CC dc.l uvec+192 159 874 00000280 FFFF F4D2 dc.l uvec+198 160 875 00000284 FFFF F4D8 dc.l uvec+204 161 876 00000288 FFFF F4DE dc.l uvec+210 162 PAGE 24 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW ROM EXCEPTION VECTORS AND JUMP TABLES (BOOT 877 0000028C FFFF F4E4 dc.l uvec+216 163 878 00000290 FFFF F4EA dc.l uvec+222 164 879 00000294 FFFF F4F0 dc.l uvec+228 165 880 00000298 FFFF F4F6 dc.l uvec+234 166 881 0000029C FFFF F4FC dc.l uvec+240 167 882 000002A0 FFFF F502 dc.l uvec+246 168 883 000002A4 FFFF F508 dc.l uvec+252 169 884 000002A8 FFFF F50E dc.l uvec+258 170 885 000002AC FFFF F514 dc.l uvec+264 171 886 000002B0 FFFF F51A dc.l uvec+270 172 887 000002B4 FFFF F520 dc.l uvec+276 173 888 000002B8 FFFF F526 dc.l uvec+282 174 889 000002BC FFFF F52C dc.l uvec+288 175 890 000002C0 FFFF F532 dc.l uvec+294 176 891 000002C4 FFFF F538 dc.l uvec+300 177 892 000002C8 FFFF F53E dc.l uvec+306 178 893 000002CC FFFF F544 dc.l uvec+312 179 894 000002D0 FFFF F54A dc.l uvec+318 180 895 000002D4 FFFF F550 dc.l uvec+324 181 896 000002D8 FFFF F556 dc.l uvec+330 182 897 000002DC FFFF F55C dc.l uvec+336 183 898 000002E0 FFFF F562 dc.l uvec+342 184 899 000002E4 FFFF F568 dc.l uvec+348 185 900 000002E8 FFFF F56E dc.l uvec+354 186 901 000002EC FFFF F574 dc.l uvec+360 187 902 000002F0 FFFF F57A dc.l uvec+366 188 903 000002F4 FFFF F580 dc.l uvec+372 189 904 000002F8 FFFF F586 dc.l uvec+378 190 905 000002FC FFFF F58C dc.l uvec+384 191 906 00000300 FFFF F592 dc.l uvec+390 192 907 00000304 FFFF F598 dc.l uvec+396 193 908 00000308 FFFF F59E dc.l uvec+402 194 909 0000030C FFFF F5A4 dc.l uvec+408 195 910 00000310 FFFF F5AA dc.l uvec+414 196 911 00000314 FFFF F5B0 dc.l uvec+420 197 912 00000318 FFFF F5B6 dc.l uvec+426 198 913 0000031C FFFF F5BC dc.l uvec+432 199 914 00000320 FFFF F5C2 dc.l uvec+438 200 915 00000324 FFFF F5C8 dc.l uvec+444 201 916 00000328 FFFF F5CE dc.l uvec+450 202 917 0000032C FFFF F5D4 dc.l uvec+456 203 918 00000330 FFFF F5DA dc.l uvec+462 204 919 00000334 FFFF F5E0 dc.l uvec+468 205 920 00000338 FFFF F5E6 dc.l uvec+474 206 921 0000033C FFFF F5EC dc.l uvec+480 207 922 00000340 FFFF F5F2 dc.l uvec+486 208 923 00000344 FFFF F5F8 dc.l uvec+492 209 924 00000348 FFFF F5FE dc.l uvec+498 210 925 0000034C FFFF F604 dc.l uvec+504 211 926 00000350 FFFF F60A dc.l uvec+510 212 927 00000354 FFFF F610 dc.l uvec+516 213 928 00000358 FFFF F616 dc.l uvec+522 214 929 0000035C FFFF F61C dc.l uvec+528 215 930 00000360 FFFF F622 dc.l uvec+534 216 931 00000364 FFFF F628 dc.l uvec+540 217 932 00000368 FFFF F62E dc.l uvec+546 218 933 0000036C FFFF F634 dc.l uvec+552 219 PAGE 25 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LOW ROM EXCEPTION VECTORS AND JUMP TABLES (BOOT 934 00000370 FFFF F63A dc.l uvec+558 220 935 00000374 FFFF F640 dc.l uvec+564 221 936 00000378 FFFF F646 dc.l uvec+570 222 937 0000037C FFFF F64C dc.l uvec+576 223 938 00000380 FFFF F652 dc.l uvec+582 224 939 00000384 FFFF F658 dc.l uvec+588 225 940 00000388 FFFF F65E dc.l uvec+594 226 941 0000038C FFFF F664 dc.l uvec+600 227 942 00000390 FFFF F66A dc.l uvec+606 228 943 00000394 FFFF F670 dc.l uvec+612 229 944 00000398 FFFF F676 dc.l uvec+618 230 945 0000039C FFFF F67C dc.l uvec+624 231 946 000003A0 FFFF F682 dc.l uvec+630 232 947 000003A4 FFFF F688 dc.l uvec+636 233 948 000003A8 FFFF F68E dc.l uvec+642 234 949 000003AC FFFF F694 dc.l uvec+648 235 950 000003B0 FFFF F69A dc.l uvec+654 236 951 000003B4 FFFF F6A0 dc.l uvec+660 237 952 000003B8 FFFF F6A6 dc.l uvec+666 238 953 000003BC FFFF F6AC dc.l uvec+672 239 954 000003C0 FFFF F6B2 dc.l uvec+678 240 955 000003C4 FFFF F6B8 dc.l uvec+684 241 956 000003C8 FFFF F6BE dc.l uvec+690 242 957 000003CC FFFF F6C4 dc.l uvec+696 243 958 000003D0 FFFF F6CA dc.l uvec+702 244 959 000003D4 FFFF F6D0 dc.l uvec+708 245 960 000003D8 FFFF F6D6 dc.l uvec+714 246 961 000003DC FFFF F6DC dc.l uvec+720 247 962 000003E0 FFFF F6E2 dc.l uvec+726 248 963 000003E4 FFFF F6E8 dc.l uvec+732 249 964 000003E8 FFFF F6EE dc.l uvec+738 250 965 000003EC FFFF F6F4 dc.l uvec+744 251 966 000003F0 FFFF F6FA dc.l uvec+750 252 967 000003F4 FFFF F700 dc.l uvec+756 253 968 000003F8 FFFF F706 dc.l uvec+762 254 969 000003FC FFFF F70C dc.l uvec+768 255 PAGE 26 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 972 ****************************************************************************** 973 ****************************************************************************** 974 *** *** 975 *** Power Up Supervisor *** 976 *** *** 977 *** Entries Supported Externally for Old Systems: *** 978 *** RESET_TEST ($19C) Test Rom Jumps Here When Done *** 979 *** RESET_START Power-up Jumps here *** 980 *** RESET RESET key comes here *** 981 *** *** 982 *** Entries Supported Internally for BOOTROM: *** 983 *** SELF_TEST Restart Point For Self-Test and Booting *** 984 *** RAMTEST Test A RAM Section *** 985 ****************************************************************************** 986 ****************************************************************************** 987 988 ****************************************************************************** 989 * RESET: Reset Key comes here * 990 * Assumed Conditions: sr=level 7,supervisor mode * 991 * d6 has bit 4 of sysflag correct to * 992 * specify whether CRT ID Register is * 993 * present. Checking is done only once * 994 * at power-up or when testrom returns. * 995 * Checking will turn CRT OFF then back * 996 * on in 9826's, 9836's, and MARMOT's. * 997 ****************************************************************************** 998 00000400 7A01 reset moveq #1,d5 Don't Recompute CRT I.D. 999 00000402 6052 bra.s reset_pload Skip CPU Register Test 1000 1001 ****************************************************************************** 1002 * RESET_TEST: ($19C) (Test Rom Jumps Here When Done) * 1003 * Assumed Conditions: sr=level 7,supervisor mode * 1004 ****************************************************************************** 1005 00000404 7A02 reset_test moveq #2,d5 TestInfo (Don't Look for TEST ROM) 1006 * But do recompute CRT I.D. 1007 00000406 604E bra.s reset_pload Skip CPU Register Test 1008 1009 ****************************************************************************** 1010 * RESET_START: Start of Power up * 1011 * Assumed Conditions: sr=level 7,supervisor mode * 1012 ****************************************************************************** 1013 1014 ****************************************************************************** 1015 * CPU Test * 1016 ******************************************************************************l 1017 00000408 4FF8 0000 reset_start lea 0,a7 1018 0000040C 2C4F reset_reg0 movea.l a7,a6 Pass a7, 5's, A's thru reg.s 1019 0000040E 2A4E movea.l a6,a5 1020 00000410 284D movea.l a5,a4 1021 00000412 264C movea.l a4,a3 1022 00000414 244B movea.l a3,a2 1023 00000416 224A movea.l a2,a1 1024 00000418 2049 movea.l a1,a0 1025 0000041A 2008 move.l a0,d0 1026 0000041C 2200 move.l d0,d1 1027 0000041E 2401 move.l d1,d2 1028 00000420 2602 move.l d2,d3 PAGE 27 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1029 00000422 2803 move.l d3,d4 1030 00000424 2A04 move.l d4,d5 1031 00000426 2C05 move.l d5,d6 1032 00000428 2E06 move.l d6,d7 1033 0000042A BE8F cmp.l a7,d7 1034 0000042C 661A bne.s reset_reg1 Not equal, Give me a break 1035 0000042E BEBC AAAA cmp.l #$AAAAAAAA,d7 End of Third Pass? AAAA 1036 00000434 671E beq.s reset_reg2 Yes 1037 00000436 2E7C 5555 movea.l #$55555555,a7 No, set up for 2nd Pass 5555 1038 0000043C 4A87 tst.l d7 End of 1st Pass 1039 0000043E 67CC beq.s reset_reg0 Yes, do Pass 2 1040 00000440 2E7C AAAA movea.l #$AAAAAAAA,a7 No, set up for Third Pass AAAA 1041 00000446 60C4 bra.s reset_reg0 and do Third Pass 1042 00000448 13FC 007E reset_reg1 move.b #-1-regf+$80,leds Indicate Failure 0001 FFFF 1043 00000450 4E72 2700 stop #$2700 And Die here 1044 00000454 51C5 reset_reg2 sf d5 Test Info (Look for TEST ROM) 1045 * And Compute CRT I.D. Presence 1046 1047 ****************************************************************************** 1048 * Position Floating RAM and Pre-load Top RAM Section * 1049 ****************************************************************************** 1050 00000456 4FF8 0100 reset_pload lea fake_stack,sp Set up sp for w/o RAM bus errors 1051 0000045A 4DFA 003E lea reset_pload2,a6 If it Bus Errors, We are at end 1052 0000045E 203C EEEE move.l #$EEEE1111,d0 Do 64 bytes at once 1111 1053 00000464 2200 move.l d0,d1 1054 00000466 2401 move.l d1,d2 1055 00000468 2602 move.l d2,d3 1056 0000046A 2803 move.l d3,d4 1057 0000046C 2E04 move.l d4,d7 1058 0000046E 2447 movea.l d7,a2 1059 00000470 264A movea.l a2,a3 1060 00000472 43F8 C000 lea topram,a1 Lowest RAM to test Now 1061 00000476 41F8 0000 lea 0,a0 1062 0000047A 48E0 F930 reset_pload1 movem.l a2-a3/d0-d4/d7,-(a0) 1063 0000047E B1C9 cmpa.l a1,a0 1064 00000480 62F8 bhi.s reset_pload1 1065 00000482 41F8 FFFF lea -1,a0 Quick Scan to Set Floating RAM 1066 00000486 203C 0001 move.l #$10000,d0 Scan in 64K blocks 0000 1067 0000048C 227C FF80 movea.l #$FF800000,a1 Lowest Allowed Place for RAM 0000 1068 00000492 4A10 reset_float tst.b (a0) 1069 00000494 91C0 suba.l d0,a0 1070 00000496 B1C9 cmpa.l a1,a0 1071 00000498 62F8 bhi.s reset_float 1072 0000 049A reset_pload2 equ * 1073 1074 ****************************************************************************** 1075 * Ripple LEDS From On to OFF * 1076 * All LEDs on at Power-up RESET. At end Bit Zero is still On. * 1077 * This code is also used to delay time between memory preload and * 1078 * memory read, to check for refresh failure. (500 ms is required.) * PAGE 28 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1079 * Modified 1/18/84 by Anny Randel to (hopefully) take at least 500ms * 1080 * even if you have a 68010 or 68012. * 1081 ****************************************************************************** 1082 0000049A 4DFA 001C reset_leds lea reset_leds2,a6 If LEDs bus ERROR, skip this 1083 0000049E 7E80 moveq #$80,d7 No LEDs yet; start with one off 1084 000004A0 70FF moveq #-1,d0 Wait 2^16 for each value 1085 000004A2 13C7 0001 reset_leds1 move.b d7,leds FFFF 1086 000004A8 2602 reset_leds3 move.l d2,d3 Kill time 1087 000004AA 2403 move.l d3,d2 Kill more time & prevent 68010 1088 * from doing fast dbra loop 1089 000004AC 51C8 FFFA dbra d0,reset_leds3 Wait until -1 again 1090 000004B0 E207 asr.b #1,d7 Turn off another led 1091 000004B2 BE00 cmp.b d0,d7 Stop with least significant led 1092 000004B4 66EC bne.s reset_leds1 on 1093 000004B6 E24F lsr #1,d7 Indicate that LEDs DTACK OK 1094 0000 04B8 reset_leds2 equ * 1095 1096 ****************************************************************************** 1097 * Look for TEST ROM here. * 1098 * This is the earliest feasible point to do it. * 1099 * Note: Don't use BOOTROM when checking for Wake-up RAM failures - * 1100 * Power-up Directly with TESTROM. * 1101 ****************************************************************************** 1102 000004B8 4A05 reset_tstrom tst.b d5 If already looked for TESTROM, don't 1103 000004BA 6628 bne.s reset_tstrom2 1104 000004BC 4DFA 0026 lea reset_tstrom2,a6 1105 000004C0 41F9 0081 lea testrom,a0 0000 1106 000004C6 30BC 4EF9 move #jmpop,(a0) Return if RAM 1107 000004CA 217C 0000 move.l #reset_tstrom2,2(a0) 04E4 0002 1108 000004D2 0C10 0060 cmpi.b #$60,(a0) Don't Pass control, unless the 1109 000004D6 660C bne.s reset_tstrom2 first instruction is bra 1110 000004D8 46FC 2700 move #$2700,sr Go to Level 7 1111 000004DC 4E70 reset Reset and possibly lose clock 1112 * tick. Too Bad, Old Test ROMs 1113 * expect keyboard to untouched. 1114 * (Doesn't Matter since it's 1115 * only done at power-up.) 1116 000004DE 4EF9 0081 jmp testrom 0000 1117 0000 04E4 reset_tstrom2 equ * 1118 1119 ****************************************************************************** 1120 * Determine If CRT I.D. Register is Present. * 1121 * * 1122 * Modified on Jan. 30, 1984 by Anny Randel to handle High Resolution * 1123 * (GATOR) CRT. * 1124 ****************************************************************************** 1125 000004E4 0C05 0001 reset_crtid cmpi.b #1,d5 Don't Turn CRT off if not necessary 1126 000004E8 672E beq.s reset_crtid2 1127 000004EA 4246 clr d6 Assume No CRT I.D. Register Yet 1128 000004EC 4DFA 002A reset_crtid3 lea reset_crtid2,a6 If CRT bus errors, no I.D. 1129 000004F0 41F9 0051 lea crtid+1,a0 See if CRT Id Register is Present FFFF 1130 000004F6 705A moveq #$5A,d0 by looking for memory there 1st PAGE 29 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1131 000004F8 72A5 moveq #$A5,d1 Second Value to Use 1132 000004FA 1080 move.b d0,(a0) Write it 1133 000004FC B010 cmp.b (a0),d0 Read it back 1134 000004FE 6606 bne.s reset_crtid1 Not the same, then check for Reg. 1135 00000500 1081 move.b d1,(a0) Try another value: Write it 1136 00000502 B210 cmp.b (a0),d1 Read it back 1137 00000504 6712 beq.s reset_crtid2 The same, then no I.D. 1138 00000506 5388 reset_crtid1 subq.l #1,a0 Point to CRT Id Register 1139 00000508 3010 move (a0),d0 Make sure it is ROM 1140 0000050A 3200 move d0,d1 1141 0000050C 5241 addq #1,d1 1142 0000050E 3081 move d1,(a0) Write out incremented value 1143 00000510 B050 cmp (a0),d0 1144 00000512 6604 bne.s reset_crtid2 Oops, it changed, assume bad RAM 1145 00000514 0046 0010 ori #$10,d6 Set CRT Id Bit 1146 1147 00000518 4DFA 0016 reset_crtid2 lea reset_hpib,a6 Look for a Gator -- go ahead on bus err 1148 0000051C 207C 0056 movea.l #hrsel,a0 Move gator internal sel. code -> a0 0000 1149 00000522 1028 0001 move.b g_id(a0),d0 Look for gator (bus error if nothing) 1150 00000526 0C00 0019 cmpi.b #25,d0 Is whatever's there a gator??? 1151 0000052A 6604 bne.s reset_hpib Nope 1152 1153 0000052C 0046 0040 ori.w #$40,d6 Set high res bit is sysflag 1154 * 1155 1156 ****************************************************************************** 1157 * Initialize SYSFLAG in D6 to No HPIB and No Keyboard * 1158 ****************************************************************************** 1159 00000530 7850 reset_hpib moveq #$50,d4 Preserve Gator Presence Bit 1160 00000532 CC84 and.l d4,d6 and CRT I.D. Presence Bit 1161 00000534 7828 moveq #$28,d4 1162 00000536 8C84 or.l d4,d6 So Far No Internal HPIB, and No 1163 * Internal Keyboard 1164 * Assume 80 wide, small graphics, 1165 * and no highlights if no CRT 1166 1167 ****************************************************************************** 1168 * Determine if Internal HPIB is present. If it is present, it possible * 1169 * that we are in a MARMOT with no CPU ID register. Also if we are * 1170 * in a MARMOT we have to cludge a lot of information based on HPIB * 1171 * status bits. * 1172 ****************************************************************************** 1173 00000538 4DFA 0008 lea reset_hpib1,a6 First we must disarm any DMA 1174 0000053C 4A79 0050 tst dma_disarm0 Disarm Channel 0 0000 1175 00000542 4DFA 0026 reset_hpib1 lea reset2,a6 No HPIB if Bus error 1176 00000546 41F9 0047 lea int_hpib3,a0 Point to Status Register 3 8003 1177 * 1178 * initial test: assumes internal HP-IB not requesting int or enabled for DMA 1179 * bit 7 = 1; hardwired 1180 * bit 6 = 0; 9914 not requesting an interrupt 1181 * bit 0 = 0; internal HP-IB not enabled for DMA0 1182 * 1183 0000054C 70C1 moveq #$C1,d0 want bits 7,6,0 1184 0000054E C010 and.b (a0),d0 get 'em PAGE 30 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1185 00000550 0C00 0080 cmpi.b #$80,d0 expected value? 1186 00000554 6614 bne.s reset2 branch of not 1187 1188 * 1189 * harder test: same assumptions and test for same values, but... 1190 * 1) immediately after explicitly writing opposite values to bits 7 & 6 1191 * 2) BIT 0 MUST NOT BE SET; if DMA is absent, the machine may lunch! 1192 * 3) after instruction pre-fetch with values opposite of bits 7,6,0 1193 * 1194 00000556 70C1 moveq #$C1,d0 want bits 7,6,0 1195 00000558 10BC 007E move.b #$7E,(a0) write opposite values to 7 & 6 1196 0000055C C010 and.b (a0),d0 write should have had no effect 1197 0000055E 727F moveq #$7F,d1 pre-fetch inst w/ opposite values 1198 00000560 0C00 0080 cmpi.b #$80,d0 expected value? 1199 00000564 6604 bne.s reset2 branch of not 1200 1201 00000566 0886 0005 bclr #5,d6 HPIB is now present 1202 1203 ****************************************************************************** 1204 * Initialize H_50_60 in D5 to 60 Hz * 1205 ****************************************************************************** 1206 0000056A 4245 reset2 clr d5 60 Hz 1207 1208 ****************************************************************************** 1209 * Determine Which CRT is out there if any. CRT Table Number in d0. * 1210 * Set CRT SYSFLAG bits in D7 (0,1,2,4) * 1211 * If Horizontal is turned off, turn it off for as short as possible. * 1212 * * 1213 * Modified 01/30/84 by Anny Randel to handle Gator (Hi. Res. CRT) * 1214 ****************************************************************************** 1215 0000056C 4DFA 000A lea reset8,a6 On bus error, come back and 1216 * look for internal CRT 1217 00000570 0806 0006 btst #6,d6 See if GATOR is Present 1218 00000574 6600 00B8 bne reset_init1 1219 1220 00000578 4DFA 010A reset8 lea topram_test,a6 Skip to RAM test if CRT bus errors 1221 0000057C 0806 0004 btst #4,d6 See if CRT Id Register is Present 1222 00000580 6726 beq.s reset4 No, then Unions and Intersections 1223 00000582 41F9 0051 reset3 lea crtid,a0 Point to CRT Id Register FFFE 1224 00000588 3010 move (a0),d0 Read it 1225 0000058A 3200 move d0,d1 Extract SYSFLAG bits 1226 0000058C E049 lsr #8,d1 1227 0000058E 827C 0010 or #$10,d1 Set CRT Id Register Present Bit 1228 00000592 C27C 0017 and #$17,d1 1229 00000596 8C01 or.b d1,d6 Add bits to SYSFLAG 1230 00000598 0800 000F btst #15,d0 Check for self-initializing CRT 1231 0000059C 6600 00A2 bne reset_clr 1232 000005A0 E648 lsr #3,d0 Get CRT table number 1233 000005A2 C07C 001F and #$1F,d0 1234 000005A6 6078 bra.s reset_init 1235 000005A8 0806 0005 reset4 btst #5,d6 If No HPIB, then can't be MARMOT 1236 000005AC 662C bne.s reset6 1237 000005AE 4DFA 002A lea reset6,a6 Look for a MARMOT CRT 1238 000005B2 0839 0002 btst #2,int_hpib3 0047 8003 1239 000005BA 671E beq.s reset6 PAGE 31 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1240 000005BC 7004 moveq #4,d0 Must be a MARMOT (Assume 60 Hz) 1241 000005BE 0839 0000 btst #0,int_hpibstatus Check for 50 Hz 0047 8005 1242 000005C6 6602 bne.s reset5 1243 000005C8 5240 addq #1,d0 Is 50 Hz MARMOT 1244 000005CA 4DFA 0054 reset5 lea reset_init,a6 Bus error means no highlight byte 1245 000005CE 4A39 0051 tst.b crtma 2704 1246 000005D4 8C3C 0004 or.b #4,d6 Highlights present in MARMOT 1247 000005D8 6046 bra.s reset_init Go initialize CRT 1248 000005DA 4DFA 001E reset6 lea reset7,a6 Bus error in highlight byte 1249 000005DE 5286 addq.l #1,d6 Means 9826 not 9836 1250 000005E0 4240 clr d0 Start with 9826 as assumed one 1251 000005E2 4A39 0051 tst.b crtma Check highlight for bus error 2704 1252 000005E8 7002 moveq #2,d0 It must be a 9836 1253 000005EA 5286 addq.l #1,d6 1254 000005EC 0839 0007 btst #7,crtma Now check for 50 Hz 0051 2704 1255 000005F4 672A beq.s reset_init 1256 000005F6 5240 addq #1,d0 1257 000005F8 6026 bra.s reset_init 1258 000005FA 4DFA 0024 reset7 lea reset_init,a6 Bus error means not Burgess Board 1259 000005FE 13FC 000F move.b #15,crtc+1 Check for a read/write Cursor 0051 0001 1260 00000606 41F9 0051 lea crtc+3,a0 If so, then it's the BURGESS 0003 1261 0000060C 725A moveq #$5A,d1 Modified 9826 Board 1262 0000060E 1081 move.b d1,(a0) 1263 00000610 B210 cmp.b (a0),d1 1264 00000612 660C bne.s reset_init 1265 00000614 72A5 moveq #$A5,d1 1266 00000616 1081 move.b d1,(a0) 1267 00000618 B210 cmp.b (a0),d1 1268 0000061A 6604 bne.s reset_init 1269 0000061C 08C5 0007 bset #bb_pres,d5 Indicate Presence 1270 1271 ****************************************************************************** 1272 * Initialize the CRT Controller * 1273 * * 1274 * Modified 01/30/84 by Anny Randel to handle Gator (Hi. Res. CRT) * 1275 ****************************************************************************** 1276 00000620 4DFA 0062 reset_init lea topram_test,a6 Bus error now means no CRT 1277 00000624 0800 0000 btst #0,d0 Check for 50 Hz 1278 00000628 6704 beq.s reset_init1 1279 0000062A 08C5 0000 bset #h_5060,d5 50 Hz 1280 0000062E 4242 reset_init1 clr d2 Initialize all Registers 1281 00000630 49FA 000E lea reset_clr,a4 Return address from Psuedo Routine 1282 00000634 BCFC 0578 cmpa #reset8,a6 Are we initializing a gator? 1283 00000638 6600 4C98 bne crt_init If no, then initialize internal CRT 1284 0000063C 6000 4CFA bra hi_res_init Otherwise, Initialize Gator 1285 1286 ****************************************************************************** 1287 * Blank out the CRT Memory & Turn off Graphics * 1288 * * 1289 * Modified 01/30/84 by Anny Randel to handle Gator (Hi. Res. CRT) * 1290 ****************************************************************************** PAGE 32 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1291 00000640 49FA FF36 reset_clr lea reset8,a4 set up for jmp(a4) rts 1292 00000644 4FF8 0100 lea fake_stack,sp reset stack pointer 1293 00000648 BCFC 0578 cmpa #reset8,a6 Are we initializing internal CRT? 1294 1295 * We set a4=reset8 here so that after we're done here we 1296 * can go back and initialize the internal crt as well as gator 1297 1298 0000064C 6700 4F02 beq gatorblank nope -- go blank in a gator 1299 1300 * other wise, we must be internal CRT 1301 00000650 223C 0020 reset_clr0 move.l #$00200020,d1 Blank Entire CRT 0020 1302 00000656 41F9 0051 lea alphstrt-1,a0 2000 1303 0000065C 343C 03FF move #$3FF,d2 Blank enough for all displays 1304 00000660 20C1 reset_clr1 move.l d1,(a0)+ 1305 00000662 51CA FFFC dbra d2,reset_clr1 1306 00000666 4A79 0053 tst goff Turn off address sensitive devices 8000 1307 0000066C 0806 0004 btst #4,d6 CRT ID Register? 1308 00000670 6712 beq.s topram_test branch if not 1309 00000672 7418 moveq #$18,d2 prepare to... 1310 00000674 C439 0051 and.b crtid,d2 extract the sub-top type bits FFFE 1311 0000067A 6708 beq.s topram_test branch if monochrome 1312 0000067C 08B9 0000 bclr #0,cgrphoff clear graphics bit to turn off 0051 FFFD 1313 1314 ****************************************************************************** 1315 * Test Top 6K bytes of RAM * 1316 ****************************************************************************** 1317 00000684 1E3C 00FB topram_test move.b #-1-tramf,d7 Indicate that we are in topram 1318 00000688 4A47 tst d7 1319 0000068A 6B06 bmi.s topram_test0 1320 0000068C 13C7 0001 move.b d7,leds FFFF 1321 00000692 43F8 0000 topram_test0 lea 0,a1 Top of RAM +1 1322 00000696 4BF8 C000 lea topram,a5 Bottom of RAM block to test 1323 1324 ****************************************************************************** 1325 * RAMTEST: * 1326 * Test RAM between A1 at top+1 and A5 at bottom * 1327 * A5 is left pointing to bottom good long word * 1328 * Assumes RAM is pre-loaded to the value $EEEE1111 * 1329 * Assumes RAM is 16 bits wide * 1330 * On a Failure to Read (Non-Bus Error): d3 = Last Write Pattern * 1331 * d4 = Last Read Pattern * 1332 * * 1333 * Write and Read The Following to all locations: * 1334 * Down: $EEEE1111 Read $1111EEEE Write * 1335 * Down: $1111EEEE Read $DDDD2222 Write * 1336 * Up: $DDDD2222 Read $2222DDDD Write * 1337 * Up: $2222DDDD Read $BBBB4444 Write * 1338 * Down: $BBBB4444 Read $4444BBBB Write * 1339 * Down: $4444BBBB Read $77778888 Write * 1340 * Up: $77778888 Read $88887777 Write * 1341 * Up: $88887777 Read $EEEE1111 Write * PAGE 33 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1342 ****************************************************************************** 1343 0000069A 4DFA 0074 ramtest lea ramtest10,a6 If bus error, fail 1344 0000069E 74FE moveq #-2,d2 Counter (Up/Down Indicator) 1345 000006A0 203C EEEE move.l #$EEEE1111,d0 D0="WRITE" 1111 1346 000006A6 223C 8888 move.l #$88887777,d1 D1="READ" 7777 1347 000006AC 5242 ramtest1 addq #1,d2 nextpat: d2<1>=1 UP; d2<1>=0 DOWN 1348 000006AE C141 exg d0,d1 1349 000006B0 E358 rol #1,d0 1350 000006B2 4840 swap d0 1351 000006B4 E358 rol #1,d0 1352 000006B6 4840 swap d0 1353 000006B8 0802 0001 ramtest2 btst #1,d2 Up or Down? 1354 000006BC 661A bne.s ramtest5 Must be Up 1355 000006BE 2049 movea.l a1,a0 Start at Top 1356 000006C0 49FA FFEA lea ramtest1,a4 On error start at next pattern 1357 000006C4 5988 ramtest3 subq.l #4,a0 Don't bus error in between 1358 000006C6 B290 cmp.l (a0),d1 marchdown: Read data 1359 000006C8 6620 bne.s ramtest7 Bad read, then fail 1360 000006CA 2080 move.l d0,(a0) Write for next one 1361 000006CC B1CD cmpa.l a5,a0 Stop at Bottom 1362 000006CE 62F4 bhi.s ramtest3 1363 000006D0 0C40 1111 ramtest4 cmpi #$1111,d0 donecheck: Check for Last Pattern 1364 000006D4 66D6 bne.s ramtest1 No, do next one 1365 000006D6 6030 bra.s ramtest9 Done with no errors 1366 000006D8 204D ramtest5 movea.l a5,a0 Start at Bottom to test up 1367 000006DA 49FA 0002 lea ramtest6,a4 On Error Start at new bottom 1368 000006DE B290 ramtest6 cmp.l (a0),d1 1369 000006E0 6608 bne.s ramtest7 marchup: Bad read, then fail 1370 000006E2 20C0 move.l d0,(a0)+ Write for next one 1371 000006E4 B1C9 cmpa.l a1,a0 Stop at top 1372 000006E6 66F6 bne.s ramtest6 1373 000006E8 60E6 bra.s ramtest4 1374 000006EA 2601 ramtest7 move.l d1,d3 Save Write Pattern 1375 000006EC 2810 move.l (a0),d4 Save Read Pattern 1376 000006EE BEFC 0100 ramtest8 cmpa.w #fake_stack,sp Die if inline code 1377 000006F2 620A bhi.s ramtest8_1 Die to Bad Bit Code 1378 000006F4 0887 0007 bclr #7,d7 Indicate RAM failure to leds 1379 000006F8 43FA 4FA8 lea msg_bad,a1 Message to display 1380 000006FC 6020 bra.s topram_test1 1381 000006FE 5888 ramtest8_1 addq.l #4,a0 Move up past error 1382 00000700 2A48 movea.l a0,a5 Reset Bottom 1383 00000702 B3CD cmpa.l a5,a1 If No memory left, return 1384 00000704 6702 beq.s ramtest9 1385 00000706 4ED4 jmp (a4) Continue Test 1386 00000708 BEFC 0100 ramtest9 cmpa.w #fake_stack,sp Go to next if inline code 1387 0000070C 6344 bls.s test_setup 1388 0000070E 4E75 rts Otherwise return 1389 00000710 BEFC 0100 ramtest10 cmpa.w #fake_stack,sp Die if inline code 1390 00000714 62E8 bhi.s ramtest8_1 Die to Bus Error Code 1391 00000716 0887 0006 bclr #6,d7 Indicate Missing RAM To leds 1392 0000071A 43FA 4F9E lea msg_miss,a1 Message to display 1393 1394 ****************************************************************************** 1395 * Error Trap for Bad RAM in TOPRAM * 1396 ****************************************************************************** PAGE 34 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1397 0000071E 4A47 topram_test1 tst d7 1398 00000720 6B06 bmi.s topram_test2 1399 00000722 13C7 0001 move.b d7,leds FFFF 1400 00000728 4DFA 0024 topram_test2 lea topram_test3,a6 If bus error, Skip Writing to CRT 1401 0000072C 41F9 0051 lea crtmb,a0 21A0 1402 00000732 0806 0000 btst #0,d6 SYSFLAG<0>=50 / not-80 wide 1403 00000736 6706 beq.s reset_msg 1404 00000738 41F9 0051 lea crtma,a0 2704 1405 1406 ****************************************************************************** 1407 * Put Out Message that RAM is required * 1408 ****************************************************************************** 1409 0000073E 4241 reset_msg clr d1 No Special Highlights on 1410 00000740 0806 0006 btst #6,d6 Is this a Hi Res CRT? 1411 00000744 6608 bne.s topram_test3 Then skip message 1412 00000746 1219 reset_msg1 move.b (a1)+,d1 Get a character 1413 00000748 6704 beq.s topram_test3 When done Indicate failure to leds 1414 0000074A 30C1 move d1,(a0)+ Write a character 1415 0000074C 60F8 bra.s reset_msg1 1416 0000074E 4E72 2700 topram_test3 stop #$2700 It's all over, not enough RAM 1417 1418 1419 ****************************************************************************** 1420 * Setup Before Allowing Initialization or testing to continue * 1421 ****************************************************************************** 1422 00000752 49F8 F7E4 test_setup lea minram-f_areatop,a4 Set up temporary LOWRAM area 1423 00000756 21CC FED4 move.l a4,f_area 1424 0000075A 422C 000B clr.b booleans(a4) Set Booleans to False 1425 0000075E 4278 FDC0 clr boottype Do Power-up Boot 1426 00000762 8B2C 000B or.b d5,booleans(a4) Save Default 50/60Hz Strap 1427 * and Presence Bits 1428 00000766 08AC 0004 bclr #lowram_ok,booleans(a4) LOWRAM is not set-up yet 000B 1429 0000076C 11C6 FED2 move.b d6,sysflag Put SYSFLAG into Memory 1430 00000770 2947 0096 move.l d7,led_val(a4) Log Errors found So far 1431 00000774 422C 0099 clr.b led_val+3(a4) No errors yet 1432 00000778 4DFA 0008 lea test_setup0,a6 Handle Bus error on Monitor Flag 1433 0000077C 4239 0088 clr.b monitor Clear Monitor Flag because 0000 1434 * it can't possibly be loaded 1435 00000782 08AC 0001 test_setup0 bclr #ram_test,booleans(a4) Short Memory Test So Far 000B 1436 00000788 0838 0005 btst #5,sysflag Not MARMOT if no HPIB FED2 1437 0000078E 660A bne.s test_setup1 1438 00000790 0839 0002 btst #2,int_hpib3 Check if MARMOT 0047 8003 1439 00000798 6614 bne.s self_test Yes, then Short Memory Test 1440 0000079A 4DFA 0012 test_setup1 lea self_test,a6 On bus error, do Short Memory Test 1441 0000079E 0839 0001 btst #ram_l,procid Check processor Id register 005F 0000 1442 000007A6 6706 beq.s self_test Must want Short Memory Test 1443 000007A8 08EC 0001 bset #ram_test,booleans(a4) Do Longer Memory Test 000B PAGE 35 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1444 1445 ****************************************************************************** 1446 * SELF_TEST: Restart Point For Self-Test and Booting * 1447 * (Re-enter here to use a RAM Monitor) * 1448 * Conditions: * 1449 * BOOTTYPE Non-zero means to never write to screen except for * 1450 * fatal errors * 1451 * Booleans Bits: * 1452 * LOWRAM_OK If True then Skip to past Memory Test and LOWRAM * 1453 * initialization * 1454 * RAM_TEST If True then Do a Long Memory Test * 1455 * H_5060 If True then 50 HZ (60 Hz otherwise) * 1456 ****************************************************************************** 1457 000007AE 007C 2700 self_test ori #$2700,sr Lock out Interrupts 1458 000007B2 0038 0008 ori.b #$08,sysflag No Keyboard Yet FED2 1459 000007B8 11FC 004E move.b #$4E,sysflag2 Initialize Sysflag2 FEDA 1460 000007BE 51F8 FDCD sf battery No Battery Yet 1461 000007C2 2878 FED4 movea.l f_area,a4 Point to Low RAM area 1462 000007C6 422C 0099 clr.b led_val+3(a4) No errors yet 1463 000007CA 4FF8 FDAC lea boot_stack,sp Set up a Real Stack Now 1464 000007CE 6100 4640 bsr setbus And use Normal Bus Error Handler 1465 000007D2 297C 0000 move.l #i_list,i_start(a4) Set-up the init/test List 0CFE 0018 1466 000007DA 297C 0000 move.l #b_list,b_start(a4) Set up Boot List 4014 001C 1467 000007E2 297C 0000 move.l #d_list,d_start(a4) Set up Mass Storage Driver List 4070 0020 1468 000007EA 397C 0017 move #23,steal(a4) BOOTROM needs 23*32 in F_AREA 02DA 1469 000007F0 297C 0000 move.l #m_sarea2,tempram(a4) Set-up Memory Re-Claim Pointer 00A0 002C 1470 000007F8 297C 0000 move.l #200,mb_size(a4) Set-up Required amount of buffer 00C8 0014 1471 00000800 4EB9 0000 jsr sr_init_links Set-up Device and Dir. Man. Lists 0000 1472 1473 ****************************************************************************** 1474 * Allow a Boot Extension ROM to Modify the Initialization/Test List * 1475 ****************************************************************************** 1476 00000806 7006 boot_extens moveq #bootf,d0 Indicate Searching to LEDs 1477 00000808 6100 125C bsr led_state 1478 0000080C 41F9 0001 lea ROM_START,a0 Begin Search after BOOTROM 0000 1479 00000812 43F9 0040 lea $400000,a1 Stop at I/O Space 0000 1480 00000818 45F8 4000 lea $4000,a2 Step by 16K 1481 0000081C 4DFA 0046 lea boot_extens3,a6 Point Bus Error 1482 00000820 2F08 boot_extens1 move.l a0,-(sp) Save Registers 1483 00000822 2A4F movea.l sp,a5 Save Stack Pointer for Bus errors 1484 00000824 0C50 F0FF cmpi #$F0FF,(a0) Look For Header Flag 1485 00000828 663A bne.s boot_extens3 Try next one 1486 0000082A 0828 0001 btst #1,3(a0) Check Boot Bit 0003 1487 00000830 6732 beq.s boot_extens3 1488 00000832 1028 000C move.b 12(a0),d0 12(a0)+1 must equal 13(a0) PAGE 36 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM POWER UP SUPERVISOR (BOOTROM0)" 1489 00000836 743F moveq #$3F,d2 1490 00000838 C042 and d2,d0 Part number is in lower 6 bits 1491 0000083A 5240 addq #1,d0 1492 0000083C 1228 000D move.b 13(a0),d1 1493 00000840 C242 and d2,d1 1494 00000842 B001 cmp.b d1,d0 1495 00000844 661E bne.s boot_extens3 Bad 1496 00000846 0828 0004 btst #4,3(a0) Check for Chskm Length Bit 0003 1497 0000084C 660E bne.s boot_extens2 If set, don't chskm 1498 0000084E 2828 0012 move.l 18(a0),d4 Get size of BOOT Ext. 1499 00000852 6100 1312 bsr sumrom Checksum the ROM 1500 00000856 2057 movea.l (sp),a0 Restore Register/Save Register 1501 00000858 4A40 tst d0 Zero if Valid Checksum 1502 0000085A 6608 bne.s boot_extens3 Ignore it if not valid 1503 0000085C D1E8 0004 boot_extens2 adda.l 4(a0),a0 1504 00000860 4EA8 0004 jsr 4(a0) Start the Extention ROM 1505 00000864 2E4D boot_extens3 movea.l a5,sp Restore Stack Pointer 1506 00000866 205F movea.l (sp)+,a0 Restore Registers 1507 00000868 D1CA adda.l a2,a0 Try next Location 1508 0000086A B3C8 cmpa.l a0,a1 1509 0000086C 66B2 bne.s boot_extens1 1510 1511 ****************************************************************************** 1512 * Go Thru the Initialization/Test List * 1513 ****************************************************************************** 1514 0000086E 2878 FED4 movea.l f_area,a4 Get Pointer to LOWRAM area 1515 00000872 7007 moveq #testf,d0 Indicate start of test to LEDs 1516 00000874 6100 11F0 bsr led_state 1517 00000878 4BEC 0018 lea i_start(a4),a5 A5 is used as Vector Entry Pntr 1518 0000087C 2A55 movea.l (a5),a5 A5 is pointing at next entry to do 1519 0000087E 4A95 test_loop tst.l (a5) If Pointing to zero 1520 00000880 670E beq.s test_done Then the list has been finished 1521 00000882 2F0D move.l a5,-(sp) Save a5 1522 00000884 2A55 movea.l (a5),a5 Point to Routine 1523 00000886 4E95 jsr (a5) Execute the Vector 1524 00000888 2A5F movea.l (sp)+,a5 Restore a4 1525 0000088A 588D addq.l #4,a5 Get Relative Link to next Vector 1526 0000088C DBD5 adda.l (a5),a5 Add offset to next Vector Pntr 1527 0000088E 60EE bra.s test_loop Try it 1528 1529 ****************************************************************************** 1530 * Check for LOOP on Power-UP Self-Test * 1531 ****************************************************************************** 1532 00000890 2878 FED4 test_done movea.l f_area,a4 Check for Self-Test Loop Back 1533 00000894 082C 0000 btst #mb_loop,m_b(a4) 0054 1534 0000089A 6708 beq.s power_boot No Looping, Start Boot Scan 1535 0000089C 41FA FB62 test_done1 lea reset,a0 Loop 1536 000008A0 6000 3B64 bra go PAGE 37 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1539 ****************************************************************************** 1540 ****************************************************************************** 1541 *** *** 1542 *** Booter *** 1543 *** *** 1544 *** Entries Supported Internally: *** 1545 *** POWER_BOOT Start of Booter *** 1546 *** *** 1547 ****************************************************************************** 1548 ****************************************************************************** 1549 1550 ****************************************************************************** 1551 * POWER_BOOT: Start of Booter * 1552 ****************************************************************************** 1553 000008A4 4A78 FDC0 power_boot tst boottype Check for Power-up 1554 000008A8 6612 bne.s boot_file 1555 000008AA 43F8 FDC2 lea sysname,a1 Set Default Name for Soft System 1556 000008AE 41FA 5191 lea defaultname,a0 1557 000008B2 6100 4444 bsr movebytes 1558 000008B6 4238 FDCC clr.b blflags Clear Boot Load Flags 1559 000008BA 6052 bra.s boot_scan 1560 1561 * After link: sp --> 4 bytes: ptr to filename * 1562 * 4 bytes: boot msus * 1563 * a5 --> 12 bytes: filename * 1564 000008BC 2878 FED4 boot_file movea.l f_area,a4 Point a4 to LOWRAM area 1565 000008C0 2978 FDCE move.l lowram,mb_ptr(a4) Allocate space for Ganglia 0010 1566 000008C6 202C 0014 move.l mb_size(a4),d0 1567 000008CA D1B8 FDCE add.l d0,lowram 1568 000008CE 4E55 FFF4 link a5,#-12 Allocate space on stack 1569 000008D2 41ED FFF4 lea -12(a5),a0 Copy filename 1570 000008D6 43F8 FDC2 lea sysname,a1 Use Passed Name for Soft System 1571 000008DA 700A moveq #10,d0 1572 000008DC 10C0 move.b d0,(a0)+ Set length 1573 000008DE 10D9 boot_file1 move.b (a1)+,(a0)+ 1574 000008E0 5340 subq #1,d0 1575 000008E2 6EFA bgt.s boot_file1 1576 * 1577 * Remove all trailing blanks 1578 * 1579 000008E4 0C20 0020 boot_file2 cmpi.b #' ',-(a0) 1580 000008E8 6608 bne.s boot_file3 No more blanks 1581 000008EA 532D FFF4 subq.b #1,-12(a5) Decrement Count 1582 000008EE 67AC beq.s test_done1 No more, start over 1583 000008F0 60F2 bra.s boot_file2 1584 000008F2 2F38 FEDC boot_file3 move.l default_msus,-(sp) Pass MSUS 1585 000008F6 486D FFF4 pea -12(a5) Pass Filename 1586 000008FA 6100 37EC boot_boot bsr boot Call the booter 1587 000008FE 41FA 4FBB lea not_found,a0 Specified System not found 1588 00000902 6100 4D82 bsr displin 1589 00000906 4EFA FFFE jmp * 1590 1591 ****************************************************************************** 1592 * BOOT_SCAN: Boot Scanner * 1593 * * 1594 * CTRL_RESET Restarts Power-UP Search; * PAGE 38 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1595 * Set up PASCAL Environment; * 1596 * Clear FOUND_LIST; * 1597 * Initialize Screen Menu; * 1598 * Indicate that a Boot System is being searched for; * 1599 * Found_MSUS:=False; * 1600 * DEFAULT_MSUS:=ROM; * 1601 * PROM_DELAY; {Wait} * 1602 * PROM_BOOT; {Look for Highest Priority Boot} * 1603 * FOR BOOTPASS:=1 TO 2^16-1 & WHILE TRUE DO FOR BOOTPASS:=2 to 2^16-1 DO* 1604 * FOREACH BOOTVECTOR in BOOT_LIST DO WITH BOOTVECTOR^ DO * 1605 * BEGIN {BOOT_LIST Scan} * 1606 * Init:=TRUE; * 1607 * Zilch:=False; * 1608 * WHILE ACTIVE(BOOTPASS,Init,MSUS,Zilch,True) DO * 1609 * BEGIN {Active Device Scan} * 1610 * IF NOT Found_MSUS and MSUS#ROM THEN * 1611 * BEGIN * 1612 * Found_MSUS:=True;DEFAULT_MSUS:=MSUS; * 1613 * END; * 1614 * WHILE NEXT_SYSTEM(FILENAME:='SYSTEM_0') DO * 1615 * BEGIN * 1616 * ADD_TO_FOUND_AND_MENU(MSUS,FILENAME); * 1617 * IF NOT ATTENDED or BOOT_SELECT(MSUS,FILENAME) THEN * 1618 * BOOT(MSUS,FILENAME); * 1619 * END; * 1620 * IF BOOT_SELECT(MSUS,FILENAME) THEN BOOT(MSUS,FILENAME); * 1621 * END; {Active Device Scan} * 1622 * IF BOOT_SELECT(MSUS,FILENAME) THEN BOOT(MSUS,FILENAME); * 1623 * END; {BOOT_LIST Scan} * 1624 ****************************************************************************** 1625 0000090A 0000 0000 long_zero dc.l 0 This is a zero 1626 1627 0000090E 2878 FED4 boot_scan movea.l f_area,a4 a4 points to LOWRAM area 1628 00000912 4A2C 02CD tst.b kbdtype(a4) If it's not an ITF keyboard, then 1629 00000916 6706 beq.s boot_scan0 use ENTER message 1630 00000918 41FA 4E11 lea bootscanm1,a0 Otherwise use RETURN message 1631 0000091C 6004 bra.s boot_scan00 1632 0000091E 41FA 4DE2 boot_scan0 lea bootscanm,a0 Indicate boot scanner mode 1633 00000922 6100 4D62 boot_scan00 bsr displin 1634 00000926 6100 43D8 bsr pascal_init Set-up for Pascal 1635 0000092A 2A6C 02D6 movea.l midram(a4),a5 Reserve some MIDRAM 1636 0000092E 06AC FFFF addi.l #next_line,midram(a4) a5 points to locals FEDA 02D6 1637 00000936 487A 3A84 pea boot_error Set-up to handle unexpected errors 1638 0000093A 2B4F FFF6 move.l sp,-10(a5) 1639 0000093E 42AD FFE6 clr.l found_list(a5) Clear found list 1640 00000942 70FF moveq #-1,d0 No MSUS on menu yet 1641 00000944 2B40 FEE0 move.l d0,disp_msus(a5) 1642 00000948 50ED FEDC st disp_wrap(a5) Haven't wrapped menu yet 1643 0000094C 21FC E0FF move.l #rom_msus,default_msus No Default msus yet FFFF FEDC 1644 00000954 422D FFEA clr.b found_msus(a5) 1645 00000958 6100 1630 bsr prom_delay 1646 0000095C 6100 153E bsr prom_boot Highest Priority Boot Check 1647 00000960 70FF moveq #-1,d0 MSUS not current 1648 00000962 2B40 FEE0 move.l d0,disp_msus(a5) 1649 00000966 426D FFF4 clr bootpass(a5) PAGE 39 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1650 0000096A 526D FFF4 boot_scan1 addq #1,bootpass(a5) Try 2^16 boot passes 1651 0000096E 6D00 00BE blt boot_scan7 1652 00000972 266C 001C movea.l b_start(a4),a3 Go thru BOOT List 1653 00000976 4A93 boot_scan2 tst.l (a3) 1654 00000978 67F0 beq boot_scan1 Finished with BOOT List 1655 0000097A 2F0B move.l a3,-(sp) a3 Points to Element of List 1656 0000097C 2653 movea.l (a3),a3 a3 Points to Vector 1657 0000097E 50ED FFE4 boot_scan2_1 st init(a5) Init:=True; 1658 00000982 51ED FFEC sf zilch(a5) Zilch:=False; 1659 00000986 6100 0124 boot_scan2_2 bsr pause_chk Check for Stop Key first 1660 0000098A 48E7 FFF8 movem.l d0-d7/a0-a4,-(sp) Save Registers 1661 0000098E 554F subq #2,sp Call ACTIVE: push boolean 1662 00000990 3F2D FFF4 move bootpass(a5),-(sp) Pass bootpass # 1663 00000994 1F2D FFE4 move.b init(a5),-(sp) Pass Init 1664 00000998 486D FFF0 pea msus(a5) Pass msus 1665 0000099C 486D FFEC pea zilch(a5) Pass zilch 1666 000009A0 50E7 st -(sp) Keep Track of Searched Devices 1667 000009A2 6100 60E2 bsr lock Lock out Resets 1668 000009A6 4EAB 0000 jsr active(a3) 1669 000009AA 6100 60EE bsr unlock Unlock Resets 1670 000009AE 4A1F tst.b (sp)+ If not active 1671 000009B0 4CDF 1FFF movem.l (sp)+,d0-d7/a0-a4 Restore Registers 1672 000009B4 676C beq.s boot_scan6 then skip to next 1673 000009B6 51ED FFE4 sf init(a5) Init:=False; 1674 000009BA 4A2D FFEA tst.b found_msus(a5) Check for Default msus 1675 000009BE 6614 bne.s boot_scan3 1676 000009C0 0CAD E0FF cmpi.l #rom_msus,msus(a5) FFFF FFF0 1677 000009C8 670A beq.s boot_scan3 1678 000009CA 50ED FFEA st found_msus(a5) Default Found and Set 1679 000009CE 21ED FFF0 move.l msus(a5),default_msus FEDC 1680 000009D4 6100 00D6 boot_scan3 bsr pause_chk Check for Stop Key first 1681 000009D8 43ED FEE4 lea filename(a5),a1 Set Filename to 'SYSTEM_0' 1682 000009DC 41F8 FDC2 lea sysname,a0 1683 000009E0 7004 moveq #4,d0 1684 000009E2 12C0 move.b d0,(a1)+ 1685 000009E4 6100 4312 bsr movebytes 1686 000009E8 48E7 FFF8 movem.l d0-d7/a0-a4,-(sp) Save Registers 1687 000009EC 554F subq #2,sp Call NEXT_SYSTEM 1688 000009EE 486D FEE4 pea filename(a5) Pass filename 1689 000009F2 6100 6092 bsr lock Lockout Resets 1690 000009F6 4EAB 0004 jsr next_system(a3) 1691 000009FA 6100 609E bsr unlock Unlock Resets 1692 000009FE 4A1F tst.b (sp)+ If no more, skip 1693 00000A00 4CDF 1FFF movem.l (sp)+,d0-d7/a0-a4 Restore Registers 1694 00000A04 6716 beq.s boot_scan5_1 1695 00000A06 6100 00E2 bsr add_to_found Call ADD_TO_FOUND 1696 00000A0A 082C 0003 btst #attended,booleans(a4) If Not ATTENDED, Boot 000B 1697 00000A10 6706 beq.s boot_scan4 1698 00000A12 6100 02AA bsr boot_select If chosen, Boot 1699 00000A16 6702 beq.s boot_scan5 1700 00000A18 6124 boot_scan4 bsr.s boot_call Call BOOT 1701 00000A1A 60B8 boot_scan5 bra.s boot_scan3 Try for more systems 1702 00000A1C 611A boot_scan5_1 bsr.s boot_check Check for Selection 1703 00000A1E 6000 FF66 bra boot_scan2_2 Check next Media PAGE 40 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1704 00000A22 6114 boot_scan6 bsr.s boot_check Check for Selection 1705 00000A24 265F movea.l (sp)+,a3 Get next Bootlist Vector 1706 00000A26 588B addq.l #4,a3 1707 00000A28 D7D3 adda.l (a3),a3 1708 00000A2A 6000 FF4A bra boot_scan2 1709 00000A2E 3B7C 0001 boot_scan7 move #1,bootpass(a5) Continue Search FFF4 1710 00000A34 6000 FF34 bra boot_scan1 1711 1712 ****************************************************************************** 1713 * Check for Boot Selection Match. If Found, then boot it. * 1714 ****************************************************************************** 1715 00000A38 6100 0284 boot_check bsr boot_select 1716 00000A3C 670C beq.s boot_check1 1717 00000A3E 2F2D FFF0 boot_call move.l msus(a5),-(sp) Call Booter 1718 00000A42 486D FEE4 pea filename(a5) 1719 00000A46 6000 FEB2 bra boot_boot 1720 00000A4A 4E75 boot_check1 rts 1721 1722 ****************************************************************************** 1723 * Convert digit in d1 to ASCII and put it into (a0)+ * 1724 * a4 points to LOWRAM area * 1725 ****************************************************************************** 1726 00000A4C D27C 0030 putdigit add #'0',d1 Convert to ASCII 1727 00000A50 3001 move d1,d0 wtb it 1728 00000A52 10C0 putdigit1 move.b d0,(a0)+ 1729 00000A54 4E75 rts 1730 1731 ****************************************************************************** 1732 * Put out two digit number in d0 with leading spaces instead of leading * 1733 * zeros * 1734 * a4 points to LOWRAM area * 1735 ****************************************************************************** 1736 00000A56 48E7 C000 putnum movem.l d0-d1,-(sp) Save Registers 1737 00000A5A 4281 clr.l d1 1738 00000A5C 3200 move d0,d1 1739 00000A5E 82FC 000A divu #10,d1 1740 00000A62 4A41 tst d1 1741 00000A64 6708 beq.s putnum1 1742 00000A66 61E4 bsr putdigit Two digits 1743 00000A68 4841 swap d1 1744 00000A6A 61E0 putnum0 bsr putdigit 1745 00000A6C 600E bra.s putnum2 1746 00000A6E 7020 putnum1 moveq #$20,d0 1st character is a space 1747 00000A70 61E0 bsr putdigit1 1748 00000A72 4841 swap d1 1749 00000A74 4A41 tst d1 1750 00000A76 66F2 bne putnum0 2nd character is a digit 1751 00000A78 7020 moveq #$20,d0 2nd character is a space 1752 00000A7A 61D6 bsr putdigit1 1753 00000A7C 4CDF 0003 putnum2 movem.l (sp)+,d0-d1 Restore Registers 1754 00000A80 4E75 rts 1755 1756 ****************************************************************************** 1757 * Display two digit number with no leading zeros or spaces * 1758 ****************************************************************************** 1759 00000A82 48E7 C000 putsel movem.l d0-d1,-(sp) PAGE 41 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1760 00000A86 4281 clr.l d1 1761 00000A88 3200 move d0,d1 1762 00000A8A 82FC 000A divu #10,d1 1763 00000A8E 4A41 tst d1 1764 00000A90 6702 beq.s putsel1 One digit only 1765 00000A92 61B8 putsel0 bsr putdigit Two digits 1766 00000A94 4841 putsel1 swap d1 1767 00000A96 61B4 bsr putdigit 1768 00000A98 4CDF 0003 movem.l (sp)+,d0-d1 1769 00000A9C 4E75 rts 1770 1771 ****************************************************************************** 1772 * Display two digit number with leading zeros * 1773 ****************************************************************************** 1774 00000A9E 48E7 C000 puthip movem.l d0-d1,-(sp) 1775 00000AA2 4281 clr.l d1 1776 00000AA4 3200 move d0,d1 1777 00000AA6 82FC 000A divu #10,d1 1778 00000AAA 60E6 bra putsel0 1779 1780 ****************************************************************************** 1781 * Check For Stop Bit Set * 1782 * a4 points to LOWRAM area * 1783 ****************************************************************************** 1784 00000AAC 2F08 pause_chk move.l a0,-(sp) Save Registers 1785 00000AAE 082C 0002 btst #mb_stop,m_b(a4) Should we pause 0054 1786 00000AB4 6730 beq.s add_tf2 No 1787 00000AB6 4A2C 02CD tst.b kbdtype(a4) If it's not an ITF keyboard, then 1788 00000ABA 6706 beq.s pause_chk0 use ENTER 1789 00000ABC 41FA 4CB3 lea bootsp1,a0 Otherwise use RETURN 1790 00000AC0 6004 bra.s pause_chk00 1791 00000AC2 41FA 4C91 pause_chk0 lea bootsp,a0 1792 00000AC6 6100 4BBE pause_chk00 bsr displin Tell user we are paused 1793 00000ACA 082C 0002 add_tf1 btst #mb_stop,m_b(a4) Wait for a continue 0054 1794 00000AD0 66F8 bne.s add_tf1 1795 1796 00000AD2 4A2C 02CD tst.b kbdtype(a4) If it's not an ITF keyboard, then 1797 00000AD6 6706 beq.s add_tf0 use ENTER message 1798 00000AD8 41FA 4C51 lea bootscanm1,a0 Otherwise use RETURN message 1799 00000ADC 6004 bra.s add_tf00 1800 00000ADE 41FA 4C22 add_tf0 lea bootscanm,a0 Indicate boot scanner mode 1801 00000AE2 6100 4BA2 add_tf00 bsr displin Tell user we are searching again 1802 00000AE6 205F add_tf2 movea.l (sp)+,a0 Restore Registers 1803 00000AE8 4E75 rts 1804 1805 ****************************************************************************** 1806 * add_to_found msus(a5) filename(a5) * 1807 * If stop bit wait for it to clear. * 1808 * Add to Found_list and Screen Menu. * 1809 * Assign character and subselector to it. * 1810 * First line is to be preserved (memory available message). * 1811 * After movem: sp --> 24 bytes of registers * 1812 * 4 bytes of return address * 1813 * a3 points to Current Boot List Entry * 1814 * a4 points to LOWRAM area * PAGE 42 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1815 * a5 points to Boot Scanner local area * 1816 ****************************************************************************** 1817 00000AEA 48E7 E0E0 add_to_found movem.l a0-a2/d0-d2,-(sp) Save Registers 1818 00000AEE 4240 clr d0 Compute Space for filename 1819 00000AF0 41ED FEE4 lea filename(a5),a0 Get pointer to filename 1820 00000AF4 1010 move.b (a0),d0 Get length 1821 00000AF6 5240 addq #1,d0 Add one for length byte 1822 00000AF8 0800 0000 btst #0,d0 Make even 1823 00000AFC 6702 beq.s add_to1 1824 00000AFE 5240 addq #1,d0 1825 00000B00 226C 02D6 add_to1 movea.l midram(a4),a1 Allocate midram space 1826 00000B04 92C0 suba d0,a1 1827 00000B06 2949 02D6 move.l a1,midram(a4) 1828 00000B0A 32D8 add_to2 move (a0)+,(a1)+ Copy in filename 1829 00000B0C 5540 subq #2,d0 1830 00000B0E 6EFA bgt.s add_to2 1831 00000B10 226C 02D6 movea.l midram(a4),a1 Allocate space for rest 1832 00000B14 92FC 000A suba #10,a1 1833 00000B18 2949 02D6 move.l a1,midram(a4) 1834 00000B1C 236D FFF0 move.l msus(a5),fmsus(a1) Copy msus 0006 1835 00000B22 0CA9 E0FF cmpi.l #rom_msus,fmsus(a1) Compute Letter: look for ROM FFFF 0006 1836 00000B2A 6608 bne.s add_to3 1837 00000B2C 1369 000B move.b fname+1(a1),fchar(a1) Use 1st char if ROM 0005 1838 00000B32 6028 bra.s add_to4 1839 00000B34 41FA 4F03 add_to3 lea longdefault,a0 If not ROM use 1st non-match 1840 00000B38 45E9 000B lea fname+1(a1),a2 with "SYSTEM_" 1841 00000B3C 4241 clr d1 If exceed length use "Z" 1842 00000B3E 1229 000A move.b fname(a1),d1 1843 00000B42 4A41 add_to3_1 tst d1 If out of name use "Z" 1844 00000B44 6604 bne.s add_to3_2 1845 00000B46 745A moveq #'Z',d2 1846 00000B48 600E bra.s add_to3_3 1847 00000B4A 141A add_to3_2 move.b (a2)+,d2 Get next character 1848 00000B4C 5341 subq #1,d1 1849 00000B4E 1018 move.b (a0)+,d0 1850 00000B50 6706 beq.s add_to3_3 If at end of "SYSTEM_" use char 1851 00000B52 B002 cmp.b d2,d0 If matching stops use that 1852 00000B54 6602 bne.s add_to3_3 character 1853 00000B56 60EA bra.s add_to3_1 Try for next character 1854 00000B58 1342 0005 add_to3_3 move.b d2,fchar(a1) Use Computed Character 1855 00000B5C 1029 0005 add_to4 move.b fchar(a1),d0 Make sure it is a-z or A-Z 1856 00000B60 6B0C bmi.s add_to5 If Bit 8 set, its not 1857 00000B62 72C6 moveq #-58,d1 Generate Mask and 6 1858 00000B64 0300 btst d1,d0 If bit 6 is zero it's 1859 00000B66 6706 beq.s add_to5 not a-z or A-Z 1860 00000B68 EA89 lsr.l #5,d1 Create 32 bit vector 1861 * with top 5 bits and lsb 0's 1862 00000B6A 0101 btst d0,d1 Look at lower 5 bits of char 1863 00000B6C 6606 bne.s add_to6 0, and 27-31 are illegal 1864 00000B6E 137C 005A add_to5 move.b #'Z',fchar(a1) Not a-z or A-Z, then use Z 0005 1865 00000B74 0CA9 E0FF add_to6 cmpi.l #rom_msus,fmsus(a1) Compute Selector: look for ROM FFFF 0006 1866 00000B7C 6606 bne.s add_to7 PAGE 43 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1867 00000B7E 4229 0004 clr.b fsel(a1) Zero selector if ROM 1868 00000B82 602C bra.s add_to11 1869 00000B84 1229 0005 add_to7 move.b fchar(a1),d1 Maximum in found_list plus 1 1870 00000B88 4200 clr.b d0 if Not ROM: Zero so far 1871 00000B8A 206D FFE6 movea.l found_list(a5),a0 Point to found_list 1872 00000B8E B0FC 0000 add_to8 cmpa.w #0,a0 1873 00000B92 6716 beq.s add_to10 Done when at end of list 1874 00000B94 B228 0005 cmp.b fchar(a0),d1 Only for same character 1875 00000B98 660A bne.s add_to9 Go to Next one 1876 00000B9A B028 0004 cmp.b fsel(a0),d0 If greater, use it 1877 00000B9E 6C04 bge.s add_to9 Otherwise, go to next one 1878 00000BA0 1028 0004 move.b fsel(a0),d0 New maximum 1879 00000BA4 2068 0000 add_to9 movea.l fnext(a0),a0 1880 00000BA8 60E4 bra.s add_to8 1881 00000BAA 5240 add_to10 addq #1,d0 One plus maximum 1882 00000BAC 1340 0004 move.b d0,fsel(a1) 1883 00000BB0 236D FFE6 add_to11 move.l found_list(a5),fnext(a1) Add to found_list 0000 1884 00000BB6 2B49 FFE6 move.l a1,found_list(a5) 1885 00000BBA 4AA9 0000 tst.l fnext(a1) Initialize Menu if 1st found 1886 00000BBE 6606 bne.s add_to14 1887 00000BC0 3B7C 0001 move #1,next_line(a5) Point to next free menu line FEDA 1888 00000BC6 6128 add_to14 bsr.s inc_nxt tabxy and increment to next line 1889 00000BC8 2029 0006 move.l fmsus(a1),d0 If msus not displayed, 1890 00000BCC B0AD FEE0 cmp.l disp_msus(a5),d0 then display it 1891 00000BD0 6714 beq.s add_to22 1892 00000BD2 2B40 FEE0 move.l d0,disp_msus(a5) Record current msus 1893 00000BD6 41F8 FDD2 lea fubuffer,a0 Build in fubuffer 1894 00000BDA 2200 move.l d0,d1 Build msus in fubuffer 1895 00000BDC 6100 535E bsr buildmsus 1896 00000BE0 4218 clr.b (a0)+ Zero Terminate the string 1897 00000BE2 6134 bsr.s menu_disp Display msus 1898 00000BE4 610A bsr.s inc_nxt Set up for next line 1899 00000BE6 6100 008A add_to22 bsr build_fname Put up filename 1900 00000BEA 4CDF 0707 add_to23 movem.l (sp)+,a0-a2/d0-d2 Restore Registers 1901 00000BEE 4E75 rts 1902 1903 00000BF0 322D FEDA inc_nxt move next_line(a5),d1 Position to next free line 1904 00000BF4 302C 0046 move width(a4),d0 X=width/2+1, Y=next_line 1905 00000BF8 E248 lsr #1,d0 1906 00000BFA 5240 addq #1,d0 1907 00000BFC 4EAC 003C jsr tabxy(a4) 1908 00000C00 526D FEDA addq #1,next_line(a5) Increment to next available line 1909 00000C04 302C 0052 move height(a4),d0 Wrap around if greater than 1910 00000C08 5540 subq #2,d0 height-2 1911 00000C0A B06D FEDA cmp next_line(a5),d0 1912 00000C0E 6C06 bge.s inc_nxt1 1913 00000C10 3B7C 0001 move #1,next_line(a5) FEDA 1914 00000C16 4E75 inc_nxt1 rts 1915 1916 00000C18 322C 0046 menu_disp move width(a4),d1 Compute line width 1917 00000C1C E249 lsr #1,d1 1918 00000C1E 41F8 FDD2 lea fubuffer,a0 1919 00000C22 4240 clr d0 1920 00000C24 1018 menu_disp1 move.b (a0)+,d0 Copy string PAGE 44 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1921 00000C26 670A beq.s menu_disp2 1922 00000C28 5341 subq #1,d1 1923 00000C2A 6D12 blt.s menu_disp4 1924 00000C2C 4EAC 0036 jsr wtb(a4) 1925 00000C30 60F2 bra.s menu_disp1 1926 00000C32 7020 menu_disp2 moveq #' ',d0 Blank Pad 1927 00000C34 5341 menu_disp3 subq #1,d1 1928 00000C36 6D06 blt.s menu_disp4 Done 1929 00000C38 4EAC 0036 jsr wtb(a4) 1930 00000C3C 60F6 bra.s menu_disp3 1931 00000C3E 322D FEDA menu_disp4 move next_line(a5),d1 Clear next line 1932 00000C42 0C41 0001 cmpi #1,d1 Unless Top line on 1st 1933 00000C46 6606 bne.s menu_disp5 1934 00000C48 4A2D FEDC tst.b disp_wrap(a5) 1935 00000C4C 661E bne.s menu_disp7 Skip clear 1936 00000C4E 302C 0046 menu_disp5 move width(a4),d0 Position to 1937 00000C52 E248 lsr #1,d0 X=width/2+1, Y=next_line 1938 00000C54 5240 addq #1,d0 1939 00000C56 4EAC 003C jsr tabxy(a4) 1940 00000C5A 7020 moveq #' ',d0 Blank it 1941 00000C5C 322C 0046 move width(a4),d1 1942 00000C60 E249 lsr #1,d1 1943 00000C62 4EAC 0036 menu_disp6 jsr wtb(a4) 1944 00000C66 5341 subq #1,d1 1945 00000C68 6EF8 bgt.s menu_disp6 1946 00000C6A 4E75 rts 1947 00000C6C 51ED FEDC menu_disp7 sf disp_wrap(a5) No more special case 1948 00000C70 4E75 rts 1949 1950 00000C72 41F8 FDD2 build_fname lea fubuffer,a0 Build string in a0 1951 00000C76 30FC 2020 move #' ',(a0)+ Indent 2 1952 00000C7A 4240 clr d0 1953 00000C7C 1029 0004 move.b fsel(a1),d0 Put out 2 digit selector 1954 00000C80 6100 FDD4 bsr putnum 1955 00000C84 10E9 0005 move.b fchar(a1),(a0)+ Put out Selector character 1956 00000C88 10FC 0020 move.b #' ',(a0)+ Put out space 1957 00000C8C 0CA9 E0FF cmpi.l #rom_msus,fmsus(a1) If it's a ROM system take FFFF 0006 1958 00000C94 6604 bne.s build_fname0 1st character only 1959 00000C96 7201 moveq #1,d1 1960 00000C98 6010 bra.s build_fname1 1961 00000C9A 4241 build_fname0 clr d1 Copy Filename 1962 00000C9C 1229 000A move.b fname(a1),d1 Get Length 1963 00000CA0 0C41 00F9 cmpi #249,d1 Max 249 allowed 1964 00000CA4 6F04 ble.s build_fname1 1965 00000CA6 323C 00F9 move #249,d1 1966 00000CAA 45E9 000B build_fname1 lea fname+1(a1),a2 1967 00000CAE 4A41 build_fname2 tst d1 1968 00000CB0 6F06 ble.s build_fname3 1969 00000CB2 10DA move.b (a2)+,(a0)+ 1970 00000CB4 5341 subq #1,d1 1971 00000CB6 60F6 bra.s build_fname2 1972 00000CB8 4218 build_fname3 clr.b (a0)+ Zero Terminate string 1973 00000CBA 6000 FF5C bra menu_disp Display line 1974 1975 ****************************************************************************** 1976 * boot_select sets msus(a5) and filename(a5) * PAGE 45 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOTER (BOOTROM0)" 1977 * If there is a match with the user's selection and the found_list * 1978 * then return true and set msus and filename to choice. * 1979 * a3 points to Bootlist Entry * 1980 * a4 points to LOWRAM area * 1981 * a5 points to Boot Scanner local area * 1982 ****************************************************************************** 1983 00000CBE 342C 02D2 boot_select move boot_sel(a4),d2 Check for user choice 1984 00000CC2 4A02 tst.b d2 1985 00000CC4 6734 beq.s boot_sel4 Nothing yet 1986 00000CC6 206D FFE6 movea.l found_list(a5),a0 Search Found list for match 1987 00000CCA B0FC 0000 boot_sel1 cmpa.w #0,a0 1988 00000CCE 672A beq.s boot_sel4 No Match in list 1989 00000CD0 B468 0004 cmp fsel(a0),d2 Both Character and Selector 1990 00000CD4 6706 beq.s boot_sel2 must match 1991 00000CD6 2068 0000 movea.l fnext(a0),a0 1992 00000CDA 60EE bra.s boot_sel1 Try next one 1993 00000CDC 45E8 000A boot_sel2 lea fname(a0),a2 Set filename 1994 00000CE0 1028 000A move.b fname(a0),d0 1995 00000CE4 5240 addq #1,d0 1996 00000CE6 43ED FEE4 lea filename(a5),a1 Address of destination 1997 00000CEA 12DA boot_sel3 move.b (a2)+,(a1)+ 1998 00000CEC 5340 subq #1,d0 1999 00000CEE 6EFA bgt.s boot_sel3 2000 00000CF0 2B68 0006 move.l fmsus(a0),msus(a5) Set Msus FFF0 2001 00000CF6 50C0 st d0 Return true 2002 00000CF8 4E75 rts 2003 00000CFA 51C0 boot_sel4 sf d0 Nothing found: return false 2004 00000CFC 4E75 rts PAGE 46 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2007 ****************************************************************************** 2008 ****************************************************************************** 2009 *** *** 2010 *** Initialization/Test Vectors *** 2011 *** *** 2012 *** Entries Supported Internally: *** 2013 *** I_LIST Power-up Init/Test Vector List *** 2014 ****************************************************************************** 2015 ****************************************************************************** 2016 2017 ****************************************************************************** 2018 * Initialization/Test List * 2019 ****************************************************************************** 2020 00000CFE 0000 0DAA i_list dc.l which_processor,4 Which processor are we on 2021 00000D06 0000 0E0A dc.l init_timer,4 Initialize processor board timer 2022 00000D0E 0000 0E6E dc.l mon_init,4 Initialize Monitor 2023 00000D16 0000 0E88 dc.l display_init,4 Initialize & Test Display 2024 00000D1E 0000 1D18 dc.l prom_init,4 Initialize PROM 2025 00000D26 0000 1002 dc.l boot_init,4 Checksum the Bootrom 2026 00000D2E 0000 10BC dc.l proc_disp,4 Display processor type 2027 00000D36 0000 1150 dc.l keybd_init,4 Initialize KBD, RESET I/O and 2028 00000D3E 0000 125C dc.l level_init,4 Drop Interrupt Level 2029 00000D46 0000 1270 dc.l mem_init,4 Memory Pre-load and waits 2030 00000D4E 0000 12E6 dc.l grph_init,4 Clear Graphics RAM 2031 00000D56 0000 48AC dc.l bat_init,4 Initialize Battery 2032 00000D5E 0000 13DC dc.l flp_init,4 Initialize Floppy 2033 00000D66 0000 4AAA dc.l hpib_init,4 Test Internal HPIB 2034 00000D6E 0000 14D2 dc.l dma_init,4 Internal DMA Card 2035 00000D76 0000 1514 dc.l iocard_init,4 Test I/O Cards 2036 00000D7E 0000 1720 dc.l roms_init,4 Test ROMs in ROM Space 2037 00000D86 0000 182E dc.l tstram_init,4 Test RAM and set LOWRAM area 2038 00000D8E 0000 18A8 dc.l lram_init,4 Setup F_AREA to LOWRAM area 2039 00000D96 0000 1962 dc.l allocate,4 Allocate memory 2040 00000D9E 0000 198C dc.l leds_up,4 Put out final LED value 2041 00000DA6 0000 0000 dc.l 0 End of List 2042 2043 2044 ************************************************************************* 2045 * which_processor 2046 * Determine which processor you are running on. 2047 * The 68000 is distinguished from 68010 and 68012 by the fact that the 2048 * trap instruction stores 6 bytes on the stack for the 68000 and 8 bytes 2049 * for the 68010/12. 2050 ************************************************************************* 2051 2052 0000 0DAA which_processor equ * 2053 00000DAA 2F38 FF42 move.l trap14vec+2,-(sp) save old trap 14 vector 2054 00000DAE 3F38 FF40 move.w trap14vec,-(sp) 2055 00000DB2 31FC 4EF9 move.w #$4ef9,trap14vec jmp instruction FF40 2056 00000DB8 21FC 0000 move.l #trap_serv,trap14vec+2 point trap 14 vector to service routine 0DDE FF42 2057 00000DC0 4E4E trap #14 2058 00000DC2 5180 subq.l #8,d0 d0 = stack bytes used by the trap 2059 00000DC4 5BC0 smi d0 2060 00000DC6 4480 neg.l d0 d0 = 1 for 68000, 0 for 68010/12 2061 00000DC8 E588 lsl.l #M68000,d0 PAGE 47 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2062 00000DCA 08B8 0002 bclr #M68000,sysflag2 FEDA 2063 00000DD0 8138 FEDA or.b d0,sysflag2 set bit in sysflag2 2064 00000DD4 31DF FF40 move.w (sp)+,trap14vec restore original trap 14 vector 2065 00000DD8 21DF FF42 move.l (sp)+,trap14vec+2 2066 00000DDC 4E75 rts 2067 2068 0000 0DDE trap_serv equ * 2069 00000DDE 21FC 0000 move.l #trap_serv2,trap14vec+2 point to service routine 2 0DEC FF42 2070 00000DE6 200F move.l sp,d0 d0 = sp before trap 2071 00000DE8 4E4E trap #14 2072 00000DEA 4E73 rte 2073 2074 0000 0DEC trap_serv2 equ * 2075 00000DEC 908F sub.l sp,d0 2076 00000DEE 4E73 rte 2077 2078 ************************************************************************* 2079 * look_for_timer 2080 * Determine if you have a timer chip on the processor board. 2081 * Try to read from the status register of the chip and see if you get 2082 * a bus error. 2083 ************************************************************************* 2084 2085 0000 0DF0 look_for_timer equ * 2086 00000DF0 4DFA 0010 lea lftskp,a6 2087 00000DF4 4A39 005F tst.b $5f8003 test for the timer 8003 2088 00000DFA 08B8 0001 bclr #timer_absent,sysflag2 there is a timer FEDA 2089 00000E00 4E75 rts 2090 2091 00000E02 08F8 0001 lftskp bset #timer_absent,sysflag2 there is no timer FEDA 2092 00000E08 4E75 rts 2093 2094 ************************************************************************* 2095 * init_timer initialize the timer 2096 * reinit_timer initialize the timer w/o looking first 2097 * outputs enabled 2098 * no interrupts 2099 * continuous operating mode 2100 * 16 bit for counter 1 and 2, 8 bit for counter 3 2101 * external clock source 2102 * divide by 8 (temporary) 2103 * 2104 * CR1 x000000r 2105 * CR2 x000000a 2106 * CR3 10000101 2107 * x - don't care 2108 * r - counter reset 2109 * a - address bit (selects CR1 or CR3) 2110 ************************************************************************* 2111 2112 0000 0E0A init_timer equ * 2113 00000E0A 61E4 bsr look_for_timer look for hardware timer PAGE 48 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2114 0000 0E0C reinit_timer equ * 2115 00000E0C 0838 0001 btst #timer_absent,sysflag2 timer absent? FEDA 2116 00000E12 663C bne.s itskp branch if so 2117 00000E14 41F9 005F lea $5f8000,a0 a0 = address of timer 8000 2118 00000E1A 117C 0000 move.b #$00,3(a0) address CR3 0003 2119 00000E20 117C 0084 move.b #$84,1(a0) set up CR3 ($85 for divide by 8) 0001 2120 00000E26 117C 0001 move.b #$01,3(a0) set up CR2 (address CR1) 0003 2121 00000E2C 117C 0001 move.b #$01,1(a0) set up CR1, stop timer 0001 2122 00000E32 117C 00FF move.b #$ff,9(a0) set timer 2 to $ffff 0009 2123 00000E38 117C 00FF move.b #$ff,11(a0) 000B 2124 00000E3E 117C 00FF move.b #$ff,13(a0) set timer 3 to $ffff 000D 2125 00000E44 117C 00FF move.b #$ff,15(a0) 000F 2126 00000E4A 117C 0000 move.b #$00,1(a0) start timer 0001 2127 00000E50 4E75 itskp rts 2128 2129 ************************************************************************* 2130 * cleanup_buserr clean up after a bus error 2131 * cleans off stack -- bus errors always return through a6 2132 * have to clean of stack differently for 68000 and 68010/12 2133 ************************************************************************* 2134 2135 0000 0E52 cleanup_buserr equ * 2136 00000E52 0838 0002 btst #M68000,sysflag2 FEDA 2137 00000E58 670A beq.s m10or12 if bit is 0, it's a 68010/12 2138 2139 * Clean up after 68000. it's a 68000 2140 2141 00000E5A 2F57 000E move.l (sp),14(sp) overwrite the return address 2142 00000E5E 4FEF 000E lea 14(sp),sp throw away extra info 2143 00000E62 4E75 rts 2144 2145 * Clean up after 68010/12. 2146 2147 00000E64 2F57 003A m10or12 move.l (sp),58(sp) overwrite the return address 2148 00000E68 4FEF 003A lea 58(sp),sp throw away extra info 2149 00000E6C 4E75 rts 2150 2151 ****************************************************************************** 2152 * Monitor Initialization * 2153 ****************************************************************************** 2154 00000E6E 4DFA 0016 mon_init lea mon_init1,a6 Get Ready for Bus error 2155 00000E72 0C79 4EF9 cmpi #jmpop,monitor Check for Existence of a Monitor 0088 0000 2156 00000E7A 660A bne.s mon_init1 No RAM Monitor is Present 2157 00000E7C 2878 FED4 movea.l f_area,a4 Indicate Monitor Presence PAGE 49 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2158 00000E80 08EC 0006 bset #mon_p,booleans(a4) 000B 2159 00000E86 4E75 mon_init1 rts 2160 2161 ****************************************************************************** 2162 * Initialize the Display Drivers * 2163 * * 2164 * Modified Spring 1984 by Anny Randel to handle the 9837 high res. * 2165 * CRT. Note that all the code that deals with the 9837 high res. * 2166 * CRT before this driver is called is uneccessary now. It wasn't * 2167 * taken out because these changes were made so close to Q.A. that * 2168 * we didn't feel confident enough to make such a major change. * 2169 ****************************************************************************** 2170 2171 00000E88 207C 0056 display_init movea.l #hrsel,a0 A0 = Internal Gator address 0000 2172 00000E8E 0838 0006 btst #6,sysflag Have we found an Internal Gator? FED2 2173 00000E94 6614 bne.s display_init000 Yep 2174 2175 00000E96 4DFA 0064 lea display_init1,a6 No, Look for one (look for internal CRT if no gator foun 2176 00000E9A 1028 0001 move.b g_id(a0),d0 Get Gator ID byte 2177 00000E9E 0C00 0019 cmpi.b #25,d0 Check for Gator ID 2178 00000EA2 6658 bne.s display_init1 Branch if not gator ID 2179 00000EA4 08F8 0006 bset #6,sysflag Set up sysflag for gator CRT FED2 2180 2181 0000 0EAA display_init000 equ * 2182 00000EAA 4DFA 0038 lea display_init0,a6 On Gator, go handle internal 2183 * if bus error occurs 2184 00000EAE 2A4F movea.l sp,a5 Save sp in case of bus error 2185 00000EB0 2878 FED4 movea.l f_area,a4 A4 = F_AREA pointer 2186 2187 00000EB4 08AC 0004 bclr #mb_badHiRes,m_b(a4) No failure in Hi Res CRT yet 0054 2188 00000EBA 08AC 0005 bclr #mb_btemp,m_b(a4) No failure in internal Alpha yet 0054 2189 2190 00000EC0 701D moveq #gatorf,d0 Indicate gator test to leds 2191 00000EC2 6100 0BA2 bsr led_state 2192 2193 00000EC6 6100 4CAC display_init00 bsr winit_hr Initialize Vectors 2194 * Checksum Gator ID ROM (a0=hrsel) 2195 00000ECA 283C 0000 move.l #$4000,d4 Size of checksum (8K words) 4000 2196 00000ED0 6100 0C94 bsr sumrom Checksum ROM 2197 00000ED4 4A43 tst d3 See if odd bytes checksummed ok 2198 00000ED6 6700 0024 beq display_init1 Continue if ok 2199 00000EDA 08EC 0004 bset #mb_badHiRes,m_b(a4) Remember it was bad, and 0054 2200 00000EE0 6000 001A bra display_init1 Go on (If problem was severe, 2201 * we would have bus errored by now) 2202 2203 00000EE4 2E4D display_init0 movea.l a5,sp Restore stack pointer on bus err 2204 00000EE6 0838 0006 btst #6,sysflag If there is an internal gator FED2 2205 00000EEC 6700 000E beq display_init1 and we got to here, PAGE 50 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2206 * Then it must have died, so 2207 00000EF0 08EC 0004 bset #mb_badHiRes,m_b(a4) Set bad Hi Res bit in RAM and 0054 2208 00000EF6 08B8 0006 bclr #6,sysflag Clear gator bit in sysflag FED2 2209 2210 2211 00000EFC 4DFA 00AE display_init1 lea display_init5,a6 Set up CRT drivers (on Bus Error 2212 * assume there is no CRT) 2213 00000F00 2A4F movea.l sp,a5 Save Stack Pointer 2214 00000F02 2878 FED4 movea.l f_area,a4 2215 2216 00000F06 08AC 0005 bclr #mb_btemp,m_b(a4) Okay so far no failures in alpha 0054 2217 00000F0C 08AC 0007 bclr #mb_btemp2,m_b(a4) Assume internal CRT's there for now 0054 2218 2219 2220 0000 0F12 display_init1_0 equ * 2221 00000F12 701E moveq #crtf,d0 Indicate To leds 2222 00000F14 6100 0B50 bsr led_state 2223 00000F18 43F9 0051 lea crtc+1,a1 Blank CRT So Memory Test is Not 0001 2224 00000F1E 12BC 000C move.b #12,(a1) Seen 2225 00000F22 137C 0000 move.b #0,2(a1) (clr.b 2(a1) could bus error) 0002 2226 00000F28 4DFA F9E0 lea long_zero,a6 Wait 50 ms for Blank to take effect 2227 00000F2C 7032 moveq #50,d0 2228 00000F2E 6100 6A40 bsr f_clock 2229 00000F32 4DFA 0078 lea display_init5,a6 Set up CRT drivers (on Bus Error 2230 * assume there is no CRT) 2231 00000F36 45F9 0051 lea alphstrt,a2 Test Alpha Memory, Point to start 2001 2232 * try to detect missing alpha RAM auto-dtack-ed by the 98204; do this by... 2233 00000F3C 1212 move.b (a2),d1 reading... 2234 00000F3E 7600 moveq #$00,d3 after this instruction prefetch... 2235 00000F40 1412 move.b (a2),d2 reading... 2236 00000F42 76FF moveq #$FF,d3 after this instruction prefetch... 2237 00000F44 B401 cmp.b d1,d2 and comparing the results 2238 00000F46 6664 bne.s display_init5 branch if different!!! 2239 00000F48 43F9 0051 lea alphstp,a1 Point to End of Alpha Memory 3001 2240 00000F4E 7EFF moveq #-1,d7 Test all 8 bits 2241 00000F50 6100 0C4E bsr bytram Test every other byte 2242 00000F54 4A40 tst d0 d0=0 means it passed 2243 00000F56 6626 bne.s display_init3 2244 00000F58 7006 moveq #6,d0 If it has highlight memory, 2245 00000F5A C038 FED2 and.b sysflag,d0 test that too 2246 00000F5E 7214 moveq #20,d1 2247 00000F60 0101 btst d0,d1 2248 00000F62 6724 beq.s display_init4 No Highlights 2249 00000F64 45F9 0051 display_init2 lea alphstrt+1,a2 Test Highlight Mem, Start 2002 2250 00000F6A 43F9 0051 lea alphstp+1,a1 Point to End 3002 2251 00000F70 2E3C 7F7F move.l #$7F7F7F7F,d7 Test only 7 bits 7F7F PAGE 51 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2252 00000F76 6100 0C28 bsr bytram Test every other byte 2253 00000F7A 4A40 tst d0 d0=0 means it passed 2254 00000F7C 670A beq.s display_init4 2255 00000F7E 6100 0B06 display_init3 bsr led_fail Indicate there has been a failure 2256 00000F82 08EC 0005 bset #mb_btemp,m_b(a4) 0054 2257 00000F88 223C 0020 display_init4 move.l #$00200020,d1 Blank Entire CRT 0020 2258 00000F8E 41F9 0051 lea alphstrt-1,a0 2000 2259 00000F94 343C 03FF move #$3FF,d2 Blank enough for all displays 2260 00000F98 20C1 display_in4_1 move.l d1,(a0)+ 2261 00000F9A 51CA FFFC dbra d2,display_in4_1 2262 00000F9E 0838 0006 btst #6,sysflag If 9837 (Gator) CRT then FED2 2263 00000FA4 661A bne.s display_init6 skip crt setup (already done) 2264 00000FA6 6100 4B3A bsr winit_a Setup CRT drivers (Clear Screen) 2265 00000FAA 6014 bra.s display_init6 2266 00000FAC 2E4D display_init5 movea.l a5,sp Restore Stack Pointer 2267 00000FAE 08EC 0007 bset #mb_btemp2,m_b(a4) CRT is not all there 0054 2268 00000FB4 0838 0006 btst #6,sysflag If 9837 (Gator) CRT then FED2 2269 00000FBA 6604 bne.s display_init6 skip crt setup (already done) 2270 00000FBC 6100 4E84 bsr winit_d Setup for dummy Write drivers 2271 00000FC0 2878 FED4 display_init6 movea.l f_area,a4 2272 00000FC4 397C 0001 move #1,nxt_sline(a4) Point to first self-test line 02D4 2273 00000FCA 6100 5CAC bsr remote_find Look for a remote H.I. 2274 00000FCE 41FA 47CE lea selftmsg,a0 Indicate Self_test in Progress 2275 00000FD2 6100 46B2 bsr displin 2276 00000FD6 48EC 0018 movem.l d3/d4,m_sarea(a4) Save any memory failure patterns 006A 2277 00000FDC 4DFA 0022 lea display_init7,a6 Turn off Graphics (handle bus err) 2278 00000FE0 4A79 0053 tst goff Do address sensitive devices 8000 2279 00000FE6 0838 0004 btst #4,sysflag CRT ID register? FED2 2280 00000FEC 6712 beq.s display_init7 branch if not 2281 00000FEE 7018 moveq #$18,d0 prepare to... 2282 00000FF0 C039 0051 and.b crtid,d0 extract the sub-top type bits FFFE 2283 00000FF6 6708 beq.s display_init7 branch if monochrome 2284 00000FF8 08B9 0000 bclr #0,cgrphoff clear graphics bit to turn off 0051 FFFD 2285 00001000 4E75 display_init7 rts 2286 2287 ****************************************************************************** 2288 * Checksum the BOOTROM. * 2289 ****************************************************************************** 2290 00001002 7003 boot_init moveq #romf,d0 Indicate to LEDs 2291 00001004 6100 0A60 bsr led_state 2292 * 2293 * Clear out Stack in BOOTROM Space for Soft BOOTROMs 2294 * 2295 00001008 7010 moveq #16,d0 2296 0000100A 41F8 00C0 lea $c0,a0 Clear Stack 1st PAGE 52 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2297 0000100E 4298 boot_init1 clr.l (a0)+ 2298 00001010 5340 subq #1,d0 2299 00001012 6EFA bgt.s boot_init1 2300 * 2301 * Checksum 48K Bytes (Every 16K Bytes has it's own Checksum) 2302 * 2303 00001014 41F8 0000 lea 0,a0 Start Address for Checksum 2304 00001018 283C 0001 move.l #boot_end,d4 Length for Checksum 0000 2305 0000101E 4DFA 0016 lea boot_init2,a6 If Bus ERROR, failure 2306 00001022 224F movea.l sp,a1 Save Stack Pointer 2307 00001024 6100 0B40 bsr sumrom 2308 00001028 4A40 tst d0 Non-zero means failure 2309 0000102A 660A bne.s boot_init2 Bad 2310 * 2311 * Display Bootrom Version Only, if BOOTROM checksums okay 2312 * 2313 0000102C 41FA 2FBA lea bootvmsg,a0 Indicate Bootrom version 2314 00001030 6100 0AF2 bsr present 2315 00001034 600A bra.s boot_init3 2316 * 2317 * Log Boot ROM Checksum Failure 2318 * 2319 00001036 2E49 boot_init2 movea.l a1,sp Restore Stack Pointer 2320 00001038 41FA 2FAE lea bootvmsg,a0 Indicate Bootrom version 2321 0000103C 6100 0AEA bsr failing 2322 * 2323 * Display any CRT Failure on screen now 2324 * 2325 00001040 2878 FED4 boot_init3 movea.l f_area,a4 2326 00001044 4CEC 0018 movem.l m_sarea(a4),d3/d4 Restore Memory Failure Information 006A 2327 2328 * 2329 * Check if High Resolution CRT is present or if it failed 2330 * 2331 0000104A 701D moveq #gatorf,d0 Indicate to leds 2332 0000104C 6100 0A18 bsr led_state 2333 00001050 082C 0004 btst #mb_badHiRes,m_b(a4) Check for bad Gator 0054 2334 00001056 6700 000E beq boot_init3_0 2335 0000105A 41FA 48F7 lea badgator,a0 2336 0000105E 6100 0AC8 bsr failing Print failed message 2337 00001062 6000 0028 bra boot_init3_0_2 Don't print present mesg or missing msg 2338 00001066 0838 0006 boot_init3_0 btst #6,sysflag Is there a Gator in the house??? FED2 2339 0000106C 6700 000C beq boot_init3_0_1 Nope 2340 00001070 41FA 48F5 lea goodgator,a0 2341 00001074 6100 0AAE bsr present Tell 'em there's a gator present 2342 00001078 6012 bra.s boot_init3_0_2 2343 * 2344 * Check if CRT is missing and required 2345 * 2346 0000 107A boot_init3_0_1 equ * 2347 0000107A 7C09 moveq #$9,d6 Is 9837 high res. CRT required? 2348 0000107C 6100 0D64 bsr required 2349 00001080 6600 000A bne boot_init3_0_2 PAGE 53 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2350 00001084 41FA 48E1 lea goodgator,a0 2351 00001088 6100 0AC6 bsr missing Indicate missing 2352 2353 0000108C 701E boot_init3_0_2 moveq #crtf,d0 Indicate To leds 2354 0000108E 6100 09D6 bsr led_state 2355 00001092 41FA 48B5 lea badalph,a0 2356 00001096 082C 0007 btst #mb_btemp2,m_b(a4) Is CRT Missing 0054 2357 0000109C 670C beq.s boot_init3_1 No 2358 0000109E 7C02 moveq #$2,d6 Check if CRT is required 2359 000010A0 6100 0D40 bsr required 2360 000010A4 6604 bne.s boot_init3_1 2361 000010A6 6000 0AA8 bra missing Supposed to be there, failure 2362 000010AA 082C 0005 boot_init3_1 btst #mb_btemp,m_b(a4) If any failure in CRT 0054 2363 000010B0 6708 beq.s boot_init5 then indicate it 2364 000010B2 6100 0A74 boot_init3_2 bsr failing (Compact Code Call to sftmsg) 2365 000010B6 6000 0BFA bra mem_fail0 Indicate any Memory Failures 2366 000010BA 4E75 boot_init5 rts 2367 2368 ****************************************************************************** 2369 * Display Processor Type * 2370 ****************************************************************************** 2371 000010BC 41FA 4879 proc_disp lea processor,a0 processor message string 2372 000010C0 43F8 FDD2 lea fubuffer,a1 message buffer 2373 000010C4 12D8 move.b (a0)+,(a1)+ copy a char 2374 000010C6 66FC bne *-2 loop till done 2375 2376 000010C8 0838 0002 btst #M68000,sysflag2 are we on a 68000? FEDA 2377 000010CE 6678 bne.s proc_disp_msg branch if so; we're done! 2378 * 2379 * not a 68000; try to distinguish the 68010 and 68012 by decoding the 2380 * 68012's 4 extra address bits with the memory management unit hardware 2381 * 2382 * note: high RAM physical addresses below are expressed with 32-bits 2383 * to take advanatge of the processor's short absolute addressing 2384 * mode; only 24 bits are really put on the backplane. 2385 * 2386 0000 3FFF USTP_VAL equ $3FFF put user segment table at highest page 2387 2388 0EFF FFFE TEST_LOG_ADR equ $0EFFFFFE test word logical address (28 bits) 2389 2390 FFFF FFBE STE_ADR_68012 equ $FFFFFFBE segment table entry address for 68012 2391 FFFF FFFE STE_ADR_68010 equ $FFFFFFFE segment table entry address for 68010 2392 2393 0000 FFFE STE_VAL_68012 equ $FFFE segment table entry value for 68012 2394 0000 FFFF STE_VAL_68010 equ $FFFF segment table entry value for 68010 2395 2396 FFFF FBFE PTE_ADR_68012 equ $FFFFFBFE page table entry address for 68012 2397 FFFF FFFE PTE_ADR_68010 equ $FFFFFFFE page table entry address for 68010 2398 2399 0000 FFFE PTE_VAL_68012 equ $FFFE page table entry value for 68012 2400 0000 FFFF PTE_VAL_68010 equ $FFFF page table entry value for 68010 2401 2402 FFFF FBFE PHY_ADR_68012 equ $FFFFFBFE test word physical address for 68012 2403 FFFF FFFE PHY_ADR_68010 equ $FFFFFFFE test word physical address for 68010 PAGE 54 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2404 2405 2406 000010D0 11FC 0031 move.b #'1',fubuffer+5 it's at least a 6801X FDD7 2407 2408 000010D6 43F8 FFBE lea STE_ADR_68012,a1 prepare to... 2409 000010DA 3211 move (a1),d1 save, then 2410 000010DC 32BC FFFE move #STE_VAL_68012,(a1) set the 68012 STE 2411 2412 000010E0 45F8 FBFE lea PTE_ADR_68012,a2 prepare to... 2413 000010E4 3412 move (a2),d2 save, then 2414 000010E6 34BC FFFE move #PTE_VAL_68012,(a2) set the 68012 PTE/PHY_VALUE 2415 2416 000010EA 47F8 FFFE lea STE_ADR_68010,a3 prepare to... 2417 000010EE 3613 move (a3),d3 save, then 2418 000010F0 36BC FFFF move #STE_VAL_68010,(a3) set the 68010 STE/PTE/PHY_VALUE 2419 2420 000010F4 4DFA 0036 lea proc_disp_6801X,a6 be prepared for a bus error 2421 000010F8 33FC 3FFF move #USTP_VAL,mmu_ustp set user segment table pointer 005F 4006 2422 00001100 33FC 0001 move #$0001,mmu_casr enable user mapping 005F 400E 2423 00001108 4A79 005F tst mmu_tlbp purge the tlb 400A 2424 0000110E 7801 moveq #$01,d4 function code for user data 2425 00001110 4E7B 4000 movec d4,sfc set the source function code 2426 00001114 0E79 4000 moves TEST_LOG_ADR,d4 perform a (user) logical read 0EFF FFFE 2427 2428 0000111C 7032 moveq #'2',d0 prepare to indicate a 68012 2429 0000111E B878 FBFE cmp PHY_ADR_68012,d4 same data as our logical read? 2430 00001122 670A beq.s proc_disp_clean branch if so 2431 2432 00001124 7030 moveq #'0',d0 prepare to indicate a 68010 2433 00001126 B878 FFFE cmp PHY_ADR_68010,d4 same data as our logical read? 2434 0000112A 6702 beq.s proc_disp_clean branch if so 2435 2436 0000112C 7058 proc_disp_6801X moveq #'X',d0 !!!???!!! 2437 2438 0000112E 3281 proc_disp_clean move d1,(a1) restore original contents 2439 00001130 3482 move d2,(a2) restore original contents 2440 00001132 3683 move d3,(a3) restore original contents 2441 00001134 4DFA 000E lea proc_disp_slc,a6 be prepared for a bus error 2442 00001138 4279 005F clr mmu_casr disable user mapping 400E 2443 0000113E 4A79 005F tst mmu_tlbp purge the tlb 400A 2444 2445 00001144 11C0 FDD8 proc_disp_slc move.b d0,fubuffer+6 set last character 2446 2447 00001148 41F8 FDD2 proc_disp_msg lea fubuffer,a0 point to message to print 2448 0000114C 6000 44EC bra sftmsg put up the message and return 2449 2450 ****************************************************************************** 2451 * Test Keyboard and Enable Input Portion of Human Interface * 2452 ****************************************************************************** 2453 00001150 2878 FED4 keybd_init movea.l f_area,a4 PAGE 55 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2454 00001154 6100 5CE4 bsr remote_flush flush all IO before resetting 2455 00001158 4DFA 001A lea keybd_init1,a6 Get Ready for a missing keyboard 2456 0000115C 2A4F movea.l sp,a5 Save Stack Pointer 2457 0000115E 7012 moveq #keyf,d0 Indicate to LEDs 2458 00001160 6100 0904 bsr led_state 2459 00001164 7231 moveq #$31,d1 Tell Kbd to Get Busy 2460 00001166 700F moveq #15,d0 Allow for a 75 usec time out 2461 00001168 6100 4F12 bsr kbd_wcmd Write Command with time out 2462 0000116C 6606 bne.s keybd_init1 Non-zero, if time out 2463 0000116E 700F moveq #15,d0 Wait for Command to Start 2464 00001170 6100 4EA2 bsr kbd_cwait Allow for a 75 usec time out 2465 2466 * NOTE: The RESET instruction must be performed within 100 usec of 2467 * the $31 command which is sent to the 8041. This is an 8041 requirement. 2468 * The $31 command must be sent to the 8041 before any RESET instruction 2469 * to prevent the 8041 from losing track of time (Hardware Requirement). 2470 * The clock must be re-initialized after the reset instruction is executed. 2471 2472 00001174 2E4D keybd_init1 movea.l a5,sp Restore Stack Pointer 2473 00001176 4E70 reset Reset I/O; May Be Auto REBOOT 2474 00001178 08AC 0002 bclr #mb_stop,m_b(a4) Don't Stop Search Yet 0054 2475 0000117E 422C 0055 clr.b r_lock(a4) No RESET's pending 2476 00001182 08AC 0001 bclr #mb_lock,m_b(a4) Allow All Kinds of RESET 0054 2477 00001188 203C 0000 move.l #20,d0 Delay 50us for streched 0014 2478 0000118E 4E71 keybd_init7 nop reset to timer on IQ board 2479 00001190 51C8 FFFC dbra d0,keybd_init7 2480 00001194 6100 FC74 bsr init_timer Re-initialize the timer, if present 2481 00001198 6100 5B9C bsr remote_init Initialize Any Remote H.I. 2482 0000119C 4DFA 0048 lea keybd_in1_1,a6 Get Ready for a missing keyboard 2483 000011A0 203C 0007 move.l #500000,d0 Set Timer for Approx. 1 Sec A120 2484 000011A6 6100 4EEE bsr kbd_rdata Wait for Keyboard to Do Self Test 2485 000011AA 663A bne.s keybd_in1_1 Keyboard Timed out 2486 000011AC 7200 moveq #0,d1 2487 000011AE 41F9 0042 lea kbdstatus,a0 prepare to... 8003 2488 000011B4 1210 move.b (a0),d1 read status... 2489 000011B6 7600 moveq #$00,d3 after this instruction pre-fetch 2490 000011B8 1410 move.b (a0),d2 then read status... 2491 000011BA 76FF moveq #$FF,d3 after this instruction pre-fetch 2492 000011BC B401 cmp.b d1,d2 do they match? 2493 000011BE 6626 bne.s keybd_in1_1 branch if not; floating bus!!! 2494 000011C0 C23C 00F0 and.b #$F0,d1 Check For Completed Self Test 2495 000011C4 0C01 0070 cmpi.b #$70,d1 2496 000011C8 661C bne.s keybd_in1_1 2497 000011CA 0C00 008E cmpi.b #$8E,d0 Check For Completed Self Test 2498 000011CE 662A bne.s keybd_init2 Keyboard Must be there and bad 2499 000011D0 4A39 0047 tst.b int_hpibstatus This Register Must be Present 8005 2500 000011D6 08B8 0003 bclr #3,sysflag Keyboard is Now Present FED2 2501 000011DC 41FA 479D lea goodkbd,a0 Indicate keyboard presence 2502 000011E0 6100 0942 bsr present 2503 000011E4 601C bra.s keybd_init3 PAGE 56 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2504 * 2505 * Keyboard is Missing 2506 * 2507 000011E6 2E4D keybd_in1_1 movea.l a5,sp Restore Stack Pointer 2508 000011E8 7C01 moveq #1,d6 Check if Keyboard is supposed 2509 000011EA 6100 0BF6 bsr required to be there 2510 000011EE 6612 bne.s keybd_init3 2511 000011F0 41FA 4789 lea goodkbd,a0 Indicate keyboard missing 2512 000011F4 6100 095A bsr missing 2513 000011F8 6008 bra.s keybd_init3 2514 * 2515 * Keyboard is There and Failed 2516 * 2517 000011FA 41FA 477F keybd_init2 lea goodkbd,a0 2518 000011FE 6100 0928 bsr failing Yes, indicate failure 2519 * 2520 * Set-up Input Interface 2521 * 2522 00001202 43F8 FEE0 keybd_init3 lea lastvector,a1 Default the Vectors To Crash 2523 00001206 70FA moveq #buserrv,d0 Before dropping Interrupt Level 2524 00001208 2878 FED4 movea.l f_area,a4 2525 0000120C 082C 0006 keybd_init4 btst #mon_p,booleans(a4) If Monitor present don't 000B 2526 00001212 6710 beq.s keybd_init4_1 Screw up Trap 15 and Trace 2527 00001214 B2FC FF3A cmpa.w #trp15,a1 2528 00001218 6706 beq.s keybd_init4_0 2529 0000121A B2FC FFD0 cmpa.w #trptrc,a1 2530 0000121E 6604 bne.s keybd_init4_1 2531 00001220 5C89 keybd_init4_0 addq.l #6,a1 2532 00001222 600A bra.s keybd_init4_2 2533 00001224 32FC 4EB9 keybd_init4_1 move #jsrop,(a1)+ Use JSR So Crash Routine 2534 00001228 22FC 0000 move.l #bcrash,(a1)+ can Figure the Vector Address 4EFA 2535 0000122E B089 keybd_init4_2 cmp.l a1,d0 Done Yet? 2536 00001230 66DA bne.s keybd_init4 2537 00001232 0838 0003 btst #3,sysflag Setup Input Drivers FED2 2538 00001238 6606 bne.s keybd_init5 2539 0000123A 6100 52C4 bsr rinit_a Set-up 8041 keyboard drivers 2540 0000123E 6004 bra.s keybd_init6 2541 00001240 6100 528A keybd_init5 bsr rinit_d Set-up Dummy keyboard drivers 2542 00001244 6100 5AF0 keybd_init6 bsr remote_init Initialize Any Remote H.I. 2543 00001248 2878 FED4 movea.l f_area,a4 2544 0000124C 302C 0052 move height(a4),d0 Clear line height 2545 00001250 6100 4382 bsr clrline 2546 00001254 41FA 4558 lea resetmsg,a0 Indicate Reset Key Set-up 2547 00001258 6000 4358 bra putmsg 2548 2549 ****************************************************************************** 2550 * Drop Interrupt Level - But First Tell the Floppy to Stop Interrupting. * 2551 ****************************************************************************** 2552 0000125C 31FC 4EF9 level_init move #jmpop,flpyvctr Handle Controller Chips FFB8 2553 00001262 21FC 0000 move.l #flpint,flpyvctr+2 that Falsely Interrupt at 4F00 FFBA 2554 * Power-up 2555 0000126A 027C F000 andi #$F000,sr Drop int level to zero PAGE 57 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2556 0000126E 4E75 rts 2557 2558 ****************************************************************************** 2559 * Pre-load For Memory test if there is going to be one and wait for * 2560 * floppy and refresh failures * 2561 ****************************************************************************** 2562 00001270 2878 FED4 mem_init movea.l f_area,a4 Check if RAM is to be tested 2563 00001274 082C 0004 btst #lowram_ok,booleans(a4) 000B 2564 0000127A 6656 bne.s mem_init7 Don't touch the RAM please 2565 0000127C 7008 moveq #rampf,d0 Indicate State to LEDs 2566 0000127E 6100 07E6 bsr led_state 2567 00001282 41FA 445C lea memptst,a0 Indicate Memory Preload 2568 00001286 6100 43FE bsr displin 2569 0000128A 082C 0001 btst #ram_test,booleans(a4) Check which pre-load to do 000B 2570 00001290 672C beq.s mem_init3 Do Quick test pre-load 2571 00001292 4DFA 0024 lea mem_init2,a6 Set-up for Bus error 2572 00001296 203C EEEE move.l #$EEEE1111,d0 Do 64 bytes at once 1111 2573 0000129C 2200 move.l d0,d1 2574 0000129E 2401 move.l d1,d2 2575 000012A0 2602 move.l d2,d3 2576 000012A2 2803 move.l d3,d4 2577 000012A4 2A04 move.l d4,d5 2578 000012A6 2C05 move.l d5,d6 2579 000012A8 2E06 move.l d6,d7 2580 000012AA 41F8 C000 lea topram,a0 2581 000012AE 90FC 0020 mem_init1 suba.w #32,a0 Make a0 Predictable at Bus error 2582 000012B2 48D0 00FF movem.l d0-d7,(a0) 2583 000012B6 60F6 bra.s mem_init1 2584 000012B8 D0FC 0020 mem_init2 adda.w #32,a0 Point to last non-bus error 2585 000012BC 6010 bra.s mem_init6 2586 000012BE 4DFA 000C mem_init3 lea mem_init5,a6 Set-up for Bus error 2587 000012C2 41F8 BFFC lea topram-4,a0 Write Addresses 2588 000012C6 2088 mem_init4 move.l a0,(a0) 2589 000012C8 5988 subq.l #4,a0 Make a0 Predictable at Bus error 2590 000012CA 60FA bra.s mem_init4 2591 000012CC 5888 mem_init5 addq.l #4,a0 Point to last non-bus error 2592 000012CE 2948 02D6 mem_init6 move.l a0,midram(a4) Save Bottom of RAM 2593 000012D2 41FA 44CA mem_init7 lea selftmsg,a0 2594 000012D6 6100 43AE bsr displin 2595 000012DA 4DFA F62E lea long_zero,a6 Floppy Wait: Point a6 to zero byte 2596 000012DE 303C 012C move.w #300,d0 Set for 300 ms wait for Floppy 2597 000012E2 6000 668C bra f_clock Use Floppy Software Clock 2598 2599 ****************************************************************************** 2600 * Clear Graphics Memory * 2601 ****************************************************************************** 2602 000012E6 701F grph_init moveq #grphf,d0 Indicate to LEDs 2603 000012E8 6100 077C bsr led_state 2604 000012EC 76FF moveq #-1,d3 No Memory Failure Trapped Yet 2605 000012EE 78FF moveq #-1,d4 2606 000012F0 4DFA 00D8 lea grph_init9,a6 Point Bus Vector 2607 000012F4 2A4F movea.l sp,a5 Save Stack Pointer for Bus Error 2608 000012F6 0838 0004 btst #4,sysflag Check for CRT Configuration Reg. FED2 PAGE 58 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2609 000012FC 6762 beq.s grph_init1 Nope 2610 000012FE 45F9 0052 lea cgrphstart,a2 Start Address 0000 2611 00001304 43F9 0054 lea cgrphstart+$20000,a1 End Address + 1 (Assume 128K now) 0000 2612 0000130A 0839 0004 btst #4,crtid Check for Color Graphics 0051 FFFE 2613 00001312 660A bne.s grph_init0 Is Color 2614 00001314 0839 0003 btst #3,crtid Is it Color ? 0051 FFFE 2615 0000131C 6742 beq.s grph_init1 Nope 2616 0000131E 0839 0003 grph_init0 btst #3,crtid Is it 256K 0051 FFFE 2617 00001326 6744 beq.s grph_init2 No 2618 00001328 43F9 0056 lea cgrphstart+$40000,a1 It is 256K 0000 2619 0000132E 0839 0004 btst #4,crtid Is it Nibble Wide 0051 FFFE 2620 00001336 6634 bne.s grph_init2 No 2621 * 2622 * Nibble Wide Test 2623 * 2624 00001338 264A movea.l a2,a3 Save Registers 2625 0000133A 2849 movea.l a1,a4 2626 0000133C 2E3C 0F0F move.l #$0F0F0F0F,d7 Set Mask 0F0F 2627 00001342 6100 085C bsr bytram 2628 00001346 4A40 tst d0 2629 00001348 6638 bne.s grph_init3 It Failed 2630 0000134A 244B movea.l a3,a2 2631 0000134C 224C movea.l a4,a1 2632 0000134E 524A addq #1,a2 Start Address 2633 00001350 5249 addq #1,a1 End Address +1 2634 00001352 4DFA 0076 lea grph_init9,a6 Handle Bus Error 2635 00001356 6100 0848 bsr bytram 2636 0000135A 4A40 tst d0 2637 0000135C 6624 bne.s grph_init3 It Failed 2638 0000135E 603C bra.s grph_init5 Okay 2639 * 2640 * 2641 * 2642 00001360 45F9 0053 grph_init1 lea goff,a2 Start for Non-9836C 8000 2643 00001366 43F9 0054 lea goff+$8000,a1 End +1 for Non-9836C 0000 2644 * 2645 * Check Byte Wide Graphics 2646 * 2647 0000136C 0838 0001 grph_init2 btst #1,sysflag If Small Graphics do everyother FED2 2648 00001372 661C bne.s grph_init4 Byte only 2649 00001374 524A addq #1,a2 Start Address 2650 00001376 5249 addq #1,a1 End Address +1 2651 00001378 7EFF moveq #-1,d7 Test all bits 2652 0000137A 6100 0824 bsr bytram 2653 0000137E 4A40 tst d0 2654 00001380 671A beq.s grph_init5 It's okay PAGE 59 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2655 * 2656 * Graphics Is There and Failed 2657 * 2658 00001382 41FA 460F grph_init3 lea goodgrp,a0 Indicate on Screen 2659 00001386 6100 07A0 bsr failing 2660 0000138A 6100 0926 bsr mem_fail0 Tell Memory Location If there is one 2661 0000138E 6038 bra.s grph_init8 2662 * 2663 * Check Word Wide Graphics 2664 * 2665 00001390 4A52 grph_init4 tst (a2) See if it's Missing 2666 00001392 2A4A movea.l a2,a5 Start Address 2667 00001394 6100 0892 bsr test_ram 2668 00001398 4A00 tst.b d0 2669 0000139A 66E6 bne.s grph_init3 2670 * 2671 * Indicate Presence 2672 * 2673 0000139C 0838 0004 grph_init5 btst #4,sysflag Indicate Presence FED2 2674 000013A2 6718 beq.s grph_init6 Not Color 2675 000013A4 41FA 45DE lea goodcgr,a0 2676 000013A8 0839 0004 btst #4,crtid Check for Color Graphics 0051 FFFE 2677 000013B0 660E bne.s grph_init6_1 Color 2678 000013B2 0839 0003 btst #3,crtid Color ? 0051 FFFE 2679 000013BA 6604 bne.s grph_init6_1 Color 2680 000013BC 41FA 45D5 grph_init6 lea goodgrp,a0 Indicate Graphics Present 2681 000013C0 6100 0762 grph_init6_1 bsr present 2682 000013C4 6100 4138 grph_init7 bsr grphclear Clear and turn off Graphics 2683 000013C8 4E75 grph_init8 rts 2684 * 2685 * It's Missing 2686 * 2687 000013CA 2E4D grph_init9 movea.l a5,sp Restore Stack Pointer 2688 000013CC 7C04 moveq #4,d6 Check if required 2689 000013CE 6100 0A12 bsr required 2690 000013D2 66F4 bne.s grph_init8 2691 000013D4 41FA 45BD lea goodgrp,a0 Indicate it's missing 2692 000013D8 6000 0776 bra missing 2693 2694 ****************************************************************************** 2695 * Floppy Test (Controller and RAM) and Initialization * 2696 ****************************************************************************** 2697 000013DC 7016 flp_init moveq #flopf,d0 Indicate to LEDs 2698 000013DE 6100 0686 bsr led_state 2699 000013E2 76FF moveq #-1,d3 No Memory Failure Trapped Yet 2700 000013E4 78FF moveq #-1,d4 2701 000013E6 11FC 0001 move.b #$01,ndrives Assume 2 drives for Now FED8 2702 000013EC 4DFA 00C2 lea flp_init7,a6 No Floppy if Bus error 2703 000013F0 70A5 moveq #$A5,d0 See if Floppy RAM is present 2704 000013F2 41F9 0044 lea fbuffer,a0 E000 2705 000013F8 1080 move.b d0,(a0) 2706 000013FA 1410 move.b (a0),d2 PAGE 60 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2707 000013FC B400 cmp.b d0,d2 2708 000013FE 6600 00B0 bne flp_init7 Just ignore it 2709 00001402 705A moveq #$5A,d0 Try another value 2710 00001404 1080 move.b d0,(a0) 2711 00001406 1410 move.b (a0),d2 2712 00001408 B400 cmp.b d0,d2 2713 0000140A 6600 00A4 bne flp_init7 No match, just ignore it 2714 0000140E 4DFA 001E lea flp_init3,a6 2715 00001412 40E7 move sr,-(sp) Lock out interrupts during 2716 00001414 007C 2700 ori #$2700,sr this test 2717 00001418 45F9 0044 lea fbuffer,a2 LO RAM ADDR E000 2718 0000141E 43F9 0044 lea fbuffer+$200,a1 HI RAM " E200 2719 00001424 7EFF moveq #-1,d7 MASK 2720 00001426 6100 0778 bsr bytram 2721 0000142A 4A00 tst.b d0 2722 0000142C 671E beq.s flp_init4 2723 * 2724 * Floppy Failed 2725 * 2726 0000142E 46DF flp_init3 move (sp)+,sr Unlock interrupts 2727 00001430 50F8 FED8 flp_init3_1 st ndrives No Drives 2728 00001434 4DFA F4D4 lea long_zero,a6 Wait rest of 500 ms for refresh 2729 00001438 303C 00C8 move.w #200,d0 if no floppy 2730 0000143C 6100 6532 bsr f_clock 2731 00001440 41FA 4573 flp_init3_2 lea goodflp,a0 Indicate Missing Floppy 2732 00001444 6100 06E2 bsr failing Log Failure 2733 00001448 6000 0868 bra mem_fail0 Indicate Any Memory failure 2734 * 2735 * Try to Power-on the Floppy 2736 * 2737 0000144C 4E55 FFF6 flp_init4 link a5,#-10 Set Error Trap for mini 2738 00001450 487A 0034 pea flp_init6 2739 00001454 2B4F FFF6 move.l sp,-10(a5) 2740 00001458 6100 61D4 bsr flpy_rst1 Power up the mini(s) without 2741 0000145C 4E5D unlk a5 looking at sysflag 2742 0000145E 46DF move (sp)+,sr Restore status register 2743 00001460 7015 moveq #$15,d0 Assume Two Drives first 2744 00001462 41FA 4540 lea twoflp,a0 2745 00001466 4A38 FED8 tst.b ndrives 2746 0000146A 6606 bne.s flp_init4_1 2747 0000146C 7C05 moveq #5,d6 2748 0000146E 41FA 4545 lea goodflp,a0 Indicate Floppy Presence 2749 00001472 6100 06B0 flp_init4_1 bsr present 2750 00001476 76FF moveq #-1,d3 No Memory Failure 2751 00001478 78FF moveq #-1,d4 2752 0000147A 6100 0966 bsr required 2753 0000147E 67C0 beq.s flp_init3_2 Wrong one there 2754 00001480 027C F000 flp_init5 andi #$F000,sr Drop int level back to zero 2755 00001484 4E75 rts 2756 00001486 41FA 452D flp_init6 lea goodflp,a0 Indicate a Failure 2757 0000148A 6100 069C bsr failing 2758 0000148E 41FA 457C lea floperr,a0 Time out During Floppy Power on 2759 00001492 43F8 FDD2 lea fubuffer,a1 2760 00001496 302D FFFE move -2(a5),d0 2761 0000149A 6100 5BEA bsr fmsgs Build Error Message PAGE 61 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2762 0000149E 4E5D unlk a5 2763 000014A0 46DF move (sp)+,sr Restore status register 2764 000014A2 41F8 FDD2 lea fubuffer,a0 Point at message 2765 000014A6 0C18 0020 flp_init6_5 cmpi.b #' ',(a0)+ skip past the first blank... 2766 000014AA 66FA bne flp_init6_5 to suppress printing the number 2767 000014AC 6000 418C bra sftmsg Print Message 2768 * 2769 * Missing Floppy 2770 * 2771 000014B0 50F8 FED8 flp_init7 st ndrives NDRIVES = 255 is NO Drives 2772 000014B4 3C3C 00F5 move #$F5,d6 No Drives Present 2773 000014B8 6100 0928 bsr required 2774 000014BC 66C2 bne.s flp_init5 2775 000014BE 41FA 44F5 lea goodflp,a0 Indicate Missing Floppy 2776 000014C2 6100 068C bsr missing 2777 000014C6 4DFA F442 lea long_zero,a6 Wait rest of 500 ms for refresh 2778 000014CA 303C 00C8 move.w #200,d0 if no floppy 2779 000014CE 6000 64A0 bra f_clock 2780 2781 ****************************************************************************** 2782 * Check for DMA Card Presence * 2783 ****************************************************************************** 2784 000014D2 7018 dma_init moveq #dmaf,d0 Indicate to LEDs 2785 000014D4 6100 0590 bsr led_state 2786 000014D8 4DFA 0028 lea dma_init2,a6 Not there if a BUS Error 2787 000014DC 4A79 0050 tst dma_disarm0 test presence by disarm operation 0000 2788 000014E2 2878 FED4 movea.l f_area,a4 2789 000014E6 08EC 0005 bset #dma_p,booleans(a4) either the A or B is present 000B 2790 000014EC 41FA 44EC lea gooddma_b,a0 assume the B; 2791 000014F0 4DFA 000C lea dma_init1,a6 it decodes address bit 15... 2792 000014F4 4A79 0050 tst dma_disarm0+$8000 so this will bus error 8000 2793 000014FA 41FA 44D5 lea gooddma_a,a0 otherwise we have the A 2794 000014FE 6000 0624 dma_init1 bra present Indicate Presence 2795 00001502 7C06 dma_init2 moveq #6,d6 Check for required presence 2796 00001504 6100 08DC bsr required 2797 00001508 6608 bne.s dma_init3 No 2798 0000150A 41FA 44BD lea gooddma,a0 "generic" 98620 2799 0000150E 6000 0640 bra missing Log that it's missing 2800 00001512 4E75 dma_init3 rts 2801 2802 ****************************************************************************** 2803 * Test I/O Cards * 2804 * * 2805 * Modified by: Anny Randel * 2806 * Date: December 14, 1983 * 2807 * Purpose: To use timer when present * 2808 ****************************************************************************** 2809 00001514 2878 FED4 iocard_init movea.l f_area,a4 No Cards yet 2810 00001518 42AC 000C clr.l iocards(a4) 2811 0000151C 45F9 0060 lea $600000,a2 Scan thru all 32 select codes 0000 2812 00001522 4241 clr d1 Start at select code 0 2813 00001524 B27C 0020 iocard_init1 cmp #32,d1 Check for end of scan 2814 00001528 6C00 00E2 bge iocard_init5 Then done PAGE 62 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2815 0000152C B5EC 009A cmpa.l remote_adr(a4),a2 If this is a Remote Interface 2816 00001530 660C bne.s iocard_int1 then skip it 2817 00001532 5241 addq #1,d1 Increment to next Select Code 2818 00001534 D5FC 0001 adda.l #$10000,a2 0000 2819 0000153A 4282 clr.l d2 No ID so far 2820 0000153C 60E6 bra iocard_init1 2821 0000153E 4DFA 00C4 iocard_int1 lea iocard_init4,a6 Go to next one if bus error 2822 00001542 2A4F movea.l sp,a5 Save Stack Pointer 2823 00001544 7020 moveq #iocardf,d0 Indicate Select Code on LEDs 2824 00001546 D041 add d1,d0 2825 00001548 6100 051C bsr led_state 2826 0000154C 747F moveq #$7F,d2 prepare to extract both... 2827 0000154E C42A 0001 and.b 1(a2),d2 primary & secondary ID fields 2828 00001552 2878 FED4 movea.l f_area,a4 Set Presence Bit 2829 00001556 0C41 0007 cmpi #7,d1 Only indicate select code 7 2830 0000155A 6608 bne.s iocard_ins if not Internal HPIB 2831 0000155C 0838 0005 btst #5,sysflag FED2 2832 00001562 670A beq.s iocard_inb 2833 00001564 282C 000C iocard_ins move.l iocards(a4),d4 2834 00001568 03C4 bset d1,d4 2835 0000156A 2944 000C move.l d4,iocards(a4) 2836 0000156E 6100 00D6 iocard_inb bsr bioname Build IO Card Name 2837 00001572 76FF moveq #-1,d3 No Memory Failures Logged Yet 2838 00001574 78FF moveq #-1,d4 2839 00001576 B43C 0034 iocard_id54 cmp.b #52,d2 Check for an ALVIN Family Card 2840 0000157A 6610 bne.s iocard_moon 2841 0000157C 0C2A 0001 cmpi.b #1,$4001(a2) Must be 1 4001 2842 00001582 6646 bne.s iocard_bad 2843 00001584 102A 400D move.b $400D(a2),d0 Get Self-test result 2844 00001588 6750 beq.s iocard_init2 Okay if 0 2845 0000158A 603E bra.s iocard_bad 2846 0000158C B43C 001C iocard_moon cmp.b #28,d2 Check for a Moon UNIT 2847 00001590 660A bne.s iocard_hpib 2848 00001592 48E7 6464 movem.l a1-a2/a5/d1-d2/d5,-(sp) 2849 00001596 6100 36BA bsr moon_test Test the Moon Unit Card 2850 0000159A 6026 bra.s iocard_cardf 2851 0000159C B43C 0001 iocard_hpib cmp.b #1,d2 Check for HPIB Card 2852 000015A0 660A bne.s iocard_sio 2853 000015A2 48E7 6464 movem.l a1-a2/a5/d1-d2/d5,-(sp) 2854 000015A6 6100 354C bsr hpib_test Test the HPIB Card 2855 000015AA 6016 bra.s iocard_cardf 2856 000015AC B43C 0002 iocard_sio cmp.b #2,d2 98626 card? 2857 000015B0 6706 beq.s iocard_sio1 branch if so 2858 000015B2 B43C 0042 cmp.b #66,d2 98644 card? 2859 000015B6 6622 bne.s iocard_init2 branch if not 2860 000015B8 5288 iocard_sio1 addq.l #1,a0 2861 000015BA 48E7 6464 movem.l a1-a2/a5/d1-d2/d5,-(sp) 2862 000015BE 6100 3636 bsr siotst Test the SIO Card 2863 000015C2 4CDF 2626 iocard_cardf movem.l (sp)+,a1-a2/a5/d1-d2/d5 2864 000015C6 4A00 tst.b d0 test failed? 2865 000015C8 6710 beq.s iocard_init2 branch if not 2866 000015CA 616C iocard_bad bsr.s error_io Indicate Failure 2867 000015CC 2878 FED4 movea.l f_area,a4 Clear Presence Bit 2868 000015D0 2C2C 000C move.l iocards(a4),d6 PAGE 63 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2869 000015D4 0386 bclr d1,d6 2870 000015D6 2946 000C move.l d6,iocards(a4) 2871 000015DA 4219 iocard_init2 clr.b (a1)+ terminate string by bioname 2872 000015DC 41F8 FDD2 lea fubuffer,a0 Put up message 2873 000015E0 6100 4058 bsr sftmsg 2874 000015E4 6100 06CC bsr mem_fail0 Indicate any Memory Failures 2875 000015E8 7A1F moveq #$1F,d5 prepare to... 2876 000015EA CA02 and.b d2,d5 isolate the primary ID 2877 000015EC BA3C 001C cmp.b #28,d5 double wide card? 2878 000015F0 6710 beq.s iocard_init3 branch if so 2879 000015F2 BA3C 001D cmp.b #29,d5 double wide card? 2880 000015F6 670A beq.s iocard_init3 branch if so 2881 000015F8 BA3C 001A cmp.b #26,d5 quad wide card? 2882 000015FC 6606 bne.s iocard_init4 branch if not 2883 000015FE 610E bsr.s required_io (4) I/O Card Required? 2884 00001600 610C bsr.s required_io (3) I/O Card Required? 2885 00001602 610A iocard_init3 bsr.s required_io (2) I/O Card Required? 2886 00001604 2E4D iocard_init4 movea.l a5,sp Restore Stack Pointer 2887 00001606 6106 bsr.s required_io (1) I/O Card Required? 2888 00001608 6000 FF1A bra iocard_init1 2889 0000160C 4E75 iocard_init5 rts 2890 2891 0000160E 2C01 required_io move.l d1,d6 Is this a required I/O Card? 2892 00001610 E15A rol #8,d2 2893 00001612 8C82 or.l d2,d6 2894 00001614 08C6 000F bset #15,d6 2895 00001618 6100 07C8 bsr required 2896 0000161C 660E bne.s required_io1 2897 0000161E 2406 move.l d6,d2 2898 00001620 6124 bsr.s bioname Build Name of I/O Card 2899 00001622 4219 clr.b (a1)+ 2900 00001624 41F8 FDD2 lea fubuffer,a0 2901 00001628 6100 0526 bsr missing Card is missing 2902 0000162C 5241 required_io1 addq #1,d1 Increment to next Select Code 2903 0000162E D5FC 0001 adda.l #$10000,a2 0000 2904 00001634 4282 clr.l d2 No ID so far 2905 00001636 4E75 rts 2906 2907 00001638 6100 044C error_io bsr led_fail Indicate Failure to leds 2908 0000163C 41FA 43EA lea iofail,a0 Print it failed 2909 00001640 12D8 error_io1 move.b (a0)+,(a1)+ 2910 00001642 66FC bne.s error_io1 2911 00001644 4E75 rts 2912 2913 00001646 43F8 FDD2 bioname lea fubuffer,a1 Construct Card Name 2914 0000164A 0C02 0034 cmpi.b #52,d2 Is it a SMART Card 2915 0000164E 6600 0088 bne bioname0 2916 00001652 2878 FED4 movea.l f_area,a4 No Card or Wrong Card 2917 00001656 282C 000C move.l iocards(a4),d4 then use generic Name 2918 0000165A 0304 btst d1,d4 2919 0000165C 674C beq.s datcom0 2920 0000165E 707F moveq #$7F,d0 2921 00001660 C02A 0001 and.b 1(a2),d0 2922 00001664 B400 cmp.b d0,d2 2923 00001666 6642 bne.s datcom0 2924 PAGE 64 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2925 ********** START OF ANNY'S TIMING CHANGES ********* 2926 2927 00001668 0838 0001 btst #timer_absent,sysflag2 timer absent? FEDA 2928 0000166E 6628 bne.s datacomw1 branch if so 2929 00001670 203C 004C move.l #5000000,d0 Wait for 5 sec for Self-test 4B40 2930 00001676 2F00 move.l d0,-(sp) push value 2931 00001678 4857 pea (sp) push location 2932 0000167A 4EBA 3B56 jsr start_timer start timer - rtns timeout value 2933 0000167E 201F datacomw2 move.l (sp)+,d0 Pop off value 2934 00001680 082A 0006 btst #6,3(a2) Wait for IREQ 0003 2935 00001686 6628 bne.s datcom1 2936 00001688 2F00 move.l d0,-(sp) push value 2937 0000168A 4857 pea (sp) push location 2938 0000168C 4EBA 3B64 jsr check_timer see if time has expired 2939 00001690 6AEC bpl datacomw2 bra if time left 2940 00001692 588F addq.l #4,sp pop off value 2941 00001694 7001 moveq #1,d0 prepare to... 2942 00001696 6006 bra.s datacomw test one more time 2943 2944 ********** END OF ANNY'S CHANGES ********* 2945 2946 00001698 203C 000F datacomw1 move.l #1000000,d0 Must timeout in 5 seconds for 4240 2947 0000169E 082A 0006 datacomw btst #6,3(a2) Self-test. Wait for IREQ 0003 2948 000016A4 660A bne.s datcom1 2949 000016A6 5380 subq.l #1,d0 2950 000016A8 6EF4 bgt.s datacomw 2951 000016AA 41FA 442D datcom0 lea datacom,a0 98628 for Now if Failed 2952 000016AE 603A bra.s bioname3 2953 000016B0 0C2A 0001 datcom1 cmpi.b #1,$4001(a2) Must be 1 4001 2954 000016B6 66F2 bne.s datcom0 2955 000016B8 102A 400D move.b $400D(a2),d0 Get Self-test result 2956 000016BC 6706 beq.s datcom2 Okay if 0 2957 000016BE 0C00 0006 cmpi.b #6,d0 2958 000016C2 66E6 bne.s datcom0 Name is probably unreadable also 2959 000016C4 41EA 400F datcom2 lea $400F(a2),a0 Get Pointer to Product Name 2960 000016C8 32FC 4850 move #'HP',(a1)+ Get Name from Card itself 2961 000016CC 7005 moveq #5,d0 Get 1st 5 characters 2962 000016CE 12D0 datcom3 move.b (a0),(a1)+ 2963 000016D0 5448 addq #2,a0 2964 000016D2 5340 subq #1,d0 2965 000016D4 6EF8 bgt.s datcom3 2966 000016D6 602A bra.s bioname4 Continue Message 2967 000016D8 41FA 4386 bioname0 lea card_list,a0 Try to find a name 2968 000016DC 1A18 bioname1 move.b (a0)+,d5 2969 000016DE 670A beq.s bioname3 At end of list 2970 000016E0 BA02 cmp.b d2,d5 2971 000016E2 6706 beq.s bioname3 Match 2972 000016E4 4A18 bioname2 tst.b (a0)+ Skip Name 2973 000016E6 66FC bne.s bioname2 2974 000016E8 60F2 bra.s bioname1 Try next one 2975 000016EA 12D8 bioname3 move.b (a0)+,(a1)+ Copy Name PAGE 65 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 2976 000016EC 66FC bne.s bioname3 2977 000016EE 5389 subq.l #1,a1 Backup past zero 2978 000016F0 4A05 tst.b d5 Check if ID was known 2979 000016F2 660E bne.s bioname4 Yes so don't print ID number 2980 000016F4 2002 move.l d2,d0 2981 000016F6 48E7 6000 movem.l d1-d2,-(sp) 2982 000016FA 6100 359A bsr bin_to_dec 2983 000016FE 4CDF 0006 movem.l (sp)+,d1-d2 2984 00001702 41FA 431F bioname4 lea cardmsg,a0 Copy " at " 2985 00001706 12D8 bioname5 move.b (a0)+,(a1)+ 2986 00001708 66FC bne.s bioname5 2987 0000170A 5389 subq.l #1,a1 Backup past zero 2988 0000170C 3001 move d1,d0 Put out select Code 2989 0000170E 48C0 ext.l d0 2990 00001710 48E7 6000 movem.l d1-d2,-(sp) 2991 00001714 6100 3580 bsr bin_to_dec 2992 00001718 4CDF 0006 movem.l (sp)+,d1-d2 2993 0000171C 204A movea.l a2,a0 2994 0000171E 4E75 rts 2995 2996 ****************************************************************************** 2997 * Test ROMs in ROM Space and Indicate Failures only * 2998 ****************************************************************************** 2999 * 3000 * Indicate State to LEDs 3001 * 3002 00001720 700D roms_init moveq #romcf,d0 Indicate to LEDs 3003 00001722 6100 0342 bsr led_state 3004 * 3005 * Start Search after BOOTROM. 3006 * 3007 00001726 2878 FED4 movea.l f_area,a4 3008 0000172A 297C 0001 move.l #rom_start,m_dirsec(a4) Start search just past BOOTROM 0000 005A 3009 00001732 197C 005A move.b #'Z',m_filesec(a4) Start with Z as ROM Name 0066 3010 00001738 244F movea.l sp,a2 Save sp for bus errors 3011 * 3012 * Check for Header at Boundary. 4 MBytes is the Limit of ROM space. 3013 * 3014 0000173A 4DFA 00C8 roms_init1 lea roms_init7,a6 Set-up for Bus error 3015 0000173E 206C 005A movea.l m_dirsec(a4),a0 Check Search address for out of range 3016 00001742 B1FC 0040 cmpa.l #$400000,a0 4 MByte limit 0000 3017 00001748 6400 00C0 bcc roms_init8 done 3018 0000174C 0C50 F0FF cmpi #$F0FF,(a0) Check header 3019 00001750 660E bne.s roms_init2 Branch if not 3020 00001752 0C68 F0FF cmpi #$F0FF,2(a0) How about the next word? 0002 3021 00001758 6706 beq.s roms_init2 If so, probably just floating bus! 3022 0000175A 0C50 F0FF cmpi #$F0FF,(a0) Check header once more to be sure 3023 0000175E 670A beq.s roms_init3 Yes, check more 3024 * 3025 * Increment to Next 16K Byte Boundary 3026 * 3027 00001760 06AC 0000 roms_init2 addi.l #$4000,m_dirsec(a4) Try next 16K 4000 005A PAGE 66 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 3028 00001768 60D0 bra.s roms_init1 3029 * 3030 * If Header has system bit set, get ROM's Name Letter. 3031 * 3032 0000176A 0828 0000 roms_init3 btst #0,3(a0) Check for System Bit 0003 3033 00001770 6706 beq.s roms_init3_1 Nope 3034 00001772 1968 0002 move.b 2(a0),m_filesec(a4) Yes, Set System Name 0066 3035 * 3036 * Pair of ROMs at header must have consecutive ROM numbers. 3037 * 3038 00001778 1028 000C roms_init3_1 move.b 12(a0),d0 12(a0)+1 must equal 13(a0) 3039 0000177C 723F moveq #$3F,d1 Only Use lower 6 bits 3040 0000177E C041 and.w d1,d0 3041 00001780 5240 addq #1,d0 3042 00001782 C228 000D and.b 13(a0),d1 3043 00001786 B001 cmp.b d1,d0 3044 00001788 6660 bne.s roms_init5 Bad 3045 * 3046 * If this is a System Header, certain ROMs should be flagged as ignored: 3047 * (a). Machine is 50 wide and ROM doesn't support it, or 3048 * (b). Machine is 80 wide and ROM doesn't support it. 3049 * 3050 0000178A 0828 0000 btst #0,3(a0) Only ignore System header 0003 3051 00001790 6724 beq.s roms_init4 3052 00001792 1028 000E move.b 14(a0),d0 3053 00001796 0838 0000 btst #0,sysflag Is Machine 50 or 80 Wide? FED2 3054 0000179C 6708 beq.s roms_init3_2 Machine is 80 Wide 3055 0000179E 0800 0006 btst #6,d0 (a). 50 Wide: Is ROM Capable? 3056 000017A2 6708 beq.s roms_init3_3 No, Flag it 3057 000017A4 6010 bra.s roms_init4 Yes, Continue to Check it 3058 000017A6 0800 0003 roms_init3_2 btst #3,d0 (b). 80 Wide: Is ROM Capable? 3059 000017AA 660A bne.s roms_init4 Yes, Continue to Check it 3060 000017AC 2F08 roms_init3_3 move.l a0,-(sp) ROM is not suitable with Machine 3061 000017AE 615C bsr.s buildrom Flag it as ignored 3062 000017B0 41FA 4268 lea ignore,a0 3063 000017B4 603C bra.s roms_init6 3064 * 3065 * Checksum ROM Pair as long as checksum disable bit is not set 3066 * 3067 000017B6 0828 0004 roms_init4 btst #4,3(a0) Don't Checksum if it says not to 0003 3068 000017BC 66A2 bne.s roms_init2 (e.g. some ROM Discs) 3069 000017BE 2F08 move.l a0,-(sp) Save Registers for Checksum 3070 000017C0 283C 0000 move.l #$4000,d4 16K multiples in length 4000 3071 000017C6 3028 000E move 14(a0),d0 If 14-15 and $F8F8 is $4040 3072 000017CA 0240 F8F8 andi #$f8f8,d0 then assume 16K in size 3073 000017CE 0C40 4040 cmpi #$4040,d0 3074 000017D2 670A beq.s roms_init4_1 3075 000017D4 1028 0010 move.b 16(a0),d0 <7:4> is multiple 3076 000017D8 4880 ext d0 3077 000017DA E848 lsr #4,d0 3078 000017DC C8C0 mulu d0,d4 d4 is now the length PAGE 67 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 3079 000017DE 6100 0386 roms_init4_1 bsr sumrom 3080 000017E2 205F movea.l (sp)+,a0 Restore a0 3081 000017E4 4A40 tst d0 3082 000017E6 6700 FF78 beq roms_init2 Good Checksum, No report 3083 * 3084 * Log a Failure: ROM X at
Failed 3085 * 3086 000017EA 2F08 roms_init5 move.l a0,-(sp) Save a0 3087 000017EC 611E bsr.s buildrom 3088 000017EE 41FA 4238 lea iofail,a0 " Failed" 3089 000017F2 12D8 roms_init6 move.b (a0)+,(a1)+ 3090 000017F4 66FC bne.s roms_init6 3091 000017F6 41F8 FDD2 lea fubuffer,a0 3092 000017FA 6100 3E3E bsr sftmsg Put up message 3093 000017FE 205F movea.l (sp)+,a0 Restore a0 3094 00001800 6000 FF5E bra roms_init2 Try next header 3095 * 3096 * Handle a Bus error during read of header 3097 * 3098 00001804 2E4A roms_init7 movea.l a2,sp Bus error handler: Reset stack 3099 00001806 6000 FF58 bra roms_init2 Try next one 3100 * 3101 * Clean-up and exit 3102 * 3103 0000180A 4E75 roms_init8 rts 3104 3105 * 3106 * Utility for roms_init 3107 * 3108 0000180C 6100 0278 buildrom bsr led_fail Indicate Failure to leds 3109 00001810 2008 move.l a0,d0 Address of ROM that Failed 3110 00001812 43F8 FDD2 lea fubuffer,a1 Build Message to Report Failure 3111 00001816 22FC 524F move.l #'ROM ',(a1)+ 4D20 3112 0000181C 12EC 0066 move.b m_filesec(a4),(a1)+ 3113 00001820 41FA 4201 lea cardmsg,a0 " at " 3114 00001824 12D8 buildrom1 move.b (a0)+,(a1)+ 3115 00001826 66FC bne.s buildrom1 3116 00001828 5389 subq.l #1,a1 3117 0000182A 6000 349A bra pnt8hex Generate Address 3118 3119 ****************************************************************************** 3120 * Test RAM and set LOWRAM area * 3121 ****************************************************************************** 3122 0000182E 2878 FED4 tstram_init movea.l f_area,a4 3123 00001832 082C 0004 btst #lowram_ok,booleans(a4) 000B 3124 00001838 666C bne.s tstram_init6 3125 0000183A 7009 moveq #ramf,d0 Indicate to LEDs 3126 0000183C 6100 0228 bsr led_state 3127 00001840 41FA 3E8E lea memtst,a0 Indicate Memory Test in Progress 3128 00001844 6100 3E40 bsr displin 3129 00001848 76FF moveq #-1,d3 No Failures Yet 3130 0000184A 78FF moveq #-1,d4 3131 0000184C 082C 0001 btst #ram_test,booleans(a4) 000B 3132 00001852 6718 beq.s tstram_init1 Do Faster test PAGE 68 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 3133 00001854 43F8 C000 lea topram,a1 Do Slow test: Top of RAM 3134 00001858 2A6C 02D6 movea.l midram(a4),a5 Bottom of RAM block 3135 0000185C 6100 EE3C bsr ramtest 3136 00001860 2878 FED4 movea.l f_area,a4 3137 00001864 266C 02D6 movea.l midram(a4),a3 Old Bottom 3138 00001868 284D movea.l a5,a4 Actual Bottom 3139 0000186A 603A bra.s tstram_init6 3140 0000186C 266C 02D6 tstram_init1 movea.l midram(a4),a3 Faster test: Save Low RAM Address 3141 00001870 4DFA 002E lea tstram_init5,a6 Handle Bus Error 3142 00001874 204B movea.l a3,a0 Set for Back Scan 3143 00001876 284B movea.l a3,a4 Set Final Low RAM 3144 00001878 5988 subq.l #4,a0 3145 0000187A 5888 tstram_init2 addq.l #4,a0 3146 0000187C B1D0 cmpa.l (a0),a0 3147 0000187E 660C bne.s tstram_init3 3148 00001880 2008 move.l a0,d0 3149 00001882 4680 not.l d0 Compliment Then test again 3150 00001884 2080 move.l d0,(a0) Save then Test Compare the Pattern 3151 00001886 B090 cmp.l (a0),d0 3152 00001888 67F0 beq.s tstram_init2 3153 0000188A 6010 bra.s tstram_init4 3154 0000188C B0FC C000 tstram_init3 cmpa.w #topram,a0 Done Yet? 3155 00001890 6714 beq.s tstram_init6 3156 00001892 2608 move.l a0,d3 Save Write Pattern 3157 00001894 2810 tstram_in3 move.l (a0),d4 Save Read Pattern 3158 00001896 2848 movea.l a0,a4 So set new low address 3159 00001898 588C addq.l #4,a4 3160 0000189A 60DE bra tstram_init2 3161 0000189C 2600 tstram_init4 move.l d0,d3 Save Write Pattern 3162 0000189E 60F4 bra.s tstram_in3 3163 000018A0 2848 tstram_init5 movea.l a0,a4 Set new low 3164 000018A2 588C addq.l #4,a4 3165 000018A4 60D4 bra.s tstram_init2 3166 000018A6 4E75 tstram_init6 rts 3167 3168 ****************************************************************************** 3169 * Setup F_AREA to LOWRAM area * 3170 * a4 = Bottom of Good RAM * 3171 * a3 = Actual Bottom of RAM * 3172 * d3 = Write Pattern of last memory read failure (Non-Bus error) * 3173 * d4 = Read Pattern of last memory read failure (Non-Bus error) * 3174 ****************************************************************************** 3175 000018A8 41FA 3EF4 lram_init lea selftmsg,a0 Indicate Self-Test in Progress 3176 000018AC 6100 3DD8 bsr displin 3177 000018B0 2078 FED4 movea.l f_area,a0 Skip test rom if not power up 3178 000018B4 0828 0004 btst #lowram_ok,booleans(a0) 000B 3179 000018BA 6600 00A4 bne lram_init7 3180 000018BE 2F0C move.l a4,-(sp) Save Pointer to Bottom of RAM 3181 000018C0 B9CB cmpa.l a3,a4 Any Failure? 3182 000018C2 673A beq.s lram_init2_1 3183 000018C4 6100 01C0 lram_init0 bsr led_fail Log error 3184 000018C8 200C move.l a4,d0 3185 000018CA 5980 subq.l #4,d0 Failed Word is 4 Bytes Below 3186 000018CC 2140 02CE move.l d0,tempsss(a0) Pass it to Print Routine 3187 000018D0 6100 03E4 bsr mem_fail Put Addr. & R/W Patterns on Screen 3188 000018D4 201F move.l (sp)+,d0 Drop back to last 64K Byte Block PAGE 69 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 3189 000018D6 74FF moveq #-1,d2 64K Boundary 3190 000018D8 4242 clr.w d2 3191 000018DA 7601 moveq #1,d3 3192 000018DC 4843 swap d3 3193 000018DE B082 cmp.l d2,d0 If top 64K Block 3194 000018E0 650C bcs.s lram_init1 then drop back 2K 3195 000018E2 243C FFFF move.l #$FFFFF800,d2 2K Boundary F800 3196 000018E8 263C 0000 move.l #$800,d3 0800 3197 000018EE 2202 lram_init1 move.l d2,d1 Check if already on boundary 3198 000018F0 4681 not.l d1 3199 000018F2 C280 and.l d0,d1 If already on Boundary, skip 3200 000018F4 6704 beq.s lram_init2 3201 000018F6 C082 and.l d2,d0 Drop down to Boundary 3202 000018F8 D083 add.l d3,d0 Pop up to next Boundary 3203 000018FA 2F00 lram_init2 move.l d0,-(sp) Put it back on the stack 3204 000018FC 600A bra.s lram_init3 3205 000018FE 76FF lram_init2_1 moveq #-1,d3 Board just may be missing 3206 00001900 78FF moveq #-1,d4 3207 00001902 6100 065A bsr prom_memchk See if Required amount of Memory 3208 00001906 66BC bne lram_init0 Required amount not there 3209 00001908 285F lram_init3 movea.l (sp)+,a4 Restore pointer to RAM Bottom 3210 0000190A 2078 FED4 movea.l f_area,a0 Point to current F_AREA 3211 0000190E 224C movea.l a4,a1 Allocate steal*32 bytes 3212 00001910 3228 02DA move steal(a0),d1 in LOWRAM 3213 00001914 48C1 ext.l d1 3214 00001916 EB89 lsl.l #5,d1 3215 00001918 D3C1 adda.l d1,a1 3216 0000191A 21C9 FDCE move.l a1,lowram 3217 0000191E 40E7 move sr,-(sp) Lock out interrupts while copying 3218 00001920 007C 2700 ori #$2700,sr 3219 00001924 2078 FED4 movea.l f_area,a0 Copy high RAM to LOWRAM 3220 00001928 224C movea.l a4,a1 3221 0000192A 323C 02DC move #f_areatop,d1 Copy f_areatop bytes 3222 0000192E 12D8 lram_init6 move.b (a0)+,(a1)+ 3223 00001930 5341 subq #1,d1 3224 00001932 6EFA bgt.s lram_init6 3225 00001934 21CC FED4 move.l a4,f_area Point to new LOWRAM 3226 00001938 46DF move (sp)+,sr Restore interrupts 3227 0000193A 08EC 0004 bset #lowram_ok,booleans(a4) LOWRAM is set up 000B 3228 00001940 200C move.l a4,d0 Calc Available Bytes: 3229 00001942 D0AC 002C add.l tempram(a4),d0 Final LOWRAM to Very Top 3230 00001946 4480 neg.l d0 3231 00001948 43F8 FDD2 lea fubuffer,a1 3232 0000194C 6100 3348 bsr bin_to_dec Convert Binary To Decimal 3233 00001950 41FA 4091 lea availbyts,a0 3234 00001954 6100 33A2 bsr movebytes 3235 00001958 41F8 FDD2 lea fubuffer,a0 Put Out Available Bytes Msg. 3236 0000195C 6100 3CDC bsr sftmsg 3237 00001960 4E75 lram_init7 rts 3238 3239 ****************************************************************************** 3240 * Allocate Memory * 3241 ****************************************************************************** 3242 00001962 2078 FED4 allocate movea.l f_area,a0 Point to LOWRAM area PAGE 70 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 3243 00001966 217C FFFF move.l #minram,midram(a0) Start allocating below stack FAC0 02D6 3244 0000196E 2238 FED4 move.l f_area,d1 3245 00001972 7020 moveq #32,d0 3246 00001974 C0E8 02DA mulu steal(a0),d0 d0 Has size of F_AREA 3247 00001978 D280 add.l d0,d1 d1 is Where LOWRAM is now 3248 0000197A 21C1 FDCE move.l d1,lowram 3249 0000197E 2028 0014 move.l mb_size(a0),d0 3250 00001982 D1B8 FDCE add.l d0,lowram 3251 00001986 2141 0010 move.l d1,mb_ptr(a0) Allocate on top of lowram 3252 0000198A 4E75 allocate1 rts 3253 3254 ****************************************************************************** 3255 * Display Final LED value * 3256 ****************************************************************************** 3257 * 3258 * Determine if Looping should be done 3259 * 3260 0000198C 2878 FED4 leds_up movea.l f_area,a4 No Looping Yet 3261 00001990 08AC 0000 bclr #mb_loop,m_b(a4) 0054 3262 * 3263 * See if it's a MARMOT. If so Use Bit of HP-IB Register. 3264 * 3265 00001996 0838 0005 btst #5,sysflag Check for Internal HPIB Presence FED2 3266 0000199C 6616 bne.s leds_up1 None, then can't be MARMOT 3267 0000199E 0839 0002 btst #2,int_hpib3 Check for MARMOT 0047 8003 3268 000019A6 670C beq.s leds_up1 No, then it must have an I.D. 3269 000019A8 0839 0007 btst #7,int_hpib3 Check MARMOT's cludgy loop bit 0047 8003 3270 000019B0 6710 beq.s leds_up2 It says to loop 3271 000019B2 6014 bra.s leds_up3 Don't Loop 3272 * 3273 * Not a Marmot, use Configuration Switches. If they bus error, don't loop. 3274 * 3275 000019B4 4DFA 0012 leds_up1 lea leds_up3,a6 Handle Bus error 3276 000019B8 0839 0000 btst #t_loop,procid Check loop bit 005F 0000 3277 000019C0 6706 beq.s leds_up3 Don't Loop 3278 000019C2 08EC 0000 leds_up2 bset #mb_loop,m_b(a4) Loop 0054 3279 * 3280 * Clear the LEDs and display Highest Priority Error 3281 * 3282 000019C8 7000 leds_up3 moveq #offf,d0 Indicate 3283 000019CA 6100 009A bsr led_state 3284 000019CE 4A6C 0098 tst led_val+2(a4) Check to make sure LEDs are there 3285 000019D2 6B0C bmi.s leds_up4 No LEDs present 3286 000019D4 102C 0099 move.b led_val+3(a4),d0 Display last error, if any 3287 000019D8 4640 not d0 LEDs are negative True 3288 000019DA 13C0 0001 move.b d0,leds FFFF 3289 * 3290 * If BOOTROM Checksum Failure, Wait forever until stop bit is cleared; 3291 * Then continue. PAGE 71 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INITIALIZATION/TEST VECTORS (BOOTROM0)" 3292 * 3293 000019E0 703F leds_up4 moveq #$3F,d0 Get the Device Code From 3294 000019E2 C02C 0099 and.b led_val+3(a4),d0 The Error Code 3295 000019E6 0C00 0003 cmpi.b #romf,d0 BootROM? 3296 000019EA 662C bne.s leds_up6 No, then don't stop now 3297 000019EC 4A2C 02CD tst.b kbdtype(a4) Is this an ITF keyboard? 3298 000019F0 6706 beq.s leds_up0 No - use ENTER msg 3299 000019F2 41FA 3E08 lea bootmsg1,a0 Yes - use RETURN msg 3300 000019F6 6004 bra.s leds_up00 3301 000019F8 41FA 3DD8 leds_up0 lea bootmsg,a0 3302 000019FC 6100 3C88 leds_up00 bsr displin Indicate stop 3303 00001A00 08EC 0002 bset #mb_stop,m_b(a4) Continue if stop bit cleared 0054 3304 00001A06 102C 0099 move.b led_val+3(a4),d0 Get the Error Code 3305 00001A0A 6100 025E bsr sound Sound off error code 3306 00001A0E 082C 0002 leds_up5 btst #mb_stop,m_b(a4) 0054 3307 00001A14 66F8 bne.s leds_up5 Wait until it gets cleared 3308 00001A16 604C bra.s leds_up9 Continue Now 3309 * 3310 * If Not Looping and Error Then Wait 1 Minute with abort via stop bit. 3311 * 3312 00001A18 082C 0000 leds_up6 btst #mb_loop,m_b(a4) Self-Test Looping? 0054 3313 00001A1E 6644 bne.s leds_up9 Yes, Don't wait, just continue 3314 00001A20 4A2C 0099 tst.b led_val+3(a4) Check for error 3315 00001A24 673E beq.s leds_up9 Don't wait, if no errors 3316 00001A26 4A2C 02CD tst.b kbdtype(a4) Is this an ITF keyboard? 3317 00001A2A 6706 beq.s leds_up10 No - use ENTER msg 3318 00001A2C 41FA 3E21 lea waitmsg1,a0 Yes - use RETURN msg 3319 00001A30 6004 bra.s leds_up11 3320 00001A32 41FA 3DF3 leds_up10 lea waitmsg,a0 3321 00001A36 6100 3C4E leds_up11 bsr displin Indicate wait 3322 00001A3A 4DFA EECE lea long_zero,a6 3323 00001A3E 223C 008C move.l #9230800,d1 Wait 1 minute for CRT D9D0 3324 00001A44 08EC 0002 bset #mb_stop,m_b(a4) Abort if stop bit cleared 0054 3325 00001A4A 102C 0099 move.b led_val+3(a4),d0 Get the Error Code 3326 00001A4E 6100 021A bsr sound Sound off error code 3327 00001A52 082C 0002 leds_up7 btst #mb_stop,m_b(a4) 0054 3328 00001A58 6704 beq.s leds_up8 Abort wait 3329 00001A5A 5381 subq.l #1,d1 3330 00001A5C 6EF4 bgt.s leds_up7 Wait 3331 00001A5E 08AC 0002 leds_up8 bclr #mb_stop,m_b(a4) Don't Stop Now 0054 3332 00001A64 4E75 leds_up9 rts PAGE 72 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM TEST UTILITIES (BOOTROM0)" 3335 ****************************************************************************** 3336 ****************************************************************************** 3337 *** *** 3338 *** Test Utilities *** 3339 *** *** 3340 *** Utility Entries Supported Internally: *** 3341 *** LED_STATE Set LEDs to next value in D0. *** 3342 *** LED_FAIL Latch LEDs to with current value as Failure. *** 3343 *** LED_MISS Latch LEDs to with current value as Missing. *** 3344 *** PRESENT Indicate Presence of a Device. *** 3345 *** FAILING Indicate Failure of a Device. *** 3346 *** MISSING Indicate Absence of a Device. *** 3347 *** SUMROM Checksum a ROM Section *** 3348 *** BYTRAM Test Byte-Wide RAM at every other address *** 3349 *** TEST_RAM Long Memory Test a Section of RAM *** 3350 *** SOUND Beep out the 8 bit value in D0 *** 3351 *** MEM_FAIL Report a Memory Failure to the Screen *** 3352 *** MEM_FAIL0 Report a Memory Failure, if it's a bit fail *** 3353 *** *** 3354 ****************************************************************************** 3355 ****************************************************************************** 3356 3357 ****************************************************************************** 3358 * LED_STATE: Set LEDs to next value in D0. * 3359 ****************************************************************************** 3360 00001A66 48E7 8008 led_state movem.l d0/a4,-(sp) Save d0/a4 3361 00001A6A 2878 FED4 movea.l f_area,a4 Point to LOWRAM area 3362 00001A6E 1940 0096 move.b d0,led_val(a4) Log the Value 3363 00001A72 4A6C 0098 led_state1 tst led_val+2(a4) Don't write to LEDs unless there 3364 00001A76 6B08 bmi.s led_state2 3365 00001A78 4600 not.b d0 LEDs are Negative True 3366 00001A7A 13C0 0001 move.b d0,leds Write to LEDs FFFF 3367 00001A80 4CDF 1001 led_state2 movem.l (sp)+,d0/a4 Restore d0/a4 3368 00001A84 4E75 rts 3369 3370 ****************************************************************************** 3371 * LED_FAIL: Latch LEDs with current value as a Failing Device if device * 3372 * has a higher priority than the already latched value * 3373 * Graphics and CRT are always lowest priority. * 3374 * * 3375 * Modified 02/14/84 by Anny Randel to handle Gator Failure the same as * 3376 * CRT failure. * 3377 ****************************************************************************** 3378 00001A86 48E7 E008 led_fail movem.l d0-d2/a4,-(sp) Save d0-d2/a4 3379 00001A8A 2878 FED4 movea.l f_area,a4 Point to LOWRAM area 3380 00001A8E 102C 0096 move.b led_val(a4),d0 Get Current State 3381 00001A92 1400 move.b d0,d2 Compute Possible New LED Value 3382 00001A94 4AC2 tas d2 Indicate a failure 3383 00001A96 0882 0006 bclr #6,d2 3384 * 3385 * Entry Point for led_miss 3386 * 3387 00001A9A 122C 0099 led_fail1 move.b led_val+3(a4),d1 Get Current LED Failure Value 3388 * 3389 * If Current Logged LED failure is 0 or PROM, then log new value 3390 * PAGE 73 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM TEST UTILITIES (BOOTROM0)" 3391 00001A9E 674E beq.s led_fail4 Zero means nothing logged yet 3392 00001AA0 0201 003F andi.b #$3F,d1 Extract Device Number 3393 00001AA4 0C01 000B cmpi.b #promf,d1 Current is PROM? 3394 00001AA8 6744 beq.s led_fail4 Yes, then log new value 3395 * 3396 * If Current Logged LED failure is grphf, then only PROM cannot override it 3397 * 3398 00001AAA 0C01 001F cmpi.b #grphf,d1 Is Current one graphics 3399 00001AAE 6608 bne.s led_fail1_1 No 3400 00001AB0 0C00 000B cmpi.b #promf,d0 Is new one PROM? 3401 00001AB4 673C beq.s led_fail5 Yes, don't log now 3402 00001AB6 6036 bra.s led_fail4 Everything else has higher priority 3403 * 3404 * If Current Logged LED Failure is crtf, then only grphf and promf canNOT override it 3405 * 3406 00001AB8 0C01 001E led_fail1_1 cmpi.b #crtf,d1 Is Current Logged Value the CRT? 3407 00001ABC 670C beq.s led_fail1_2 3408 00001ABE 0C01 001D cmpi.b #gatorf,d1 Or an internal Gator? 3409 00001AC2 6706 beq.s led_fail1_2 3410 00001AC4 0C01 001C cmpi.b #nofont,d1 Or is there no font for hi res 3411 00001AC8 660E bne.s led_fail2 No, then use priority of new one 3412 00001ACA 0C00 001F led_fail1_2 cmpi.b #grphf,d0 Is new one Graphics? 3413 00001ACE 6722 beq.s led_fail5 Yes, then don't log it 3414 00001AD0 0C00 000B cmpi.b #promf,d0 Is new one PROM? 3415 00001AD4 671C beq.s led_fail5 Yes, then don't log it 3416 00001AD6 6016 bra.s led_fail4 Everything else has higher priority 3417 * 3418 * If New Value is CRT or GRAPHICS or PROM, it cannot override anything now 3419 * 3420 00001AD8 0C00 000B led_fail2 cmpi.b #promf,d0 PROM? 3421 00001ADC 6714 beq.s led_fail5 Yes, then ignore it 3422 00001ADE 0C00 001F cmpi.b #grphf,d0 Graphics? 3423 00001AE2 670E beq.s led_fail5 Yes, then ignore it 3424 00001AE4 0C00 001E cmpi.b #crtf,d0 CRT? 3425 00001AE8 6708 beq.s led_fail5 Yes, then ignore it 3426 * 3427 * Check Priority via Value Order 3428 * 3429 00001AEA B001 led_fail3 cmp.b d1,d0 Log if higher priority 3430 00001AEC 6204 bhi.s led_fail5 3431 * 3432 * Log a new LED Failure Value 3433 * 3434 00001AEE 1942 0099 led_fail4 move.b d2,led_val+3(a4) Log the Value 3435 * 3436 * Write to LEDs 3437 * 3438 00001AF2 4A6C 0098 led_fail5 tst led_val+2(a4) Don't write to LEDs unless there 3439 00001AF6 6B0C bmi.s led_fail6 3440 00001AF8 102C 0099 move.b led_val+3(a4),d0 Get Current Highest Priority One 3441 00001AFC 4640 not d0 LEDs are Negative True 3442 00001AFE 13C0 0001 move.b d0,leds Write Value to LEDs FFFF 3443 00001B04 4CDF 1007 led_fail6 movem.l (sp)+,d0-d2/a4 Restore d0-d2/a4 3444 00001B08 4E75 rts 3445 3446 ****************************************************************************** PAGE 74 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM TEST UTILITIES (BOOTROM0)" 3447 * LED_MISS: Latch LEDs with current value as a Missing Device if device * 3448 * has a higher priority than the already latched value * 3449 ****************************************************************************** 3450 00001B0A 48E7 E008 led_miss movem.l d0-d2/a4,-(sp) Save d0-d2/a4 3451 00001B0E 2878 FED4 movea.l f_area,a4 Point to LOWRAM area 3452 00001B12 102C 0096 move.b led_val(a4),d0 Get Current State 3453 00001B16 1400 move.b d0,d2 Compute Possible New LED Value 3454 00001B18 0882 0007 bclr #7,d2 Indicate Missing 3455 00001B1C 08C2 0006 bset #6,d2 3456 00001B20 6000 FF78 bra led_fail1 3457 3458 ****************************************************************************** 3459 * PRESENT: Indicate Presence of a Device. * 3460 * On entry A0 points to a Zero Terminated Device Name. * 3461 * String will be copied into FUBUFFER (possibly enhanced) and then * 3462 * sent to the screen. * 3463 ****************************************************************************** 3464 00001B24 6000 3B14 present bra sftmsg 3465 3466 ****************************************************************************** 3467 * FAILING: Indicate Failure of a Device. * 3468 * On entry A0 points to a Zero Terminated Device Name. * 3469 * String will be copied into FUBUFFER (possibly enhanced) and then * 3470 * sent to the screen. * 3471 ****************************************************************************** 3472 00001B28 48E7 00C0 failing movem.l a0/a1,-(sp) Save a0/a1 3473 00001B2C 6100 FF58 bsr led_fail Indicate Failure to LEDs 3474 00001B30 43F8 FDD2 lea fubuffer,a1 Copy String to Fubuffer 3475 00001B34 12D8 failing1 move.b (a0)+,(a1)+ 3476 00001B36 66FC bne.s failing1 Stop on a null 3477 00001B38 5349 subq #1,a1 Adjust Back one 3478 00001B3A 41FA 3EEC lea iofail,a0 Concatenate " Failed" to Name 3479 00001B3E 12D8 failing2 move.b (a0)+,(a1)+ 3480 00001B40 66FC bne.s failing2 Stop on a null 3481 00001B42 41F8 FDD2 lea fubuffer,a0 Put up the Message 3482 00001B46 6100 3AF2 bsr sftmsg 3483 00001B4A 4CDF 0300 movem.l (sp)+,a0/a1 Restore a0/a1 3484 00001B4E 4E75 rts 3485 3486 ****************************************************************************** 3487 * MISSING: Indicate Absence of a Device. * 3488 * On entry A0 points to a Zero Terminated Device Name. * 3489 * String will be copied into FUBUFFER (possibly enhanced) and then * 3490 * sent to the screen. * 3491 ****************************************************************************** 3492 00001B50 48E7 00C0 missing movem.l a0/a1,-(sp) Save a0/a1 3493 00001B54 61B4 bsr led_miss Indicate Failure to LEDs 3494 00001B56 43F8 FDD2 lea fubuffer,a1 Copy String to Fubuffer 3495 00001B5A 12D8 missing1 move.b (a0)+,(a1)+ 3496 00001B5C 66FC bne.s missing1 Stop on a null 3497 00001B5E 5349 subq #1,a1 Adjust Back one 3498 00001B60 41FA 3ECE lea mismsg,a0 Concatenate " Missing" to Name 3499 00001B64 60D8 bra failing2 3500 3501 ****************************************************************************** 3502 * SUMROM: Checksum a Section of ROM * 3503 * On entry: A0.L = Start Address for Checksum * PAGE 75 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM TEST UTILITIES (BOOTROM0)" 3504 * D4.L = Size of Area to Checksum * 3505 * On exit: D0.W = 0 for a good Checksum * 3506 * D2.W = 0 for a good Even Byte Checksum * 3507 * D3.W = 0 for a good Odd Byte Checksum * 3508 * IF SP>FAKE_STACK THEN RTS ELSE JMP(A4) When done * 3509 ****************************************************************************** 3510 00001B66 7200 sumrom moveq #0,d1 d1 = Dummy Word 3511 00001B68 7400 moveq #0,d2 d2 = Checksum of even bytes 3512 00001B6A 7600 moveq #0,d3 d3 = Checksum of odd bytes 3513 00001B6C 0B08 0000 sumrom1 movep.w 0(a0),d5 3514 00001B70 0D08 0001 movep.w 1(a0),d6 3515 00001B74 D445 add d5,d2 3516 00001B76 D541 addx d1,d2 3517 00001B78 D646 add d6,d3 3518 00001B7A D741 addx d1,d3 3519 00001B7C 5848 addq #4,a0 3520 00001B7E 5984 subq.l #4,d4 3521 00001B80 6EEA bgt.s sumrom1 3522 00001B82 5242 addq #1,d2 d2 = - 1 is good 3523 00001B84 3002 move d2,d0 3524 00001B86 5243 addq #1,d3 d3 = - 1 is good 3525 00001B88 8043 or d3,d0 3526 00001B8A BEFC 0100 cmpa.w #fake_stack,sp Return thru a4 if no RAM 3527 00001B8E 6302 bls.s sumrom2 3528 00001B90 4E75 rts Otherwise return 3529 00001B92 4ED4 sumrom2 jmp (a4) 3530 3531 ****************************************************************************** 3532 * BYTRAM: Test Byte-Wide RAM at everyother address: * 3533 * AT ENTRY: * 3534 * A2 = LOW (START) ADDRESS * 3535 * A1 = HIGH (STOP) ADDRESS ["LAST" ADDR + 1] * 3536 * d7 = Test mask 1=test/0=no test (must be replicated 4 times) * 3537 * Test RAM between A1 at top+1 and A2 at bottom * 3538 * Assumes RAM is 8 bits wide everyother bit * 3539 * On a Failure to Read (Non-Bus Error): d3 = Last Write Pattern * 3540 * d4 = Last Read Pattern * 3541 * * 3542 * Write and Read The Following to all locations: (movep.l) * 3543 * Down: $EE11EE11 Read $11EE11EE Write * 3544 * Down: $11EE11EE Read $DD22DD22 Write * 3545 * Up: $DD22DD22 Read $22DD22DD Write * 3546 * Up: $22DD22DD Read $BB44BB44 Write * 3547 * Down: $BB44BB44 Read $44BB44BB Write * 3548 * Down: $44BB44BB Read $77887788 Write * 3549 * Up: $77887788 Read $88778877 Write * 3550 * Up: $88778877 Read $EE11EE11 Write * 3551 ****************************************************************************** 3552 00001B94 E318 byt_rot rol.b #1,d0 3553 00001B96 E158 rol #8,d0 3554 00001B98 E318 rol.b #1,d0 3555 00001B9A E158 rol #8,d0 3556 00001B9C 4840 swap d0 3557 00001B9E 4E75 rts 3558 * 3559 * Load Memory Space with First Pattern 3560 * PAGE 76 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM TEST UTILITIES (BOOTROM0)" 3561 00001BA0 204A bytram movea.l a2,a0 3562 00001BA2 223C EE11 move.l #$EE11EE11,d1 Initial Pattern EE11 3563 00001BA8 03C8 0000 bytram0 movep.l d1,0(a0) 3564 00001BAC 5088 addq.l #8,a0 3565 00001BAE B3C8 cmpa.l a0,a1 3566 00001BB0 66F6 bne.s bytram0 3567 * 3568 * Set-up d0 to be write pattern. 3569 * Set-up d1 to be Read Pattern. 3570 * Set-up d5 to be Actual Read Pattern 3571 * Use d6 for extracting from memory 3572 * Use d7 as read mask 3573 * 3574 00001BB2 76FF moveq #-1,d3 No Patterns Trapped Yet 3575 00001BB4 78FF moveq #-1,d4 3576 00001BB6 4DFA 0060 lea bytram8,a6 If bus error, fail 3577 00001BBA 74FE moveq #-2,d2 Counter (Up/Down Indicator) 3578 00001BBC 203C EE11 move.l #$EE11EE11,d0 D0="WRITE" EE11 3579 00001BC2 223C 8877 move.l #$88778877,d1 D1="READ" 8877 3580 * 3581 * Generate Next Pass Patterns 3582 * 3583 00001BC8 5242 bytram1 addq #1,d2 nextpat: d2<1>=1 UP; d2<1>=0 DOWN 3584 00001BCA C141 exg d0,d1 3585 00001BCC 61C6 bsr byt_rot 3586 00001BCE 61C4 bsr byt_rot 3587 00001BD0 2A01 move.l d1,d5 Generate actual read pattern in d5 3588 00001BD2 CA87 and.l d7,d5 3589 * 3590 * Up or Down ? 3591 * 3592 00001BD4 0802 0001 bytram2 btst #1,d2 Up or Down? 3593 00001BD8 661E bne.s bytram5 Must be Up 3594 * 3595 * Go Down 3596 * 3597 00001BDA 2049 movea.l a1,a0 Start at Top 3598 00001BDC 5188 bytram3 subq.l #8,a0 Don't bus error in between 3599 00001BDE 0D48 0000 movep.l 0(a0),d6 Marchdowm: Read data 3600 00001BE2 CC87 and.l d7,d6 Mask 3601 00001BE4 BA86 cmp.l d6,d5 3602 00001BE6 6628 bne.s bytram7 Bad read, then fail 3603 00001BE8 01C8 0000 movep.l d0,0(a0) Write for next one 3604 00001BEC B1CA cmpa.l a2,a0 Stop at Bottom 3605 00001BEE 62EC bhi.s bytram3 3606 00001BF0 0C00 0011 bytram4 cmpi.b #$11,d0 donecheck: Check for Last Pattern 3607 00001BF4 66D2 bne.s bytram1 No, do next one 3608 00001BF6 602C bra.s bytram9 Done with no errors 3609 * 3610 * Go Up 3611 * 3612 00001BF8 204A bytram5 movea.l a2,a0 Start at Bottom to test up 3613 00001BFA 0D48 0000 bytram6 movep.l 0(a0),d6 Read 3614 00001BFE CC87 and.l d7,d6 Mask PAGE 77 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM TEST UTILITIES (BOOTROM0)" 3615 00001C00 BA86 cmp.l d6,d5 3616 00001C02 660C bne.s bytram7 marchup: Bad read, then fail 3617 00001C04 01C8 0000 movep.l d0,0(a0) Write for next one 3618 00001C08 5088 addq.l #8,a0 3619 00001C0A B1C9 cmpa.l a1,a0 Stop at top 3620 00001C0C 66EC bne.s bytram6 3621 00001C0E 60E0 bra.s bytram4 3622 * 3623 * Log a Failure 3624 * 3625 00001C10 2605 bytram7 move.l d5,d3 Save Write Pattern 3626 00001C12 0948 0000 movep.l 0(a0),d4 Save Read Pattern 3627 00001C16 C887 and.l d7,d4 3628 * 3629 * Bus Error, Log a Failure Entry 3630 * 3631 00001C18 2478 FED4 bytram8 movea.l f_area,a2 Remember Address of Failure 3632 00001C1C 2548 02CE move.l a0,tempsss(a2) 3633 00001C20 70FF moveq #-1,d0 Failure 3634 00001C22 4E75 rts 3635 * 3636 * Log a Success 3637 * 3638 00001C24 4240 bytram9 clr d0 Success 3639 00001C26 4E75 rts 3640 3641 ****************************************************************************** 3642 * test_ram: Routine to Test RAM between A1 at top+1 and A5 at Bottom * 3643 * On exit: sf d0 Succeeded * 3644 * st d0 Failed * 3645 ****************************************************************************** 3646 00001C28 4DFA 0038 test_ram lea test_ram2,a6 On Bus error, fail 3647 * 3648 * Pre-load Memory Space (Must be multiple of 32 bytes) 3649 * 3650 00001C2C 203C EEEE move.l #$EEEE1111,d0 Do 64 bytes at once 1111 3651 00001C32 2200 move.l d0,d1 3652 00001C34 2401 move.l d1,d2 3653 00001C36 2602 move.l d2,d3 3654 00001C38 2803 move.l d3,d4 3655 00001C3A 2A04 move.l d4,d5 3656 00001C3C 2C05 move.l d5,d6 3657 00001C3E 2E06 move.l d6,d7 3658 00001C40 2049 movea.l a1,a0 3659 00001C42 48E0 FF00 test_ram1 movem.l d0-d7,-(a0) 3660 00001C46 B1CD cmpa.l a5,a0 3661 00001C48 62F8 bhi.s test_ram1 3662 * 3663 * Test Memory (Takes 1 Second per 65K Bytes) 3664 * 3665 00001C4A 76FF moveq #-1,d3 No Failures Captured Yet 3666 00001C4C 78FF moveq #-1,d4 3667 00001C4E 264D movea.l a5,a3 Save Bottom of Memory 3668 00001C50 6100 EA48 bsr ramtest Test the Memory 3669 00001C54 BBCB cmpa.l a3,a5 Bottom still there? 3670 00001C56 670E beq.s test_ram3 Yes, then it succeed PAGE 78 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM TEST UTILITIES (BOOTROM0)" 3671 00001C58 598D subq.l #4,a5 Bad location is 4 down 3672 00001C5A 2078 FED4 movea.l f_area,a0 3673 00001C5E 214D 02CE move.l a5,tempsss(a0) Remember Address 3674 00001C62 50C0 test_ram2 st d0 Test Failed 3675 00001C64 4E75 rts 3676 00001C66 51C0 test_ram3 sf d0 Test Succeeded 3677 00001C68 4E75 rts 3678 3679 ****************************************************************************** 3680 * SOUND: Beep out the 7 bit value in D0 * 3681 ****************************************************************************** 3682 00001C6A 0838 0003 sound btst #3,sysflag If no 8041, then don't try it FED2 3683 00001C70 663E bne.s sound6 No Keyboard is there 3684 00001C72 48E7 FFFE sound1 movem.l d0-d7/a0-a6,-(sp) Save Registers 3685 * 3686 * Sound out bit D3 of D4 3687 * 3688 00001C76 2878 FED4 movea.l f_area,a4 3689 00001C7A 7606 moveq #6,d3 First bit to sound out 3690 00001C7C 3800 move d0,d4 Save D0 3691 00001C7E 2878 FED4 sound2 movea.l f_area,a4 Abort if stop bit is cleared 3692 00001C82 082C 0002 btst #mb_stop,m_b(a4) 0054 3693 00001C88 6722 beq.s sound5 3694 00001C8A 0704 btst d3,d4 3695 00001C8C 6706 beq.s sound3 Is Low 3696 00001C8E 343C 10CD move #$10CD,d2 Is HIGH: High (16) & Long (.50 s) 3697 00001C92 6004 bra.s sound4 3698 00001C94 343C 04CD sound3 move #$04CD,d2 IS LOW: Low (4) & Long (.50 s) 3699 00001C98 6100 477C sound4 bsr beep Call BOOTROM Beeper 3700 00001C9C 4DFA EC6C lea long_zero,a6 Wait for 1000 ms. 3701 00001CA0 303C 03E8 move.w #1000,d0 3702 00001CA4 6100 5CCA bsr f_clock 3703 00001CA8 5343 subq #1,d3 Do next bit 3704 00001CAA 6CD2 bge.s sound2 3705 00001CAC 4CDF 7FFF sound5 movem.l (sp)+,d0-d7/a0-a6 Restore Registers 3706 00001CB0 4E75 sound6 rts 3707 3708 ****************************************************************************** 3709 * MEM_FAIL0: Report a Memory Failure, if it's a bit fail * 3710 * MEM_FAIL: Report a Memory Failure to the Screen * 3711 * D0 Has Address of Bad Memory Location * 3712 * D3 is Write Pattern * 3713 * D4 is Read Pattern * 3714 ****************************************************************************** 3715 00001CB2 B883 mem_fail0 cmp.l d3,d4 If Patterns are equal, it was 3716 00001CB4 6760 beq.s mem_fail4 a bus error failure for sure 3717 * or no failure, just return 3718 00001CB6 48E7 FFFE mem_fail movem.l d0-d7/a0-a6,-(sp) 3719 00001CBA 43F8 FDD2 lea fubuffer,a1 Yes 3720 00001CBE 41FA 3D2A lea badrammsg,a0 Display The Last Failure Address 3721 00001CC2 B883 cmp.l d3,d4 If Patterns are equal, it was 3722 00001CC4 6604 bne.s mem_fail1 a bus error failure for sure 3723 00001CC6 41FA 3D34 lea misrammsg,a0 3724 00001CCA 6100 302C mem_fail1 bsr movebytes 3725 00001CCE 2078 FED4 movea.l f_area,a0 PAGE 79 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM TEST UTILITIES (BOOTROM0)" 3726 00001CD2 2028 02CE move.l tempsss(a0),d0 Get Address of Memory Failure 3727 00001CD6 6100 2FEE bsr pnt8hex 3728 00001CDA 4219 clr.b (a1)+ Add Terminator 3729 00001CDC 41F8 FDD2 lea fubuffer,a0 3730 00001CE0 6100 3958 bsr sftmsg 3731 00001CE4 B883 cmp.l d3,d4 If Patterns are equal, it was 3732 00001CE6 672A beq.s mem_fail3 a bus error failure for sure 3733 * so just return now 3734 00001CE8 43F8 FDD2 mem_fail2 lea fubuffer,a1 Display Write Pattern 3735 00001CEC 22FC 2028 move.l #' (W:',(a1)+ 573A 3736 00001CF2 2003 move.l d3,d0 3737 00001CF4 6100 2FD0 bsr pnt8hex 3738 00001CF8 22FC 2C20 move.l #', R:',(a1)+ Display Read Pattern 523A 3739 00001CFE 2004 move.l d4,d0 3740 00001D00 6100 2FC4 bsr pnt8hex 3741 00001D04 12FC 0029 move.b #')',(a1)+ 3742 00001D08 4219 clr.b (a1)+ 3743 00001D0A 41F8 FDD2 lea fubuffer,a0 3744 00001D0E 6100 392A bsr sftmsg 3745 00001D12 4CDF 7FFF mem_fail3 movem.l (sp)+,d0-d7/a0-a6 3746 00001D16 4E75 mem_fail4 rts 3747 PAGE 80 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 PROM DRIVERS (BOOTROM1)' 3750 ****************************************************************************** 3751 ****************************************************************************** 3752 *** *** 3753 *** PROM Drivers *** 3754 *** *** 3755 *** Entries Supported Internally: *** 3756 *** prom_init PROM Test vector entry *** 3757 *** required Determine if a device is required *** 3758 *** prom_boot High-est Priority Boot Scan *** 3759 *** prom_memchk Checks a4 against Required Memory *** 3760 *** prom_delay Wait amount in PROM *** 3761 *** *** 3762 ****************************************************************************** 3763 ****************************************************************************** 3764 3765 ****************************************************************************** 3766 * prom_init: PROM Test Vector entry * 3767 * Check out PROM * 3768 * Put up Product Name, and Serial Number. If PROM is bad indicate. * 3769 * Put up Copyright Message. * 3770 * Finally, put up a blank line. * 3771 ****************************************************************************** 3772 * 3773 * Check for Presence of a Good PROM 3774 * 3775 00001D18 700B prom_init moveq #promf,d0 Indicate to LEDs 3776 00001D1A 6100 FD4A bsr led_state 3777 3778 00001D1E 08B8 0000 bclr #prom_ok,sysflag2 No PROM Yet FEDA 3779 00001D24 2A4F movea.l sp,a5 Save Stack Pointer 3780 00001D26 4DFA 0076 lea prom_berr,a6 If Bus error, assume missing 3781 * 3782 * Start by trying to checksum the PROM 3783 * 3784 00001D2A 41F9 005F lea prom+prom_size,a0 Location containing PROM size 0005 3785 00001D30 1010 move.b (a0),d0 load PROM size... 3786 00001D32 7800 moveq #$00,d4 after Ins. pre-fetched byte of $00 3787 00001D34 1810 move.b (a0),d4 load PROM size again... 3788 00001D36 72FF moveq #$ff,d1 after Ins. pre-fetched byte of $ff 3789 00001D38 B800 cmp.b d0,d4 do the two values match? 3790 00001D3A 6664 bne.s prom_missing bad or missing PROM if different 3791 00001D3C B83C 0020 cmp.b #32,d4 PROM size with 8K byte range? 3792 00001D40 625E bhi.s prom_missing bad or missing prom if not 3793 3794 00001D42 5B88 subq.l #prom_size+1,a0 Start for checksum 3795 00001D44 4A44 tst d4 Minimum size is 256 bytes 3796 00001D46 6602 bne.s prom_chk1 3797 00001D48 7801 moveq #1,d4 3798 00001D4A E18C prom_chk1 lsl.l #8,d4 Checksum Routine does both bytes 3799 00001D4C E38C lsl.l #1,d4 3800 00001D4E 6100 FE16 bsr sumrom 3801 00001D52 4A43 tst d3 Only concerned with odd bytes 3802 00001D54 6668 bne.s prom_badsum Whoops, Bad checksum 3803 * 3804 * Check ID. If it's Zero it's ours. If it's not zero, it's someone elses. PAGE 81 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 PROM DRIVERS (BOOTROM1)' 3805 * 3806 00001D56 41F9 005F lea prom,a0 0001 3807 00001D5C 4A28 00C6 tst.b prom_id(a0) 3808 00001D60 6666 bne.s prom_cright It's not our's but don't Error 3809 * 3810 * PROM is there and alright 3811 * 3812 00001D62 08F8 0000 bset #prom_ok,sysflag2 Indicate PROM presence FEDA 3813 * 3814 * Display Machine Product Name 3815 * 3816 00001D68 43F9 005F lea prom,a1 Get Product Name 0001 3817 00001D6E 45E9 001C lea prom_prod(a1),a2 3818 00001D72 7007 moveq #7,d0 3819 00001D74 41F8 FDD2 lea fubuffer,a0 3820 00001D78 10D2 prom_init1 move.b (a2),(a0)+ 3821 00001D7A 544A addq #2,a2 3822 00001D7C 5340 subq #1,d0 3823 00001D7E 6EF8 bgt.s prom_init1 3824 00001D80 7020 moveq #' ',d0 Separate with two blanks 3825 00001D82 10C0 move.b d0,(a0)+ 3826 00001D84 10C0 move.b d0,(a0)+ 3827 * 3828 * Display Machine Serial Number 3829 * 3830 00001D86 45E9 0006 lea prom_serial(a1),a2 Get Serial Number 3831 00001D8A 700B moveq #11,d0 3832 00001D8C 10D2 prom_init2 move.b (a2),(a0)+ 3833 00001D8E 544A addq #2,a2 3834 00001D90 5340 subq #1,d0 3835 00001D92 6EF8 bgt.s prom_init2 3836 00001D94 4218 clr.b (a0)+ 3837 00001D96 41F8 FDD2 lea fubuffer,a0 3838 00001D9A 6142 bsr.s prom_sftmsg (Compact Code Call to sftmsg) 3839 00001D9C 602A bra.s prom_cright finish up with the copyright 3840 * 3841 * Bus errors are okay 3842 * 3843 00001D9E 2E4D prom_berr movea.l a5,sp Restore Stack Pointer 3844 * 3845 * PROM Not Installed (we think!) - Must Special Case MARMOT 3846 * 3847 00001DA0 41FA 3B3A prom_missing lea noprom,a0 PROM Not Installed Message 3848 00001DA4 0838 0005 btst #5,sysflag HPIB Present? FED2 3849 00001DAA 660E bne.s prom_miss_msg No, Then it can't be MARMOT 3850 00001DAC 0839 0002 btst #2,int_hpib3 Is it a MARMOT? 0047 8003 3851 00001DB4 6704 beq.s prom_miss_msg No, Then it must be missing a PROM 3852 00001DB6 41FA 3B3A lea marmot,a0 It's a MARMOT with no PROM 3853 00001DBA 6122 prom_miss_msg bsr.s prom_sftmsg (Compact Code Call to sftmsg) 3854 00001DBC 600A bra.s prom_cright finish up with the copyright 3855 * 3856 * Indicate Failure PAGE 82 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 PROM DRIVERS (BOOTROM1)' 3857 * 3858 00001DBE 6100 FCC6 prom_badsum bsr led_fail Indicate failure to LEDs 3859 00001DC2 41FA 3B09 lea badprom,a0 Indicate that the PROM is bad 3860 00001DC6 6116 bsr.s prom_sftmsg (Compact Code Call to sftmsg) 3861 * 3862 * Put out Copyright followed by a Blank Line 3863 * 3864 00001DC8 41FA 3B2D prom_cright lea copyright1,a0 First Line of Copyright 3865 00001DCC 6110 bsr.s prom_sftmsg (Compact Code Call to sftmsg) 3866 00001DCE 41FA 3B37 lea copyright2,a0 Second Line of Copyright 3867 00001DD2 610A bsr.s prom_sftmsg (Compact Code Call to sftmsg) 3868 00001DD4 41FA 3B4A lea copyright3,a0 Third Line of Copyright 3869 00001DD8 6104 bsr.s prom_sftmsg (Compact Code Call to sftmsg) 3870 00001DDA 41FA 3B59 lea blank_line,a0 Put out a Blank line terminator 3871 00001DDE 6000 385A prom_sftmsg bra sftmsg 3872 3873 ****************************************************************************** 3874 * required: Determine if a Device is required by the machine. * 3875 * d6<15> 1 for I/O Card * 3876 * d6<13> - Smart Bit * 3877 * d6<12:8> - Card ID * 3878 * d6<4:0> - Card Select Code * 3879 * 0 for Internal Peripheral * 3880 * d6<3:0> - Peripheral Device ID * 3881 * On exit: * 3882 * moveq #-1,d0 Device is not required or passed I/O is correct * 3883 * moveq #0,d0 Device is required or passed I/O is incorrect: * 3884 * If a select code was specified in d6 * 3885 * then d6 returns expected Card ID. * 3886 ****************************************************************************** 3887 * 3888 * If there is a PROM use it 3889 * 3890 00001DE2 48E7 6088 required movem.l d1-d2/a0/a4,-(sp) Save Registers 3891 00001DE6 2878 FED4 movea.l f_area,a4 Check for PROM presence 3892 00001DEA 0838 0000 btst #prom_ok,sysflag2 FEDA 3893 00001DF0 6778 beq.s required7 No Then not required or MARMOT 3894 * 3895 * Use PROM: Check for Peripheral 3896 * 3897 00001DF2 4A46 tst d6 Is it a Peripheral? 3898 00001DF4 6B36 bmi.s required3 No, It is I/O 3899 00001DF6 3406 move d6,d2 3900 00001DF8 0242 000F andi #$F,d2 3901 00001DFC 41F9 005F lea prom,a0 Search entries to see if it's 0001 3902 00001E02 41E8 002C lea prom_per(a0),a0 Required 3903 00001E06 7010 moveq #16,d0 Up to 16 Peripherals 3904 00001E08 1210 required1 move.b (a0),d1 Get one 3905 00001E0A 0241 000F andi #$F,d1 Look at id 3906 00001E0E B202 cmp.b d2,d1 3907 00001E10 6708 beq.s required1_1 It's required 3908 00001E12 5448 addq #2,a0 3909 00001E14 5340 subq #1,d0 3910 00001E16 6EF0 bgt.s required1 Try again 3911 00001E18 600A bra.s required2 Can't find it, then not required PAGE 83 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 PROM DRIVERS (BOOTROM1)' 3912 00001E1A 0C01 0005 required1_1 cmpi.b #5,d1 Look for Mass Storage 3913 00001E1E 6642 bne.s required6 No, then it's required 3914 00001E20 BC10 cmp.b (a0),d6 Check # of Drives 3915 00001E22 663E bne.s required6 Not equal, but it's required 3916 * 3917 * It's Not Required, or Is Correct I/O 3918 * 3919 00001E24 70FF required2 moveq #-1,d0 3920 00001E26 4CDF 1106 movem.l (sp)+,d1-d2/a0/a4 Restore Registers 3921 00001E2A 4E75 rts 3922 * 3923 * Use PROM: Check for I/O 3924 * 3925 00001E2C 41F9 005F required3 lea prom,a0 Search List for I/O Select Code 0001 3926 00001E32 41E8 0054 lea prom_io(a0),a0 3927 00001E36 7010 moveq #16,d0 Up to 16 I/O Cards 3928 00001E38 1210 required4 move.b (a0),d1 Get ID 3929 00001E3A 5448 addq #2,a0 3930 00001E3C E149 lsl #8,d1 3931 00001E3E 1210 move.b (a0),d1 Get Select Code 3932 00001E40 5448 addq #2,a0 3933 00001E42 0C41 00FF cmpi #255,d1 ID 0 is not Required ever 3934 00001E46 6304 bls.s required4_1 3935 00001E48 BC01 cmp.b d1,d6 Is the right select Code? 3936 00001E4A 6706 beq.s required5 Yes, verify now 3937 00001E4C 5340 required4_1 subq #1,d0 No, try next entry 3938 00001E4E 6EE8 bgt.s required4 3939 00001E50 60D2 bra.s required2 I/O is Okay, it's not required 3940 * 3941 * Use PROM: Check for I/O Card Correctness at Select Code 3942 * 3943 00001E52 08C1 000F required5 bset #15,d1 This bit is set for passed value 3944 00001E56 BC41 cmp d1,d6 Is the right I/O Card? 3945 00001E58 67CA beq.s required2 Yes, this one is Okay 3946 00001E5A E049 lsr #8,d1 Construct expected I.D. 3947 00001E5C 0241 003F andi #$3F,d1 3948 00001E60 3C01 move d1,d6 3949 * 3950 * It's Required, or Is Incorrect I/O 3951 * 3952 00001E62 7000 required6 moveq #0,d0 3953 00001E64 4CDF 1106 movem.l (sp)+,d1-d2/a0/a4 Restore Registers 3954 00001E68 4E75 rts 3955 * 3956 * Check for MARMOT, Since there is no PROM around to use 3957 * 3958 00001E6A 0838 0005 required7 btst #5,sysflag HPIB Present ? FED2 3959 00001E70 66B2 bne required2 No, Then Not MARMOT & Not Required 3960 00001E72 0839 0002 btst #2,int_hpib3 Is a MARMOT? 0047 8003 3961 00001E7A 67A8 beq required2 No, Then Not Required 3962 * 3963 * It's A MARMOT assume configuration 3964 * 3965 00001E7C 4A46 tst d6 Check for I/O PAGE 84 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 PROM DRIVERS (BOOTROM1)' 3966 00001E7E 6B0C bmi.s required8 Yes, it's I/O 3967 * 3968 * Handle MARMOT assumed peripherals 3969 * 3970 00001E80 CC7C 000F and #$F,d6 3971 00001E84 0C46 0004 cmpi #4,d6 KBD, CRT, HP-IB, Graphics Required 3972 00001E88 629A bhi required2 Not Required 3973 00001E8A 60D6 bra required6 Required 3974 * 3975 * Handle MARMOT assumed I/O Cards 3976 * 3977 00001E8C 0C06 0009 required8 cmpi.b #9,d6 Select Code 9 Required 3978 00001E90 6692 bne required2 Not 9, then not required 3979 00001E92 0C46 8209 cmpi.w #$8209,d6 Select Code 9 is HP98626 3980 00001E96 678C beq required2 Yes, then it's correct 3981 00001E98 7C02 moveq #2,d6 I.D. of 2 was expected 3982 00001E9A 60C6 bra required6 No, then it's incorrect 3983 3984 ****************************************************************************** 3985 * prom_boot: Highest Priority Boot * 3986 * * 3987 * (Most Useful to an O.E.M. in an ASPEN.) * 3988 * If No PROM then EXIT; * 3989 * MSUS:=prom_msus; FILENAME:=prom_filename; * 3990 * IF M_INIT(MSUS) AND M_FOPEN(FILENAME,Zilch,Zilch,SFTYPE:=-5822) THEN * 3991 * BEGIN * 3992 * ADD_TO_FOUND_AND_MENU(MSUS,FILENAME); * 3993 * IF NOT ATTENDED or BOOT_SELECT(MSUS,FILENAME) THEN * 3994 * BOOT(MSUS,FILENAME); * 3995 * END; * 3996 ****************************************************************************** 3997 * 3998 * Check for PROM Presence 3999 * 4000 00001E9C 0838 0000 prom_boot btst #prom_ok,sysflag2 Make sure there is a PROM first FEDA 4001 00001EA2 6602 bne.s prom_boot1 Yes, check it 4002 00001EA4 4E75 rts 4003 * 4004 * Get MSUS and FILENAME 4005 * 4006 00001EA6 41F9 005F prom_boot1 lea prom,a0 Get pointer to prom msus 0001 4007 00001EAC 41E8 0094 lea prom_msus(a0),a0 4008 00001EB0 7004 moveq #4,d0 4009 00001EB2 43EC 0056 lea m_msus(a4),a1 Get pointer to destination msus 4010 00001EB6 12D0 prom_boot2 move.b (a0),(a1)+ 4011 00001EB8 5448 addq #2,a0 4012 00001EBA 5340 subq #1,d0 4013 00001EBC 6EF8 bgt.s prom_boot2 4014 00001EBE 41F9 005F lea prom,a0 Get pointer to filename 0001 4015 00001EC4 41E8 009C lea prom_filename(a0),a0 4016 00001EC8 7011 moveq #17,d0 4017 00001ECA 43ED FEE4 lea filename(a5),a1 Get pointer to destination filename 4018 00001ECE 12D0 prom_boot3 move.b (a0),(a1)+ 4019 00001ED0 5448 addq #2,a0 PAGE 85 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 PROM DRIVERS (BOOTROM1)' 4020 00001ED2 5340 subq #1,d0 4021 00001ED4 6EF8 bgt.s prom_boot3 4022 00001ED6 41ED FEE4 lea filename(a5),a0 a0 is pointer to filename 4023 00001EDA 43ED FFEC lea zilch(a5),a1 a1 is pointer to zilch 4024 00001EDE 45ED FEDE lea sftype(a5),a2 a2 is pointer to filetype 4025 * 4026 * Set-up for possible escape 4027 * 4028 00001EE2 4E55 FFF6 link a5,#-10 4029 00001EE6 487A 006A pea prom_boot7 4030 00001EEA 2B4F FFF6 move.l sp,-10(a5) 4031 * 4032 * Call M_INIT 4033 * 4034 00001EEE 48E7 FFF8 movem.l a0-a4/d0-d7,-(sp) Save Registers 4035 00001EF2 554F subq #2,sp Pass Space for Boolean 4036 00001EF4 2F2C 0056 move.l m_msus(a4),-(sp) Pass MSUS 4037 00001EF8 6100 4B8C bsr lock Lockout Resets 4038 00001EFC 6100 2010 bsr m_init 4039 00001F00 6100 4B98 bsr unlock Unlock Resets 4040 00001F04 4A1F tst.b (sp)+ If false, we are done 4041 00001F06 4CDF 1FFF movem.l (sp)+,a0-a4/d0-d7 Restore Registers 4042 00001F0A 6604 bne.s prom_boot5 4043 * 4044 * Done, clean up 4045 * 4046 00001F0C 4E5D prom_boot4 unlk a5 4047 00001F0E 4E75 rts 4048 * 4049 * Call M_FOPEN 4050 * 4051 00001F10 48E7 FFF8 prom_boot5 movem.l a0-a4/d0-d7,-(sp) Save Registers 4052 00001F14 558F subq.l #2,sp Pass Space for Boolean 4053 00001F16 2F08 move.l a0,-(sp) Pass Filename 4054 00001F18 2F09 move.l a1,-(sp) Pass Execution Address Ptr 4055 00001F1A 2F09 move.l a1,-(sp) Pass Length Ptr 4056 00001F1C 34BC E942 move #-5822,(a2) Pass System Filetype 4057 00001F20 2F0A move.l a2,-(sp) 4058 00001F22 6100 4B62 bsr lock Lock out Resets 4059 00001F26 6100 202E bsr m_fopen 4060 00001F2A 6100 4B6E bsr unlock Unlock Resets 4061 00001F2E 4A1F tst.b (sp)+ 4062 00001F30 4CDF 1FFF movem.l (sp)+,a0-a4/d0-d7 Restore Registers 4063 00001F34 67D6 beq prom_boot4 Not Found, then return 4064 * 4065 * Clean up First 4066 * 4067 00001F36 4E5D unlk a5 4068 * 4069 * Call ADD_TO_FOUND_AND_MENU 4070 * 4071 00001F38 2B6C 0056 move.l m_msus(a4),msus(a5) FFF0 4072 00001F3E 6100 EBAA bsr add_to_found 4073 * 4074 * If not ATTENDED THEN BOOT IT 4075 * PAGE 86 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 PROM DRIVERS (BOOTROM1)' 4076 00001F42 082C 0003 btst #attended,booleans(a4) 000B 4077 00001F48 6604 bne.s prom_boot6 4078 00001F4A 6100 EAF2 bsr boot_call 4079 * 4080 * If Boot Selected then BOOT 4081 * 4082 00001F4E 6000 EAE8 prom_boot6 bra boot_check 4083 * 4084 * Handle an escape 4085 * 4086 00001F52 6100 4B46 prom_boot7 bsr unlock Unlock Resets 4087 00001F56 6100 3F2A bsr dsp_ri_error Display error in -2(a5) 4088 00001F5A 4E5D unlk a5 Clean up stack 4089 00001F5C 4E75 rts 4090 4091 ****************************************************************************** 4092 * prom_memchk: Checks for Required Memory. * 4093 * moveq #-1,d0 If a4 is not low enough. * 4094 * moveq #0,d0 If a4 is low enough. * 4095 ****************************************************************************** 4096 00001F5E 2F08 prom_memchk move.l a0,-(sp) Save Registers 4097 00001F60 203C FFFF move.l #$FFFFC000,d0 Always require 16K C000 4098 00001F66 0838 0000 btst #prom_ok,sysflag2 If no PROM, it's okay then FEDA 4099 00001F6C 670E beq.s prom_memchk2 No PROM 4100 00001F6E 41F9 005F lea prom,a0 Get required bottom of memory 0001 4101 00001F74 41E8 004C lea prom_mem(a0),a0 4102 00001F78 0148 0000 movep.l 0(a0),d0 4103 00001F7C B9C0 prom_memchk2 cmpa.l d0,a4 4104 00001F7E 6304 bls.s prom_memchk3 It's low enough 4105 00001F80 70FF moveq #-1,d0 It's not low enough 4106 00001F82 6002 bra.s prom_memchk4 4107 00001F84 7000 prom_memchk3 moveq #0,d0 It's low enough 4108 00001F86 205F prom_memchk4 movea.l (sp)+,a0 Restore Registers 4109 00001F88 4E75 rts 4110 4111 ****************************************************************************** 4112 * prom_delay: Wait As per PROM. * 4113 ****************************************************************************** 4114 00001F8A 0838 0000 prom_delay btst #prom_ok,sysflag2 If no PROM, no wait FEDA 4115 00001F90 6732 beq.s prom_delay3 4116 * 4117 * Get Wait value in milliseconds 4118 * 4119 00001F92 41F9 005F lea prom,a0 0001 4120 00001F98 0148 00BE movep.l prom_wait(a0),d0 4121 * 4122 * If number is greater than $7FFF then wait $7FFF ms 4123 * subtract from count and try again. 4124 * 4125 00001F9C 0C80 0000 prom_delay1 cmpi.l #$7FFF,d0 Check for limit of wait routine 7FFF PAGE 87 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 PROM DRIVERS (BOOTROM1)' 4126 00001FA2 6318 bls.s prom_delay2 4127 00001FA4 0480 0000 subi.l #$7FFF,d0 Adjust count 7FFF 4128 00001FAA 2F00 move.l d0,-(sp) Save adjusted count 4129 00001FAC 303C 7FFF move.w #$7FFF,d0 Wait maximum limit of routine 4130 00001FB0 4DFA E958 lea long_zero,a6 4131 00001FB4 6100 59BA bsr f_clock 4132 00001FB8 201F move.l (sp)+,d0 Restore adjusted count 4133 00001FBA 60E0 bra.s prom_delay1 Try again 4134 * 4135 * Wait for amounts of $7FFF or less 4136 * 4137 00001FBC 4DFA E94C prom_delay2 lea long_zero,a6 4138 00001FC0 6100 59AE bsr f_clock 4139 00001FC4 4E75 prom_delay3 rts PAGE 88 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM READ INTERFACE (BOOTROM1)" 4142 00003ED8 rorg $3ED8 4143 ****************************************************************************** 4144 ****************************************************************************** 4145 *** *** 4146 *** Read Interface *** 4147 *** *** 4148 *** Entries Supported Externally: *** 4149 *** M_INIT ($4004) Initialize Mass Storage Device *** 4150 *** M_FOPEN ($4008) Open File on Mass Storage Device *** 4151 *** M_READ ($400C) Multi-Byte Read from Mass Storage *** 4152 *** M_FCLOSE ($4010) Close Open file on Mass Storage *** 4153 *** *** 4154 *** Utility Entries Supported Internally: *** 4155 *** M_MENU Return Device Name and Ptr to Menu Descrip. *** 4156 *** *** 4157 ****************************************************************************** 4158 ****************************************************************************** 4159 4160 ****************************************************************************** 4161 * find_driver: Return Pointer to Driver in a0 * 4162 * Scan on top 3 bits of Type only. Except when top 3 bits are 7 * 4163 * then require match of all of msus type bits. * 4164 ****************************************************************************** 4165 00003ED8 48A7 C000 find_driver movem d0-d1,-(sp) Save Registers 4166 00003EDC 2078 FED4 movea.l f_area,a0 4167 00003EE0 1028 0056 move.b m_msus(a0),d0 Get Passed msus 4168 00003EE4 1200 move.b d0,d1 4169 00003EE6 0201 00E0 andi.b #$E0,d1 Check for Type special 4170 00003EEA 0C01 00E0 cmpi.b #$E0,d1 4171 00003EEE 6702 beq.s find_driver0 4172 00003EF0 1001 move.b d1,d0 Not special, match top bits only 4173 00003EF2 2068 0020 find_driver0 movea.l d_start(a0),a0 Get pointer to driver list 4174 00003EF6 4A90 find_driver1 tst.l (a0) Check for end of list 4175 00003EF8 670A beq.s find_driver2 Yes, use dummy driver 4176 00003EFA B028 0008 cmp.b 8(a0),d0 Match? 4177 00003EFE 6704 beq.s find_driver2 Yes, use it 4178 00003F00 D1D0 adda.l (a0),a0 Try next element 4179 00003F02 60F2 bra.s find_driver1 4180 00003F04 2068 0004 find_driver2 movea.l 4(a0),a0 Get Pointer to Driver 4181 00003F08 4C9F 0003 movem (sp)+,d0-d1 Restore Registers 4182 00003F0C 4E75 rts 4183 4184 ****************************************************************************** 4185 * M_INIT(MSUS:MSUSTYPE):BOOLEAN * 4186 * Initialize the passed mass storage device. Set-up any temporaries * 4187 * Determine if the device and media is present. Return true if so. * 4188 * Verify that the device and media is of the expected msus. * 4189 * Point to start of Director. * 4190 * * 4191 * a0-a4/d0-d7 Destroyed * 4192 ****************************************************************************** 4193 * 4194 * Pop off msus and store it in a global 4195 * 4196 00003F0E 2078 FED4 m_init movea.l f_area,a0 Set-up global msus 4197 00003F12 216F 0004 move.l 4(sp),m_msus(a0) 0056 PAGE 89 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM READ INTERFACE (BOOTROM1)" 4198 00003F18 2F57 0004 move.l (sp),4(sp) Pop off msus 4199 00003F1C 588F addq.l #4,sp 4200 * 4201 * Save Current Environment 4202 * 4203 00003F1E 6100 0E54 bsr trapset Set-up Trap environment 4204 * 4205 * Set-up to Trap all Escapes 4206 * 4207 00003F22 4E55 FFF6 link a5,#-10 Trap all Escapes 4208 00003F26 487A 001A pea m_init1 4209 00003F2A 2B4F FFF6 move.l sp,-10(a5) 4210 * 4211 * Make Room for a Boolean on the Stack 4212 * 4213 00003F2E 554F subq #2,sp Boolean 4214 * 4215 * Find the driver based on the msus 4216 * 4217 00003F30 61A6 bsr find_driver Find driver in a0 4218 * 4219 * Call the Driver 4220 * 4221 00003F32 4EA8 0000 jsr 0(a0) Call driver 4222 * 4223 * Normal Return from Driver. Get Returned Boolean. 4224 * 4225 00003F36 3B57 0008 m_init0 move (sp),8(a5) Pass Boolean to caller 4226 00003F3A 6100 0E7E m_init0_1 bsr trapres Restore Trap environment 4227 00003F3E 4E5D unlk a5 4228 00003F40 4E75 rts 4229 * 4230 * Escape Return from Driver, Restore Environment and Pass Escape thru 4231 * 4232 00003F42 6100 0E76 m_init1 bsr trapres 4233 00003F46 302D FFFE move -2(a5),d0 4234 00003F4A 4E5D unlk a5 4235 00003F4C 3B40 FFFE move d0,-2(a5) 4236 00003F50 2E6D FFF6 movea.l -10(a5),sp Pass Escape out 4237 00003F54 4E75 rts 4238 4239 4240 ****************************************************************************** 4241 * M_FOPEN(VAR FILENAME:STRING255;VAR X_ADR,LENGTH:INTEGER; * 4242 * VAR FTYPE:WORD):BOOLEAN * 4243 * Attempt to open the specified file. Start search where you left off * 4244 * last. If successful; return true, the size in bytes, start * 4245 * execution address in memory, and the actual ftype and * 4246 * filename found. If FTYPE=-1, then File type is a don't care. * 4247 * On GANGLIA, look on /SYSTEM_68000 unless "/" is first character of * 4248 * filename. * 4249 * * 4250 * a0-a4/d0-d7 Destroyed * 4251 ****************************************************************************** 4252 * 4253 * Save Current Environment 4254 * PAGE 90 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM READ INTERFACE (BOOTROM1)" 4255 00003F56 6100 0E1C m_fopen bsr trapset Set-up Trap environment 4256 * 4257 * Save Passed Parameters 4258 * 4259 00003F5A 4CDF 001F movem.l (sp)+,d0-d4 Return Address in d0 4260 * 4261 * Put Boolean and Return Address on Stack 4262 * 4263 00003F5E 2F00 move.l d0,-(sp) 4264 * 4265 * Set-up to Trap all Escapes 4266 * 4267 00003F60 4E55 FFF6 link a5,#-10 Trap all Escapes 4268 00003F64 487A FFDC pea m_init1 4269 00003F68 2B4F FFF6 move.l sp,-10(a5) 4270 * 4271 * Make Room for a Boolean on the Stack 4272 * 4273 00003F6C 554F subq #2,sp Boolean 4274 * 4275 * Put Parameters Back on Stack 4276 * 4277 00003F6E 48E7 7800 movem.l d1-d4,-(sp) 4278 * 4279 * Find the driver based on the msus 4280 * 4281 00003F72 6100 FF64 bsr find_driver Find driver in a0 4282 * 4283 * Call the Driver 4284 * 4285 00003F76 4EA8 0004 jsr 4(a0) Call driver 4286 00003F7A 60BA bra m_init0 4287 4288 ****************************************************************************** 4289 * M_READ(SECTOR,BYTECOUNT,RAMADDRESS:INTEGER;MEDIA:BOOLEAN) * 4290 * Read the specified number of bytes starting at the specified sector * 4291 * to a specified ram location. Sector * 4292 * number is relative to a file if one is open and MEDIA is set to * 4293 * false (sector is absolute on media otherwise). * 4294 * * 4295 * a0-a4/d0-d7 Destroyed * 4296 ****************************************************************************** 4297 * 4298 * Save Current Environment 4299 * 4300 00003F7C 6100 0DF6 m_read bsr trapset Set-up Trap environment 4301 * 4302 * Save Passed Parameters 4303 * 4304 00003F80 4CDF 000F movem.l (sp)+,d0-d3 Return Address in d0 4305 00003F84 381F move (sp)+,d4 4306 * 4307 * Put Return Address on Stack 4308 * 4309 00003F86 2F00 move.l d0,-(sp) 4310 * 4311 * Set-up to Trap all Escapes PAGE 91 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM READ INTERFACE (BOOTROM1)" 4312 * 4313 00003F88 4E55 FFF6 link a5,#-10 Trap all Escapes 4314 00003F8C 487A FFB4 pea m_init1 4315 00003F90 2B4F FFF6 move.l sp,-10(a5) 4316 * 4317 * Put Parameters Back on Stack 4318 * 4319 00003F94 3F04 move d4,-(sp) 4320 00003F96 48E7 7000 movem.l d1-d3,-(sp) 4321 * 4322 * Find the driver based on the msus 4323 * 4324 00003F9A 6100 FF3C bsr find_driver Find driver in a0 4325 * 4326 * Call the Driver 4327 * 4328 00003F9E 4EA8 0008 jsr 8(a0) Call driver 4329 00003FA2 6096 bra m_init0_1 4330 4331 ****************************************************************************** 4332 * M_FCLOSE * 4333 * Close the currently opened file. * 4334 * * 4335 * a0-a4/d0-d7 Destroyed * 4336 ****************************************************************************** 4337 * 4338 * Save Current Environment 4339 * 4340 00003FA4 6100 0DCE m_fclose bsr trapset Set-up Trap environment 4341 * 4342 * Set-up to Trap all Escapes 4343 * 4344 00003FA8 4E55 FFF6 link a5,#-10 Trap all Escapes 4345 00003FAC 487A FF94 pea m_init1 4346 00003FB0 2B4F FFF6 move.l sp,-10(a5) 4347 * 4348 * Find the driver based on the msus 4349 * 4350 00003FB4 6100 FF22 bsr find_driver Find driver in a0 4351 * 4352 * Call the Driver 4353 * 4354 00003FB8 4EA8 0010 jsr 16(a0) Call driver 4355 00003FBC 6000 FF7C bra m_init0_1 4356 4357 ****************************************************************************** 4358 * M_MENU(VAR DEVICENAME:STRING80):ANYPTR * 4359 * Return Pointer to Descriptor Byte and Device name. * 4360 * * 4361 * a0-a4/d0-d7 Destroyed * 4362 ****************************************************************************** 4363 00003FC0 6100 FF16 m_menu bsr find_driver Find driver in a0 4364 00003FC4 4EE8 000C jmp 12(a0) Call driver PAGE 92 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM EXTERNAL DISC BOOT MASS STORAGE DRIVER SUPPORT 4367 ****************************************************************************** 4368 ****************************************************************************** 4369 *** *** 4370 *** External Disc Boot Mass Storage Driver Support *** 4371 *** *** 4372 *** Entries Supported Internally: *** 4373 *** b_ext1 Jump table for Boot List Disc Drivers 1 *** 4374 *** b_ext2 Jump table for Boot List Disc Drivers 2 *** 4375 *** *** 4376 ****************************************************************************** 4377 ****************************************************************************** 4378 4379 ****************************************************************************** 4380 * b_ext1: Jump table for External Disc High Priority Boot List Drivers * 4381 ****************************************************************************** 4382 00003FC8 6000 C036 b_ext1 bra spsod_extd_active1 ACTIVE for High Priority 4383 00003FCC 6000 C032 bra spsod_next_system NEXT_SYSTEM 4384 4385 ****************************************************************************** 4386 * b_ext2: Jump table for External Disc Low Priority Boot List Drivers * 4387 ****************************************************************************** 4388 00003FD0 6000 C02E b_ext2 bra spsod_extd_active2 ACTIVE for Low Priority 4389 00003FD4 6000 C02A bra spsod_next_system NEXT_SYSTEM PAGE 93 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BUBBLE MEMORY BOOT MASS STORAGE DRIVER SUPPORT 4392 ****************************************************************************** 4393 ****************************************************************************** 4394 *** *** 4395 *** Bubble Memory Boot Mass Storage Driver Support *** 4396 *** *** 4397 *** Entries Supported Internally: *** 4398 *** b_bub1 Jump table for Boot List Disc Drivers 1 *** 4399 *** b_bub2 Jump table for Boot List Disc Drivers 2 *** 4400 *** *** 4401 ****************************************************************************** 4402 ****************************************************************************** 4403 4404 ****************************************************************************** 4405 * b_bub1: Jump table for Bubble Memory High Priority Boot List Drivers * 4406 ****************************************************************************** 4407 00003FD8 6000 C026 b_bub1 bra spsod_bubl_active1 ACTIVE for High Priority 4408 00003FDC 6000 C022 bra spsod_next_system NEXT_SYSTEM 4409 4410 ****************************************************************************** 4411 * b_bub2: Jump table for Bubble Memory Low Priority Boot List Drivers * 4412 ****************************************************************************** 4413 00003FE0 6000 C01E b_bub2 bra spsod_bubl_active2 ACTIVE for Low Priority 4414 00003FE4 6000 C01A bra spsod_next_system NEXT_SYSTEM PAGE 94 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BUBBLE MEMORY BOOT MASS STORAGE DRIVER SUPPORT 4416 00003FE8 42 bootvmsg dc.b 'BOOTROM 4.0',0 4417 00003FF4 rorg $3FF4 4418 00003FF4 F096 A5C3 dc.l $F096A5C3 Pattern For Test Board 4419 00003FF8 FFFF FFFF dc.l $FFFFFFFF Reserved for Checksum 4420 * 4421 * Configuration Word: 4422 * <15:9> Reserved at Zero 4423 * <8> 0=Has Read Interface 1=No Read Interface 4424 * <7:5> Reserved at Zero 4425 * <4:0> BOOTROM Size in Number of 16K byte blocks 4426 * 4427 00003FFC 0004 dc 4 BOOTROM 4.0 SIZE: 4*16K bytes 4428 00003FFE 0004 dc 4 BOOTROM 4.0 ID 4429 include GREG:BOOTROM3 4430 * sccs info: @(#) bootrom3 8.1 84/05/04 00:14:30 * 4431 PAGE 95 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM EXTENDED JUMP TABLE ENTRIES (BOOTROM3)" 4434 ****************************************************************************** 4435 ****************************************************************************** 4436 *** *** 4437 *** BOOTROM 3.0 Extended Jump Table Entries *** 4438 *** *** 4439 ****************************************************************************** 4440 ****************************************************************************** 4441 00004000 rorg bootstart+$4000 4442 00004000 4EFA 00E6 jmp boot BOOT 4443 00004004 4EFA FF08 jmp m_init Initialize MSUS 4444 00004008 4EFA FF4C jmp m_fopen Open a file 4445 0000400C 4EFA FF6E jmp m_read Multi-sector read 4446 00004010 4EFA FF92 jmp m_fclose Close the opened file PAGE 96 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MASS STORAGE DRIVER LISTS (BOOTROM3)" 4449 ****************************************************************************** 4450 ****************************************************************************** 4451 *** *** 4452 *** BOOTROM 3.0 Mass Storage Driver Lists *** 4453 *** *** 4454 *** Utility Entries Supported Internally: *** 4455 *** B_LIST Boot List *** 4456 *** D_LIST Driver List *** 4457 *** *** 4458 ****************************************************************************** 4459 ****************************************************************************** 4460 4461 ****************************************************************************** 4462 * B_LIST: Boot List of Mass Storage Devices to Search during Boot_scan * 4463 * 4 Bytes: Address of Vector Routines * 4464 * 4 Bytes: Long Offset to Next Element * 4465 ****************************************************************************** 4466 00004014 0000 45D8 b_list dc.l b_mini0,4 Internal Mini-Floppy Drive 0 4467 0000401C 0000 3FC8 dc.l b_ext1,4 External Discs at Unit 0's 4468 00004024 0000 4872 dc.l b_ganglia1,4 High Priority GANGLIA at 14 4469 0000402C 0000 3FD8 dc.l b_bub1,4 Bubble Memory at 30 4470 00004034 0000 46CC dc.l b_eprom1,4 EPROM Memory Unit 0 4471 0000403C 0000 46EE dc.l b_rom,4 ROM Systems 4472 00004044 0000 45E0 dc.l b_minin,4 Rest of Internal Mini-Floppies 4473 0000404C 0000 3FD0 dc.l b_ext2,4 Rest of External Discs 4474 00004054 0000 487A dc.l b_ganglia2,4 Rest of GANGLIA's 4475 0000405C 0000 3FE0 dc.l b_bub2,4 Rest of Bubble Memories 4476 00004064 0000 46D4 dc.l b_eprom2,4 Rest of EPROM Units 4477 0000406C 0000 0000 dc.l 0 End of list 4478 4479 ****************************************************************************** 4480 * D_LIST: Driver List of Mass Storage Read Drivers * 4481 * 4 Bytes: Long Offset to Next Element (0 at end of list * 4482 * 4 Bytes: Address of Read Drivers * 4483 * 1 Byte: MSUS Type Byte * 4484 ****************************************************************************** 4485 00004070 0000 000A d_list dc.l d_list1-*,d_sodlif LIF Drivrs 4486 00004078 00 dc.b 0,0 4487 0000407A 0000 000A d_list1 dc.l d_list2-*,d_sodsdf SDF Drivers 4488 00004082 20 dc.b $20,0 4489 00004084 0000 000A d_list2 dc.l d_list3-*,d_sodunix UNIX Drivers 4490 0000408C 40 dc.b $40,0 4491 0000408E 0000 000A d_list3 dc.l d_list4-*,d_rom ROM Drivers 4492 00004096 E0 dc.b $E0,0 4493 00004098 0000 000A d_list4 dc.l d_list5-*,d_ganglia GANGLIA Drivers 4494 000040A0 E1 dc.b $E1,0 4495 000040A2 0000 0000 d_list5 dc.l 0,d_dummy Dummy Drivers 4496 000040AA 00 dc.b 0,0 PAGE 97 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES I (BOOTROM3)" 4499 ****************************************************************************** 4500 ****************************************************************************** 4501 *** *** 4502 *** Boot Entries I *** 4503 *** *** 4504 *** Entries Supported Externally: *** 4505 *** BOOT ($4000) Boot a system *** 4506 *** REQ_REBOOT ($1A4) System Requested ReBoot *** 4507 *** REQ_BOOT ($1C0) System Switch *** 4508 *** *** 4509 ****************************************************************************** 4510 ****************************************************************************** 4511 4512 ****************************************************************************** 4513 * REQ_REBOOT: ($1A4) System Requested ReBoot * 4514 ****************************************************************************** 4515 000040AC 31FC 000C req_reboot move #12,boottype Assume Caller Supplied File Name FDC0 4516 000040B2 4A38 FDC2 req_reboot1 tst.b sysname Check for Null Name 4517 000040B6 6720 beq.s req_reboot2 4518 000040B8 08F8 0002 bset #2,blflags Set Soft Sys Only Flag FDCC 4519 000040BE 4A38 FDC3 tst.b sysname+1 4520 000040C2 6600 C6EA bne self_test 4521 000040C6 08B8 0002 bclr #2,blflags Clear Soft Sys Only Flag FDCC 4522 000040CC 21FC E0FF move.l #rom_msus,default_msus Boot a ROM system FFFF FEDC 4523 000040D4 6000 C6D8 bra self_test 4524 000040D8 4278 FDC0 req_reboot2 clr boottype 4525 000040DC 6000 C6D0 bra self_test 4526 4527 ****************************************************************************** 4528 * REQ_BOOT: ($1C0) System Switch * 4529 ****************************************************************************** 4530 000040E0 31FC 0012 req_boot move #18,boottype Set Boot Type FDC0 4531 000040E6 60CA bra req_reboot1 4532 4533 ****************************************************************************** 4534 * BOOT(MSUS:LONGWORD,VAR FILENAME:STRING255): ($4000) Boot a System * 4535 * If there is such a file to boot then do it. * 4536 * Return if file is not found or no load is possible. * 4537 * After setup: sp --> 4 bytes: Ptr to Error Handler * 4538 * 4 bytes: Old Bus error Routine Address * 4539 * 2 bytes: bftype * 4540 * 4 bytes: load_adr, bmedia * 4541 * 4 bytes: length, msusvalid * 4542 * 4 bytes: x_adr * 4543 * 4 bytes: Ptr to Stack entry pointing to Err Hdlr * 4544 * 4 bytes: Unused by Error Block * 4545 * 2 bytes: Error Number * 4546 * a5 --> 4 bytes: Old a5 * 4547 * 28 bytes: 7 Registers * 4548 * 4 bytes: Return Address * 4549 * 4 bytes: Filename ptr (bfptr) * 4550 * 4 bytes: MSUS (bmsus) * PAGE 98 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES I (BOOTROM3)" 4551 * a4 points to LOWRAM area * 4552 * d5: Sector * 4553 * d6: seg_length/present_msus * 4554 * d7: anything_loaded/Media_found * 4555 * a3: load_adr/boot_listptr * 4556 * * 4557 * Indicate that Booter has been called. * 4558 * IF M_INIT(MSUS) and M_FOPEN(FILENAME,X_ADR,LENGTH,BTYPE:=#-5822) THEN * 4559 * BEGIN * 4560 * Sector:=0; * 4561 * On Error IF NOT ANYTHING_LOADED THEN RETURN * 4562 * ELSE ERROR(Error,RESET to RETRY, * 4563 * CONTROL-RESET to POWER-UP, Hang); * 4564 * On Bus Error IF ANYTHING_LOADED THEN * 4565 * ERROR(Not Enough RAM,RESET to POWER-UP, Hang) * 4566 * ELSE RETURN; * 4567 * ANYTHING_LOADED:=False; * 4568 * IF LENGTH THEN REPEAT * 4569 * M_READ(Sector,256,FUBUFFER,Relative); * 4570 * Load_adr:=FUBUFFER[0:3];Seg_length:=FUBUFFER[4:7]; * 4571 * IF Load_adr to Load_adr+Seg_length-1 overlaps * 4572 * F_AREA to LOWRAM-1 or Load_adr+Seg_length > MIDRAM THEN * 4573 * IF NOT ANYTHING_LOADED THEN RETURN * 4574 * ELSE ERROR(Not Enough RAM,RESET to RETRY, * 4575 * CONTROL-RESET to POWER-UP, Hang); * 4576 * ANYTHING_LOADED:=True; * 4577 * Sector:=Sector+1; * 4578 * IF Seg_length<=(256-8) then * 4579 * Copy Seg_length from FUBUFFER at 8 to Load_Adr; * 4580 * ELSE * 4581 * BEGIN * 4582 * Copy 256-8 bytes from FUBUFFER to Load_Adr; * 4583 * Load_Adr:=Load_Adr+256-8; * 4584 * Seg_length:=Seg_length-(256-8); * 4585 * M_READ(Sector,Seg_length,Load_adr,Relative); * 4586 * Sector:=Sector+((Seg_length+255) div 256); * 4587 * END; * 4588 * UNTIL (Sector+1)*256>LENGTH; * 4589 * M_FCLOSE; * 4590 * * 4591 * {Determine Default MSUS.} * 4592 * If MSUS#ROM THEN DEFAULT_MSUS:=MSUS * 4593 * ELSE IF DEFAULT_MSUS=ROM THEN * 4594 * BEGIN {Determine ROM DEFAULT_MSUS} * 4595 * DEFAULT_MSUS:=M7908X 700,0; * 4596 * Media_Found:=False; * 4597 * Present_MSUS:=ROM; * 4598 * FOREACH BOOTV in BOOT_LIST DO WITH BOOTV^ DO * 4599 * BEGIN "FINDMSUS" {BOOT_LIST Search} * 4600 * MSUSVALID:=False; * 4601 * Media:=ACTIVE(1,True,MSUS,MSUSVALID,False); * 4602 * IF MSUSVALID and MSUS#ROM THEN * 4603 * BEGIN * 4604 * IF Media THEN * 4605 * BEGIN * 4606 * DEFAULT_MSUS:=MSUS; * 4607 * Media_Found:=True; * PAGE 99 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES I (BOOTROM3)" 4608 * EXIT "FINDMSUS"; * 4609 * END; * 4610 * IF Present_MSUS=ROM THEN Present_MSUS:=MSUS; * 4611 * END; * 4612 * END "FINDMSUS"; {BOOT_LIST Search} * 4613 * IF NOT Media_Found AND Present_MSUS#ROM THEN * 4614 * DEFAULT_MSUS:=Present_MSUS; * 4615 * END; {Determine ROM DEFAULT_MSUS} * 4616 * Set LOWRAM back; * 4617 * Mem[LOWRAM]:=FILENAME; * 4618 * SYSNAME:=FILENAME; * 4619 * Initialize MACHINE; * 4620 * JSR (X_ADR); * 4621 * END; * 4622 ****************************************************************************** 4623 0000 0028 bmsus equ 40 Passed msus off a5 4624 0000 0024 bfptr equ 36 Passes Filename ptr off a5 4625 FFFF FFF2 x_adr equ -14 Execution Address 4626 FFFF FFEE length equ -18 File length 4627 FFFF FFEE msusvalid equ -18 Boolean 4628 FFFF FFEA load_adr equ -22 Segment load address 4629 FFFF FFEA bmedia equ -22 Boolean 4630 FFFF FFE8 bftype equ -24 File Type 4631 FFFF FFE4 oldbus equ -28 Old bus error handler 4632 FFFF FFFF no_ram equ -1 Insufficient RAM error number 4633 4634 000040E8 48E7 8798 boot movem.l a0/a3/a4/d0/d5-d7,-(sp) Save Registers 4635 000040EC 4E55 FFE8 link a5,#bftype Allocate Space 4636 000040F0 2F38 FFFC move.l buserrv+2,-(sp) Set-up Bus error handler 4637 000040F4 6100 0C0A bsr pascal_init Set-up Pascal Environment 4638 000040F8 21FC 0000 move.l #boot_berr,buserrv+2 43F2 FFFC 4639 00004100 487A 02BA pea boot_error Error handler set-up 4640 00004104 2B4F FFF6 move.l sp,-10(a5) 4641 00004108 2878 FED4 movea.l f_area,a4 Point to LOWRAM area 4642 0000410C 302C 0052 move height(a4),d0 Clear line height-1 4643 00004110 5340 subq #1,d0 4644 00004112 6100 14C0 bsr clrline 4645 00004116 41FA 15D8 lea bootermsg,a0 Indicate that booter is called 4646 0000411A 6100 1496 bsr putmsg 4647 0000411E 48E7 FFF8 movem.l a0-a4/d0-d7,-(sp) Save Registers 4648 00004122 558F subq.l #2,sp Call M_INIT: Push Boolean 4649 00004124 2F2D 0028 move.l bmsus(a5),-(sp) Pass msus 4650 00004128 6100 295C bsr lock Lock out Resets 4651 0000412C 6100 FDE0 bsr m_init 4652 00004130 6100 2968 bsr unlock Unlock Resets 4653 00004134 4A1F tst.b (sp)+ 4654 00004136 4CDF 1FFF movem.l (sp)+,a0-a4/d0-d7 Restore Registers 4655 0000413A 6700 0268 beq boot15 If it fails, return 4656 0000413E 48E7 FFF8 movem.l a0-a4/d0-d7,-(sp) Save Registers 4657 00004142 558F subq.l #2,sp Open file: push boolean 4658 00004144 2F2D 0024 move.l bfptr(a5),-(sp) Pass filename 4659 00004148 486D FFF2 pea x_adr(a5) Pass execution address ptr 4660 0000414C 486D FFEE pea length(a5) Pass length ptr 4661 00004150 3B7C E942 move #-5822,bftype(a5) Pass System File type FFE8 4662 00004156 486D FFE8 pea bftype(a5) PAGE 100 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES I (BOOTROM3)" 4663 0000415A 6100 292A bsr lock Lock out Resets 4664 0000415E 6100 FDF6 bsr m_fopen 4665 00004162 6100 2936 bsr unlock Unlock Resets 4666 00004166 4A1F tst.b (sp)+ 4667 00004168 4CDF 1FFF movem.l (sp)+,a0-a4/d0-d7 Restore Registers 4668 0000416C 6700 0236 beq boot15 If it fails, return 4669 00004170 4AAD FFEE tst.l length(a5) If length=0 (Probably ROM) 4670 00004174 6700 00B0 beq boot6_1 then don't load anything 4671 00004178 4285 clr.l d5 Sector:=0 4672 0000417A 4207 clr.b d7 anything_loaded:=false 4673 0000417C 48E7 FFF8 boot1 movem.l a0-a4/d0-d7,-(sp) Save Registers 4674 00004180 2F05 move.l d5,-(sp) Call M_READ: Pass sector 4675 00004182 4878 0100 pea 256 Read 256 bytes 4676 00004186 4878 FDD2 pea fubuffer Read into floppy RAM buffer 4677 0000418A 4227 clr.b -(sp) Pass false, Not Media Relative 4678 0000418C 6100 28F8 bsr lock Lock out Resets 4679 00004190 6100 FDEA bsr m_read 4680 00004194 6100 2904 bsr unlock Unlock Resets 4681 00004198 4CDF 1FFF movem.l (sp)+,a0-a4/d0-d7 Restore Registers 4682 0000419C 2678 FDD2 movea.l fubuffer,a3 Get load_adr 4683 000041A0 2C38 FDD6 move.l fubuffer+4,d6 Get segment length in bytes 4684 000041A4 2006 move.l d6,d0 4685 000041A6 204B movea.l a3,a0 No overlap if a3+d6<=F_AREA 4686 000041A8 D088 add.l a0,d0 Unsigned 4687 000041AA 6500 0240 bcs boot_berr0 4688 000041AE B0BC FFFF cmp.l #minram,d0 FAC0 4689 000041B4 6200 0236 bhi boot_berr0 Check for TOPRAM overlap also 4690 000041B8 B0B8 FED4 cmp.l f_area,d0 4691 000041BC 6308 bls.s boot2 4692 000041BE B7F8 FDCE cmpa.l lowram,a3 No overlap if a3>=LOWRAM 4693 000041C2 6500 022E bcs boot_berr Unsigned 4694 000041C6 50C7 boot2 st d7 anything_loaded:=true; 4695 000041C8 5285 addq.l #1,d5 sector:=sector+1 4696 000041CA 41F8 FDDA lea fubuffer+8,a0 4697 000041CE BCBC 0000 cmp.l #256-8,d6 If seg_length<=(256-8) then 00F8 4698 000041D4 6E0A bgt.s boot4 copy it 4699 000041D6 4A86 tst.l d6 4700 000041D8 6F3E boot3 ble.s boot6 Done 4701 000041DA 16D8 move.b (a0)+,(a3)+ 4702 000041DC 5386 subq.l #1,d6 4703 000041DE 60F8 bra.s boot3 4704 000041E0 203C 0000 boot4 move.l #256-8,d0 Copy 256-8 bytes 00F8 4705 000041E6 9C80 sub.l d0,d6 4706 000041E8 26D8 boot5 move.l (a0)+,(a3)+ 4707 000041EA 5940 subq #4,d0 4708 000041EC 6EFA bgt.s boot5 4709 000041EE 48E7 FFF8 movem.l a0-a4/d0-d7,-(sp) Save Registers 4710 000041F2 2F05 move.l d5,-(sp) Call M_READ: Pass sector 4711 000041F4 2F06 move.l d6,-(sp) Pass rest of seg_length 4712 000041F6 2F0B move.l a3,-(sp) Pass RAM location 4713 000041F8 4227 clr.b -(sp) Pass false, not media Relative 4714 000041FA 6100 288A bsr lock Lock out Resets 4715 000041FE 6100 FD7C bsr m_read 4716 00004202 6100 2896 bsr unlock Unlock Resets PAGE 101 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES I (BOOTROM3)" 4717 00004206 4CDF 1FFF movem.l (sp)+,a0-a4/d0-d7 Restore Registers 4718 0000420A DCBC 0000 add.l #255,d6 sector:=sector+ 00FF 4719 00004210 8CFC 0100 divu #256,d6 ((seg_length+255)div256) 4720 00004214 48C6 ext.l d6 4721 00004216 DA86 add.l d6,d5 4722 00004218 2005 boot6 move.l d5,d0 If (sector+1)*256>length then done 4723 0000421A 5280 addq.l #1,d0 4724 0000421C E188 lsl.l #8,d0 4725 0000421E B0AD FFEE cmp.l length(a5),d0 4726 00004222 6F00 FF58 ble boot1 4727 00004226 48E7 FFF8 boot6_1 movem.l a0-a4/d0-d7,-(sp) Save Registers 4728 0000422A 6100 285A bsr lock Lock out Resets 4729 0000422E 6100 FD74 bsr m_fclose Close the file 4730 00004232 6100 2866 bsr unlock Unlock Resets 4731 00004236 4CDF 1FFF movem.l (sp)+,a0-a4/d0-d7 Restore Registers 4732 0000423A 50C7 st d7 Media_found:=True 4733 0000423C 7CFF moveq #-1,d6 Device Present 4734 0000423E 0CAD E0FF cmpi.l #rom_msus,bmsus(a5) If MSUS#ROM then FFFF 0028 4735 00004246 670A beq.s boot7 4736 00004248 21ED 0028 move.l bmsus(a5),default_msus default_msus:=msus FEDC 4737 0000424E 6000 008E bra boot12 4738 00004252 0CB8 E0FF boot7 cmpi.l #rom_msus,default_msus FFFF FEDC 4739 0000425A 6600 0082 bne boot12 4740 0000425E 21FC 0500 move.l #minext_msus,default_msus default_msus:=External Schnook 0700 FEDC 4741 00004266 4207 clr.b d7 Media_found:=false 4742 00004268 2C3C E0FF move.l #rom_msus,d6 present_msus:=rom FFFF 4743 0000426E 266C 001C movea.l b_start(a4),a3 Go thru boot list 4744 00004272 4A93 boot8 tst.l (a3) 4745 00004274 6768 beq.s boot11 Done with boot list 4746 00004276 2F0B move.l a3,-(sp) a3 points to element of list 4747 00004278 2653 movea.l (a3),a3 a3 points to vector 4748 0000427A 51ED FFEE sf msusvalid(a5) MSUSVALID:=False 4749 0000427E 48E7 FFF8 movem.l a0-a4/d0-d7,-(sp) Save Registers 4750 00004282 558F subq.l #2,sp Call ACTIVE: push boolean 4751 00004284 3F3C 0001 move #1,-(sp) Pass bootpass # 4752 00004288 50E7 st -(sp) Pass true 4753 0000428A 486D 0028 pea bmsus(a5) Pass msus ptr 4754 0000428E 486D FFEE pea msusvalid(a5) Pass msusvalid boolean ptr 4755 00004292 51E7 sf -(sp) Pass false: Don't use Search Bols 4756 00004294 6100 27F0 bsr lock Lock out Resets 4757 00004298 4EAB 0000 jsr active(a3) 4758 0000429C 6100 27FC bsr unlock Unlock Resets 4759 000042A0 1B5F FFEA move.b (sp)+,bmedia(a5) Get boolean 4760 000042A4 4CDF 1FFF movem.l (sp)+,a0-a4/d0-d7 Restore Registers 4761 000042A8 4A2D FFEE tst.b msusvalid(a5) If msusvalid 4762 000042AC 6728 beq.s boot10 and 4763 000042AE 0CAD E0FF cmpi.l #rom_msus,bmsus(a5) msus#ROM then FFFF 0028 4764 000042B6 671E beq.s boot10 4765 000042B8 4A2D FFEA tst.b bmedia(a5) If media, we have it 4766 000042BC 670C beq.s boot9 PAGE 102 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES I (BOOTROM3)" 4767 000042BE 21ED 0028 move.l bmsus(a5),default_msus default_msus:=msus FEDC 4768 000042C4 50C7 st d7 media_found:=true 4769 000042C6 584F addq #4,sp exit 4770 000042C8 6014 bra.s boot11 4771 000042CA BCBC E0FF boot9 cmp.l #rom_msus,d6 If present_msus=rom then FFFF 4772 000042D0 6604 bne.s boot10 4773 000042D2 2C2D 0028 move.l bmsus(a5),d6 present_msus:=msus 4774 000042D6 265F boot10 movea.l (sp)+,a3 Try next in list 4775 000042D8 588B addq.l #4,a3 4776 000042DA D7D3 adda.l (a3),a3 4777 000042DC 6094 bra.s boot8 4778 0000 42DE boot11 equ * 4779 000042DE 206D FFF2 boot12 movea.l x_adr(a5),a0 Initialize Machine 4780 000042E2 21C8 FDBC move.l a0,start_addr Get Start address 4781 * 4782 * Special Case BASIC 2.0 So it is unlikely to Die At Power-up 4783 * 4784 000042E6 47F9 FFFB lea $FFFBCEE4,a3 Check Start Address for SOFT 2.0 CEE4 4785 000042EC B1CB cmpa.l a3,a0 SOFT BASIC 2.0 ? 4786 000042EE 670A beq.s boot_bfix Yes, Patch it 4787 000042F0 47F9 0008 lea $80012,a3 Check Start Address for ROM 2.0 0012 4788 000042F6 B1CB cmpa.l a3,a0 ROM BASIC 2.0 ? 4789 000042F8 6652 bne.s boot_bfixdone No, Then It's the General Case 4790 000042FA 0CAB F0FF boot_bfix cmpi.l #$F0FF4201,-18(a3) Make Sure The BASIC 2.0 Header 4201 FFEE 4791 00004302 6648 bne.s boot_bfixdone is correct 4792 00004304 302B FFFA move -6(a3),d0 4793 00004308 0240 C0C0 andi #$C0C0,d0 4794 0000430C 663E bne.s boot_bfixdone 4795 0000430E 21FC 0000 move.l #$120,$FFFFD030 Set-up BASIC 2.0 Uninitialized 0120 D030 4796 00004316 42B8 D034 clr.l $FFFFD034 Procedure Variables 4797 0000431A 21FC FFFD move.l #$FFFDB4CC,$FFFFD048 B4CC D048 4798 00004322 42B8 D04C clr.l $FFFFD04C 4799 00004326 B7FC 0008 cmpa.l #$80012,a3 If ROM, use different second one 0012 4800 0000432C 6608 bne.s boot_bfix1 4801 0000432E 21FC 0009 move.l #$9E5FA,$FFFFD048 E5FA D048 4802 00004336 4A07 boot_bfix1 tst.b d7 If media found, msus is okay 4803 00004338 6612 bne.s boot_bfixdone 4804 0000433A 0C86 E0FF cmpi.l #rom_msus,d6 Device Present? FFFF 4805 00004340 660A bne.s boot_bfixdone No 4806 00004342 21FC 0000 move.l #mini0_msus,default_msus Yes, Use mini drive 0 FFFF FEDC 4807 0000434A 6010 bra.s boot12_1 4808 0000434C 4A07 boot_bfixdone tst.b d7 If not media and present_msus# 4809 0000434E 660C bne.s boot12_1 rom then 4810 00004350 0C86 E0FF cmpi.l #rom_msus,d6 default_msus:=present_msus FFFF 4811 00004356 6704 beq.s boot12_1 PAGE 103 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES I (BOOTROM3)" 4812 00004358 21C6 FEDC move.l d6,default_msus 4813 4814 * 4815 * 4816 * 4817 0000435C 2678 FED4 boot12_1 movea.l f_area,a3 Set LOWRAM back 4818 00004360 D7EB 002C adda.l tempram(a3),a3 Compute final LOWRAM 4819 00004364 21CB FDCE move.l a3,lowram 4820 00004368 286D 0024 movea.l bfptr(a5),a4 Copy Filename to LOWRAM 4821 0000436C 4240 clr d0 4822 0000436E 101C move.b (a4)+,d0 Get Length 4823 00004370 16C0 move.b d0,(a3)+ 4824 00004372 16DC boot13 move.b (a4)+,(a3)+ 4825 00004374 5340 subq #1,d0 4826 00004376 6EFA bgt.s boot13 4827 * 4828 * Copy 1st 10 chars of filename to SYSNAME for compatibility 4829 * (Blank pad) 4830 * 4831 00004378 2878 FDCE movea.l lowram,a4 Get Address of Filename 4832 0000437C 47F8 FDC2 lea sysname,a3 Destination 4833 00004380 4240 clr d0 Get Length of String 4834 00004382 101C move.b (a4)+,d0 4835 00004384 3200 move d0,d1 Remember length 4836 00004386 0C40 000A cmpi #10,d0 10 is maximum 4837 0000438A 6F02 ble.s boot14 4838 0000438C 700A moveq #10,d0 4839 0000438E 16DC boot14 move.b (a4)+,(a3)+ Copy Filename 4840 00004390 5340 subq #1,d0 4841 00004392 6EFA bgt.s boot14 4842 00004394 B27C 000A boot14_1 cmp #10,d1 Pad with blanks 4843 00004398 6C00 006C bge go When it's padded, go for it 4844 0000439C 16FC 0020 move.b #' ',(a3)+ 4845 000043A0 5241 addq #1,d1 4846 000043A2 60F0 bra.s boot14_1 4847 4848 000043A4 6100 26F4 boot15 bsr unlock Unlock Reset 4849 000043A8 588F addq.l #4,sp Return: pop error routine 4850 000043AA 21DF FFFC move.l (sp)+,buserrv+2 Restore bus error handler 4851 000043AE 4E5D unlk a5 Restore space 4852 000043B0 4CDF 19E1 movem.l (sp)+,a0/a3/a4/d0/d5-d7 Restore Registers 4853 000043B4 2F57 0008 move.l (sp),8(sp) Move rts 4854 000043B8 508F addq.l #8,sp Pop parameters 4855 000043BA 4E75 rts 4856 4857 000043BC 6100 26DC boot_error bsr unlock Unlock Reset 4858 000043C0 0C6D 0007 cmpi #ec_bus_error,-2(a5) If bus error, handle as one FFFE 4859 000043C6 672A beq.s boot_berr 4860 000043C8 302D FFFE move -2(a5),d0 Get error number 4861 000043CC 2078 FED4 movea.l f_area,a0 Get msus 4862 000043D0 2228 0056 move.l m_msus(a0),d1 and pass it to the routine 4863 000043D4 41F8 FDD2 lea fubuffer,a0 4864 000043D8 10FC 0020 move.b #' ',(a0)+ 4865 000043DC 6100 1AD6 bsr get_ri_mess Build message in fubuffer (a0) 4866 000043E0 6100 1B5A bsr buildmsus 4867 000043E4 4218 clr.b (a0)+ PAGE 104 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES I (BOOTROM3)" 4868 000043E6 41F8 FDD2 lea fubuffer,a0 4869 000043EA 6014 bra.s boot_berr2 Put message on Screen 4870 4871 000043EC 41FA 14B1 boot_berr0 lea sys_too_high,a0 4872 000043F0 6008 bra.s boot_berr1 4873 000043F2 6100 26A6 boot_berr bsr unlock Unlock Reset 4874 000043F6 41FA 1494 lea sys_too_big,a0 Put up failure message 4875 000043FA 21ED FFE4 boot_berr1 move.l oldbus(a5),buserrv+2 Restore bus error handler FFFC 4876 00004400 6100 1284 boot_berr2 bsr displin 4877 00004404 60FE bra.s * Try again PAGE 105 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES II (BOOTROM3)" 4880 ****************************************************************************** 4881 ****************************************************************************** 4882 *** *** 4883 *** Boot Entries II *** 4884 *** *** 4885 *** Entries Supported Externally: *** 4886 *** GO ($140) Start a System *** 4887 *** *** 4888 ****************************************************************************** 4889 ****************************************************************************** 4890 4891 ****************************************************************************** 4892 * GO: ($140) Start a System * 4893 ****************************************************************************** 4894 00004406 31FC 4EF9 go move #jmpop,trap0v Go To Supervisor Mode FF94 4895 0000440C 21FC 0000 move.l #go0,trap0v+2 4416 FF96 4896 00004414 4E40 trap #0 4897 00004416 46FC 2700 go0 move #$2700,sr Make sure of Processor level 4898 0000441A 2278 FED4 movea.l f_area,a1 Clear the CRT 4899 0000441E 4EA9 0030 jsr winit(a1) 4900 00004422 6100 2A16 bsr remote_flush finish all IO 4901 00004426 4A29 009E tst.b remote_type(a1) is the console remote? 4902 0000442A 6B0A bmi.s go0_5 branch if not 4903 0000442C 2269 009A movea.l remote_adr(a1),a1 remote human interface card addr 4904 00004430 08A9 0007 bclr #7,3(a1) disable card interrupts 0003 4905 00004436 4280 go0_5 clr.l d0 Clear timeout count 4906 00004438 0838 0003 btst #3,sysflag Check for Keyboard Presence FED2 4907 0000443E 6616 bne.s go1 4908 00004440 725F moveq #$5F,d1 Tell Keyboard to not interrupt 4909 00004442 6100 1C38 bsr kbd_wcmd 4910 00004446 6100 1BCC bsr kbd_cwait 4911 0000444A 203C 0000 go0_0 move.l #200,d0 set timer to 1 millisecond 00C8 4912 00004450 6100 1C44 bsr kbd_rdata read data out of FIFO 4913 00004454 67F4 beq.s go0_0 until FIFO is purged (times out) 4914 00004456 722E go1 moveq #$2E,d1 Tell Battery to not interrupt 4915 00004458 6100 061C bsr bat_wcmd 4916 0000445C 43F8 FEE0 lea lastvector,a1 Default all the vectors to CRASH 4917 00004460 4280 clr.l d0 4918 00004462 2878 FED4 movea.l f_area,a4 4919 00004466 082C 0006 go2 btst #mon_p,booleans(a4) If Monitor present don't 000B 4920 0000446C 6710 beq.s go4 Screw up Trap 15 and Trace 4921 0000446E B2FC FF3A cmpa.w #trp15,a1 4922 00004472 6706 beq.s go3 4923 00004474 B2FC FFD0 cmpa.w #trptrc,a1 4924 00004478 6604 bne.s go4 4925 0000447A 5C89 go3 addq.l #6,a1 4926 0000447C 600A bra.s go5 4927 0000447E 32FC 4EB9 go4 move #jsrop,(a1)+ Use JSR So Crash Routine 4928 00004482 22FC 0000 move.l #crash,(a1)+ can Figure the Vector Address 4EBC 4929 00004488 B089 go5 cmp.l a1,d0 Done Yet? PAGE 106 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BOOT ENTRIES II (BOOTROM3)" 4930 0000448A 66DA bne.s go2 4931 0000448C 4FF8 FDAC lea boot_stack,sp Reset the stack pointer 4932 00004490 1C38 FED2 move.b sysflag,d6 Just in case it's a start over 4933 00004494 4E90 jsr (a0) Start the System 4934 00004496 6000 09AE bra rtn_to_monitor No system should return here PAGE 107 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM DUMMY MASS STORAGE DRIVERS (BOOTROM3)" 4937 ****************************************************************************** 4938 ****************************************************************************** 4939 *** *** 4940 *** Dummy Mass Storage Drivers *** 4941 *** *** 4942 *** Entries Supported Internally: *** 4943 *** d_dummy Jump table for Dummy Drivers *** 4944 *** *** 4945 ****************************************************************************** 4946 ****************************************************************************** 4947 4948 ****************************************************************************** 4949 * d_dummy: Jump table for Dummy Drivers * 4950 ****************************************************************************** 4951 0000449A 6000 0010 d_dummy bra dum_init Dummy M_INIT entry 4952 0000449E 6000 0012 bra dum_fopen Dummy M_FOPEN entry 4953 000044A2 6000 0018 bra dum_read Dummy M_READ entry 4954 000044A6 6000 001C bra dum_menu Dummy M_MENU entry 4955 000044AA 4E75 rts Dummy M_FCLOSE entry 4956 4957 000044AC 51EF 0004 dum_init sf 4(sp) Return false 4958 000044B0 4E75 rts 4959 4960 000044B2 2057 dum_fopen movea.l (sp),a0 Remove length,x_adr,filename 4961 000044B4 DEFC 0014 adda #20,sp from stack 4962 000044B8 51D7 sf (sp) Return false 4963 000044BA 4ED0 jmp (a0) 4964 4965 000044BC 2057 dum_read movea.l (sp),a0 Remove media,ramaddress, 4966 000044BE DEFC 0012 adda #18,sp bytecount,sector from stack 4967 000044C2 4ED0 jmp (a0) 4968 4969 000044C4 205F dum_menu movea.l (sp)+,a0 Get return Address 4970 000044C6 225F movea.l (sp)+,a1 Get Ptr to Device String 4971 000044C8 45FA 000E lea dum_name,a2 Copy Dummy Name 4972 000044CC 12DA dum_menu1 move.b (a2)+,(a1)+ 4973 000044CE 66FC bne.s dum_menu1 4974 000044D0 2EBC 0000 move.l #long_zero,(sp) Return Pointer to Long zero 090A 4975 000044D6 4ED0 jmp (a0) Return 4976 4977 000044D8 07 dum_name dc.b 7,'UNKNOWN',0,0 PAGE 108 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MINI-FLOPPY BOOT MASS STORAGE DRIVERS (BOOTROM3 4980 ****************************************************************************** 4981 ****************************************************************************** 4982 *** *** 4983 *** Mini-Floppy Boot Mass Storage Drivers *** 4984 *** *** 4985 *** Entries Supported Internally: *** 4986 *** ddmini_setdevicename Return Name of Device *** 4987 *** ddmini_deviceread Read from Mini *** 4988 *** ddmini_unit_init Select Drive *** 4989 *** b_mini0 Jump table for Mini 0 Boot List Drivers *** 4990 *** b_minin Jump table for Mini 1-n Boot List Drivers *** 4991 *** *** 4992 ****************************************************************************** 4993 ****************************************************************************** 4994 4995 ****************************************************************************** 4996 * ddmini_setdevicename(var device_name:string255) * 4997 * Return name of Device * 4998 ****************************************************************************** 4999 0000 44E2 ddmini_setdevicename equ * 5000 000044E2 45FA 0006 lea mini_name,a2 Copy String 5001 000044E6 6000 0100 bra setdevicename 5002 000044EA 08 mini_name dc.b 8,'INTERNAL',0 5003 5004 ****************************************************************************** 5005 * ddmini_deviceread(anyvar buf:char;bytes,sector:integer) * 5006 * Read number of bytes starting from sector number into specified RAM. * 5007 * Does not handle bus errors. * 5008 * Retry if Media changed. Translate Floppy escape codes. * 5009 * Setup Floppy interrupt vector during routine. * 5010 ****************************************************************************** 5011 0000 44F4 ddmini_deviceread equ * 5012 000044F4 225F movea.l (sp)+,a1 Get Return address 5013 000044F6 201F move.l (sp)+,d0 Get Sector # 5014 000044F8 241F move.l (sp)+,d2 Get Byte count 5015 000044FA 205F movea.l (sp)+,a0 Get RAM Address 5016 000044FC 2F09 move.l a1,-(sp) Save Return address 5017 000044FE 48E7 A082 mini_read1 movem.l d0/d2/a0/a6,-(sp) Save Registers for Retry 5018 00004502 3F38 FFB8 move flpyvctr,-(sp) Save Current Level 2 Vector 5019 00004506 2F38 FFBA move.l flpyvctr+2,-(sp) 5020 0000450A 21FC 0000 move.l #fintrupt,flpyvctr+2 Set-up Floppy Vector 7916 FFBA 5021 00004512 31FC 4EF9 move #jmpop,flpyvctr FFB8 5022 00004518 4E55 FFF6 link a5,#-10 Trap all errors 5023 0000451C 487A 001A pea mini_readerr 5024 00004520 2B4F FFF6 move.l sp,-10(a5) 5025 00004524 6100 0C12 bsr blockload1 Enter blockload to copy it 5026 00004528 4E5D unlk a5 Normal Return 5027 0000452A 21DF FFBA move.l (sp)+,flpyvctr+2 Restore old floppy vector 5028 0000452E 31DF FFB8 move (sp)+,flpyvctr 5029 00004532 4CDF 4105 movem.l (sp)+,d0/d2/a0/a6 5030 00004536 4E75 rts 5031 00004538 322D FFFE mini_readerr move -2(a5),d1 Get the error number 5032 0000453C 4E5D unlk a5 5033 0000453E 31DF FFB8 move (sp)+,flpyvctr Restore old floppy vector 5034 00004542 21DF FFBA move.l (sp)+,flpyvctr+2 PAGE 109 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MINI-FLOPPY BOOT MASS STORAGE DRIVERS (BOOTROM3 5035 00004546 4CDF 4105 movem.l (sp)+,d0/d2/a0/a6 5036 0000454A B27C 1F90 cmp #8080,d1 Retry if media change 5037 0000454E 67AE beq.s mini_read1 5038 00004550 B27C 2378 cmp #9080,d1 Retry if media change 5039 00004554 67A8 beq.s mini_read1 5040 00004556 41FA 001E lea mini_errtab,a0 Translate error in d1 5041 0000455A 3018 mini_readerr1 move (a0)+,d0 Get Table Floppy value 5042 0000455C 670C beq.s mini_readerr2 End of table use bad_error_state 5043 0000455E 3418 move (a0)+,d2 Get Translated version of value 5044 00004560 B240 cmp d0,d1 Is this the right one? 5045 00004562 66F6 bne.s mini_readerr1 No look at next one 5046 00004564 3B42 FFFE move d2,-2(a5) Escape with translated value 5047 00004568 6006 bra.s mini_readerr3 5048 0000456A 3B7C 0006 mini_readerr2 move #ec_bad_error_state,-2(a5) Unrecognized Error State FFFE 5049 00004570 2E6D FFF6 mini_readerr3 movea.l -10(a5),sp Escape No Device 5050 00004574 4E75 rts 5051 5052 00004576 0438 mini_errtab dc 1080,ec_no_medium Door Open / No Media 5053 0000457A 0820 dc 2080,ec_no_medium Door Open / No Media 5054 0000457E 0C08 dc 3080,ec_no_medium Door Open / No Media 5055 00004582 0439 dc 1081,ec_read_error Seek .. Track not Found 5056 00004586 0821 dc 2081,ec_read_error Seek .. Track not Found 5057 0000458A 0C09 dc 3081,ec_read_error Seek .. No Track 0 5058 0000458E 0FF1 dc 4081,ec_read_error Read .. Lost Data 5059 00004592 17C1 dc 6081,ec_read_error Seek .. Lost Data 5060 00004596 043C dc 1084,ec_read_error Read .. Sector not Found 5061 0000459A 0C0C dc 3084,ec_read_error Seek .. Track not Found 5062 0000459E 043F dc 1087,ec_read_error Seek .. Address CRC Error 5063 000045A2 0440 dc 1088,ec_read_error Read .. CRC Error 5064 000045A6 1F9A dc 8090,ec_read_error Timeout during Interrupt 5065 000045AA 2B52 dc 11090,ec_bad_hardware Drive Not Responding 5066 000045AE 0000 dc 0 End of Translation Table 5067 5068 ****************************************************************************** 5069 * ddmini_unit_init * 5070 * Select Drive Number. Escape if it fails to find drive. * 5071 * Does not read device or check for media present. * 5072 ****************************************************************************** 5073 0000 45B0 ddmini_unit_init equ * 5074 000045B0 0C38 00FF cmpi.b #255,ndrives Check for Controller Presence FED8 5075 000045B6 6714 beq.s mini_unit1 5076 000045B8 2078 FED4 movea.l f_area,a0 Get Drive Number 5077 000045BC 1028 0057 move.b m_msus+1(a0),d0 5078 000045C0 B038 FED8 cmp.b ndrives,d0 5079 000045C4 6206 bhi.s mini_unit1 Out of range then escape 5080 000045C6 11C0 FED3 move.b d0,drive Set the Drive Number 5081 000045CA 4E75 rts 5082 000045CC 3B7C 0001 mini_unit1 move #ec_no_device,-2(a5) Not that drive FFFE 5083 000045D2 2E6D FFF6 movea.l -10(a5),sp Escape No Device 5084 000045D6 4E75 rts 5085 5086 ****************************************************************************** 5087 * b_mini0: Jump table for Mini 0 Boot List Drivers * 5088 ****************************************************************************** PAGE 110 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MINI-FLOPPY BOOT MASS STORAGE DRIVERS (BOOTROM3 5089 000045D8 6000 BA26 b_mini0 bra SPSOD_mini_active1 ACTIVE for mini drive 0 5090 000045DC 6000 BA22 bra SPSOD_next_system NEXT_SYSTEM for mini drive 0 5091 5092 ****************************************************************************** 5093 * b_minin: Jump table for Mini 1-n Boot List Drivers * 5094 ****************************************************************************** 5095 000045E0 6000 BA1E b_minin bra SPSOD_mini_active2 ACTIVE for mini drives 1-n 5096 000045E4 6000 BA1A bra SPSOD_next_system NEXT_SYSTEM for mini drives 1-n PAGE 111 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 EPROM BOOT MASS STORAGE DRIVERS (BOOTROM3)' 5099 ****************************************************************************** 5100 ****************************************************************************** 5101 *** *** 5102 *** EPROM Boot Mass Storage Drivers *** 5103 *** *** 5104 *** Entries Supported Internally: *** 5105 *** ddeprom_setdevicename Return Name of Device *** 5106 *** ddeprom_deviceread Read from EPROM *** 5107 *** ddeprom_unit_init Select Drive *** 5108 *** b_eprom1 High Priority Boot List Entry *** 5109 *** b_eprom2 Low Priority Boot List Entry *** 5110 *** *** 5111 ****************************************************************************** 5112 ****************************************************************************** 5113 5114 ****************************************************************************** 5115 * setdevicename(var device_name:string255) * 5116 * Common code for device drivers. * 5117 * On entry a2 points to zero terminated PASCAL string literal. * 5118 ****************************************************************************** 5119 000045E8 205F setdevicename movea.l (sp)+,a0 Get Return address 5120 000045EA 225F movea.l (sp)+,a1 Get var String ptr 5121 000045EC 12DA setdev1 move.b (a2)+,(a1)+ Copy Literal out 5122 000045EE 66FC bne.s setdev1 5123 000045F0 4ED0 jmp (a0) Return 5124 5125 ****************************************************************************** 5126 * ddEPROM_setdevicename(var device_name:string255) * 5127 * Return Device Name * 5128 ****************************************************************************** 5129 0000 45F2 ddEPROM_setdevicename equ * 5130 000045F2 45FA 0004 lea eprom_name,a2 Copy string 5131 000045F6 60F0 bra.s setdevicename Return Literal 5132 5133 000045F8 05 eprom_name dc.b 5,'EPROM',0,0 5134 5135 ****************************************************************************** 5136 * ddEPROM_deviceread(anyvar buf:char;bytes,sector:integer) * 5137 * Read number of bytes starting from sector number into specified RAM. * 5138 * Does not handle bus error from EPROM. * 5139 ****************************************************************************** 5140 0000 4600 ddEPROM_deviceread equ * 5141 00004600 225F movea.l (sp)+,a1 Get Return Address 5142 00004602 221F move.l (sp)+,d1 Get Sector Number 5143 00004604 241F move.l (sp)+,d2 Get Byte Count 5144 00004606 205F movea.l (sp)+,a0 Get RAM Address 5145 00004608 2F09 move.l a1,-(sp) Save Return Address 5146 * 5147 * Compute Sector Start Address: m_nxtmsus(f_area)+18+(d1 div 64)*2+d1*256 5148 * 5149 0000460A 2278 FED4 movea.l f_area,a1 Get Start of EPROM 5150 0000460E 2269 0092 movea.l m_nxtmsus(a1),a1 5151 00004612 D2FC 0012 adda #18,a1 +18 (First ROM Header) 5152 00004616 2601 move.l d1,d3 d1 div 64 5153 00004618 86FC 0040 divu #64,d3 5154 0000461C 48C3 ext.l d3 5155 0000461E E38B lsl.l #1,d3 *2 PAGE 112 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 EPROM BOOT MASS STORAGE DRIVERS (BOOTROM3)' 5156 00004620 D3C3 adda.l d3,a1 5157 00004622 E189 lsl.l #8,d1 d1*256 5158 00004624 D3C1 adda.l d1,a1 a1 is Source Address 5159 * 5160 * Compute amount to read in d0. Maximum of up to next header. 5161 * d0 := delta from a1 to next 16K boundary 5162 * 5163 00004626 2009 eprom_read1 move.l a1,d0 d0 is start truncated down 5164 00004628 0280 FFFF andi.l #$FFFFC000,d0 C000 5165 0000462E D0BC 0000 add.l #$00004000,d0 d0 is next 16K boundary 4000 5166 00004634 9089 sub.l a1,d0 d0 is number of bytes to bound. 5167 00004636 B480 cmp.l d0,d2 Use min(d0,d2) for read length 5168 00004638 6202 bhi.s eprom_read2 5169 0000463A 2002 move.l d2,d0 5170 0000463C 48E7 A0C0 eprom_read2 movem.l d0/d2/a0-a1,-(sp) Call RM@VER (Pascal Utility) 5171 00004640 4EB8 315A jsr $315A Copy d0 bytes from (a1) 5172 00004644 4CDF 0305 movem.l (sp)+,d0/d2/a0-a1 to (a0) 5173 * 5174 * Update counters 5175 * 5176 00004648 9480 sub.l d0,d2 Number of bytes left to do 5177 0000464A 6308 bls.s eprom_read3 lower or the same then done 5178 0000464C D1C0 adda.l d0,a0 Update RAM Pointer 5179 0000464E D3C0 adda.l d0,a1 Update Source Pointer 5180 00004650 5449 addq #2,a1 Skip next header 5181 00004652 60D2 bra.s eprom_read1 Read some more 5182 00004654 4E75 eprom_read3 rts 5183 5184 ****************************************************************************** 5185 * ddEPROM_unit_init * 5186 * Select Drive Number. Escape if it fails to find drive. * 5187 * Sets m_nxtmsus(f_area) to start of it for subsequent reads. * 5188 ****************************************************************************** 5189 0000 4656 ddEPROM_unit_init equ * 5190 00004656 2078 FED4 movea.l f_area,a0 Get Unit Number to find 5191 0000465A 1028 0057 move.b m_msus+1(a0),d0 into d0 5192 0000465E 72FF moveq #-1,d1 d1 is current unit Number 5193 00004660 2F38 FFFC move.l buserrv+2,-(sp) Save current Bus error handler 5194 00004664 3F38 FFFA move buserrv,-(sp) 5195 00004668 31FC 4EF9 move #jmpop,buserrv Handle Bus errors locally FFFA 5196 0000466E 21FC 0000 move.l #eprom_unit3,buserrv+2 469C FFFC 5197 00004676 244F movea.l sp,a2 Save sp for bus errors 5198 00004678 217C 0001 move.l #rom_start,m_nxtmsus(a0) Use as RAM ptr 0000 0092 5199 00004680 2268 0092 eprom_unit1 movea.l m_nxtmsus(a0),a1 Get Ptr to Header 5200 00004684 B3FC 0040 cmpa.l #$400000,a1 4 MByte Limit 0000 5201 0000468A 642C bcc.s eprom_unit5 Escape Because Drive Not Present 5202 0000468C 0C51 F0FF cmpi #$F0FF,(a1) Check for header 5203 00004690 670E beq.s eprom_unit4 Yes, look further 5204 00004692 06A8 0000 eprom_unit2 addi.l #$4000,m_nxtmsus(a0) Try next 16K 4000 0092 5205 0000469A 60E4 bra.s eprom_unit1 PAGE 113 [3.3a] 6/29/89 08:33:30 'BOOTROM 3.0 EPROM BOOT MASS STORAGE DRIVERS (BOOTROM3)' 5206 0000469C 2E4A eprom_unit3 movea.l a2,sp Bus error, Reset stack 5207 0000469E 60F2 bra.s eprom_unit2 Try next one 5208 000046A0 0829 0003 eprom_unit4 btst #3,3(a1) Disc Bit Set ? 0003 5209 000046A6 67EA beq.s eprom_unit2 Nope try again 5210 000046A8 5241 addq #1,d1 Found one, increment current unit 5211 000046AA B001 cmp.b d1,d0 Is this the desired one? 5212 000046AC 66E4 bne.s eprom_unit2 Not this one 5213 000046AE 31DF FFFA move (sp)+,buserrv Yes we are there 5214 000046B2 21DF FFFC move.l (sp)+,buserrv+2 Restore Bus error handler 5215 000046B6 4E75 rts 5216 000046B8 31DF FFFA eprom_unit5 move (sp)+,buserrv Not that drive 5217 000046BC 21DF FFFC move.l (sp)+,buserrv+2 Restore Bus error handler 5218 000046C0 3B7C 0001 move #ec_no_device,-2(a5) Not that drive FFFE 5219 000046C6 2E6D FFF6 movea.l -10(a5),sp Escape No Device 5220 000046CA 4E75 rts 5221 5222 ****************************************************************************** 5223 * b_eprom1: Jump table for EPROM Memory High Priority Boot List Drivers * 5224 ****************************************************************************** 5225 000046CC 6000 B932 b_eprom1 bra spsod_eprom_active1 ACTIVE for High Priority 5226 000046D0 6000 B92E bra spsod_next_system NEXT_SYSTEM 5227 5228 ****************************************************************************** 5229 * b_eprom2: Jump table for EPROM Memory Low Priority Boot List Drivers * 5230 ****************************************************************************** 5231 000046D4 6000 B92A b_eprom2 bra spsod_eprom_active2 ACTIVE for Low Priority 5232 000046D8 6000 B926 bra spsod_next_system NEXT_SYSTEM PAGE 114 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM ROM BOOT MASS STORAGE DRIVERS (BOOTROM3)" 5235 ****************************************************************************** 5236 ****************************************************************************** 5237 *** *** 5238 *** Rom Boot Mass Storage Drivers *** 5239 *** *** 5240 *** Entries Supported Internally: *** 5241 *** d_rom Jump table for ROM Device Drivers *** 5242 *** b_rom Jump table for ROM Boot List Drivers *** 5243 *** *** 5244 ****************************************************************************** 5245 ****************************************************************************** 5246 5247 ****************************************************************************** 5248 * d_rom: Jump table for ROM Device Drivers * 5249 ****************************************************************************** 5250 000046DC 6000 0018 d_rom bra rom_init M_INIT entry 5251 000046E0 6000 0026 bra rom_fopen M_FOPEN entry 5252 000046E4 6000 FDD6 bra dum_read M_READ entry 5253 000046E8 6000 00E8 bra rom_menu M_MENU entry 5254 000046EC 4E75 rts M_FCLOSE entry 5255 5256 ****************************************************************************** 5257 * b_rom: Jump table for ROM Boot List Drivers * 5258 ****************************************************************************** 5259 000046EE 6000 00FC b_rom bra rom_act ACTIVE for ROM 5260 000046F2 6000 013C bra rom_nxt NEXT_SYSTEM for ROM 5261 5262 ****************************************************************************** 5263 * rom_init: M_INIT routine for ROM * 5264 * After movem sp --> 4 bytes: Return address * 5265 * 2 bytes: Boolean to Return * 5266 ****************************************************************************** 5267 000046F6 2878 FED4 rom_init movea.l f_area,a4 5268 000046FA 297C 0001 move.l #rom_start,m_dirsec(a4) Start search just past BOOTROM 0000 005A 5269 00004702 50EF 0004 st 4(sp) Return true 5270 00004706 4E75 rts 5271 5272 ****************************************************************************** 5273 * rom_fopen: M_FOPEN routine for ROM * 5274 * After move sp -> 4 bytes: Old Bus error routine * 5275 * 4 bytes: Return address 4 * 5276 * 4 bytes: File Type Ptr 8 * 5277 * 4 bytes: Length Ptr 12 * 5278 * 4 bytes: Execution Address Ptr 16 * 5279 * 4 bytes: Filename Ptr 20 * 5280 * 2 bytes: Boolean to Return 24 * 5281 * Look for specific system if zero is second character or name is * 5282 * only one character long. Otherwise find next one * 5283 ****************************************************************************** 5284 00004708 2F38 FFFC rom_fopen move.l buserrv+2,-(sp) Save Current Bus error handler 5285 0000470C 21FC 0000 move.l #rom_fopen8,buserrv+2 47BC FFFC 5286 00004714 244F movea.l sp,a2 Save sp for bus errors 5287 00004716 2878 FED4 movea.l f_area,a4 Check Search address 5288 0000471A 206C 005A rom_fopen1 movea.l m_dirsec(a4),a0 for out of range PAGE 115 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM ROM BOOT MASS STORAGE DRIVERS (BOOTROM3)" 5289 0000471E B1FC 0040 cmpa.l #$400000,a0 4 MByte limit 0000 5290 00004724 6400 009C bcc rom_fopen9 return false 5291 00004728 0C50 F0FF cmpi #$F0FF,(a0) Check header 5292 0000472C 660E bne.s rom_fopen2 Branch if not 5293 0000472E 0C68 F0FF cmpi #$F0FF,2(a0) How about the next word? 0002 5294 00004734 6706 beq.s rom_fopen2 If so, probably just floating bus! 5295 00004736 0C50 F0FF cmpi #$F0FF,(a0) Check header once more to be sure 5296 0000473A 670A beq.s rom_fopen3 Yes, check more 5297 0000473C 06AC 0000 rom_fopen2 addi.l #$4000,m_dirsec(a4) Try next 16K 4000 005A 5298 00004744 60D4 bra.s rom_fopen1 5299 00004746 0828 0000 rom_fopen3 btst #0,3(a0) Check for System Bit 0003 5300 0000474C 67EE beq.s rom_fopen2 Nope 5301 * 5302 * Certain ROMs should be ignored: 5303 * (a). Machine is 50 wide and ROM doesn't support it, or 5304 * (b). Machine is 80 wide and ROM doesn't support it. 5305 * 5306 0000474E 1028 000E move.b 14(a0),d0 5307 00004752 0838 0000 btst #0,sysflag Is Machine 50 or 80 Wide? FED2 5308 00004758 6708 beq.s rom_fopen3_1 Machine is 80 Wide 5309 0000475A 0800 0006 btst #6,d0 (a). 50 Wide: Is ROM Capable? 5310 0000475E 67DC beq.s rom_fopen2 ROM is not suitable with Machine 5311 00004760 6008 bra.s rom_fopen4 Yes, Continue to Check it 5312 00004762 0800 0003 rom_fopen3_1 btst #3,d0 (b). 80 Wide: Is ROM Capable? 5313 00004766 6602 bne.s rom_fopen4 Yes, Continue to Check it 5314 00004768 60D2 bra.s rom_fopen2 ROM is not suitable with Machine 5315 0000476A 226F 0014 rom_fopen4 movea.l 20(sp),a1 Check Id Against Filename 5316 0000476E 0C11 0001 cmpi.b #1,(a1) If filename is one long, check 5317 00004772 6640 bne.s rom_fopen7 5318 00004774 1029 0001 rom_fopen5 move.b 1(a1),d0 5319 00004778 B028 0002 cmp.b 2(a0),d0 5320 0000477C 66BE bne.s rom_fopen2 No match, try next one 5321 0000477E 12BC 0002 rom_fopen6 move.b #2,(a1) Have a match set Filename 5322 00004782 1368 0002 move.b 2(a0),1(a1) 0001 5323 00004788 4229 0002 clr.b 2(a1) 5324 0000478C 226F 000C movea.l 12(sp),a1 Set length to zero 5325 00004790 4291 clr.l (a1) 5326 00004792 226F 0010 movea.l 16(sp),a1 Copy execution address 5327 00004796 41E8 0008 lea 8(a0),a0 5328 0000479A D1D0 adda.l (a0),a0 5329 0000479C 2288 move.l a0,(a1) 5330 0000479E 43EF 0008 lea 8(sp),a1 Set File Type 5331 000047A2 32BC E942 move #-5822,(a1) 5332 000047A6 06AC 0000 addi.l #$4000,m_dirsec(a4) Increment to next one 4000 005A 5333 000047AE 50EF 0018 st 24(sp) Return true 5334 000047B2 6012 bra.s rom_fopen10 5335 000047B4 4A29 0002 rom_fopen7 tst.b 2(a1) If 2nd char is null, check 5336 000047B8 67BA beq.s rom_fopen5 5337 000047BA 60C2 bra.s rom_fopen6 Otherwise - wild card search 5338 000047BC 2E4A rom_fopen8 movea.l a2,sp Bus error handler: Reset stack PAGE 116 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM ROM BOOT MASS STORAGE DRIVERS (BOOTROM3)" 5339 000047BE 6000 FF7C bra rom_fopen2 Try next one 5340 000047C2 51EF 0018 rom_fopen9 sf 24(sp) Return false 5341 000047C6 21DF FFFC rom_fopen10 move.l (sp)+,buserrv+2 Restore Bus error routine 5342 000047CA 205F movea.l (sp)+,a0 5343 000047CC DEFC 0010 adda #16,sp 5344 000047D0 4ED0 jmp (a0) 5345 5346 ****************************************************************************** 5347 * rom_menu: M_MENU routine for ROM * 5348 ****************************************************************************** 5349 000047D2 205F rom_menu movea.l (sp)+,a0 Get return Address 5350 000047D4 225F movea.l (sp)+,a1 Get Ptr to Device String 5351 000047D6 45FA 000E lea rom_name,a2 Copy Name 5352 000047DA 12DA rom_menu1 move.b (a2)+,(a1)+ 5353 000047DC 66FC bne.s rom_menu1 5354 000047DE 2EBC 0000 move.l #long_zero,(sp) Return Pointer to Long zero 090A 5355 000047E4 4ED0 jmp (a0) Return 5356 5357 000047E6 03 rom_name dc.b 3,'ROM',0,0 5358 5359 ****************************************************************************** 5360 * rom_act: ACTIVE routine for ROM * 5361 * After move sp -> 4 bytes: rts * 5362 * 2 bytes: Search Boolean 4 * 5363 * 4 bytes: MSUSVALID Ptr 6 * 5364 * 4 bytes: MSUS Ptr 10 * 5365 * 2 bytes: Init Boolean 14 * 5366 * 2 bytes: Bootpass Value 16 * 5367 * 2 bytes: Boolean to return 18 * 5368 ****************************************************************************** 5369 000047EC 206F 0006 rom_act movea.l 6(sp),a0 5370 000047F0 50D0 st (a0) Set MSUSVALID to true 5371 000047F2 206F 000A movea.l 10(sp),a0 Set MSUS 5372 000047F6 20BC E0FF move.l #rom_msus,(a0) FFFF 5373 000047FC 2078 FED4 movea.l f_area,a0 5374 00004800 217C E0FF move.l #rom_msus,m_msus(a0) Set MSUS to ROM FFFF 0056 5375 00004808 558F subq.l #2,sp Call rom_init 5376 0000480A 6100 FEEA bsr rom_init 5377 0000480E 548F addq.l #2,sp 5378 00004810 51EF 0012 sf 18(sp) Return true if Bootpass=1 and 5379 * Init=True 5380 00004814 4A2F 000E tst.b 14(sp) 5381 00004818 670C beq.s rom_act1 Init=False 5382 0000481A 0C6F 0001 cmpi #1,16(sp) 0010 5383 00004820 6604 bne.s rom_act1 Bootpass#1 5384 00004822 50EF 0012 st 18(sp) Return true 5385 00004826 2F57 000E rom_act1 move.l (sp),14(sp) 5386 0000482A DEFC 000E adda #14,sp 5387 0000482E 4E75 rts 5388 5389 ****************************************************************************** 5390 * rom_nxt: NEXT_SYSTEM routine for ROM * 5391 * After link sp -> 2 bytes: Filetype -6 * PAGE 117 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM ROM BOOT MASS STORAGE DRIVERS (BOOTROM3)" 5392 * 4 bytes: Zilch (length, x_adr) -4 * 5393 * a5 -> 4 bytes: Old a5 * 5394 * 4 bytes: rts 4 * 5395 * 4 bytes: ptr to filename 8 * 5396 * 2 bytes: Boolean to return 12 * 5397 ****************************************************************************** 5398 00004830 4E55 FFFA rom_nxt link a5,#-6 5399 00004834 558F subq.l #2,sp Call FOPEN: Push boolean 5400 00004836 2F2D 0008 move.l 8(a5),-(sp) Pass filename 5401 0000483A 486D FFFC pea -4(a5) Pass dummy x_adr ptr 5402 0000483E 486D FFFC pea -4(a5) Pass dummy length ptr 5403 00004842 3B7C E942 move #-5822,-6(a5) Pass file type FFFA 5404 00004848 486D FFFA pea -6(a5) 5405 0000484C 6100 FEBA bsr rom_fopen 5406 00004850 1B5F 000C move.b (sp)+,12(a5) Return result 5407 00004854 4E5D unlk a5 5408 00004856 2F57 0004 move.l (sp),4(sp) 5409 0000485A 588F addq.l #4,sp 5410 0000485C 4E75 rts PAGE 118 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM GANGLIA BOOT MASS STORAGE DRIVER SUPPORT (BOOTR 5413 ****************************************************************************** 5414 ****************************************************************************** 5415 *** *** 5416 *** GANGLIA Boot Mass Storage Driver Support *** 5417 *** *** 5418 *** Entries Supported Internally: *** 5419 *** d_ganglia Jump table for GANGLIA Device Drivers *** 5420 *** b_ganglia1 Jump table for GANGLIA Boot List Drivers 1 *** 5421 *** b_ganglia2 Jump table for GANGLIA Boot List Drivers 2 *** 5422 *** *** 5423 ****************************************************************************** 5424 ****************************************************************************** 5425 5426 ****************************************************************************** 5427 * d_ganglia: Jump table for ROM Device Drivers * 5428 ****************************************************************************** 5429 0000485E 6000 B7A0 d_ganglia bra ganglia_init M_INIT entry 5430 00004862 6000 B79C bra ganglia_fopen M_FOPEN entry 5431 00004866 6000 B798 bra ganglia_read M_READ entry 5432 0000486A 6000 0016 bra ganglia_menu M_MENU entry 5433 0000486E 6000 B790 bra ganglia_fclose M_FCLOSE entry 5434 5435 ****************************************************************************** 5436 * b_ganglia1: Jump table for GANGLIA High Priority Boot List Drivers * 5437 ****************************************************************************** 5438 00004872 6000 B78C b_ganglia1 bra ganglia_active1 ACTIVE for High Priority GANGLIA 5439 00004876 6000 B788 bra ganglia_next_system NEXT_SYSTEM for GANGLIA 5440 5441 ****************************************************************************** 5442 * b_ganglia2: Jump table for GANGLIA Low Priority Boot List Drivers * 5443 ****************************************************************************** 5444 0000487A 6000 B784 b_ganglia2 bra ganglia_active2 ACTIVE for Low Priority GANGLIA 5445 0000487E 6000 B780 bra ganglia_next_system NEXT_SYSTEM for GANGLIA 5446 5447 ****************************************************************************** 5448 * ganglia_menu: M_MENU routine for ROM * 5449 ****************************************************************************** 5450 00004882 205F ganglia_menu movea.l (sp)+,a0 Get return Address 5451 00004884 225F movea.l (sp)+,a1 Get Ptr to Device String 5452 00004886 45FA 000E lea ganglia_name,a2 Copy Name 5453 0000488A 12DA ganglia_menu1 move.b (a2)+,(a1)+ 5454 0000488C 66FC bne.s ganglia_menu1 5455 0000488E 2EBC 0000 move.l #ganglia_des,(sp) Return Pointer to Descriptor 489E 5456 00004894 4ED0 jmp (a0) Return 5457 5458 00004896 06 ganglia_name dc.b 6,'REMOTE',0 5459 0000489E 1F ganglia_des dc.b $1F,0 :SRM,SC,VOL,UN PAGE 119 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BATTERY HARDWARE DRIVERS (BOOTROM3)" 5462 ****************************************************************************** 5463 ****************************************************************************** 5464 *** *** 5465 *** Battery Hardware Drivers *** 5466 *** *** 5467 *** Utility Entries Supported Internally: *** 5468 *** BAT_INIT Test Vector For the Battery *** 5469 *** *** 5470 *** Utility Entries Supported Externally for Old Systems: *** 5471 *** CHK_BATTERY ($170) Chk for Battery (Sets BATTERY flag) *** 5472 *** BAT_NO_INT ($174) Wait for NMI Interrupt to Clear *** 5473 *** BAT_CWAIT ($178) Wait for Last Command *** 5474 *** BAT_WCMD ($17C) Write Command *** 5475 *** BAT_WDATA ($180) Write Data *** 5476 *** BAT_RDATA ($184) Read Data *** 5477 *** *** 5478 ****************************************************************************** 5479 ****************************************************************************** 5480 5481 ****************************************************************************** 5482 * Battery Init * 5483 ****************************************************************************** 5484 000048A0 4238 FDCD bat_nmi clr.b battery No Battery Yet Please 5485 000048A4 6000 1B9E bra r_nmi Must be Keyboard NMI 5486 5487 000048A8 6000 01DA bat_xdata bra bat_wdata 5488 5489 000048AC 701A bat_init moveq #batf,d0 Indicate to LEDs 5490 000048AE 6100 D1B6 bsr led_state 5491 000048B2 4DFA 0056 lea bat_init1,a6 No Battery if Bus error 5492 000048B6 2A4F movea.l sp,a5 Save Stack Pointer 5493 000048B8 31FC 4EF9 move #jmpop,batteryvector Set-up for RESET during FF28 5494 000048BE 21FC 0000 move.l #bat_nmi,batteryvector+2 Illegal value of battery flag 48A0 FF2A 5495 000048C6 615A bsr.s chk_battery Check for Battery 5496 000048C8 31FC 4EB9 move #jsrop,batteryvector Set-up back for illegal NMI FF28 5497 000048CE 21FC 0000 move.l #bcrash,batteryvector+2 From Battery 4EFA FF2A 5498 000048D6 4280 clr.l d0 Tell Battery Not to Interrupt 5499 000048D8 722E moveq #$2E,d1 5500 000048DA 6100 019A bsr bat_wcmd 5501 000048DE 4280 clr.l d0 Give 60 Second Protection 5502 000048E0 123C 00A3 move.b #$A3,d1 Set Power Back 5503 000048E4 6100 0190 bsr bat_wcmd Delay to Zero 5504 000048E8 3200 move d0,d1 5505 000048EA 61BC bsr bat_xdata MSByte 5506 000048EC 61BA bsr bat_xdata LSByte 5507 000048EE 123C 00A7 move.b #$A7,d1 Set Protection To 60 Seconds 5508 000048F2 61B4 bsr bat_xdata (6000 = $1770) 5509 000048F4 7217 moveq #$17,d1 MSByte 5510 000048F6 61B0 bsr bat_xdata 5511 000048F8 7270 moveq #$70,d1 5512 000048FA 61AC bsr bat_xdata LSByte 5513 000048FC 4A38 FDCD tst.b battery Indicate Battery Presence 5514 00004900 6708 beq.s bat_init1 PAGE 120 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BATTERY HARDWARE DRIVERS (BOOTROM3)" 5515 00004902 41FA 1098 lea goodbat,a0 5516 00004906 6000 D21C bra present 5517 0000490A 2E4D bat_init1 movea.l a5,sp Restore Stack Pointer 5518 0000490C 4238 FDCD clr.b battery 5519 00004910 7C07 moveq #7,d6 Check if required 5520 00004912 6100 D4CE bsr required 5521 00004916 6608 bne.s bat_init2 5522 00004918 41FA 1082 lea goodbat,a0 Yes, indicate Failed 5523 0000491C 6100 D20A bsr failing 5524 00004920 4E75 bat_init2 rts 5525 5526 ****************************************************************************** 5527 * CHK_BATTERY: ($170) Chk for Battery (Sets BATTERY flag) * 5528 ****************************************************************************** 5529 00004922 11FC 0001 CHK_BATTERY MOVE.B #1,BATTERY ASSUME THERE IS A BATTERY FDCD 5530 00004928 203C 0000 MOVE.L #20000,D0 APPROX 10 MILLI SECOND TIMEOUT 4E20 5531 0000492E 2400 MOVE.L D0,D2 MAKE A COPY OF THE COUNTER 5532 00004930 123C 00AF MOVE.B #$AF,D1 SEND BYTES TO BATTERY RAM 5533 00004934 6100 0140 BSR BAT_WCMD WRITE THE COMMAND 5534 00004938 663C BNE.S BAT_CHK_END 5535 0000493A 41FA 0010 LEA BATTST,A0 5536 0000493E 1218 CHK_B1 MOVE.B (A0)+,D1 5537 00004940 6714 BEQ.S CHK_B2 5538 00004942 2002 MOVE.L D2,D0 RESET COUNTER 5539 00004944 6100 013E BSR BAT_WDATA WRITE THE DATA BYTE 5540 00004948 662C BNE.S BAT_CHK_END 5541 0000494A 60F2 BRA CHK_B1 5542 0000494C F0 BATTST DC.B $F0,$FF,$A5,$5A,$00 5543 00004951 EF BATCMD DC.B $EF,$EE,$ED,$EC,$00 5544 * NOW READ BACK THESE BYTES 5545 00004956 41FA FFF4 CHK_B2 LEA BATTST,A0 5546 0000495A 43FA FFF5 LEA BATCMD,A1 5547 0000495E 1219 CHK_B3 MOVE.B (A1)+,D1 5548 00004960 6718 BEQ.S CHK_B4 5549 00004962 2002 MOVE.L D2,D0 5550 00004964 6100 0110 BSR BAT_WCMD READ THE DATA 5551 00004968 660C BNE.S BAT_CHK_END 5552 0000496A 2002 MOVE.L D2,D0 5553 0000496C 6100 0128 BSR BAT_RDATA 5554 00004970 6604 BNE.S BAT_CHK_END 5555 00004972 B018 CMP.B (A0)+,D0 CHECK THE DATA 5556 00004974 67E8 BEQ CHK_B3 5557 00004976 4238 FDCD BAT_CHK_END CLR.B BATTERY THERE IS NO BATTERY 5558 0000497A 4E75 CHK_B4 RTS PAGE 121 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BATTERY HARDWARE DRIVERS (BOOTROM3)" 5560 ****************************************************************************** 5561 * BAT_NO_INT: ($174) Wait for NMI Interrupt to Clear * 5562 ****************************************************************************** 5563 0000497C 0839 0002 BAT_NO_INT BTST #2,BATTERYSTATUS WAIT FOR BATTERY TO STOP 0045 8021 5564 00004984 66F6 BNE BAT_NO_INT INTERUPTING 5565 00004986 4E75 RTS 5566 ****************************************************************************** 5567 * WAIT FOR DATA FROM BATTERY 5568 * 5569 * Modified by: Anny Randel 5570 * Date: Dec. 14, 1983 5571 * Purpose: To use timer routines when timer present 5572 * Note: When timer is used, this routine takes at least 50 us 5573 * See comments in kbd_cwait 5574 ****************************************************************************** 5575 00004988 4A38 FDCD BAT_DWAIT TST.B BATTERY 5576 0000498C 6768 BEQ.S BAT_BAD_X 5577 0000498E 4A80 TST.L D0 5578 00004990 6758 BEQ.S BAT_DW2 5579 5580 ************ START OF ANNY'S CHANGES ************ 5581 00004992 0838 0001 btst #timer_absent,sysflag2 timer absent? FEDA 5582 00004998 6640 bne.s bat_dw1 branch if so 5583 0000499A 80FC 00C8 divu #200,d0 divide d0 by 200 to get ms value 5584 0000499E 0280 0000 andi.l #$0ffff,d0 clear upperword FFFF 5585 000049A4 0640 0001 addi.w #1,d0 5586 000049A8 2F00 move.l d0,-(sp) 5587 000049AA 4857 pea (sp) put value loc on stack 5588 000049AC 6100 07FA bsr milli_to_micro get micro sec value 5589 000049B0 201F move.l (sp)+,d0 5590 000049B2 90BC 0000 sub.l #9,d0 subtract out overhead (9us) 0009 5591 000049B8 2F00 move.l d0,-(sp) put value on stack 5592 000049BA 4857 pea (sp) put location on stack 5593 000049BC 4EBA 0814 jsr start_timer start timer for timeout 5594 000049C0 201F bat_dw3 move.l (sp)+,d0 pop value 5595 000049C2 0839 0000 btst #0,batterystatus chk status 0045 8021 5596 000049CA 6630 bne.s bat_ok_x bit came on to show data ready 5597 000049CC 2F00 move.l d0,-(sp) push value 5598 000049CE 4857 pea (sp) push location 5599 000049D0 4EBA 0820 jsr check_timer timed out yet? 5600 000049D4 6AEA bpl bat_dw3 if not, branch back 5601 000049D6 588F addq.l #4,sp pop stack 5602 000049D8 7000 moveq #0,d0 test one more time! 5603 ************ END OF ANNY'S CHANGES ************ 5604 5605 000049DA 0839 0000 BAT_DW1 BTST #0,BATTERYSTATUS 0045 8021 5606 000049E2 56C8 FFF6 DBNE D0,BAT_DW1 5607 000049E6 670E BEQ.S BAT_BAD_X 5608 000049E8 6012 BRA.S BAT_OK_X BIT CAME ON TO SHOW DATA READY 5609 000049EA 0839 0000 BAT_DW2 BTST #0,BATTERYSTATUS 0045 8021 PAGE 122 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BATTERY HARDWARE DRIVERS (BOOTROM3)" 5610 000049F2 67F6 BEQ BAT_DW2 5611 000049F4 6006 BRA.S BAT_OK_X BIT CAME ON TO SHOW DATA READY 5612 * TIMEOUT OR NO BATTERY 5613 000049F6 44FC 0000 BAT_BAD_X MOVE #0,CCR SHOW NON ZERO 5614 000049FA 4E75 BAT_RTS RTS RETURN TO CALLER 5615 000049FC 44FC 0004 BAT_OK_X MOVE #4,CCR SHOW ZERO 5616 00004A00 4E75 RTS 5617 5618 ****************************************************************************** 5619 * BAT_CWAIT: ($178) Wait for Last Command to the Battery * 5620 * 5621 * Modified by: Anny Randel 5622 * Date: Dec. 14, 1983 5623 * Purpose: To use timer routines when timer present 5624 * Note: When timer is used, this routine takes at least 50 us 5625 * See comments in kbd_cwait 5626 ****************************************************************************** 5627 00004A02 4A38 FDCD BAT_CWAIT TST.B BATTERY 5628 00004A06 67EE BEQ BAT_BAD_X 5629 00004A08 4A80 TST.L D0 CHECK TIME COUNT 5630 00004A0A 675E BEQ.S BAT_CW2 5631 5632 ************ START OF ANNY'S CHANGES ************ 5633 00004A0C 0838 0001 btst #timer_absent,sysflag2 timer absent? FEDA 5634 00004A12 6648 bne.s bat_cw1 branch if so 5635 00004A14 80FC 00C8 divu #200,d0 divide d0 by 200 to get ms value 5636 00004A18 0280 0000 andi.l #$0ffff,d0 clear upperword FFFF 5637 00004A1E 0640 0001 addi.w #1,d0 5638 00004A22 2F00 move.l d0,-(sp) 5639 00004A24 4857 pea (sp) put value loc on stack 5640 00004A26 6100 0780 bsr milli_to_micro get micro sec value 5641 00004A2A 201F move.l (sp)+,d0 5642 00004A2C 90BC 0000 sub.l #9,d0 sub out 9us of overhead 0009 5643 00004A32 2F00 move.l d0,-(sp) put value on stack 5644 00004A34 4857 pea (sp) put location on stack 5645 00004A36 4EBA 079A jsr start_timer start timer for timeout 5646 00004A3A 201F bat_cw3 move.l (sp)+,d0 pop value 5647 00004A3C 0839 0001 btst #1,batterystatus chk status 0045 8021 5648 00004A44 67B4 beq bat_rts return (ccr set correctly already) 5649 00004A46 2F00 move.l d0,-(sp) push value 5650 00004A48 4857 pea (sp) push location 5651 00004A4A 4EBA 07A6 jsr check_timer timed out yet? 5652 00004A4E 6AEA bpl bat_cw3 if not, branch back 5653 00004A50 588F addq.l #4,sp pop stack 5654 00004A52 0839 0001 btst #1,batterystatus chk status (set cond codes) 0045 8021 5655 00004A5A 4E75 rts else, rts (ccr set correctly already) 5656 ************ END OF ANNY'S CHANGES ************ 5657 5658 00004A5C 0839 0001 BAT_CW1 BTST #1,BATTERYSTATUS 0045 8021 5659 00004A64 57C8 FFF6 DBEQ D0,BAT_CW1 5660 00004A68 4E75 RTS CCR SET CORRECTLY ALREADY PAGE 123 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM BATTERY HARDWARE DRIVERS (BOOTROM3)" 5661 00004A6A 0839 0001 BAT_CW2 BTST #1,BATTERYSTATUS 0045 8021 5662 00004A72 66F6 BNE BAT_CW2 5663 00004A74 4E75 RTS BIT WENT ZERO TO SHOW DONE 5664 5665 ****************************************************************************** 5666 * BAT_WCMD: ($17C) Wait for Last Command To Battery Then Write Command * 5667 ****************************************************************************** 5668 00004A76 618A BAT_WCMD BSR BAT_CWAIT 5669 00004A78 6680 BNE BAT_RTS 5670 00004A7A 13C1 0045 MOVE.B D1,BATTERYSTATUS 8021 5671 00004A80 6000 FF7A BRA BAT_OK_X 5672 5673 ****************************************************************************** 5674 * BAT_WDATA: ($180) Wait for Last Command To Battery Then Write Data * 5675 ****************************************************************************** 5676 00004A84 6100 FF7C BAT_WDATA BSR BAT_CWAIT 5677 00004A88 6600 FF70 BNE BAT_RTS 5678 00004A8C 13C1 0045 MOVE.B D1,BATTERYDATA 8001 5679 00004A92 6000 FF68 BRA BAT_OK_X 5680 5681 ****************************************************************************** 5682 * BAT_RDATA: ($184) Poll For Data Ready From Battery Then Read Data * 5683 ****************************************************************************** 5684 00004A96 6100 FEF0 BAT_RDATA BSR BAT_DWAIT 5685 00004A9A 6600 FF5E BNE BAT_RTS 5686 00004A9E 4280 CLR.L D0 SET D0 TO PICK UP DATA BYTE 5687 00004AA0 1039 0045 MOVE.B BATTERYDATA,D0 8001 5688 00004AA6 6000 FF54 BRA BAT_OK_X PAGE 124 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HPIB HARDWARE DRIVERS (BOOTROM3)" 5691 ****************************************************************************** 5692 ****************************************************************************** 5693 *** *** 5694 *** HPIB Hardware Drivers *** 5695 *** *** 5696 *** Utility Entries Supported Internally: *** 5697 *** HPIB_INIT Test Vector for Internal HPIB *** 5698 *** HPIB_TEST TEST HPIB at A0 *** 5699 *** RST_HPIB Reset the HPIB Controller (9914), and *** 5700 *** send Interface Clear and Remote Enable *** 5701 *** *** 5702 *** Assumes A0 has address of the card, and *** 5703 *** A1 points to the card's auxiliary command register *** 5704 ****************************************************************************** 5705 ****************************************************************************** 5706 5707 ****************************************************************************** 5708 * Test the Internal HPIB if Present and SYSTEM Controller * 5709 ****************************************************************************** 5710 00004AAA 2A4F hpib_init movea.l sp,a5 Save Stack Pointer 5711 00004AAC 0838 0005 btst #5,sysflag Check for Presence FED2 5712 00004AB2 6636 bne.s hpib_init3 Not present so don't bother 5713 00004AB4 7014 moveq #hpibf,d0 Indicate to LEDs 5714 00004AB6 6100 CFAE bsr led_state 5715 00004ABA 4DFA 0016 lea hpib_init1,a6 If bus error, then failure 5716 00004ABE 41F9 0047 lea int_hpib,a0 8000 5717 00004AC4 612E bsr.s hpib_test 5718 00004AC6 4A00 tst.b d0 5719 00004AC8 6718 beq.s hpib_init2 5720 00004ACA 41FA 0EF7 lea goodhpib,a0 Indicate Failure 5721 00004ACE 6000 D058 bra failing 5722 00004AD2 2E4D hpib_init1 movea.l a5,sp Restore Stack Pointer 5723 00004AD4 08F8 0005 bset #5,sysflag Indicate absence FED2 5724 00004ADA 41FA 0EE7 lea goodhpib,a0 Indicate Missing 5725 00004ADE 6000 D070 bra missing 5726 00004AE2 41FA 0EDF hpib_init2 lea goodhpib,a0 Indicate Presence 5727 00004AE6 6000 D03C bra present 5728 00004AEA 7C03 hpib_init3 moveq #3,d6 5729 00004AEC 6100 D2F4 bsr required Check is device is required 5730 00004AF0 67E0 beq.s hpib_init1 Yes, Indicate Missing 5731 00004AF2 4E75 rts 5732 5733 ****************************************************************************** 5734 * Test HPIB at A0 * 5735 ****************************************************************************** 5736 00004AF4 43E8 0017 hpib_test lea auxcmd(a0),a1 Set A1 pointing to aux. cmd. 5737 00004AF8 6100 009C bsr rst_hpib Reset the card. 5738 00004AFC 0828 0007 btst #SC,ext_stat(a0) Are we system controller? 0005 5739 00004B02 660C bne.s hpib_test1 If so, do full test. 5740 00004B04 0828 0006 btst #AC,ext_stat(a0) If we are active controller 0005 5741 00004B0A 6700 0082 beq hpib_test3 then give an error 5742 00004B0E 6076 bra.s hpib_test4 Else assume card is OK PAGE 125 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HPIB HARDWARE DRIVERS (BOOTROM3)" 5743 5744 00004B10 0828 0006 hpib_test1 btst #AC,ext_stat(a0) Should be active controller. 0005 5745 00004B16 6676 bne.s hpib_test3 Else error! 5746 00004B18 1028 0017 move.b busstat(a0),d0 Get bus status register 5747 00004B1C C03C 00CB and.b #$CB,d0 Extract ATN,DAV,EOI,IFC,REN 5748 00004B20 5300 subq.b #1,d0 Should see only REN 5749 00004B22 666A bne.s hpib_test3 If not, give error 5750 00004B24 1028 0015 move.b addrstat(a0),d0 Get address status register 5751 00004B28 C03C 00E6 and.b #$E6,d0 Extract REM,LLO,ATN,LADS,TADS 5752 00004B2C 6660 bne.s hpib_test3 Should see all zero! 5753 00004B2E 12BC 008A move.b #ton1,(a1) Tell 9914 to become talker. 5754 00004B32 1028 0015 move.b addrstat(a0),d0 Make sure we became talker 5755 00004B36 C03C 00E6 and.b #$E6,d0 5756 00004B3A 903C 0002 sub.b #2,d0 5757 00004B3E 664E bne.s hpib_test3 If not, give error. 5758 00004B40 12BC 0089 move.b #lon1,(a1) Now make him a listener. 5759 00004B44 1028 0015 move.b addrstat(a0),d0 Make sure we became one. 5760 00004B48 C03C 00E6 and.b #$E6,d0 5761 00004B4C B03C 0084 cmp.b #$84,d0 Should be listener and remote 5762 00004B50 663C bne.s hpib_test3 If not, give error 5763 00004B52 12BC 0009 move.b #lon0,(a1) Unlisten. 5764 00004B56 12BC 000C move.b #tca,(a1) Try to set ATN 5765 00004B5A 727F moveq #127,d1 Give 9914 some time ... 5766 00004B5C 4A28 0017 hpib_test2 tst.b busstat(a0) 5767 00004B60 5BC9 FFFA dbmi d1,hpib_test2 5768 00004B64 6A28 bpl.s hpib_test3 If ATN not true, then error 5769 00004B66 1028 0015 move.b addrstat(a0),d0 5770 00004B6A C03C 00E6 and.b #$E6,d0 Extract REM,LLO,ATN,LADS,TADS 5771 00004B6E B03C 00A0 cmp.b #$A0,d0 5772 00004B72 661A bne.s hpib_test3 Should have REM,ATN true. 5773 00004B74 0108 0011 movep.w int0stat(a0),d0 Make sure we got interrupts 5774 00004B78 0240 FFFD andi #$FFFD,d0 5775 00004B7C B07C 1200 cmp.w #$1200,d0 BO and RLC 5776 00004B80 660C bne.s hpib_test3 5777 00004B82 12BC 000B move.b #gts,(a1) Drop ATN 5778 00004B86 51C0 hpib_test4 sf d0 Indicate Presence 5779 00004B88 12BC 0010 move.b #ren0,(a1) Drop REN for testrom 5780 00004B8C 4E75 rts 5781 00004B8E 50C0 hpib_test3 st d0 Indicate Failure 5782 00004B90 12BC 0010 move.b #ren0,(a1) Drop REN for testrom 5783 00004B94 4E75 rts 5784 5785 ****************************************************************************** 5786 * RST_HPIB: Reset the HPIB Controller (9914) * 5787 * * 5788 * Assumes A0 has address of the card, and * 5789 * A1 points to the card's auxiliary command register * 5790 * * 5791 * Modified by: Anny Randel * 5792 * Date: Dec. 14, 1983 * 5793 * Purpose: Use timer when present * 5794 ****************************************************************************** 5795 00004B96 12BC 0080 RST_HPIB MOVE.B #SWRST1,(A1) Start software reset 5796 00004B9A 12BC 0093 MOVE.B #DAI1,(A1) Tell 9914 to disable all ints 5797 00004B9E 7000 moveq #0,d0 Clear Interrupt Mask 5798 00004BA0 0188 0011 movep.w d0,int0mask(a0) PAGE 126 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HPIB HARDWARE DRIVERS (BOOTROM3)" 5799 00004BA4 1028 0005 move.b ext_stat(a0),d0 Get external status register 5800 00004BA8 B1FC 0047 cmpa.l #int_hpib,a0 If this is an external HP-IB, 8000 5801 00004BAE 660C bne.s rst_hpib2 Then d0 has bus address 5802 00004BB0 0800 0007 btst #sc,d0 For internal HP-IB, use address 5803 00004BB4 6704 beq.s rst_hpib1 21 for system controller and 5804 00004BB6 7015 moveq #21,d0 20 for non-system controller 5805 00004BB8 6002 bra.s rst_hpib2 5806 00004BBA 7014 rst_hpib1 moveq #20,d0 5807 00004BBC 0240 001F rst_hpib2 andi #31,d0 Use only lower 5 bits for address 5808 00004BC0 0C40 001F cmpi #31,d0 If switch is set to address 31 5809 00004BC4 6602 bne.s rst_hpib3 then use address 0 5810 00004BC6 7000 moveq #0,d0 5811 00004BC8 1140 0019 rst_hpib3 move.b d0,address(a0) Tell 9914 its address 5812 00004BCC 12BC 0000 MOVE.B #SWRST0,(A1) Terminate software reset 5813 00004BD0 0828 0007 BTST #SC,EXT_STAT(A0) Are we SYSTEM CONTRLR? 0005 5814 00004BD6 671C BEQ.S RST_RTS if not, skip 'cause we're done 5815 00004BD8 12BC 0010 MOVE.B #REN0,(A1) else drop REN 5816 00004BDC 12BC 008F MOVE.B #SIC1,(A1) set IFC 5817 00004BE0 4878 0064 pea 100 push microsecond value 5818 00004BE4 6100 B41A bsr miscasm_delay delay 5819 00004BE8 12BC 000F MOVE.B #SIC0,(A1) clear IFC 5820 00004BEC 12BC 0090 MOVE.B #REN1,(A1) set REN 5821 00004BF0 12BC 000B MOVE.B #GTS,(A1) and drop ATN 5822 00004BF4 4E75 RST_RTS RTS PAGE 127 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM SIO HARDWARE DRIVERS (BOOTROM3)" 5825 ****************************************************************************** 5826 ****************************************************************************** 5827 *** *** 5828 *** SIO Hardware Drivers *** 5829 *** *** 5830 *** Utility Entries Supported Internally: *** 5831 *** siotst Test SIO Card at A0 *** 5832 *** *** 5833 *** Modified by: Anny Randel *** 5834 *** Date: Dec. 14, 1983 *** 5835 *** Purpose: Use timer when present *** 5836 *** *** 5837 ****************************************************************************** 5838 ****************************************************************************** 5839 5840 ****************************************************************************** 5841 * Test SIO Card at A0 * 5842 ****************************************************************************** 5843 00004BF6 4DFA 003E siotst lea siotst3,a6 On Bus error, fail 5844 00004BFA 117C 0080 move.b #dlab,lcr(a0) 0016 5845 00004C00 117C 0000 move.b #0,udiv(a0) 0012 5846 00004C06 117C 0007 move.b #7,ldiv(a0) BAUD=21.94 Kbaud 0010 5847 00004C0C 117C 0007 move.b #7,lcr(a0) 0016 5848 00004C12 117C 001F move.b #echo,mcr(a0) 0018 5849 00004C18 1A3C 0001 move.b #1,d5 START PATTERN 5850 00004C1C 1145 0010 siotst1 move.b d5,siodata(a0) 5851 00004C20 4878 03E8 pea 1000 push microsecond value 5852 00004C24 6100 B3DA bsr miscasm_delay delay 5853 00004C28 BA28 0010 cmp.b siodata(a0),d5 5854 00004C2C 6608 bne.s siotst3 5855 00004C2E E30D siotst2 lsl.b #1,d5 5856 00004C30 64EA bcc siotst1 5857 00004C32 51C0 sf d0 5858 00004C34 6002 bra.s siotst4 Okay 5859 00004C36 50C0 siotst3 st d0 5860 00004C38 117C 0000 siotst4 move.b #$00,mcr(a0) clear loop back, modem lines 0018 5861 00004C3E 117C 0080 move.b #dlab,lcr(a0) 0016 5862 00004C44 117C 0040 move.b #$40,ldiv(a0) ***********Use 2400 baud for test 0010 5863 00004C4A 117C 0007 move.b #7,lcr(a0) 0016 5864 00004C50 4E75 rts Failed PAGE 128 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MOON UNIT HARDWARE DRIVERS (BOOTROM3)" 5867 ****************************************************************************** 5868 ****************************************************************************** 5869 *** *** 5870 *** Moon Unit Hardware Drivers *** 5871 *** *** 5872 *** Utility Entries Supported Internally: *** 5873 *** moon_test Test Moon Unit Card at A0 *** 5874 ****************************************************************************** 5875 ****************************************************************************** 5876 5877 ****************************************************************************** 5878 * Test Moon Unit Card at A0 * 5879 ****************************************************************************** 5880 00004C52 4DFA 002E moon_test lea moon_test2,a6 On Bus error, fail 5881 00004C56 2A4F movea.l sp,a5 Save Stack Pointer 5882 * 5883 * Start up Controller, so it can refresh memory 5884 * 5885 00004C58 7000 moveq #0,d0 Start with Register 0 5886 00004C5A 720D moveq #13,d1 End with Register 13 5887 00004C5C 43FA 002A lea moon_tab,a1 Table of Controller Constants 5888 00004C60 1140 0010 moon_test1 move.b d0,16(a0) Set Address Register 5889 00004C64 1159 0012 move.b (a1)+,18(a0) Set Data Register 5890 00004C68 5240 addq #1,d0 5891 00004C6A B041 cmp d1,d0 5892 00004C6C 6FF2 ble.s moon_test1 Check for Done 5893 * 5894 * Test the Memory 5895 * 5896 00004C6E 2A48 movea.l a0,a5 Compute Bottom of RAM 5897 00004C70 DBFC 0000 adda.l #$8000,a5 8000 5898 00004C76 2248 movea.l a0,a1 Compute Top of RAM +1 5899 00004C78 D3FC 0002 adda.l #$20000,a1 0000 5900 00004C7E 6000 CFA8 bra test_ram 5901 * 5902 * Error if Bus error 5903 * 5904 00004C82 2E4D moon_test2 movea.l a5,sp Restore Stack Pointer 5905 00004C84 50C0 st d0 Failure 5906 00004C86 4E75 rts 5907 5908 00004C88 29 moon_tab dc.b 41,32,34,03,50,5,49,49,0,7,0,0,0,0 USTV values PAGE 129 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MISCELLANEOUS UTILITIES (BOOTROM3)" 5911 ****************************************************************************** 5912 ****************************************************************************** 5913 *** *** 5914 *** Miscellaneous Utilities *** 5915 *** *** 5916 *** Utility Entries Supported Externally for Old Systems: *** 5917 *** BIN_TO_DEC ($1A8) D0 to Decimal Conversion *** 5918 *** PNT8HEX ($1AC) D0 to ASCII HEX Converison *** 5919 *** *** 5920 *** Utility Entries Supported Internally Only: *** 5921 *** MOVEBYTES Copy Data *** 5922 *** PASCAL_INIT Set-up Pascal Environment *** 5923 *** TRAPSET Sets up Read Interface Environment *** 5924 *** TRAPRES Restores from Read Interface Environment *** 5925 *** *** 5926 ****************************************************************************** 5927 ****************************************************************************** 5928 5929 ****************************************************************************** 5930 * BIN_TO_DEC: ($1A8) Convert Binary in D0 to ASCII Code Decimal in Buffer * 5931 * at (A1) * 5932 * Uses D0-D6 and A1 * 5933 ****************************************************************************** 5934 00004C96 780A bin_to_dec moveq #10,d4 base 10 5935 00004C98 2200 move.l d0,d1 d1 is working reg 5936 00004C9A 6A06 bpl.s bin1 + or - ? 5937 00004C9C 12FC 002D move.b #'-',(a1)+ store minus sign 5938 00004CA0 4481 neg.l d1 & make positive 5939 00004CA2 3401 bin1 move.w d1,d2 d2 := low word 5940 00004CA4 4241 bin2 clr.w d1 d1 := high word 5941 00004CA6 4841 swap d1 5942 00004CA8 82C4 divu d4,d1 hi dividend/10 5943 00004CAA 3601 move.w d1,d3 save hi quotient 5944 00004CAC 3202 move.w d2,d1 lo quotient 5945 00004CAE 82C4 divu d4,d1 5946 00004CB0 3401 move.w d1,d2 hi quotient 5947 00004CB2 3203 move.w d3,d1 remainder 5948 00004CB4 4841 swap d1 save lo digit 5949 00004CB6 3F01 move.w d1,-(sp) quotient => 0 ? 5950 00004CB8 8642 or.w d2,d3 jmp if zero 5951 00004CBA 6702 beq.s bin3 use new quotient 5952 00004CBC 61E6 bsr.s bin2 for ASCII conversion 5953 00004CBE 7230 bin3 moveq #'0',d1 get digit 5954 00004CC0 D25F add.w (sp)+,d1 move it 5955 00004CC2 12C1 move.b d1,(a1)+ keep going (or done) 5956 00004CC4 4E75 rts 5957 5958 ****************************************************************************** 5959 * PNT8HEX: ($1AC) Put D0 as ASCII Coded HEX into a Buffer at (A1) * 5960 * Uses A1,D0,D1 & D2 * 5961 * * 5962 * WARNING: Some BOZO Documented OFFSET ENTRIES INTO THIS ROUTINE. * 5963 * DO NOT CHANGE THE CODING OF THIS ROUTINE. * 5964 ****************************************************************************** 5965 00004CC6 4840 PNT8HEX SWAP D0 FLIP REG HALVES 5966 00004CC8 610A BSR.S PNT4HEX DO TOP WORD 5967 00004CCA 4840 SWAP D0 DO LOW WORD PAGE 130 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MISCELLANEOUS UTILITIES (BOOTROM3)" 5968 00004CCC 6006 BRA.S PNT4HEX 5969 * 5970 00004CCE 4840 PNT6HEX SWAP D0 FLIP REG HALVES 5971 00004CD0 610A BSR.S PNT2HEX 5972 00004CD2 4840 SWAP D0 5973 * 5974 00004CD4 3200 PNT4HEX MOVE.W D0,D1 SAVE IN TEMP 5975 00004CD6 E058 ROR.W #8,D0 GET BITS 15-8 INTO LOWER BYTE 5976 00004CD8 6102 BSR.S PNT2HEX PUT IT IN BUFFER 5977 00004CDA 3001 MOVE.W D1,D0 GET IT BACK 5978 * 5979 00004CDC 3400 PNT2HEX MOVE.W D0,D2 SAVE IN TEMP 5980 00004CDE E850 ROXR.W #4,D0 FORM UPPER NIBBLE 5981 00004CE0 6102 BSR.S PUTHEX PUT ASCII INTO BUFFER 5982 00004CE2 3002 MOVE.W D2,D0 GET BACK FROM TEMP 5983 * CONVERT D0.NIBBLE TO HEX AND PUT IT IN BUFFER 5984 00004CE4 0200 000F PUTHEX ANDI.B #$0F,D0 SAVE LOWER NIBBLE 5985 00004CE8 0000 0030 ORI.B #$30,D0 CONVERT TO ASCII 5986 00004CEC 0C00 0039 CMPI.B #$39,D0 IS IT > 9 ? 5987 00004CF0 6F02 BLE.S SAVEHEX 5988 00004CF2 5E40 ADDQ #7,D0 ADD TO MAKE 10=>A 5989 00004CF4 12C0 SAVEHEX MOVE.B D0,(A1)+ PUT IT IN THE BUFFER 5990 00004CF6 4E75 RTS ALL DONE 5991 5992 ****************************************************************************** 5993 * MOVEBYTES: MOVE BYTES FROM (A0) TO (A1) !! STOPPED BY NULL BYTE * 5994 ****************************************************************************** 5995 00004CF8 12D8 MOVEBYTES MOVE.B (A0)+,(A1)+ 5996 00004CFA 66FC BNE MOVEBYTES 5997 00004CFC 5389 SUBQ.L #1,A1 BACKUP ONE BYTE 5998 00004CFE 4E75 RTS 5999 6000 ****************************************************************************** 6001 * PASCAL_INIT: Set-up Pascal Environment * 6002 ****************************************************************************** 6003 00004D00 48E7 80C0 pascal_init movem.l d0/a0-a1,-(sp) Save Registers 6004 00004D04 31FC 4EF9 move #jmpop,trp10 Set-up Trap 10 Routine FF58 6005 00004D0A 21FC 0000 move.l #trp10rt,trp10+2 4E40 FF5A 6006 00004D12 41F8 FF5E lea trp9,a0 Initialize PASCAL Traps to Error 6007 00004D16 43F8 FF9A lea lvl7v,a1 6008 00004D1A 30FC 4EF9 pascal_init1 move #jmpop,(a0)+ 6009 00004D1E 20FC 0000 move.l #trpn,(a0)+ 4E3A 6010 00004D24 B3C8 cmpa.l a0,a1 6011 00004D26 62F2 bhi.s pascal_init1 6012 00004D28 5C48 addq #6,a0 Don't Change Level 7 6013 00004D2A 43F8 FFBE lea lvl1v,a1 Initialize I-Vectors to BCrash 6014 00004D2E 0C50 4EF9 pascal_init2 cmpi #jmpop,(a0) Don't Change Already Set up ones 6015 00004D32 6604 bne.s pascal_int2_1 6016 00004D34 5C48 addq #6,a0 Skip this vector 6017 00004D36 600A bra.s pascal_int2_2 6018 00004D38 30FC 4EB9 pascal_int2_1 move #jsrop,(a0)+ Don't Change Level One 6019 00004D3C 20FC 0000 move.l #bcrash,(a0)+ 4EFA 6020 00004D42 B3C8 pascal_int2_2 cmpa.l a0,a1 PAGE 131 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MISCELLANEOUS UTILITIES (BOOTROM3)" 6021 00004D44 62E8 bhi.s pascal_init2 6022 00004D46 4280 clr.l d0 Initialize Non I-Vectors 6023 00004D48 43F8 FFD0 lea trptrc,a1 Don't Change TRPTRC 6024 00004D4C 41F8 FFC4 lea op1111,a0 6025 00004D50 30FC 4EF9 pascal_init3 move #jmpop,(a0)+ 6026 00004D54 20FC 0000 move.l #trpn,(a0)+ 4E3A 6027 00004D5A B3C8 cmpa.l a0,a1 6028 00004D5C 62F2 bhi.s pascal_init3 6029 00004D5E 5C48 addq #6,a0 Don't Change TRPTRC 6030 00004D60 30FC 4EF9 pascal_init4 move #jmpop,(a0)+ 6031 00004D64 20FC 0000 move.l #trpn,(a0)+ 4E3A 6032 00004D6A B1C0 cmpa.l d0,a0 6033 00004D6C 66E2 bne.s pascal_init3 6034 00004D6E 4CDF 0301 movem.l (sp)+,d0/a0-a1 Save Registers 6035 00004D72 4E75 rts 6036 6037 ****************************************************************************** 6038 * trapset Sets up read interface Trap environment * 6039 ****************************************************************************** 6040 * 6041 * Save Current Environment 6042 * 6043 00004D74 2878 FED4 trapset movea.l f_area,a4 Save Traps that will be changed 6044 00004D78 206C 0010 movea.l mb_ptr(a4),a0 Save at front of Read Interface 6045 00004D7C 30F8 FF58 move trp10,(a0)+ Buffer 6046 00004D80 20F8 FF5A move.l trp10+2,(a0)+ Save Trap 10 6047 00004D84 49F8 FF76 lea trp5,a4 Save Trap 5 and 4 Vectors 6048 00004D88 20DC move.l (a4)+,(a0)+ 6049 00004D8A 20DC move.l (a4)+,(a0)+ 6050 00004D8C 20DC move.l (a4)+,(a0)+ 6051 * 6052 * Set-up New Environment Required by Read Interface 6053 * 6054 00004D8E 31FC 4EF9 move #jmpop,trp10 Set-up Trap 10 Routine FF58 6055 00004D94 21FC 0000 move.l #trp10rt,trp10+2 4E40 FF5A 6056 00004D9C 31FC 4EF9 move #jmpop,trp4 Set-up Trap 4 FF7C 6057 00004DA2 21FC 0000 move.l #trpn,trp4+2 4E3A FF7E 6058 00004DAA 31FC 4EF9 move #jmpop,trp5 Set-up Trap 5 FF76 6059 00004DB0 21FC 0000 move.l #trpn,trp5+2 4E3A FF78 6060 00004DB8 4E75 rts 6061 6062 6063 ****************************************************************************** 6064 * trapres Restores Trap environment set-up for Read interface * 6065 ****************************************************************************** 6066 * 6067 * Restore Environment 6068 * 6069 00004DBA 2878 FED4 trapres movea.l f_area,a4 Restore Traps that have changed PAGE 132 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM MISCELLANEOUS UTILITIES (BOOTROM3)" 6070 00004DBE 206C 0010 movea.l mb_ptr(a4),a0 Restore from front of Read 6071 00004DC2 31D8 FF58 move (a0)+,trp10 Interface Buffer 6072 00004DC6 21D8 FF5A move.l (a0)+,trp10+2 Restore Trap 10 6073 00004DCA 49F8 FF76 lea trp5,a4 Restore Trap 5 and 4 Vectors 6074 00004DCE 28D8 move.l (a0)+,(a4)+ 6075 00004DD0 28D8 move.l (a0)+,(a4)+ 6076 00004DD2 28D8 move.l (a0)+,(a4)+ 6077 00004DD4 4E75 rts PAGE 133 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM EXCEPTION HANDLERS (BOOTROM3)" 6080 ****************************************************************************** 6081 ****************************************************************************** 6082 *** *** 6083 *** Exception Handlers *** 6084 *** *** 6085 *** HBUSERROR Bus error Prefix Code for all Bus Errors *** 6086 *** BOOT_BUSERROR Booter Bus Error Handler *** 6087 *** IGNOREISR Exception Stub Routine (just RTE's) *** 6088 *** SETBUS Initialize Bus Error Vector *** 6089 *** DIE Hang forever *** 6090 *** WAITFORNMI Wait for NMI *** 6091 *** TRPN Pascal Illegal Trap Handler *** 6092 *** TRP10RT Pascal Trap 10 Handler *** 6093 *** BCRASH Boot ROM Crash Routine *** 6094 *** FLPINIT Handle Floppies that Interrupt at Power-up *** 6095 *** *** 6096 *** Utility Entries Supported for Old Systems: *** 6097 *** RTN_TO_MONITOR($1A0) System Comes Here on Control-Reset *** 6098 *** NMI_DECODE ($1B0) Address of NMI Decode ISR *** 6099 *** CRASH ($1B8) System Called Crash Routine *** 6100 *** *** 6101 ****************************************************************************** 6102 ****************************************************************************** 6103 6104 ****************************************************************************** 6105 * HBUSERROR: All Bus Errors Come Here First * 6106 ****************************************************************************** 6107 00004DD6 BEFC 0100 hbuserror cmpa.w #fake_stack,sp If sp is less than fake_stack 6108 00004DDA 6326 bls.s hbusfake then handle without RAM 6109 00004DDC BFFC 0082 cmpa.l #$0082FFFE,sp If stack pointer was above this FFFE 6110 * location, then it wasn't test ROM 6111 00004DE2 621A bhi.s xbuserrv Use High RAM Vector 6112 00004DE4 BFFC 0082 cmpa.l #$00828000,sp If stack pointer was below this 8000 6113 * location then it wasn't test ROM 6114 00004DEA 6312 bls.s xbuserrv Use High RAM Vector 6115 * NOTE: No one (besides the test ROM) at this time (4.0 bootROM) uses a stack 6116 * pointer below $0082xxxx. The following check verifies that we're looking 6117 * at test board just in case somebody gets cute and uses a lower stack pointer. 6118 * It should be ok to read $818000 as long as we're on a board as young, at least 6119 * as a Big Mac (which we will be since this was added in 4.0). 6120 00004DEC 0CB9 F0FF cmpi.l #$F0FF5480,$00818000 Check test code ROM header 5480 0081 8000 6121 00004DF6 6606 bne.s xbuserrv Not correct ROM header 6122 00004DF8 4EF9 0081 jmp tbuserrv Use Test ROM Vector 87FA 6123 00004DFE 4EF8 FFFA xbuserrv jmp buserrv 6124 00004E02 4FF8 0100 hbusfake lea fake_stack,sp Reset Stack pointer 6125 00004E06 4ED6 jmp (a6) Return via a6 6126 6127 ****************************************************************************** 6128 * BOOTR_BUSERROR: Bus Error Handler For Booter Operations * 6129 * Fixed to handle 68010 also. * 6130 ****************************************************************************** 6131 00004E08 4EBA C048 BOOT_BUSERROR jsr cleanup_buserr CLEAN OFF THE STACK PAGE 134 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM EXCEPTION HANDLERS (BOOTROM3)" 6132 00004E0C 4ED6 JMP (A6) USE (A6) AS A VECTOR 6133 6134 ****************************************************************************** 6135 * IGNOREISR: Exception Stub Routine (just RTE's) * 6136 ****************************************************************************** 6137 00004E0E 4E73 IGNOREISR RTE JUST RETURN 6138 6139 ****************************************************************************** 6140 * SETBUS: Initialize Bus Error Vector * 6141 ****************************************************************************** 6142 00004E10 31FC 4EF9 SETBUS MOVE.W #JMPOP,BUSERRV FFFA 6143 00004E16 21FC 0000 MOVE.L #BOOT_BUSERROR,BUSERRV+2 4E08 FFFC 6144 00004E1E 4E75 RTS 6145 6146 ****************************************************************************** 6147 * DIE: Hang forever * 6148 ****************************************************************************** 6149 00004E20 31FC 4EF9 DIE MOVE.W #JMPOP,LVL7V IGNORE NMI FF9A 6150 00004E26 21FC 0000 MOVE.L #IGNOREISR,LVL7V+2 4E0E FF9C 6151 00004E2E 6004 BRA.S WAITNMI2 WAIT FOR POWER OFF 6152 6153 ****************************************************************************** 6154 * WAITFORNMI: Wait for NMI * 6155 ****************************************************************************** 6156 00004E30 4E72 2600 WAITFORNMI STOP #$2600 ALLOW IGNORED NMI'S 6157 00004E34 4E72 2700 WAITNMI2 STOP #$2700 WAIT FOR NEW NMI INTERUPTS 6158 00004E38 60FA BRA WAITNMI2 6159 6160 ****************************************************************************** 6161 * TRPN: Pascal Illegal Trap Handler * 6162 ****************************************************************************** 6163 00004E3A 3B7C 0006 trpn move #ec_bad_error_state,-2(a5) Escape with the Unexpected FFFE 6164 6165 ****************************************************************************** 6166 * TRP10RT: Pascal Trap 10 Handler * 6167 ****************************************************************************** 6168 00004E40 2E6D FFF6 trp10rt movea.l sysglobals-10(a5),sp 6169 00004E44 4E75 rts 6170 6171 ****************************************************************************** 6172 * RTN_TO_MONITOR: ($1A0) System Comes Here on Control-Reset * 6173 ****************************************************************************** 6174 0000 4E46 RTN_TO_MONITOR EQU * SYSTEM COULD COME HERE ON 6175 * CONTROL SHIFT PAUSE COMBO. 6176 00004E46 3F38 FFFA MOVE.W BUSERRV,-(SP) SAVE BUS ERROR VECTOR CONTENTS 6177 00004E4A 2F38 FFFC MOVE.L BUSERRV+2,-(SP) 6178 00004E4E 31FC 4EF9 MOVE.W #JMPOP,BUSERRV SET BUS ERROR VECTOR FFFA 6179 00004E54 21FC 0000 MOVE.L #NO_MONITOR,BUSERRV+2 TO GOTO POWERON IF NO MONITOR 4E72 FFFC 6180 00004E5C 0C79 4EF9 CMPI.W #JMPOP,MONITOR CHECK MONITOR 0088 0000 PAGE 135 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM EXCEPTION HANDLERS (BOOTROM3)" 6181 00004E64 6610 BNE.S NO_MONIT2 NO MONITOR LOADED OR START VECTOR IS DAMAGED 6182 00004E66 21DF FFFC MOVE.L (SP)+,BUSERRV+2 RESTORE THE BUS ERROR VECTOR 6183 00004E6A 31DF FFFA MOVE.W (SP)+,BUSERRV 6184 00004E6E 588F ADDQ.L #4,SP SKIP OVER THE NORMAL RETURN 6185 00004E70 4E75 RTS ENTER MONITOR VIA GIVEN VECTOR 6186 * 6187 00004E72 4EBA BFDE NO_MONITOR jsr cleanup_buserr CLEAR OFF BUS ERROR JUNK 6188 00004E76 21DF FFFC NO_MONIT2 MOVE.L (SP)+,BUSERRV+2 RESTORE BUS ERROR VECTOR 6189 00004E7A 31DF FFFA MOVE.W (SP)+,BUSERRV 6190 00004E7E 4E75 RTS RETURN TO SYSTEM 6191 6192 ****************************************************************************** 6193 * NMI_DECODE: ($1B0) NMI Vector Decoder: Find out what caused the NMI and * 6194 * vector to the appropriate pseudo vector * 6195 ****************************************************************************** 6196 00004E80 4A38 FDCD nmi_decode tst.b battery Is there a Battery? 6197 00004E84 670E beq.s nmi_decode1 No, Don't check it 6198 00004E86 0839 0002 btst #2,batterystatus Did Battery Do it? 0045 8021 6199 00004E8E 6704 beq.s nmi_decode1 No, Then look elsewhere 6200 00004E90 4EF8 FF28 jmp batteryvector Yes, Go thru it's soft link 6201 00004E94 0838 0003 nmi_decode1 btst #3,sysflag Is there a Keyboard? FED2 6202 00004E9A 660A bne.s nmi_decode2 No, then use other_nmi_v 6203 00004E9C 0839 0002 btst #2,int_hpibstatus Did Keyboard Do it? 0047 8005 6204 00004EA4 6604 bne.s nmi_decode3 Yes, then find out type 6205 00004EA6 4EF8 FF22 nmi_decode2 jmp other_nmi_v Some thing on back plane 6206 00004EAA 0839 0002 nmi_decode3 btst #2,kbdstatus Keyboard did it 0042 8003 6207 00004EB2 6604 bne.s nmi_decode4 Keyboard FHS timer did it 6208 00004EB4 4EF8 FF34 jmp kbd_resetv Keyboard Reset did it 6209 00004EB8 4EF8 FF2E nmi_decode4 jmp kbd_fastv Keyboard Fast Handshake Timer 6210 6211 ****************************************************************************** 6212 * CRASH: ($1B8) System Called Crash Routine * 6213 * Uninitialized Vectors Come Here After System Has Started * 6214 ****************************************************************************** 6215 00004EBC 21D7 FDBC CRASH MOVE.L (SP),START_ADDR SAVE THE VECTOR ADDRESS 6216 00004EC0 31FC 4EF9 MOVE.W #JMPOP,TRAP0V SET TRAP TO FORCE SYSTEM MODE FF94 6217 00004EC6 21FC 0000 MOVE.L #CRASH1,TRAP0V+2 4ED0 FF96 6218 00004ECE 4E40 TRAP #0 6219 00004ED0 2078 FED4 crash1 movea.l f_area,a0 Clear/Init Screen 6220 00004ED4 4EA8 0030 jsr winit(a0) 6221 0000 4ED8 crash2 equ * 6222 00004ED8 43F8 FDD2 LEA FUBUFFER,A1 SET FOR MESSAGE PRINT 6223 00004EDC 41FA 099A LEA UNEXPECTED,A0 6224 00004EE0 6100 FE16 BSR MOVEBYTES 6225 00004EE4 2038 FDBC MOVE.L START_ADDR,D0 6226 00004EE8 5D80 SUBQ.L #6,D0 GET ACTUAL VECTOR ADDRESS 6227 00004EEA 6100 FDDA BSR PNT8HEX 6228 00004EEE 4219 CLR.B (A1)+ ADD DELIMITER 6229 00004EF0 41F8 FDD2 LEA FUBUFFER,A0 6230 00004EF4 6100 0790 bsr displin Put-out Message 6231 00004EF8 60FE bra.s * PAGE 136 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM EXCEPTION HANDLERS (BOOTROM3)" 6232 6233 ****************************************************************************** 6234 * BCRASH: Bootrom Crash ROUTINE * 6235 ****************************************************************************** 6236 00004EFA 21D7 FDBC bcrash move.l (sp),start_addr 6237 00004EFE 60D8 bra.s crash2 6238 6239 ****************************************************************************** 6240 * FLPINIT: Handle Floppies that Interrupt at Power-up * 6241 ****************************************************************************** 6242 00004F00 2F0E flpint move.l a6,-(sp) Save a6 6243 00004F02 4DFA 0008 lea flpint1,a6 Handle Bus error 6244 00004F06 1039 0044 move.b cmdreg,d0 Do A Dummy Read of Command C000 6245 00004F0C 31FC 4EB9 flpint1 move #jsrop,flpyvctr Unexpected From Now on FFB8 6246 00004F12 21FC 0000 move.l #bcrash,flpyvctr+2 4EFA FFBA 6247 00004F1A 2C5F movea.l (sp)+,a6 Restore a6 6248 00004F1C 4E73 rte PAGE 137 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LIF INTERNAL MINIFLOPPY LOAD UTILITIES (BOOTROM 6251 ****************************************************************************** 6252 ****************************************************************************** 6253 *** *** 6254 *** LIF Internal Minifloppy Loader Utilities *** 6255 *** *** 6256 *** Entries Supported Externally for Old Systems: *** 6257 *** SOFTLOAD ($188) Direct Call To Loader *** 6258 *** LIFHEAD ($18C) Validate LIF Header *** 6259 *** FINDFILE ($190) Find LIF File Of Given Name And Type *** 6260 *** LOADFILE ($194) Load a File Of 'BLOCKS' *** 6261 *** BLOCKLOAD ($198) Load a Single Block *** 6262 *** *** 6263 ****************************************************************************** 6264 ****************************************************************************** 6265 6266 ****************************************************************************** 6267 * SOFTLOAD: ($188) Direct Call To Loader * 6268 ****************************************************************************** 6269 00004F1E 4E55 FFF6 SOFTLOAD LINK A5,#-10 UTILITY ENTRYPOINT 6270 00004F22 487A 0066 PEA RECOVER1 6271 00004F26 2B4F FFF6 MOVE.L SP,-10(A5) 6272 00004F2A 46FC 2100 MOVE #$2100,SR REDUCE PRIORITY TO ENABLE FLOPPY INTS. 6273 * 6274 * VALIDATE THE HEADER 6275 * 6276 00004F2E 4878 FDB0 PEA BDLENGTH 6277 00004F32 4878 FDB4 PEA BDSTART 6278 00004F36 6100 00B6 BSR LIFHEAD 6279 * 6280 * FIND THE SYSTEM FILE 6281 * 6282 00004F3A 2EBC 0000 MOVE.L #RECOVER2,(SP) 4FAC 6283 00004F40 4878 FDAC PEA BCATENTRY 6284 00004F44 4878 FDC2 PEA SYSNAME FILE NAME 6285 00004F48 3F3C E942 MOVE.W #-5822,-(SP) FILE TYPE 6286 00004F4C 2F38 FDB0 MOVE.L BDLENGTH,-(SP) 6287 00004F50 2F38 FDB4 MOVE.L BDSTART,-(SP) 6288 00004F54 6100 0106 BSR FINDFILE 6289 * 6290 * LOAD THE FILE 6291 * 6292 00004F58 2EBC 0000 MOVE.L #RECOVER3,(SP) 4FB6 6293 00004F5E 2078 FDAC MOVEA.L BCATENTRY,A0 6294 00004F62 21D0 FDC2 MOVE.L (A0),SYSNAME SAVE THE NAME OF THE FILE 6295 00004F66 21E8 0004 MOVE.L 4(A0),SYSNAME+4 FDC6 6296 00004F6C 31E8 0008 MOVE.W 8(A0),SYSNAME+8 FDCA 6297 00004F72 43F8 FDBC LEA START_ADDR,A1 6298 00004F76 22A8 001C MOVE.L 28(A0),(A1) SAVE THE PROGRAM START ADDRESS 6299 00004F7A 2F28 0010 MOVE.L 16(A0),-(SP) SAVE FILE LENGTH 6300 00004F7E 2F28 000C MOVE.L 12(A0),-(SP) SAVE FILE START SECTOR 6301 * 6302 00004F82 6100 014E BSR LOADFILE 6303 * PAGE 138 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LIF INTERNAL MINIFLOPPY LOAD UTILITIES (BOOTROM 6304 00004F86 4E5D SOFTL_XIT UNLK A5 6305 00004F88 4E75 RTS 6306 * 6307 00004F8A 0C6D FFFF RECOVER1 CMPI.W #-1,-2(A5) CHECK FOR NOT LIF HEADER FFFE 6308 00004F90 6712 BEQ.S RECOV1A 6309 00004F92 4280 CLR.L D0 CHECK FOR NO MEDIA OR DOOR OPEN 6310 00004F94 302D FFFE MOVE.W -2(A5),D0 6311 00004F98 80FC 03E8 DIVU #1000,D0 6312 00004F9C 4840 SWAP D0 6313 00004F9E B07C 0050 CMP.W #80,D0 6314 00004FA2 662A BNE.S RECOVER4 6315 00004FA4 08F8 0000 RECOV1A BSET #0,BLFLAGS SET NOT FOUND FLAG FDCC 6316 00004FAA 60DA BRA SOFTL_XIT 6317 * 6318 00004FAC 0C6D FFFF RECOVER2 CMPI.W #-1,-2(A5) NO SYSTEM FILE FFFE 6319 00004FB2 661A BNE.S RECOVER4 6320 00004FB4 60EE BRA RECOV1A GOTO SET NOT FOUND FLAG 6321 * 6322 00004FB6 0C6D FFFF RECOVER3 CMPI.W #-1,-2(A5) FAIL DURING LOAD FFFE 6323 00004FBC 6610 BNE.S RECOVER4 6324 00004FBE 41FA 08CC LEA NOTENOUGH,A0 6325 00004FC2 6100 06C2 BSR DISPLIN 6326 00004FC6 08F8 0001 RECOV3A BSET #1,BLFLAGS SET ERROR FLAG FDCC 6327 00004FCC 60B8 BRA SOFTL_XIT 6328 * 6329 * 6330 * UN EXPECTED ERROR CODE 6331 * 6332 00004FCE 7000 RECOVER4 MOVEQ #0,D0 6333 00004FD0 302D FFFE MOVE.W -2(A5),D0 GET ERROR CODE 6334 00004FD4 43F8 FDD2 LEA FUBUFFER,A1 6335 00004FD8 41FA 0A32 LEA FLOPERR,A0 6336 00004FDC 6100 FD1A BSR MOVEBYTES MOVE TEXT TO BUFFER 6337 00004FE0 6100 20A4 BSR FMSGS BUILD REST OF MESSAGE 6338 00004FE4 41F8 FDD2 LEA FUBUFFER,A0 PUT MSG ON LINE 2 6339 00004FE8 6100 069C BSR DISPLIN 6340 00004FEC 60D8 BRA RECOV3A GOTO SET ERROR FLAG AND EXIT 6341 6342 ****************************************************************************** 6343 * LIFHEAD: ($18C) Validate (Verify) LIF Header * 6344 * Calling Sequence: * 6345 * SP + 8 POINTER TO DIRECTOR LENGTH LONG O * 6346 * SP + 4 POINTER TO DIRECTORY START LONG O * 6347 * SP + 0 RETURN ADDRESS * 6348 ****************************************************************************** 6349 00004FEE 4E55 FFF6 LIFHEAD LINK A5,#-10 GET ROOM FOR TRY SETUP 6350 00004FF2 487A 0044 LIFHEAD1 PEA LHEADERR SET TRY BLOCK 6351 00004FF6 2B4F FFF6 MOVE.L SP,-10(A5) 6352 00004FFA 4878 0000 PEA 0 READ SECTOR ZERO 6353 00004FFE 4878 FDD2 PEA FUBUFFER TO GENERAL BUFFER 6354 00005002 4EBA 2308 JSR FLPYREAD 6355 00005006 4E5D UNLK A5 ALLOW HIGHER LEVEL RECOVER PAGE 139 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LIF INTERNAL MINIFLOPPY LOAD UTILITIES (BOOTROM 6356 * CHECK OUT THE HEADER 6357 00005008 41F8 FDD2 LEA FUBUFFER,A0 6358 0000500C 0C50 8000 CMPI.W #$8000,(A0) 6359 00005010 6642 BNE.S NOTLIF 6360 00005012 0CA8 1000 CMPI.L #$10000000,12(A0) 0000 000C 6361 0000501A 6638 BNE.S NOTLIF 6362 0000501C 4A68 0016 TST.W 22(A0) 6363 00005020 6632 BNE.S NOTLIF 6364 * HEADER CHECKS OUT SO SAVE DIRECTORY INFO 6365 00005022 226F 0004 MOVEA.L 4(SP),A1 DIRECTORY START SECTOR 6366 00005026 22A8 0008 MOVE.L 8(A0),(A1) 6367 0000502A 226F 0008 MOVEA.L 8(SP),A1 DIRECTORY LENGTH 6368 0000502E 22A8 0010 MOVE.L 16(A0),(A1) 6369 00005032 225F MOVEA.L (SP)+,A1 GET RETURN ADDRESS 6370 00005034 504F ADDQ #8,SP CLEAR OFF ARGS 6371 00005036 4ED1 JMP (A1) ALL DONE 6372 * 6373 00005038 0C6D 1F90 LHEADERR CMPI.W #8080,-2(A5) CHECK FOR MEDIA CHANGE FFFE 6374 0000503E 67B2 BEQ LIFHEAD1 IGNORE IT 6375 00005040 0C6D 2378 CMPI.W #9080,-2(A5) FFFE 6376 00005046 67AA BEQ LIFHEAD1 6377 00005048 302D FFFE MOVE.W -2(A5),D0 COPY THE ERROR CODE 6378 0000504C 4E5D UNLK A5 TO CALLERS RECOVER BLOCK 6379 0000504E 3B40 FFFE MOVE.W D0,-2(A5) 6380 00005052 6078 BRA.S ESCAPE COMPLETE THE ESCAPE 6381 00005054 3B7C FFFF NOTLIF MOVE.W #-1,-2(A5) SET ESCAPE CODE -1 FFFE 6382 0000505A 6070 BRA.S ESCAPE FOR NOT LIF DISK 6383 6384 ****************************************************************************** 6385 * FINDFILE: ($190) Find LIF File Of Given Name And Type * 6386 * Calling Sequence: * 6387 * SP + 18 ADDRESS OF CAT ENTRY LONG O * 6388 * SP + 14 ADDRESS OF FILE NAME LONG I * 6389 * SP + 12 FILE TYPE WORD I * 6390 * SP + 8 DIRECTORY SIZE (SECTORS) LONG I * 6391 * SP + 4 DIRECTORY START SECTOR LONG I * 6392 * SP + 0 RETURN ADDRESS * 6393 ****************************************************************************** 6394 0000505C 242F 0004 FINDFILE MOVE.L 4(SP),D2 GET DIR START 6395 00005060 262F 0008 MOVE.L 8(SP),D3 GET DIR LEN 6396 00005064 302F 000C MOVE.W 12(SP),D0 GET FILE TYPE 6397 00005068 206F 000E MOVEA.L 14(SP),A0 GET FILE NAME ADDR 6398 0000506C 286F 0012 MOVEA.L 18(SP),A4 GET ADDR OF CAT ENTRY 6399 00005070 7AFF MOVEQ #-1,D5 6400 00005072 45F8 FDD2 NXTDSECTOR LEA FUBUFFER,A2 6401 00005076 48E7 FCF8 MOVEM.L A0-A4/D0-D5,-(SP) SAVE REGS 6402 0000507A 2F02 MOVE.L D2,-(SP) 6403 0000507C 2F0A MOVE.L A2,-(SP) READ THE NEXT 6404 0000507E 6100 228C BSR FLPYREAD DIRECTORY SECTOR 6405 00005082 4CDF 1F3F MOVEM.L (SP)+,A0-A4/D0-D5 RESTORE REGS 6406 00005086 7208 MOVEQ #8,D1 (8 ENTRIES/SECTOR) 6407 * CHECKTYPE CMP.W 10(A2),D0 CHECK FILE TYPE {1.0 & 2.0} 6408 * BEQ.S CHECKNAME {1.0 & 2.0} PAGE 140 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LIF INTERNAL MINIFLOPPY LOAD UTILITIES (BOOTROM 6409 * CMP.W 10(A2),D5 CHECK LOGICAL EOD {1.0 & 2.0} 6410 * BEQ.S NOTFOUND {1.0 & 2.0} 6411 00005088 BA6A 000A CHECKTYPE CMP.W 10(A2),D5 CHECK LOGICAL EOD {GLL 3.0} 6412 0000508C 6718 BEQ.S NOTFOUND {GLL 3.0} 6413 0000508E B06A 000A CMP.W 10(A2),D0 CHECK FILE TYPE {GLL 3.0} 6414 00005092 6722 BEQ.S CHECKNAME {GLL 3.0} 6415 00005094 BA40 CMP.W D0,D5 IF GIVEN TYPE IS -1 THEN IGNORE 6416 00005096 671E BEQ.S CHECKNAME FILE TYPE 6417 00005098 D4FC 0020 NXTDENTRY ADDA #32,A2 INCREMENT 6418 0000509C 5341 SUBQ #1,D1 TO NEXT ENTRY 6419 0000509E 6EE8 BGT.S CHECKTYPE 6420 000050A0 5242 NXTDFILE ADDQ #1,D2 INCREMENT 6421 000050A2 5343 SUBQ #1,D3 TO NEXT DIRECTORY 6422 000050A4 6ECC BGT.S NXTDSECTOR SECTOR 6423 000050A6 3B7C FFFF NOTFOUND MOVE.W #-1,-2(A5) ESCAPECODE <=-1 FFFE 6424 000050AC 601E BRA.S ESCAPE 6425 000050AE 205F FINDEXIT MOVEA.L (SP)+,A0 GET RETURN ADDRESS 6426 000050B0 DEFC 0012 ADDA #18,SP CLEAR OFF ARGS 6427 000050B4 4ED0 JMP (A0) RETURN 6428 000050B6 2248 CHECKNAME MOVEA.L A0,A1 SAVE NAME POINTER 6429 000050B8 264A MOVEA.L A2,A3 COPY ENTRY POINTER 6430 000050BA 7809 MOVEQ #9,D4 SET CHARACTER COUNTER 6431 000050BC 4A11 CHKNAME1 TST.B (A1) CHECK FOR NULL TO END NAME 6432 000050BE 6708 BEQ.S FOUNDNAME 6433 000050C0 B709 CMPM.B (A1)+,(A3)+ MATCH CHARACTERS 6434 000050C2 56CC FFF8 DBNE D4,CHKNAME1 6435 000050C6 66D0 BNE NXTDENTRY 6436 000050C8 288A FOUNDNAME MOVE.L A2,(A4) STORE THEN CAT ENTRY ADDR. 6437 000050CA 60E2 BRA FINDEXIT 6438 * 6439 * ESCAPE 6440 * 6441 000050CC 2E6D FFF6 ESCAPE MOVEA.L -10(A5),SP 6442 000050D0 4E75 RTS 6443 6444 ****************************************************************************** 6445 * LOADFILE: ($194) Load a File Of 'BLOCKS' * 6446 * Calling Sequence: * 6447 * SP + 8 NUMBER OF SECTORS LONG I * 6448 * SP + 4 START SECTOR LONG I * 6449 * SP + 0 RETURN ADDRESS * 6450 ****************************************************************************** 6451 000050D2 202F 0004 LOADFILE MOVE.L 4(SP),D0 LOAD FIRST SECTOR 6452 000050D6 222F 0008 MOVE.L 8(SP),D1 TOTAL SECTORS 6453 000050DA D280 ADD.L D0,D1 LAST SECTOR + 1 6454 000050DC 610A NEXTBLOCK BSR.S BLOCKLOAD LOAD A BLOCK 6455 000050DE B280 CMP.L D0,D1 ALL DONE ? 6456 000050E0 66FA BNE NEXTBLOCK 6457 000050E2 205F MOVEA.L (SP)+,A0 YES; SO GET RETURN ADDR. 6458 000050E4 504F ADDQ #8,SP CLEAR OFF ARGS 6459 000050E6 4ED0 JMP (A0) READ 6460 6461 ****************************************************************************** 6462 * BLOCKLOAD: ($198) Load a Single Block * 6463 * D0 IS START SECTOR/ NEXT SECTOR TO READ * 6464 * D1 IS LAST SECTOR OF THE FILE (Not Used or Destroyed) * PAGE 141 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LIF INTERNAL MINIFLOPPY LOAD UTILITIES (BOOTROM 6465 ****************************************************************************** 6466 000050E8 48E7 C000 BLOCKLOAD MOVEM.L D0-D1,-(SP) SAVE THE SECTOR INFO 6467 000050EC 2F00 MOVE.L D0,-(SP) READ THE FIRST SECTOR 6468 000050EE 4878 FDD2 PEA FUBUFFER INTO GENERAL BUFFER 6469 000050F2 6100 2218 BSR FLPYREAD 6470 000050F6 4CDF 0003 MOVEM.L (SP)+,D0-D1 RESTORE REGS 6471 000050FA 5280 ADDQ.L #1,D0 INC CURRENT SECTOR 6472 000050FC 43F8 FDDA LEA FUBUFFER+8,A1 SET FROM ADDRESS 6473 00005100 2078 FDD2 MOVEA.L FUBUFFER,A0 READ BLOCK LOAD ADDR. 6474 00005104 2438 FDD6 MOVE.L FUBUFFER+4,D2 READ BLOCK LENGTH IN BYTES 6475 00005108 B1F8 FDCE CMPA.L LOWRAM,A0 CHECK LOAD ADDRESS AGAINS LOW BOUND 6476 0000510C 6C08 BGE.S LOAD_OK 6477 0000510E 3B7C FFFF MOVE.W #-1,-2(A5) LOAD ADDRESS IS BELOW MIN USABLE RAM FFFE 6478 00005114 60B6 BRA ESCAPE 6479 00005116 2602 LOAD_OK MOVE.L D2,D3 CALC 6480 00005118 5083 ADDQ.L #8,D3 6481 0000511A 0283 FFFF ANDI.L #$FFFFFF00,D3 TOTAL SECTORS IN THIS BLOCK FF00 6482 00005120 4A83 TST.L D3 ONLY ONE SECTOR ? 6483 00005122 6762 BEQ.S MOVELAST 6484 * MAYBE NOT 6485 * MOVE THE FIRST SECTOR INTO PLACE 6486 00005124 283C 0000 MOVE.L #256-9,D4 SET MOVE COUNT 00F7 6487 0000512A 10D9 MOVEL1 MOVE.B (A1)+,(A0)+ MOVE THE CODE 6488 0000512C 51CC FFFC DBRA D4,MOVEL1 6489 00005130 0482 0000 SUBI.L #256-8,D2 DECRIMENT BYTE COUNT 00F8 6490 00005136 6730 BEQ.S BLOCKEXIT IS THERE ONLY ONE SECTOR ? 6491 * NO 6492 * Entry Point used by Boot Drivers 6493 * D2.L = Byte Count 6494 * A0.L = RAM Address 6495 * D0.L = Start Address 6496 * 6497 * 6498 00005138 2602 BLOCKLOAD1 MOVE.L D2,D3 ARE THERE MORE THAN TWO ? 6499 0000513A 0283 FFFF ANDI.L #$FFFFFF00,D3 FF00 6500 00005140 6728 BEQ.S READLAST 6501 * NO 6502 * READ AND MOVE WHOLE SECTORS 6503 00005142 E08B LSR.L #8,D3 CALC # OF SECTORS 6504 00005144 48E7 F080 MOVEM.L A0/D0-D3,-(SP) SAVE NEEDED REGS 6505 00005148 2F03 MOVE.L D3,-(SP) # SECTORS 6506 0000514A 2F00 MOVE.L D0,-(SP) START SECTOR 6507 0000514C 2F08 MOVE.L A0,-(SP) LOAD ADDRESS 6508 0000514E 6100 1E54 BSR FLPYMREAD 6509 00005152 4CDF 010F MOVEM.L (SP)+,A0/D0-D3 RESTORE REGS 6510 00005156 2803 MOVE.L D3,D4 CALC NEXT LOAD ADDRESS 6511 00005158 C8FC 0100 MULU #256,D4 6512 0000515C D1C4 ADDA.L D4,A0 6513 0000515E D083 ADD.L D3,D0 INCREMENT SECTOR # 6514 00005160 0282 0000 ANDI.L #$000000FF,D2 CALC REMAINING BYTES 00FF 6515 00005166 6602 BNE.S READLAST PAGE 142 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM LIF INTERNAL MINIFLOPPY LOAD UTILITIES (BOOTROM 6516 00005168 4E75 BLOCKEXIT RTS ALL DONE 6517 * LAST SECTOR IS PARTIALY FULL 6518 0000516A 48E7 F080 READLAST MOVEM.L A0/D0-D3,-(SP) SAVE REGS 6519 0000516E 2F00 MOVE.L D0,-(SP) 6520 00005170 4878 FDD2 PEA FUBUFFER LAST SECTOR IS PARTIAL 6521 00005174 6100 2196 BSR FLPYREAD 6522 00005178 4CDF 010F MOVEM.L (SP)+,A0/D0-D3 RESTORE REGS 6523 0000517C 5280 ADDQ.L #1,D0 INCREMENT SECTOR # 6524 0000517E 43F8 FDD2 LEA FUBUFFER,A1 SET FROM ADDRESS 6525 00005182 5342 SUBQ #1,D2 SET MOVE COUNT 6526 00005184 10D9 MOVEL2 MOVE.B (A1)+,(A0)+ 6527 00005186 51CA FFFC MOVELAST DBRA D2,MOVEL2 6528 0000518A 4E75 RTS ALL DONE 6529 6531 include ../BROM/TIMER 6532 * sccs info: @(#) timer 8.1 84/05/04 00:19:09 * 6533 6534 6535 ************************************************************************* 6536 * 6537 * HOW TO USE TIMER ROUTINES: 6538 * 6539 * To make a delay: 6540 * 6541 * move.l #delay_in_microsecs,(sp)- 6542 * jsr delay (parameter popped by routine) 6543 * 6544 * To check a condition until time out: 6545 * 6546 * pea (loc_of_time_value) 6547 * jsr read_timer Retrns timeout time at loc_of_time_value 6548 * 6549 * [check condition] 6550 * [if condition met branch] 6551 * [otherwise] 6552 * 6553 * chk_t pea (loc_of_time_value) Push timeout time 6554 * jsr check_timer 6555 * bpl chk_t 6556 * 6557 * INIT_TIMER must be executed before any of the other timer 6558 * routines will work (it calls look_for_timer). 6559 * 6560 ************************************************************************* 6561 nosyms 6562 6563 * timer_absent equ 1 1 if there is no timer, 0 if there is 6564 * M68000 equ 2 1 for 68000, 0 for 68010/12 6565 6566 * trap14vec equ $ffffff40 trap 14 vector 6567 6568 def start_timer,check_timer,delay,milli_to_micro 6569 6570 ************************************************************************* 6571 * read_timer read the timer 6572 * d0.l will contain timer value 6573 ************************************************************************* PAGE 143 [3.3a] 6/29/89 08:33:30 "4.0 BOOT ROM TIMER ROUTINES (TIMER)" 6574 6575 0000 518C read_timer equ * return timer value in d0.L 6576 0000518C 41F9 005F lea $5f8000,a0 address of timer 8000 6577 00005192 0148 0009 movep.l 9(a0),d0 read counter 2 and 3 6578 00005196 0348 0009 movep.l 9(a0),d1 read them again 6579 0000519A B181 eor.l d0,d1 see if the upper word has changed 6580 0000519C 4841 swap d1 6581 0000519E 4A41 tst.w d1 6582 000051A0 6704 beq.s rtskp1 6583 000051A2 4841 swap d1 6584 000051A4 B380 eor.l d1,d0 use second reading if MSW has changed 6585 000051A6 4E75 rtskp1 rts 6586 6587 6588 ************************************************************************* 6589 * 6590 * milli_to_micro 6591 * 6592 * ASSUMES: 6593 * - sp+4 contains pointer to the location of a millisecond value 6594 * (long integer) 6595 * 6596 * RETURNS: 6597 * - equivalent value in microseconds at same location 6598 * 6599 * 6600 * OVERHEAD: 6601 * - 25 us of overhead time is subtracted by this routine. 6602 * this time includes time for the execution of this routine 6603 * as well as time to jsr and rts to and from this routine. 6604 * 6605 ************************************************************************* 6606 6607 0000 51A8 milli_to_micro equ * 6608 000051A8 48E7 8080 movem.l d0/a0,-(sp) save registers 6609 000051AC 206F 000C movea.l 12(sp),a0 put location of millisec value in a0 6610 000051B0 2F6F 0008 move.l 8(sp),12(sp) move up return address 000C 6611 000051B6 2010 move.l (a0),d0 move into d reg to multiply by 1000 6612 000051B8 ED88 lsl.l #6,d0 64n 6613 000051BA 9090 sub.l (a0),d0 63n 6614 000051BC E388 lsl.l #1,d0 126n 6615 000051BE 9090 sub.l (a0),d0 125n 6616 000051C0 E788 lsl.l #3,d0 1000n (micro seconds) 6617 000051C2 90BC 0000 sub.l #25,d0 subtract out 25us of overhead for conversion 0019 6618 000051C8 2080 move.l d0,(a0) write new (micro second) value to location 6619 000051CA 4CDF 0101 movem.l (sp)+,d0/a0 restore registers 6620 000051CE 588F addq.l #4,sp clean up stack (get rid of extra rtn addr) 6621 000051D0 4E75 rts 6622 6623 6624 ************************************************************************* 6625 * start_timer timing setup 6626 * 6627 * ASSUMES: PAGE 144 [3.3a] 6/29/89 08:33:30 "4.0 BOOT ROM TIMER ROUTINES (TIMER)" 6628 * - check for presence of timer was made by calling routine 6629 * - sp+4 points to location of delay in microseconds (long integer) 6630 * 6631 * RETURNS: 6632 * - value of timer at timeout in location pointed to by sp+4 6633 * 6634 * OVERHEAD: 6635 * - The 16 us overhead subtracted from the delay time includes 6636 * a) time for calling routine to check for timer 6637 * presence, push us value onto stack and jsr to this 6638 * routine, 6639 * b) execution of this routine up until, and including 6640 * bsr to READ_TIMER, 6641 * c) execution of READ_TIMER up until, and including 6642 * the second movep.l, 6643 * d) execution of bpl after timer has expired (see 6644 * comment on CHECK_TIMER). 6645 ************************************************************************* 6646 6647 0000 51D2 start_timer equ * 6648 000051D2 48E7 C080 movem.l d0-d1/a0,-(sp) 6649 000051D6 61B4 bsr read_timer read current time value 6650 000051D8 206F 0010 movea.l 16(sp),a0 get delay time 6651 000051DC 2210 move.l (a0),d1 (d1 = delay in us) 6652 000051DE 92BC 0000 sub.l #16,d1 subtract out overhead (16 us) 0010 6653 000051E4 E489 lsr.l #2,d1 divide by 4 to get 6654 * d1 = delay in tics (1 tic = 4 us) 6655 * lsr.l #3,d1 (temporary) d1 = delay in tics (1 tic = 32 us) 6656 000051E6 9081 sub.l d1,d0 d0 = timeout value 6657 000051E8 2080 move.l d0,(a0) put timeout value back at a0 location 6658 000051EA 4CDF 0103 movem.l (sp)+,d0-d1/a0 6659 000051EE 2E9F move.l (sp)+,(sp) 6660 000051F0 4E75 rts 6661 6662 ************************************************************************* 6663 * check_timer check the timer 6664 * 6665 * ASSUMES: 6666 * - sp+4 contains timeout variable (set up by start_timer) 6667 * (Note that this variable must be popped of the stack by 6668 * the calling routine after either the time has expired or 6669 * a condition has been met) 6670 * - calling routine has done check for timer 6671 * - calling routine uses bpl or bmi to check for timeout (bpl will branch 6672 * if not timed out yet) 6673 * - any code between start_timer and check_timer is aware of parameter on 6674 * stack and, after time out or condition met, parameter is popped 6675 ************************************************************************* 6676 6677 0000 51F2 check_timer equ * 6678 000051F2 48E7 C080 movem.l d0-d1/a0,-(sp) save registers 6679 000051F6 6194 bsr read_timer d0 = timer value 6680 000051F8 206F 0010 movea.l 16(sp),a0 a0 = ^timeout value 6681 000051FC 2F6F 000C move.l 12(sp),16(sp) move rtn addr to where old param was 0010 6682 00005202 B090 cmp.l (a0),d0 check for timeout PAGE 145 [3.3a] 6/29/89 08:33:30 "4.0 BOOT ROM TIMER ROUTINES (TIMER)" 6683 00005204 4CDF 0103 movem.l (sp)+,d0-d1/a0 restore registers 6684 00005208 588F addq.l #4,sp pop extra copy of retn addr 6685 0000520A 4E75 rts 6686 6687 ************************************************************************* 6688 * delay wait for specified amount of time 6689 * 6690 * ASSUMTIONS: 6691 * - sp+4 contains the amount of time to wait in microseconds 6692 * (long integer) 6693 * 6694 ************************************************************************* 6695 6696 0000520C 48E7 C080 delay movem.l d0-d1/a0,-(sp) 6697 00005210 41F9 005F lea $5f8000,a0 address of timer 8000 6698 00005216 0148 0009 movep.l 9(a0),d0 read counter 2 and 3 6699 0000521A 0348 0009 movep.l 9(a0),d1 read them again 6700 0000521E B181 eor.l d0,d1 see if the upper word has changed 6701 00005220 4841 swap d1 6702 00005222 4A41 tst.w d1 6703 00005224 6704 beq.s dlskp1 6704 00005226 4841 swap d1 6705 00005228 B380 eor.l d1,d0 use second reading if MSW has changed 6706 0000522A 222F 0010 dlskp1 move.l 16(sp),d1 d1 = delay in microseconds 6707 0000522E E489 lsr.l #2,d1 d1 = delay in tics (1 tic = 4 us) 6708 00005230 5B81 subq.l #5,d1 subtract overhead outside loop (20us) 6709 * lsr.l #3,d1 (temporary) d1 = delay in tics (1 tic = 32 us) 6710 00005232 9081 sub.l d1,d0 d0 = timeout value 6711 6712 00005234 0348 0009 dlloop1 movep.l 9(a0),d1 read counter 2 and 3 6713 00005238 B280 cmp.l d0,d1 compare timer value to timeout value 6714 0000523A 6AF8 bpl.s dlloop1 branch back if not timed out 6715 0000523C 4CDF 0103 movem.l (sp)+,d0-d1/a0 restore registers 6716 00005240 2E9F move.l (sp)+,(sp) pop off parameter 6717 00005242 4E75 rts 6718 * 6719 * This code not used, but left in, commented, in case I decide to use it 6720 * later. 6721 * 6722 * Use timing loop if no timer is present. 6723 * Number of cycles = 230+31n 6724 * 6725 *dlskp2 move.l 16(sp),d1 d1 = delay in microseconds 6726 * lsr.l #2,d1 d1 = number of loops (1 loop = 4 us) 6727 * subq.l #7,d1 subtract overhead outside loop (230/31) 6728 *dlloop2 subq.l #1,d1 timing loop 6729 * nop 6730 * nop 6731 * bpl.s dlloop2 6732 * movem.l (sp)+,d0-d1/a0 6733 * move.l (sp)+,(sp) pop parameter 6734 * rts PAGE 146 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 6737 include GREG:BOOTHI 6738 * sccs info: @(#) boothi 8.1 84/05/04 00:11:54 * 6739 6740 ****************************************************************************** 6741 ****************************************************************************** 6742 *** *** 6743 *** BOOTROM 3.0 Human Interface Drivers *** 6744 *** *** 6745 *** CRT Layout during BOOTROM 3.0 Control of Machine *** 6746 *** *** 6747 *** CRT Utility Entries Supported Externally for Old Systems: *** 6748 *** CRTINIT ($13C) Initialize CRT Registers R0-R11 *** 6749 *** CRTCLEAR ($148) Initialize and Clear CRT *** 6750 *** CRTBLANK ($14C) Clear CRT Memory (Blank) *** 6751 *** CRTMSG ($150) Put Single Line of Text on CRT *** 6752 *** GRPHCLEAR ($158) Clear Graphics Ram (Zero) *** 6753 *** *** 6754 *** CRT Utility Routines Internal to the BOOTROM: *** 6755 *** CRT_FIND Determines which CRT Type and Initializes *** 6756 *** CRT_INIT Initializes CRT via CRT Table Number *** 6757 *** HI_RES_INIT Initializes hi res CRT (gator) via ID ROM *** 6758 *** PUTMSG Put Message Structure on the Screen *** 6759 *** CLRLINE Clear line d0 by filling with blanks *** 6760 *** MENUCLR Clear menu area *** 6761 *** SFTMSG Put out a message in the self-test area *** 6762 *** DISPLIN Put out a Message to Next to Bottom Line *** 6763 *** WINIT_A Initializes CRT and Vectors *** 6764 *** WTB_A Writes Character in D0 at Printhead *** 6765 *** TABXY_A Sets Printhead to X(D0), Y(D1) *** 6766 *** WINIT_HR Initializes CRT and Vectors for hi res crt *** 6767 *** WTB_HR Writes Character in D0 at Prthead for gator *** 6768 *** TABXY_HR Sets Printhead to X(D0),Y(D1) for hi res crt *** 6769 *** GETFONT Gets correct font for High Res CRT *** 6770 *** DSP_RI_ERROR Display Read Interface Error Message *** 6771 *** BUILDMSUS Build MSUS String at (a0)+ msus=d1 *** 6772 *** *** 6773 *** Dummy CRT Utility Routines Internal to the BOOTROM: *** 6774 *** WINIT_D Initializes CRT and Vectors *** 6775 *** WTB_D Writes Character in D0 at Printhead *** 6776 *** TABXY_D Sets Printhead to X(D0), Y(D1) *** 6777 *** *** 6778 *** KEYBOARD Utility Entries Supported Externally for Old Systems: *** 6779 *** KBD_NO_INT ($15C) Wait for NMI to Clear *** 6780 *** KBD_CWAIT ($160) Wait for Last Command *** 6781 *** KBD_WCMD ($164) Write Command *** 6782 *** KBD_WDATA ($168) Write Data *** 6783 *** KBD_RDATA ($16C) Read Data *** 6784 *** READ_KEYS ($1C4) Read and Translate a Key *** 6785 *** KTRANS ($154) $3C to $7D USASCII Keycode Table *** 6786 *** BEEP ($1C8) Cause Keyboard to Beep Programably *** 6787 *** *** 6788 *** KEYBOARD Utility Routines Internal to the BOOTROM: *** 6789 *** READ_TRNS Translate entry into READ_KEYS *** 6790 *** IGNOREKBD Stop Keyboard NMI and Ignore It *** 6791 *** R_NMI Keyboard NMI handler *** 6792 *** RINIT_A Initialize Input Device *** 6793 *** RSTATUS_A Check for Input Character Available *** PAGE 147 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 6794 *** RDB_A Get Input Character Into D0.b *** 6795 *** KBDISR Input Interrupt Service Handler *** 6796 *** CONFMODE Configure Mode Supervisor *** 6797 *** KEYPROC Booter Menu Keyprocessor *** 6798 *** KEYDISP Display Menu Keyprocessor state *** 6799 *** LOCK Lock out Keyboard Resets *** 6800 *** UNLOCK Unlock Keyboard Resets, Service any pending *** 6801 *** *** 6802 *** Dummy KEYBOARD Utility Routines Internal to the BOOTROM: *** 6803 *** RINIT_D Initialize Input Device *** 6804 *** *** 6805 ****************************************************************************** 6806 ****************************************************************************** PAGE 148 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 6808 ****************************************************************************** 6809 * CRT Layout during BOOTROM 3.0 Control of Machine * 6810 * * 6811 * Line Columns * 6812 * 1 26 Width-3 Width * 6813 * | | | | * 6814 * ------------------------------------------------------- * 6815 * 1 | BOOTROM Ver. | Booter MENU | * 6816 * 2 | Memory Avail. | or CONFIGURE Mode MENU | * 6817 * ... | Self-Test | | * 6818 * Height-2 | Results | | * 6819 * ------------------------------------------------------- * 6820 * Height-1 | Error or Mode Indicator Line | * 6821 * ------------------------------------------------------- * 6822 * Height | Tells what RESET and CNTRL-RESET Do 15B | * 6823 * ------------------------------------------------------- * 6824 * * 6825 * Three characters in lower right corner indicate keyprocessor state. * 6826 ****************************************************************************** 6827 6828 ****************************************************************************** 6829 * CRTINIT: ($13C) Initialize 6845 registers R0-R11 * 6830 ****************************************************************************** 6831 00005244 48E7 E480 crtinit movem.l a0/d0-d2/d5,-(sp) Save Registers 6832 00005248 2078 FED4 movea.l f_area,a0 6833 0000524C 1A28 000B move.b booleans(a0),d5 Get 50/60 Hz Selector 6834 00005250 7404 crtinit1 moveq #4,d2 Skip R15-R12 6835 00005252 6106 bsr.s crt_find Initialize the CRT Controller 6836 00005254 4CDF 0127 movem.l (sp)+,a0/d0-d2/d5 Restore Registers 6837 00005258 4E75 rts 6838 6839 ****************************************************************************** 6840 * crt_find: Routine to Determine which CRT and then initialize it * 6841 * d5 is copy of H_50_60 * 6842 * If sp A1 7218 0000557A 317C 0080 move #128,g_rrr(a0) set repl rule reg to clear 4008 7219 00005580 317C 0000 move #0,g_wwr(a0) set window width to get whole line 400C 7220 7221 00005586 12BC 0000 gatorclear1 move.b #00,(a1) write any thing to line 7222 0000558A D3C2 adda.l d2,a1 go to addr of next line (add width) 7223 7224 0000558C 0828 0007 gatorclear2 btst #7,gstat(a0) check busybit 4001 7225 00005592 67F8 beq gatorclear2 wait till clear 7226 7227 00005594 51C8 FFF0 dbra d0,gatorclear1 do next line 7228 7229 00005598 BEFC 0100 cmpa.w #fake_stack,sp check for RAM available 7230 0000559C 6300 0008 bls gatorclear3 7231 000055A0 4CDF 030F movem.l (sp)+,a0-a1/d0-d3 restore regs 7232 000055A4 4E75 rts 7233 000055A6 4ED4 gatorclear3 jmp (a4) if none, return thru a4 7234 7235 ****************************************************************************** 7236 * PUTMSG: Put Message at A0 on line d0 * 7237 * PUTMSG1: Put out String at A0 to current CRT position * 7238 ****************************************************************************** 7239 000055A8 48E7 C0C0 putmsg1 movem.l a0-a1/d0-d1,-(sp) Save Registers 7240 000055AC 2278 FED4 movea.l f_area,a1 7241 000055B0 6010 bra.s putmsg0 7242 000055B2 48E7 C0C0 putmsg movem.l a0-a1/d0-d1,-(sp) Save Registers 7243 000055B6 2278 FED4 movea.l f_area,a1 7244 000055BA 3200 move d0,d1 7245 000055BC 7001 moveq #1,d0 Tabxy to d0,(A0)+ 7246 000055BE 4EA9 003C jsr tabxy(a1) 7247 000055C2 4240 putmsg0 clr d0 No Highlights 7248 000055C4 1018 putmsg2 move.b (a0)+,d0 7249 000055C6 6706 beq.s putmsg3 Terminate on Null 7250 000055C8 4EA9 0036 jsr wtb(a1) Print a Character 7251 000055CC 60F6 bra.s putmsg2 7252 000055CE 4CDF 0303 putmsg3 movem.l (sp)+,a0-a1/d0-d1 Restore Registers 7253 000055D2 4E75 rts PAGE 158 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7254 7255 ****************************************************************************** 7256 * CLRLINE: Clear line d0 by filling with blanks * 7257 ****************************************************************************** 7258 000055D4 48E7 C008 clrline movem.l a4/d0-d1,-(sp) Save Registers 7259 000055D8 2878 FED4 movea.l f_area,a4 Point to LOWRAM area 7260 000055DC 3200 move d0,d1 tabxy 1,d0 7261 000055DE 7001 moveq #1,d0 7262 000055E0 4EAC 003C jsr tabxy(a4) 7263 000055E4 4240 clr d0 7264 000055E6 B26C 0052 cmp height(a4),d1 7265 000055EA 6602 bne.s clrline0 7266 000055EC 70FF moveq #-1,d0 If Last Line do one less space 7267 * to prevent a terminal from 7268 * scrolling 7269 000055EE 322C 0046 clrline0 move width(a4),d1 7270 000055F2 D240 add d0,d1 Offset 7271 000055F4 303C 0020 move #$20,d0 7272 000055F8 4EAC 0036 clrline1 jsr wtb(a4) 7273 000055FC 5341 subq #1,d1 7274 000055FE 6EF8 bgt.s clrline1 7275 00005600 4CDF 1003 movem.l (sp)+,a4/d0-d1 Restore Registers 7276 00005604 4E75 rts 7277 7278 7279 ****************************************************************************** 7280 * MENUCLR: Clear menu area * 7281 ****************************************************************************** 7282 00005606 48E7 E008 menuclr movem.l a4/d0-d2,-(sp) Save Registers 7283 0000560A 2878 FED4 movea.l f_area,a4 7284 0000560E 322C 0052 move height(a4),d1 Blank lines height-2 thru 1 7285 00005612 5541 subq #2,d1 7286 00005614 302C 0046 menuclr1 move width(a4),d0 Start at X=width/2+2 7287 00005618 E248 lsr #1,d0 7288 0000561A 5240 addq #1,d0 7289 0000561C 4EAC 003C jsr tabxy(a4) Position Printhead 7290 00005620 7020 moveq #$20,d0 Use space with No Highlights 7291 00005622 342C 0046 move width(a4),d2 Blank width/2 7292 00005626 E24A lsr #1,d2 7293 00005628 4EAC 0036 menuclr2 jsr wtb(a4) Put out Blank 7294 0000562C 5342 subq #1,d2 7295 0000562E 6EF8 bgt.s menuclr2 7296 00005630 5341 subq #1,d1 Point to next line 7297 00005632 6EE0 bgt.s menuclr1 7298 00005634 4CDF 1007 movem.l (sp)+,a4/d0-d2 Restore Registers 7299 00005638 4E75 rts 7300 7301 ****************************************************************************** 7302 * SFTMSG: Put out a message in the self-test area * 7303 * Message is a null terminated string at (a0). * 7304 * Line to place message is nxt_sline(a4) where a4=f_area * 7305 * Routine also increments nxt_sline(a4) * 7306 ****************************************************************************** 7307 0000563A 48E7 C088 sftmsg movem.l a0/a4/d0-d1,-(sp) Save Registers 7308 0000563E 2878 FED4 movea.l f_area,a4 Point to Lowram area 7309 00005642 7001 moveq #1,d0 tabxy 1,nxt_sline 7310 00005644 322C 02D4 move nxt_sline(a4),d1 PAGE 159 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7311 00005648 4EAC 003C jsr tabxy(a4) 7312 0000564C 526C 02D4 addq #1,nxt_sline(a4) Increment nxt_sline 7313 00005650 302C 0052 move height(a4),d0 7314 00005654 5540 subq #2,d0 7315 00005656 B06C 02D4 cmp nxt_sline(a4),d0 Wrap around if it goes past 7316 0000565A 6C06 bge.s sftmsg1 height-2 7317 0000565C 397C 0001 move #1,nxt_sline(a4) 02D4 7318 00005662 322C 0046 sftmsg1 move width(a4),d1 Don't go past width of area 7319 00005666 E249 lsr #1,d1 7320 00005668 1018 sftmsg2 move.b (a0)+,d0 Copy the characters 7321 0000566A 670E beq.s sftmsg4 Stop on a null 7322 0000566C 4EAC 0036 jsr wtb(a4) Write a character 7323 00005670 5341 subq #1,d1 7324 00005672 6EF4 bgt.s sftmsg2 7325 00005674 4CDF 1103 sftmsg3 movem.l (sp)+,a0/a4/d0-d1 7326 00005678 4E75 rts 7327 0000567A 7020 sftmsg4 moveq #' ',d0 Blank rest of line 7328 0000567C 4EAC 0036 sftmsg5 jsr wtb(a4) 7329 00005680 5341 subq #1,d1 7330 00005682 6EF8 bgt.s sftmsg5 7331 00005684 60EE bra.s sftmsg3 7332 7333 ****************************************************************************** 7334 * DISPLIN: Put out a Message on next to bottom line * 7335 * Address of Null terminated string is in a0. * 7336 ****************************************************************************** 7337 00005686 48E7 8008 displin movem.l a4/d0,-(sp) Save Registers 7338 0000568A 2878 FED4 movea.l f_area,a4 Point to LOWRAM area 7339 0000568E 302C 0052 move height(a4),d0 Point to next to bottom line 7340 00005692 5340 subq #1,d0 7341 00005694 6100 FF3E bsr clrline Clear the line 7342 00005698 6100 FF18 bsr putmsg Put out the message 7343 0000569C 4CDF 1001 movem.l (sp)+,a4/d0 7344 000056A0 4E75 rts 7345 7346 ****************************************************************************** 7347 * Messages * 7348 ****************************************************************************** 7349 000056A2 52 msg_bad dc.b 'RAM FAILED ABOVE FFC000',0 7350 000056BA 52 msg_miss dc.b 'RAM GONE ABOVE FFC000',0 7351 000056D0 20 memtst dc.b ' TESTING MEMORY',0 7352 000056E0 20 memptst dc.b ' LOADING MEMORY',0 7353 000056F0 20 bootermsg dc.b ' BOOTING A SYSTEM',0 7354 00005702 20 bootscanm dc.b ' SEARCHING FOR A SYSTEM (ENTER To Pause)',0 7355 0000572B 20 bootscanm1 dc.b ' SEARCHING FOR A SYSTEM (RETURN To Pause)',0 7356 00005755 20 bootsp dc.b ' PAUSED (ENTER To Continue)',0 7357 00005771 20 bootsp1 dc.b ' PAUSED (RETURN To Continue)',0 7358 0000578E 20 confmmsg dc.b ' CONFIGURE MODE',0 7359 0000579E 20 selftmsg dc.b ' SELF-TEST MODE',0 7360 000057AE 20 resetmsg dc.b ' RESET To Power-Up',0 7361 000057C1 20 retrymsg dc.b ' RESET TO RE-TRY',0 7362 000057D2 20 bootmsg dc.b ' CONTINUE AT OWN RISK (ENTER To Continue)',0 7363 000057FC 20 bootmsg1 dc.b ' CONTINUE AT OWN RISK (RETURN To Continue)',0 7364 00005827 20 waitmsg dc.b ' WAITING 1 MINUTE (ENTER To Abort Wait)',0 7365 0000584F 20 waitmsg1 dc.b ' WAITING 1 MINUTE (RETURN To Abort Wait)',0 7366 00005878 20 UNEXPECTED DC.B ' UNEXPECTED USE OF ',0 PAGE 160 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7367 0000 588C not_enough equ * 7368 0000 588C NOTENOUGH equ * 7369 0000588C 20 SYS_TOO_BIG DC.B ' NOT ENOUGH MEMORY',0 7370 0000589F 20 sys_too_high dc.b ' SYSTEM WOULD LOAD TOO HIGH',0 7371 000058BB 20 not_found dc.b ' SYSTEM NOT FOUND',0 7372 000058CD 49 badprom dc.b 'ID PROM Failed',0 7373 000058DC 49 noprom dc.b 'ID PROM Not Installed',0 7374 000058F2 39 marmot dc.b '9816',0 7375 000058F7 43 copyright1 dc.b 'Copyright 1984,',0 7376 00005907 48 copyright2 dc.b 'Hewlett-Packard Company.',0 7377 00005920 41 copyright3 dc.b 'All Rights Reserved.',0 7378 00005935 20 blank_line dc.b ' ',0 7379 00005937 4D processor dc.b 'MC68000 Processor',0 7380 00005949 43 badalph dc.b 'CRT Alpha',0 7381 00005953 48 badgator dc.b 'High Resolution CRT',0 7382 00005967 48 goodgator dc.b 'High Resolution CRT',0 7383 0000597B 4B goodkbd dc.b 'Keyboard',0 7384 00005984 43 goodcgr dc.b 'Color Graphics',0 7385 00005993 47 goodgrp dc.b 'Graphics',0 7386 0000599C 42 goodbat dc.b 'Battery',0 7387 000059A4 32 twoflp dc.b '2 Flexible Discs',0 7388 000059B5 46 goodflp dc.b 'Flexible Disc',0 7389 000059C3 48 goodhpib dc.b 'HP-IB',0 7390 000059C9 48 gooddma dc.b 'HP98620',0 7391 000059D1 48 gooddma_a dc.b 'HP98620A',0 7392 000059DA 48 gooddma_b dc.b 'HP98620B',0 7393 000059E3 20 availbyts DC.B ' Bytes',0 7394 000059EA 4D badrammsg DC.B 'Memory Failed at ',0 7395 000059FC 4D misrammsg DC.B 'Memory Gone at ',0 7396 00005A0C 46 floperr dc.b 'F Disc Error ',0 7397 00005A1A 20 ignore dc.b ' Ignored',0 7398 00005A23 20 cardmsg dc.b ' at ',0 7399 00005A28 20 iofail dc.b ' Failed',0 7400 00005A30 20 mismsg dc.b ' Missing',0 7401 00005A39 53 longdefault DC.B 'SYSTEM_',0 7402 00005A41 53 defaultname DC.B 'SYS',0,0,0,0,0,0,0 7403 00005A4B 52 remotemsg dc.b 'Remote Interface at ',0 7404 7405 * Names must be 7 characters or less 7406 00005A60 01 card_list dc.b 1,'HP98624',0 HPIB 7407 00005A69 02 dc.b 2,'HP98626',0 Serial 7408 00005A72 42 dc.b 2+64,'HP98644',0 Low-Cost Serial 7409 00005A7B 03 dc.b 3,'HP98622',0 GPIO 7410 00005A84 04 dc.b 4,'HP98623',0 BCD 7411 00005A8D 05 dc.b 5,'HP98642',0 MUX 7412 00005A96 08 dc.b 8,'HP98625',0 PHI Disc 7413 00005A9F 12 dc.b 18,'HP98640',0 ADC 7414 00005AA8 16 dc.b 22,'HP98695',0 3270 Emulator 7415 00005AB1 1B dc.b 27,'HP98253',0 EPROM Programmer 7416 00005ABA 1C dc.b 28,'HP98627',0 Color Graphics 7417 00005AC3 1D dc.b 29,'HP98633',0 Multiprogrammer I/F 7418 00005ACC 1E dc.b 30,'HP98259',0 Bubbles 7419 00005AD5 00 dc.b 0,'ID',0 Generic I/O Card 7420 00005AD9 48 datacom dc.b 'HP98628',0 Generic ID20 Datacomm Card PAGE 161 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7422 ****************************************************************************** 7423 * WINIT_A: Initializes CRT and Vectors * 7424 * * 7425 * Initialize and Turn on CRT Controller. * 7426 * Blank CRT Memory. * 7427 * if sysflag<0> then * 7428 * begin {50 Wide Display} * 7429 * width:=50;crtst:=$512704;prthead:=$512704; * 7430 * end * 7431 * else * 7432 * begin {80 Wide Display} * 7433 * width:=80;crtst:=$5121A0;prthead:=$5121A0; * 7434 * end; * 7435 * width2:=width*2;height:=25;crtlst:=crtst+height*width2; * 7436 * set_up_vectors; * 7437 ****************************************************************************** 7438 00005AE2 48E7 8080 winit_a movem.l a0/d0,-(sp) Save Registers 7439 00005AE6 2078 FED4 movea.l f_area,a0 Point to LOWRAM area 7440 00005AEA 6100 F8E8 bsr crtclear Clear and Reinit the CRT 7441 00005AEE 0838 0000 winit3 btst #0,sysflag 50 or 80 wide? FED2 7442 00005AF4 6718 beq.s winit4 7443 00005AF6 317C 0032 move #50,width(a0) 50 Wide 0046 7444 00005AFC 217C 0051 move.l #crtma,crtst(a0) Set Start of Display 2704 0042 7445 00005B04 217C 0051 move.l #crtma,prthead(a0) Reset Printhead 2704 004A 7446 00005B0C 6016 bra.s winit5 7447 00005B0E 317C 0050 winit4 move #80,width(a0) 80 Wide 0046 7448 00005B14 217C 0051 move.l #crtmb,crtst(a0) Set Start of Display 21A0 0042 7449 00005B1C 217C 0051 move.l #crtmb,prthead(a0) Reset Printhead 21A0 004A 7450 00005B24 3168 0046 winit5 move width(a0),width2(a0) Characters are every other byte 0048 7451 00005B2A E3E8 0048 lsl width2(a0) 7452 00005B2E 317C 0019 move #25,height(a0) 25 Line Display 0052 7453 00005B34 3028 0052 move height(a0),d0 Compute End of Display Plus One 7454 00005B38 C0E8 0048 mulu width2(a0),d0 7455 00005B3C D0A8 0042 add.l crtst(a0),d0 7456 00005B40 2140 004E move.l d0,crtlst(a0) 7457 00005B44 317C 4EF9 move #jmpop,winit(a0) Set up Vectors 0030 7458 00005B4A 217C 0000 move.l #winit_a,winit+2(a0) 5AE2 0032 7459 00005B52 317C 4EF9 move #jmpop,tabxy(a0) 003C 7460 00005B58 217C 0000 move.l #tabxy_a,tabxy+2(a0) 5D96 003E 7461 00005B60 317C 4EF9 move #jmpop,wtb(a0) 0036 7462 00005B66 217C 0000 move.l #wtb_a,wtb+2(a0) 5C82 0038 7463 00005B6E 4CDF 0101 movem.l (sp)+,d0/a0 Restore Registers PAGE 162 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7464 00005B72 4E75 rts 7465 7466 *************************************************************************** 7467 * 7468 * WINIT_HR 7469 * Initializes CRT and Vectors for High Resolution CRT. 7470 * 7471 * Initialize control registers and clear frame buffer. 7472 * Set up the following locations in f_area: 7473 * 7474 * STARTOFFONT Word offset from start of ROM to 1st byte 7475 * of font space (not first byte of first char 7476 * of font) 7477 * 7478 * CRTST Address of the 1st byte of the FRAME BUFFER 7479 * 7480 * WIDTH Width of DISPLAYED AREA in CHARACTERS 7481 * 7482 * PRTHEAD CHARACTER location of printhead in DISPLAYED 7483 * AREA (where 1st location is 0) -- Initialized 7484 * to zero. 7485 * 7486 * CRTLST Last CHARACTER cell location of DISPLAYED AREA 7487 * 7488 * HEIGHT Height of the DISPLAYED AREA in CHARCTERS 7489 * 7490 * Set up vectors to high resolution, bitmaped CRT routines 7491 * 7492 * Written by Anny Randel. February 15, 1984 7493 * 7494 **************************************************************************** 7495 7496 7497 0000 5B74 winit_hr equ * 7498 7499 00005B74 48E7 F8F8 movem.l a0-a4/d0-d4,-(sp) Save Registers 7500 7501 00005B78 6100 F6E0 bsr crt_find Initialize control registers 7502 * Uses registers a0-a4/d0-d4 7503 7504 00005B7C 6100 F9C2 bsr gatorclear Clear Frame buffer 7505 7506 00005B80 2078 FED4 movea.l f_area,a0 A0 = Pointer to Lowram 7507 7508 * GET STARTOFFONT(A0) 7509 7510 00005B84 6100 00A4 bsr getfont D2 = Start of Font Space 7511 7512 00005B88 0C82 FFFF cmpi.l #-1,d2 Check for no font FFFF 7513 00005B8E 6608 bne.s winit_hr1 7514 00005B90 4CDF 1F1F movem.l (sp)+,a0-a4/d0-d4 Restore registers 7515 00005B94 6000 02AC bra winit_d Set up dummy vectors 7516 7517 0000 5B98 winit_hr1 equ * 7518 00005B98 3142 0048 move.w d2,startoffont(a0) Store in f_area 7519 PAGE 163 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7520 * GET CRTST(A0) 7521 7522 00005B9C 247C 0056 movea.l #HRSEL,a2 A2 = Start of Gator ID ROM 0000 7523 00005BA2 102A 4001 move.b gstat(a2),d0 D0 = Gator Status Register 7524 00005BA6 0280 0000 andi.l #$0F,d0 Clear all but Frame Buffer Bits 000F 7525 00005BAC 223C 0000 move.l #20,d1 0014 7526 00005BB2 E3A8 lsl.l d1,d0 D0 = Frame Buffer address 7527 00005BB4 2140 0042 move.l d0,crtst(a0) Save start of Frame Buffer 7528 7529 * GET HEIGHT(A0) 7530 7531 00005BB8 224A movea.l a2,a1 A1 = Start of ID ROM 7532 00005BBA D2C2 adda.w d2,a1 A1 = Start of font space 7533 00005BBC 1229 0000 move.b cellheight(a1),d1 D1 = Cell Height in pixels 7534 00005BC0 050A 0011 movep.w g_dheight(a2),d2 D2 = Height of Displayed Area in pixels 7535 00005BC4 0282 0000 andi.l #$0FFFF,d2 Clr upper word of d2 FFFF 7536 00005BCA 0241 00FF andi.w #$0FF,d1 Clr upper byte of lower word of d1 7537 00005BCE 84C1 divu d1,d2 D2 = Height of Displayed Area in Chars 7538 00005BD0 3142 0052 move.w d2,height(a0) Save in f_area 7539 7540 * GET WIDTH(A0) 7541 7542 00005BD4 030A 000D movep.w g_dwidth(a2),d1 D1 = Width of Displayed Area in pixels 7543 00005BD8 1029 0002 move.b cellwidth(a1),d0 D0 = Width of character cell in pixels 7544 00005BDC 0281 0000 andi.l #$0FFFF,d1 FFFF 7545 00005BE2 0240 00FF andi.w #$0FF,d0 7546 00005BE6 82C0 divu d0,d1 D1 = Width of Displayed area in Chars 7547 00005BE8 3141 0046 move.w d1,width(a0) Save in f_area 7548 7549 * RESET PRTHEAD 7550 7551 00005BEC 217C 0000 move.l #0,prthead(a0) Reset Printhead 0000 004A 7552 7553 * GET CRTLST(A0) 7554 7555 00005BF4 C4C1 mulu d1,d2 D2 = # of chars in Displayed Area 7556 00005BF6 2142 004E move.l d2,crtlst(a0) Save in f_area 7557 7558 * SET UP VECTORS 7559 7560 00005BFA 317C 4EF9 move #jmpop,winit(a0) Winit_hr 0030 7561 00005C00 217C 0000 move.l #winit_hr,winit+2(a0) 5B74 0032 7562 00005C08 317C 4EF9 move #jmpop,tabxy(a0) Tabxy_hr 003C 7563 00005C0E 217C 0000 move.l #tabxy_hr,tabxy+2(a0) 5DF4 003E 7564 00005C16 317C 4EF9 move #jmpop,wtb(a0) Wtb_hr 0036 PAGE 164 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7565 00005C1C 217C 0000 move.l #wtb_hr,wtb+2(a0) 5CAC 0038 7566 7567 00005C24 4CDF 1F1F movem.l (sp)+,a0-a4/d0-d4 7568 00005C28 4E75 rts 7569 7570 ****************************************************************************** 7571 * 7572 * GETFONT: 7573 * Get font for high resolution CRT from ID ROM; 7574 * Returns offset to start of font (from start of ROM). 7575 * Will only accept a font with ID of 01. This font must be 7576 * U.S. ASCII with depth of one. The offset is returned in 7577 * register d2. THIS ROUTINE WIPES OUT REGISTER D2 !!! 7578 * If there is no good font, then this routine returns 7579 * a -1 in d2. 7580 * 7581 * 7582 * A0 points to start of ID ROM 7583 * A1 points to base of correct font 7584 * 7585 * D0 ascii char to be printed 7586 * D1 offset to font ID 7587 * D2 font counter 7588 * 7589 7590 00005C2A 48E7 C0E0 GETFONT movem.l d0-d1/a0-a2,-(sp) 7591 00005C2E 323C FFFC move.w #-4,D1 d1 = offset to font ID (from start of font) 7592 00005C32 207C 0056 movea.l #hrsel,a0 a0 = location of ID ROM 0000 7593 00005C38 0508 003B movep.w g_font(a0),d2 a1 = pointer to start of font space 7594 00005C3C 2248 movea.l a0,a1 7595 00005C3E D2C2 adda.w d2,a1 7596 00005C40 B47C 0000 cmp.w #0,d2 make sure there's a font there 7597 00005C44 6700 002E beq BADFONT 7598 7599 00005C48 4242 clr.w d2 7600 00005C4A 1429 0000 move.b 0(a1),d2 d2 = # of fonts in ROM 7601 00005C4E 4A02 tst.b d2 must be >0 for any fonts 7602 00005C50 6700 0022 beq BADFONT 7603 00005C54 5342 subq.w #1,d2 subtract one for dbra to follow 7604 7605 00005C56 5C41 GETFNT1 addq.w #6,d1 get font ID offset 7606 00005C58 0C31 0001 cmpi.b #1,0(a1,d1.w) look for US Ascii font ID 1000 7607 00005C5E 6706 beq.s GETFNT2 found it! 7608 00005C60 51CA FFF4 dbra d2,GETFNT1 try the next one 7609 00005C64 600E bra.s BADFONT If it got this far then we didn't find a font 7610 7611 * MOVE OFFSET TO FONT POINTER INTO D0 7612 00005C66 45F1 1002 GETFNT2 lea 2(a1,d1.w),a2 move effective address into a2 7613 00005C6A 050A 0000 movep.w 0(a2),d2 move data word into d2 7614 7615 00005C6E 4CDF 0703 movem.l (sp)+,d0-d1/a0-a2 7616 00005C72 4E75 rts 7617 PAGE 165 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7618 00005C74 08EC 0004 BADFONT bset #mb_badHiRes,m_b(a4) Indicate Hi Res Failure 0054 7619 00005C7A 243C FFFF move.l #-1,d2 FFFF 7620 00005C80 4E75 rts 7621 7622 ****************************************************************************** 7623 * WTB_A: Writes Character in D0 at Printhead * 7624 * Character plus highlight byte in d0 is printed to CRT at prthead. * 7625 * Prthead is then incremented. * 7626 * Scrolling simply wraps around. It is assumed that prthead is modified * 7627 * only by WTB, WINIT, and TABXY. * 7628 * * 7629 * mem[prthead]:=char;prthead:=prthead+2; * 7630 * if prthead>=crtlst then prthead:=crtst; * 7631 ****************************************************************************** 7632 00005C82 48E7 80C0 wtb_a movem.l a0-a1/d0,-(sp) Save Registers 7633 00005C86 2278 FED4 movea.l f_area,a1 Point to LOWRAM 7634 00005C8A 2069 004A movea.l prthead(a1),a0 Write out the Character 7635 00005C8E 40E7 move sr,-(sp) Lock out Interrupts 7636 00005C90 007C 2700 ori #$2700,sr 7637 00005C94 30C0 move d0,(a0)+ 7638 00005C96 B1E9 004E cmpa.l crtlst(a1),a0 Update Prthead 7639 00005C9A 6D04 blt.s wtb2 7640 00005C9C 2069 0042 movea.l crtst(a1),a0 7641 00005CA0 2348 004A wtb2 move.l a0,prthead(a1) 7642 00005CA4 46DF wtb3 move (sp)+,sr Restore sr 7643 00005CA6 4CDF 0301 movem.l (sp)+,a0-a1/d0 Restore Registers 7644 00005CAA 4E75 rts 7645 7646 *********************************************************************** 7647 * 7648 * WTB_HR: 7649 * Routine to print a character (in D0) at printhead 7650 * location on high resolution crt. 7651 * 7652 * A0 = pointer to start of ID ROM 7653 * A1 = pointer into F_AREA 7654 * A2 = pointer into FONT 7655 * A3 = pointer into FRAME BUFFER 7656 * A6 = PRTHEAD 7657 * 7658 * D0 = character to be printed (Passed into this routine) 7659 * D1 = height of cell 7660 * D2 = width of cell 7661 * 7662 * Written by Anny Randel. February 15, 1984 7663 * 7664 *********************************************************************** 7665 7666 00005CAC 48E7 FFF0 wtb_hr movem.l d0-d7/a0-a3,-(sp) Save registers 7667 00005CB0 207C 0056 movea.l #HRSEL,a0 A0 points to ID ROM 0000 7668 00005CB6 2278 FED4 movea.l f_area,a1 A1 points to F_AREA 7669 7670 00005CBA 40E7 move sr,-(sp) Lock out INTERRUPTS 7671 00005CBC 007C 2700 ori #$2700,sr PAGE 166 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7672 7673 00005CC0 3429 0048 move.w startoffont(a1),d2 A2 = start of font space 7674 00005CC4 45F0 2000 lea 0(a0,d2.w),a2 7675 7676 00005CC8 4241 clr.w d1 Clear for mutiplication 7677 00005CCA 4242 clr.w d2 7678 00005CCC 122A 0000 move.b cellheight(a2),d1 D1 = CHEIGHT 7679 00005CD0 142A 0002 move.b cellwidth(a2),d2 D2 = CWIDTH 7680 7681 00005CD4 2829 004A move.l prthead(a1),d4 D4 = PRTHEAD 7682 7683 00005CD8 3629 0046 move.w width(a1),d3 D3 = # of characters per row 7684 00005CDC 88C3 divu d3,d4 D4 = # of chars / # of chars per row 7685 00005CDE 3604 move.w d4,d3 D3 = current row # 7686 00005CE0 4844 swap d4 D4 = current col # 7687 7688 * SET UP POINTER INTO FRAME BUFFER (A3) 7689 7690 00005CE2 C8C2 mulu d2,d4 D4 = Col# * Cellwidth 7691 00005CE4 0B08 0005 movep.w g_width(a0),d5 D5 = Frame Buffer Width 7692 00005CE8 CAC3 mulu d3,d5 D5 = Row# * Width 7693 00005CEA CAC1 mulu d1,d5 D5 = Cellheight * (Row# * Width) 7694 00005CEC DA84 add.l d4,d5 D5 = (Col# * Cellwidth) + (Row# * Width) 7695 00005CEE 2669 0042 movea.l crtst(a1),a3 A3 = Start of Frame Buffer 7696 00005CF2 D7C5 adda.l d5,a3 A3 = Current Location in Frame Buffer 7697 7698 00005CF4 2E0B move.l a3,d7 D7 = 1st byte in current row 7699 00005CF6 317C 0003 move.w #$03,G_RRR(a0) Set repl rule reg to do pixel 4008 7700 * operations and to used exact source 7701 7702 * CHECK FOR SPECIAL CASE OF SPACE (for speed !!!) 7703 7704 00005CFC 0C00 0020 cmpi.b #' ',d0 Is it a space? 7705 00005D00 6600 0022 bne wtb_hr6 NO 7706 7707 00005D04 0B08 0005 movep.w G_WIDTH(a0),d5 -- YES -- 7708 00005D08 48C5 ext.l d5 Get FB width 7709 00005D0A 5342 subq.w #1,d2 D2 = cell width - 1 7710 00005D0C 5341 subq.w #1,d1 D1 = cell height - 1 7711 00005D0E 7800 moveq #0,d4 D4 = dummy register with zeros 7712 7713 00005D10 3602 wtb_hr7 move d2,d3 D3 = width counter 7714 00005D12 16C4 wtb_hr8 move.b d4,(a3)+ Clear byte of Frame Buffer 7715 00005D14 51CB FFFC dbra d3,wtb_hr8 Do whole width 7716 00005D18 DE85 add.l d5,d7 D7 = Pointer to 1st position in next row 7717 00005D1A 2647 movea.l d7,a3 A3 = SAME 7718 00005D1C 51C9 FFF2 dbra d1,wtb_hr7 Do EACH row (all columns) 7719 7720 00005D20 6000 0054 bra wtb_hr4 All through -- update printhead 7721 7722 * SET UP POINTER INTO CHARACTER FONT (A2) 7723 7724 00005D24 1602 wtb_hr6 move.b d2,d3 Do fancy stuff here to allow for 7725 00005D26 5E03 addq.b #7,d3 font width not evenly divisible by 8 7726 00005D28 E64B lsr #3,d3 7727 00005D2A E34B lsl #1,d3 PAGE 167 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7728 00005D2C 0283 0000 andi.l #$0FF,d3 D3 = [(cell width + 7) div 8] * 2 00FF 7729 00005D32 C6C1 mulu d1,d3 D3 = D3 * cell height 7730 7731 00005D34 902A 0006 sub.b startchar(a2),d0 D0 = Char value relative to font 7732 00005D38 0280 0000 andi.l #$0FF,d0 00FF 7733 00005D3E C6C0 mulu d0,d3 D3 = D3 * Char # in font 7734 7735 7736 * SET UP TO ENTER CHAR WRITING LOOP 7737 7738 00005D40 3C01 move.w d1,d6 7739 00005D42 5346 subq.w #1,d6 D6 = Cell height - 1 (COLUMN COUNTER) 7740 7741 00005D44 3002 wtb_hr0 move.w d2,d0 D0 = Cell width (ROW COUNTER) 7742 00005D46 1832 380A wtb_hr1 move.b 10(a2,d3.l),d4 D4 = 1st byte of font 7743 00005D4A 7A07 moveq #7,d5 D5 = 7 (Bit # in Byte COUNTER) 7744 7745 00005D4C 0B04 wtb_hr2 btst d5,d4 Check current bit 7746 00005D4E 56DB sne (a3)+ Set frame buffer location if bit was set 7747 00005D50 5340 subq.w #1,d0 Any more useful bits is this row??? 7748 00005D52 6708 beq.s wtb_hr3 If not, Go get next row 7749 00005D54 51CD FFF6 dbra d5,wtb_hr2 Otherwise, go to next bit in byte 7750 7751 00005D58 5483 addq.l #2,d3 Get next byte 7752 00005D5A 60EA bra wtb_hr1 7753 7754 * NOW WE'RE AT THE END OF THE ROW 7755 7756 00005D5C 4A46 wtb_hr3 tst d6 Are we at the end of the LAST row ? 7757 00005D5E 6700 0016 beq wtb_hr4 If yes, handle special case 7758 7759 00005D62 0B08 0005 movep.w G_WIDTH(a0),d5 D5 = Width of Frame Buffer 7760 00005D66 0285 0000 andi.l #$0FFFF,d5 FFFF 7761 00005D6C DE85 add.l d5,d7 D7 = Points to 1st position in NEXT row 7762 00005D6E 2647 movea.l d7,a3 a3 = Points to 1st position in NEXT row 7763 00005D70 5483 addq.l #2,d3 Get next byte 7764 00005D72 51CE FFD0 dbra d6,wtb_hr0 Decrement row counter and do next row 7765 7766 * At end of Last Row, so update prthead and exit 7767 7768 00005D76 52A9 004A wtb_hr4 addq.l #1,prthead(a1) Update printhead to point to next cell 7769 7770 00005D7A 2029 004A move.l prthead(a1),d0 7771 00005D7E B0A9 004E cmp.l crtlst(a1),d0 Has printhead exceeded end of disp area? 7772 00005D82 6D00 000A blt wtb_hr5 If it's ok then go to ending 7773 7774 00005D86 237C 0000 move.l #0,prthead(a1) Reset printhead to zero if at end 0000 004A 7775 7776 7777 0000 5D8E wtb_hr5 equ * Ending 7778 7779 00005D8E 46DF move (sp)+,sr Restore sr 7780 00005D90 4CDF 0FFF movem.l (sp)+,d0-d7/a0-a3 Restore registers PAGE 168 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7781 7782 00005D94 4E75 rts 7783 7784 ****************************************************************************** 7785 * TABXY_A: Sets Printhead to X(D0), Y(D1) * 7786 * Compute Current X,Y from prthead. Make mod to X if Non-Zero. * 7787 * Make mod to Y if Non-Zero. Compute new prthead from X,Y. * 7788 * * 7789 * x:=((prthead-crtst) mod width2)/2; * 7790 * y:=((prthead-crtst) div width2)+1; * 7791 * if d0.b>0 then x:=((d0.b-1) mod width); * 7792 * if d1.b>0 then y:=((d1.b-1) mod height); * 7793 * prthead:=y*width2+x*2+crtst; * 7794 ****************************************************************************** 7795 00005D96 48E7 F080 tabxy_a movem.l a0/d0-d3,-(sp) Save Registers 7796 00005D9A 40E7 move sr,-(sp) Lock out keyboard access 7797 00005D9C 007C 2700 ori #$2700,sr 7798 00005DA0 2078 FED4 movea.l f_area,a0 Point to LOWRAM 7799 00005DA4 2428 004A move.l prthead(a0),d2 x2(d2):=((prthead-crtst) mod 7800 00005DA8 94A8 0042 sub.l crtst(a0),d2 width2)/2 7801 00005DAC 84E8 0048 divu width2(a0),d2 7802 00005DB0 3602 move d2,d3 y2(d3):=((prthead-crtst) mod 7803 00005DB2 4842 swap d2 width2) 7804 00005DB4 E24A lsr #1,d2 7805 00005DB6 4A00 tst.b d0 if x1(d0.b)>0 then 7806 00005DB8 6F0E ble.s tabxy1 x2(d2):=(d0.b-1) mod width 7807 00005DBA 4880 ext d0 7808 00005DBC 48C0 ext.l d0 7809 00005DBE 5380 subq.l #1,d0 7810 00005DC0 80E8 0046 divu width(a0),d0 7811 00005DC4 4840 swap d0 7812 00005DC6 3400 move d0,d2 7813 00005DC8 4A01 tabxy1 tst.b d1 if y1(d1.b)>0 then 7814 00005DCA 6F0E ble.s tabxy2 y2(d3):=(d1.b-1) mod height 7815 00005DCC 4881 ext d1 7816 00005DCE 48C1 ext.l d1 7817 00005DD0 5381 subq.l #1,d1 7818 00005DD2 82E8 0052 divu height(a0),d1 7819 00005DD6 4841 swap d1 7820 00005DD8 3601 move d1,d3 7821 00005DDA C6E8 0048 tabxy2 mulu width2(a0),d3 prthead:=y2*width2+x2*2+crtst 7822 00005DDE D642 add d2,d3 7823 00005DE0 D642 add d2,d3 7824 00005DE2 48C3 ext.l d3 7825 00005DE4 D6A8 0042 add.l crtst(a0),d3 7826 00005DE8 2143 004A move.l d3,prthead(a0) 7827 00005DEC 46DF move (sp)+,sr Restore sr 7828 00005DEE 4CDF 010F movem.l (sp)+,a0/d0-d3 7829 00005DF2 4E75 rts 7830 7831 ****************************************************************************** 7832 * 7833 * TABXY_HR 7834 * This routine places the printhead in the display area 7835 * of the High Res. CRT (GATOR). Passed in to tabxy_hr are: 7836 * 7837 * D0 = new X + 1 (in character cells) PAGE 169 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7838 * D1 = new Y + 1 (in character cells) 7839 * 7840 * If either D0 or D1 is a zero, then that parameter (X or Y) will 7841 * remain the same as the previous printhead location 7842 * 7843 * Stores new printhead value (# of character cells from start of 7844 * frame buffer to new location) in prthead(a0) where a0 = f_area. 7845 * 7846 * Written by Anny Randel. February 15, 1984 7847 **************************************************************************** 7848 7849 0000 5DF4 tabxy_hr equ * 7850 00005DF4 48E7 E080 movem.l d0-d2/a0,-(sp) 7851 00005DF8 40E7 move sr,-(sp) Lock out interupts 7852 00005DFA 007C 0A8C ori #2700,sr 7853 00005DFE 2078 FED4 movea.l f_area,a0 A0 = F_AREA 7854 7855 00005E02 2428 004A move.l prthead(a0),d2 D2 = current prthead location 7856 00005E06 84E8 0046 divu width(a0),d2 D2: upper wd = current X ; lower wd = current Y 7857 7858 00005E0A 4A01 tst.b d1 if d1 is 0, then use the same Y coordinate 7859 00005E0C 6600 0006 bne tabxy_hr1 7860 00005E10 1202 move.b d2,d1 use same 7861 00005E12 5201 addq.b #1,d1 7862 7863 0000 5E14 tabxy_hr1 equ * 7864 00005E14 4A00 tst.b d0 if d0 is 0, then use the same X coordinate 7865 00005E16 6600 0008 bne tabxy_hr2 7866 00005E1A 4842 swap d2 7867 00005E1C 1002 move.b d2,d0 7868 00005E1E 5200 addq.b #1,d0 7869 7870 0000 5E20 tabxy_hr2 equ * 7871 00005E20 5301 subq.b #1,d1 7872 00005E22 5300 subq.b #1,d0 7873 7874 00005E24 0280 0000 andi.l #$0FF,d0 00FF 7875 00005E2A 0281 0000 andi.l #$0FF,d1 00FF 7876 00005E30 C2E8 0046 mulu width(a0),d1 D1 = width (in chars) * Y coord (row #) 7877 00005E34 D081 add.l d1,d0 D0 = new prthead location 7878 00005E36 2140 004A move.l d0,prthead(a0) 7879 7880 00005E3A 46DF move (sp)+,sr 7881 00005E3C 4CDF 0107 movem.l (sp)+,d0-d2/a0 7882 7883 00005E40 4E75 rts 7884 7885 ******************************************************************************* 7886 7887 ****************************************************************************** 7888 * WINIT_D: Initializes Dummy CRT and Vectors * 7889 ****************************************************************************** 7890 00005E42 2F08 winit_d move.l a0,-(sp) Save Registers 7891 00005E44 2078 FED4 movea.l f_area,a0 Point to LOWRAM PAGE 170 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7892 00005E48 317C 0050 move #80,width(a0) Set Width and Height 0046 7893 00005E4E 317C 0019 move #25,height(a0) 0052 7894 00005E54 317C 4EF9 move #jmpop,winit(a0) Set up Vectors 0030 7895 00005E5A 217C 0000 move.l #winit_d,winit+2(a0) 5E42 0032 7896 00005E62 317C 4EF9 move #jmpop,tabxy(a0) 003C 7897 00005E68 217C 0000 move.l #tabxy_d,tabxy+2(a0) 5E80 003E 7898 00005E70 317C 4EF9 move #jmpop,wtb(a0) 0036 7899 00005E76 217C 0000 move.l #wtb_d,wtb+2(a0) 5E80 0038 7900 00005E7E 205F movea.l (sp)+,a0 Restore Registers 7901 7902 ****************************************************************************** 7903 * WTB_D: Dummy Writes Character in D0 at Printhead * 7904 ****************************************************************************** 7905 0000 5E80 wtb_d equ * 7906 7907 ****************************************************************************** 7908 * TABXY_D: Dummy Sets Printhead to X(D0), Y(D1) * 7909 ****************************************************************************** 7910 00005E80 4E75 tabxy_d rts PAGE 171 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7912 ****************************************************************************** 7913 * dsp_ri_error * 7914 * Display Read Interface error message on left screen. * 7915 * Number is in word at -2(a5) msus is in m_msus(f_area) * 7916 * fubuffer is used to build message. * 7917 ****************************************************************************** 7918 00005E82 302D FFFE dsp_ri_error move -2(a5),d0 Get error number 7919 00005E86 2078 FED4 movea.l f_area,a0 Get msus 7920 00005E8A 2228 0056 move.l m_msus(a0),d1 and pass it to the routine 7921 00005E8E 41F8 FDD2 lea fubuffer,a0 7922 00005E92 6100 00A8 bsr buildmsus 7923 00005E96 4218 clr.b (a0)+ 7924 00005E98 41F8 FDD2 lea fubuffer,a0 7925 00005E9C 6100 F79C bsr sftmsg 7926 00005EA0 41F8 FDD2 lea fubuffer,a0 7927 00005EA4 30FC 2020 move #' ',(a0)+ 7928 00005EA8 610A bsr.s get_ri_mess Build message in fubuffer (a0) 7929 00005EAA 4218 clr.b (a0)+ 7930 00005EAC 41F8 FDD2 lea fubuffer,a0 7931 00005EB0 6000 F788 bra sftmsg Put message on Screen 7932 7933 ****************************************************************************** 7934 * get_ri_mess * 7935 * Get address of Read Interface error message for error d0 into a0 * 7936 * MSUS for failure is in d1 * 7937 ****************************************************************************** 7938 00005EB4 48E7 E040 get_ri_mess movem.l d0-d2/a1,-(sp) Save Registers 7939 00005EB8 43FA 002A lea ri_errmsg,a1 Point to table 7940 00005EBC 1419 get_ri_mess1 move.b (a1)+,d2 Get table value 7941 00005EBE 670A beq.s get_ri_mess3 Ran out of table use last message 7942 00005EC0 B002 cmp.b d2,d0 If this is the message 7943 00005EC2 6706 beq.s get_ri_mess3 then use it 7944 00005EC4 4A19 get_ri_mess2 tst.b (a1)+ If this is not the message 7945 00005EC6 66FC bne.s get_ri_mess2 then skip over it 7946 00005EC8 60F2 bra.s get_ri_mess1 Try next one 7947 0000 5ECA get_ri_mess3 equ * 7948 00005ECA 10D9 get_ri_mess4 move.b (a1)+,(a0)+ Copy Error Message 7949 00005ECC 66FC bne.s get_ri_mess4 7950 00005ECE 117C 0020 move.b #' ',-1(a0) Put space afterwards FFFF 7951 00005ED4 B07C 0007 cmp #ec_bus_error,d0 7952 00005ED8 6304 bls.s get_ri_mess5 7953 00005EDA 6100 ABA6 bsr putsel Put Number if > 5 7954 00005EDE 4CDF 0207 get_ri_mess5 movem.l (sp)+,d0-d2/a1 Restore 7955 00005EE2 4E75 rts 7956 7957 00005EE4 01 ri_errmsg dc.b ec_no_device,'No Device',0 7958 00005EEF 02 dc.b ec_no_medium,'No Medium',0 7959 00005EFA 03 dc.b ec_not_ready,'Not Ready',0 7960 00005F05 04 dc.b ec_read_error,'Read Error',0 7961 00005F11 05 dc.b ec_bad_hardware,'Bad Hardware',0 7962 00005F1F 06 dc.b ec_bad_error_state,'Bad State',0 7963 00005F2A 07 dc.b ec_bus_error,'Bus Error',0 7964 00005F35 00 dc.b 0,'Error',0 7965 7966 ****************************************************************************** 7967 * buildmsus Build msus string at (a0)+ * PAGE 172 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 7968 * msus is passed in d1 * 7969 ****************************************************************************** 7970 00005F3C 48E7 FF78 buildmsus movem.l d0-d7/a1-a4,-(sp) Save Registers 7971 00005F40 10FC 003A move.b #':',(a0)+ Put out colon 7972 00005F44 48E7 40C0 movem.l d1/a0-a1,-(sp) Save d1/a0-a1 7973 00005F48 2278 FED4 movea.l f_area,a1 Save Current global msus 7974 00005F4C 2F29 0056 move.l m_msus(a1),-(sp) 7975 00005F50 2341 0056 move.l d1,m_msus(a1) Set Global msus for menu call 7976 00005F54 598F subq.l #4,sp Pass ptr to descriptor byte 7977 00005F56 2F08 move.l a0,-(sp) Pass Device Name 7978 00005F58 6100 E066 bsr m_menu 7979 00005F5C 245F movea.l (sp)+,a2 Get pointer to descriptor byte 7980 00005F5E 1412 move.b (a2),d2 Get descriptor 7981 00005F60 2078 FED4 movea.l f_area,a0 Restore Current global msus 7982 00005F64 215F 0056 move.l (sp)+,m_msus(a0) 7983 00005F68 4CDF 0302 movem.l (sp)+,d1/a0-a1 Restore d1/a0-a1 7984 00005F6C 2448 movea.l a0,a2 Get pointer to device name 7985 00005F6E 4240 clr d0 Get Length of Name 7986 00005F70 101A move.b (a2)+,d0 7987 00005F72 5340 buildmsus1 subq #1,d0 7988 00005F74 6D04 blt.s buildmsus2 7989 00005F76 10DA move.b (a2)+,(a0)+ 7990 00005F78 60F8 bra.s buildmsus1 7991 00005F7A 0802 0003 buildmsus2 btst #dcomma1,d2 Put out Comma and space 7992 00005F7E 6708 beq.s buildmsus3 7993 00005F80 10FC 002C move.b #',',(a0)+ 7994 00005F84 10FC 0020 move.b #' ',(a0)+ 7995 00005F88 E099 buildmsus3 ror.l #8,d1 Use menu descriptor: Select Code 7996 00005F8A 0802 0000 btst #dsel,d2 7997 00005F8E 6708 beq.s buildmsus4 7998 00005F90 4240 clr d0 7999 00005F92 1001 move.b d1,d0 Get Select Code 8000 00005F94 6100 AAEC bsr putsel 8001 00005F98 0802 0004 buildmsus4 btst #dcomma2,d2 Put out a Comma and space 8002 00005F9C 6708 beq.s buildmsus5 8003 00005F9E 10FC 002C move.b #',',(a0)+ 8004 00005FA2 10FC 0020 move.b #' ',(a0)+ 8005 00005FA6 E199 buildmsus5 rol.l #8,d1 HPIB Address ? 8006 00005FA8 4240 clr d0 8007 00005FAA 1001 move.b d1,d0 8008 00005FAC 0802 0001 btst #dhpib,d2 8009 00005FB0 6710 beq.s buildmsus7 8010 00005FB2 0802 0004 btst #dcomma2,d2 8011 00005FB6 6706 beq.s buildmsus6 8012 00005FB8 6100 AAC8 bsr putsel 8013 00005FBC 6004 bra.s buildmsus7 8014 00005FBE 6100 AADE buildmsus6 bsr puthip 8015 00005FC2 E199 buildmsus7 rol.l #8,d1 Drive Number ? 8016 00005FC4 E199 rol.l #8,d1 8017 00005FC6 0802 0002 btst #ddrive,d2 8018 00005FCA 672A beq.s buildmsus10 8019 00005FCC 10FC 002C move.b #',',(a0)+ Implied Comma 8020 00005FD0 10FC 0020 move.b #' ',(a0)+ 8021 00005FD4 4240 clr d0 8022 00005FD6 1001 move.b d1,d0 8023 00005FD8 0802 0005 btst #dvol,d2 Split out volume number 8024 00005FDC 6714 beq.s buildmsus9 No PAGE 173 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8025 00005FDE C07C 000F and #$F,d0 Put out unit number first 8026 00005FE2 6100 AA9E bsr putsel 8027 00005FE6 1001 move.b d1,d0 8028 00005FE8 E848 lsr #4,d0 Put out volume number next 8029 00005FEA 10FC 002C move.b #',',(a0)+ Implied Comma 8030 00005FEE 10FC 0020 move.b #' ',(a0)+ 8031 00005FF2 6100 AA8E buildmsus9 bsr putsel 8032 00005FF6 4CDF 1EFF buildmsus10 movem.l (sp)+,d0-d7/a1-a4 Restore Registers 8033 00005FFA 4E75 rts PAGE 174 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8035 ****************************************************************************** 8036 * KBD_NO_INT: ($15C) Wait for Keyboard NMI to Clear * 8037 ****************************************************************************** 8038 00005FFC 0839 0000 KBD_NO_INT BTST #0,KBDSTATUS CHECK INTERUPT BIT 0042 8003 8039 00006004 66F6 BNE KBD_NO_INT WAIT FOR IT TO TURN OFF 8040 00006006 4E75 RTS 8041 8042 00006008 44FC 0000 KBD_BAD_X MOVE #0,CCR SHOW NON ZERO 8043 0000600C 4E75 KBD_RET RTS 8044 0000600E 44FC 0004 KBD_OK_X MOVE #4,CCR SHOW ZERO 8045 00006012 4E75 RTS 8046 8047 ****************************************************************************** 8048 * KBD_CWAIT: ($160) Wait for Last Keyboard Command With Timeout * 8049 * * 8050 * modified by: Anny Randel * 8051 * date: 12/14/83 * 8052 * purpose: To use timer routines on processor boards with timers* 8053 * * 8054 * note: The mods assume that the comments in the 3.0 bootROM * 8055 * notebook are correct, and therefore waits 1 ms for * 8056 * each count of 200 in d0. This results in some of * 8057 * the comments in the boot ROM code being incorrect. * 8058 * Also, the timer routines do not guarantee a given * 8059 * number of parallel poll attempts as documented in * 8060 * the 3.0 boot ROM Notebook. * 8061 * * 8062 * another note: When the timer is used this takes at least 50 us. * 8063 * * 8064 ****************************************************************************** 8065 8066 00006014 4A80 KBD_CWAIT TST.L D0 8067 00006016 6758 BEQ.S KBD_CW2 8068 8069 ************* START OF ANNY'S CHANGES ************* 8070 00006018 0838 0001 btst #timer_absent,sysflag2 timer absent? FEDA 8071 0000601E 6640 bne.s kbd_cw1 branch if so 8072 00006020 80FC 00C8 divu #200,d0 divide d0 by 200 to get ms value 8073 00006024 0280 0000 andi.l #$0ffff,d0 clear upperword FFFF 8074 0000602A 0640 0001 addi.w #1,d0 8075 0000602E 2F00 move.l d0,-(sp) 8076 00006030 4857 pea (sp) put value loc on stack 8077 00006032 6100 F174 bsr milli_to_micro get micro sec value 8078 00006036 201F move.l (sp)+,d0 8079 00006038 90BC 0000 sub.l #9,d0 sub out 9us of overhead 0009 8080 0000603E 2F00 move.l d0,-(sp) put value on stack 8081 00006040 4857 pea (sp) put value loc on stack 8082 00006042 4EBA F18E jsr start_timer start timer for timeout 8083 00006046 201F kbd_cw3 move.l (sp)+,d0 pop off timeout value 8084 00006048 0839 0001 btst #1,kbdstatus check status 0042 8003 8085 00006050 67BA beq kbd_ret return if zero 8086 00006052 2F00 move.l d0,-(sp) put value on stack PAGE 175 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8087 00006054 4857 pea (sp) push parameter addr 8088 00006056 4EBA F19A jsr check_timer has time expired 8089 0000605A 6AEA bpl kbd_cw3 go back if not expired 8090 0000605C 588F addq.l #4,sp pop of val of parameter 8091 0000605E 7000 moveq #0,d0 check one more time! 8092 ************* END OF ANNY'S CHANGES ************* 8093 8094 00006060 0839 0001 KBD_CW1 BTST #1,KBDSTATUS 0042 8003 8095 00006068 57C8 FFF6 DBEQ D0,KBD_CW1 8096 0000606C 669A BNE KBD_BAD_X 8097 0000606E 4E75 RTS 8098 00006070 0839 0001 KBD_CW2 BTST #1,KBDSTATUS 0042 8003 8099 00006078 66F6 BNE KBD_CW2 8100 0000607A 4E75 RTS 8101 8102 ****************************************************************************** 8103 * KBD_WCMD: ($164) Keyboard Write After Wait For Last Command With Timeout * 8104 ****************************************************************************** 8105 0000607C 6196 KBD_WCMD BSR KBD_CWAIT 8106 0000607E 668C BNE KBD_RET 8107 00006080 13C1 0042 MOVE.B D1,KBDSTATUS 8003 8108 00006086 6086 BRA KBD_OK_X 8109 8110 ****************************************************************************** 8111 * KBD_WDATA: ($168) Write Data After Waiting For Last Command With Timeout * 8112 ****************************************************************************** 8113 00006088 618A KBD_WDATA BSR KBD_CWAIT 8114 0000608A 6680 BNE KBD_RET 8115 0000608C 13C1 0042 MOVE.B D1,KBDDATA 8001 8116 00006092 6000 FF7A BRA KBD_OK_X 8117 8118 ****************************************************************************** 8119 * KBD_RDATA: ($16C) Read Data From Keyboard With Timeout * 8120 * * 8121 * modified by: Anny Randel * 8122 * date: 12/14/83 * 8123 * purpose: To use timer routines on processor boards with timers* 8124 * See comments on kbd_cwait, same changes. * 8125 * * 8126 * note: When the timer is used this takes at least 50 us. * 8127 * * 8128 ****************************************************************************** 8129 8130 00006096 4A80 KBD_RDATA TST.L D0 CHECK THE COUNTER 8131 00006098 676C BEQ.S KBD_RD3 8132 8133 ************* START OF ANNY'S CHANGES ************* 8134 0000609A 0838 0001 btst #timer_absent,sysflag2 timer absent? FEDA 8135 000060A0 6642 bne.s kbd_rd1 branch if so 8136 000060A2 80FC 00C8 divu #200,d0 divide d0 by 200 to get ms value 8137 000060A6 0280 0000 andi.l #$0ffff,d0 clear upperword FFFF PAGE 176 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8138 000060AC 0640 0001 addi.w #1,d0 8139 000060B0 2F00 move.l d0,-(sp) 8140 000060B2 4857 pea (sp) put value loc on stack 8141 000060B4 6100 F0F2 bsr milli_to_micro get micro sec value 8142 000060B8 201F move.l (sp)+,d0 8143 000060BA 90BC 0000 sub.l #9,d0 sub out 9us of overhead 0009 8144 000060C0 2F00 move.l d0,-(sp) put value on stack 8145 000060C2 4857 pea (sp) put value loc on stack 8146 000060C4 4EBA F10C jsr start_timer start timer for timeout 8147 000060C8 201F kbd_rd4 move.l (sp)+,d0 pop timeout into d0 8148 000060CA 0839 0000 btst #0,kbdstatus check status 0042 8003 8149 000060D2 6600 0020 bne kbd_rd2 if #0 went to 1, go on 8150 000060D6 2F00 move.l d0,-(sp) put value on stack 8151 000060D8 4857 pea (sp) push parameter addr 8152 000060DA 4EBA F116 jsr check_timer has time expired 8153 000060DE 6AE8 bpl kbd_rd4 go back if not expired 8154 000060E0 588F addq.l #4,sp pop of val of parameter 8155 000060E2 7000 moveq #0,d0 check one more time! 8156 ************* END OF ANNY'S CHANGES ************* 8157 8158 000060E4 0839 0000 KBD_RD1 BTST #0,KBDSTATUS CHECK STATUS 0042 8003 8159 000060EC 56C8 FFF6 DBNE D0,KBD_RD1 8160 000060F0 6700 FF16 BEQ KBD_BAD_X 8161 000060F4 4280 KBD_RD2 CLR.L D0 CLEAR DATA REG 8162 000060F6 1239 0042 MOVE.B KBDSTATUS,D1 SAVE STATUS 8003 8163 000060FC 1039 0042 MOVE.B KBDDATA,D0 READ DATA 8001 8164 00006102 6000 FF0A BRA KBD_OK_X 8165 * READ FROM KEYBOARD WITH INFINITE WAIT 8166 00006106 0839 0000 KBD_RD3 BTST #0,KBDSTATUS 0042 8003 8167 0000610E 66E4 BNE KBD_RD2 IF DATA READY GO READ IT 8168 00006110 60F4 BRA KBD_RD3 ELSE CHECK AGAIN PAGE 177 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8170 ****************************************************************************** 8171 * READ_KEYS: ($1C4) Read From Keyboard and Translate a Key If Possible * 8172 * STATUS REG (D1) RETURNED AS ALL ZEROS IF NO RESPONSE. * 8173 * USES A0,D0,D1,D2 and D3 * 8174 * * 8175 * Modified: 3/31/84 by Anny Randel to handle foreign ITF keyboards * 8176 ****************************************************************************** 8177 00006112 4281 READ_KEYS CLR.L D1 CLEAR REG TO HOLD STATUS 8178 00006114 6180 BSR KBD_RDATA RETURNS DATA IN D0 STATUS IN D1 8179 00006116 6600 FEF4 BNE KBD_RET RETURN IF NO RESPONSE 8180 0000611A 0881 0000 BCLR #0,D1 CLEAR TRANSLATE BIT 8181 0000611E 0801 0007 BTST #7,D1 CHECK FOR TIMER OR SPECIAL INPUT 8182 00006122 6700 FEE8 BEQ KBD_RET 8183 00006126 0801 0006 BTST #6,D1 CHECK FOR RPG INPUT 8184 0000612A 6656 BNE.S IGNORERPG IGNORE IT IF THERE WAS ONE 8185 0000612C 0C00 003C CMPI.B #$3C,D0 CHECK FOR SPECIAL KEYS 8186 00006130 6D00 FEDA BLT KBD_RET 8187 * 8188 00006134 2400 read_trns MOVE.L D0,D2 TRANSLATE THE KEY 8189 00006136 4840 SWAP D0 8190 00006138 943C 003C SUB.B #$3C,D2 OFFSET 8191 0000613C 08C1 0000 BSET #0,D1 SET TRANSLATE BIT 8192 00006140 0801 0004 BTST #4,D1 CHECK FOR SHIFT KEY 8193 00006144 6606 BNE.S NOSHIFT 8194 00006146 D4BC 0000 ADD.L #66,D2 SHIFT IT 0042 8195 8196 0000614C 2078 FED4 NOSHIFT MOVEA.L F_AREA,A0 {ar} 8197 00006150 4A28 02CD TST.B KBDTYPE(A0) IS THIS AN ITF KEYBOARD? {ar} 8198 00006154 6718 BEQ.S read_trn1 NOT ITF (ar} 8199 8200 00006156 1628 02CC MOVE.B KBDLANG(A0),D3 D3 = LANGUAGE CODE {ar} 8201 0000615A 4883 EXT D3 {ar} 8202 0000615C E54B LSL #2,D3 D3 = # OF BYTES INTO TABLE {ar} 8203 0000615E 207C 0000 MOVEA.L #WHICHTABLE,A0 A0 = START OF WHICHTABLE TABLE {ar} 6396 8204 00006164 2070 3000 MOVEA.L 0(A0,D3.W),A0 A0 = START OF CORRECT KTRANS TABLE {ar} 8205 00006168 1030 2800 MOVE.B 0(A0,D2.L),D0 D0 = TRANSLATED KEY {ar} 8206 0000616C 6006 BRA.S read_trn2 {ar} 8207 8208 0000616E 2042 read_trn1 MOVEA.L D2,A0 FOR OLD STYLE KEYBOARDS {ar} 8209 00006170 103B 8014 MOVE.B KTRANS(A0),D0 TRANSLATE IT {ar} 8210 8211 00006174 0801 0005 read_trn2 BTST #5,D1 CHECK FOR CONTROL KEY 8212 00006178 6604 BNE.S NOCTL 8213 0000617A 0200 001F ANDI.B #$1F,D0 LEAVE ONLY LOWER 5 BITS 8214 0000617E 4840 NOCTL SWAP D0 HI BYTE IS NOW TRANSLATE OF LOW BYTE 8215 00006180 4E75 RTS 8216 00006182 7200 IGNORERPG MOVEQ #0,D1 8217 00006184 4E75 RTS PAGE 178 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8219 8220 ****************************************************************************** 8221 * KTRANS: ($154) $3C to $7D USASCII Keycode Table * 8222 ****************************************************************************** 8223 00006186 30 KTRANS DC.B $30,$2E,$2C,$2B,$31,$32,$33,$2D *3C - *43 8224 0000618E 34 DC.B $34,$35,$36,$2A,$37,$38,$39,$2F *44 - *4B 8225 00006196 45 DC.B $45,$28,$29,$5E,$31,$32,$33,$34 *4C - *53 8226 0000619E 35 DC.B $35,$36,$37,$38,$39,$30,$2D,$3D *54 - *5B 8227 000061A6 5B DC.B $5B,$5D,$3B,$27,$2C,$2E,$2F,$20 *5C - *63 8228 000061AE 4F DC.B $4F,$50,$4B,$4C,$51,$57,$45,$52 *64 - *6B 8229 000061B6 54 DC.B $54,$59,$55,$49,$41,$53,$44,$46 *6C - *73 8230 000061BE 47 DC.B $47,$48,$4A,$4D,$5A,$58,$43,$56 *74 - *7B 8231 000061C6 42 DC.B $42,$4E *7C - *7D 8232 000061C8 7F DC.B $7F,$60 *3C - *3D 8233 000061CA 7C DC.B $7C,$F1,$B0,$B3,$DF,$7E,$EB,$EF *3E - *45 8234 000061D2 F5 DC.B $F5,$F0,$F6,$F7,$FA,$5C,$D1,$F4 *46 - *4D 8235 000061DA FB DC.B $FB,$D1,$21,$40,$23,$24,$25,$5E *4E - *55 8236 000061E2 26 DC.B $26,$2A,$28,$29,$5F,$2B,$7B,$7D *56 - *5D 8237 000061EA 3A DC.B $3A,$22,$3C,$3E,$3F,$20,$6F,$70 *5E - *65 8238 000061F2 6B DC.B $6B,$6C,$71,$77,$65,$72,$74,$79 *66 - *6D 8239 000061FA 75 DC.B $75,$69,$61,$73,$64,$66,$67,$68 *6E - *75 8240 00006202 6A DC.B $6A,$6D,$7A,$78,$63,$76,$62,$6E *76 - *7D 8241 8242 ***************************************************************************** 8243 * KTRANS1: GERMAN STYLE KEYCODE TRANSLATION TABLE 8244 * THIS TABLE IS ONLY VALID FOR "A-Z", "a-z", AND "0-9" 8245 * ALL OTHER KEYCODES ARE PROBALY WRONG 8246 * THIS TABLE IS USED FOR THE GERMAN, SWISS GERMAN, AND 8247 * SWISS FRENCH ITF STYLE KEYBOARDS 8248 * 8249 * This table was added by Anny Randel on 3/31/84 8250 ***************************************************************************** 8251 8252 0000620A 30 KTRANS1 DC.B '0','.',',','+','1','2','3','-' * $3C - $43 8253 00006212 34 DC.B '4','5','6','*','7','8','9','/' * $44 - $4B 8254 0000621A 45 DC.B 'E','(',')','^','1','2','3','4' * $4C - $53 8255 00006222 35 DC.B '5','6','7','8','9','0','-','=' * $54 - $5B 8256 0000622A 5B DC.B '[',']',';',$27,',','.','/',' ' * $5C - $63 8257 00006232 4F DC.B 'O','P','K','L','Q','W','E','R' * $64 - $6B 8258 0000623A 54 DC.B 'T','Z','U','I','A','S','D','F' * $6C - $73 8259 00006242 47 DC.B 'G','H','J','M','Y','X','C','V' * $74 - $7B 8260 0000624A 42 DC.B 'B','N' 8261 0000624C 30 DC.B '0','.',',','+','1','2','3','-' * $3C - $43 8262 00006254 34 DC.B '4','5','6','*','7','8','9','/' * $44 - $4B 8263 0000625C 45 DC.B 'E','(',')','^','!','@','#','$' * $4C - $53 8264 00006264 25 DC.B '%','^','&','*','(',')','_','+' * $54 - $5B 8265 0000626C 7B DC.B '{','}',':',$34,'<','>','?',' ' * $5C - $63 8266 00006274 6F DC.B 'o','p','k','l','q','w','e','r' * $64 - $6B 8267 0000627C 74 DC.B 't','z','u','i','a','s','d','f' * $6C - $73 8268 00006284 67 DC.B 'g','h','j','m','y','x','c','v' * $74 - $7B 8269 0000628C 62 DC.B 'b','n' 8270 8271 ***************************************************************************** 8272 * KTRANS2: ITALIAN STYLE KEYCODE TRANSLATION TABLE 8273 * THIS TABLE IS ONLY VALID FOR "A-Z", "a-z", AND "0-9" 8274 * ALL OTHER KEYCODES ARE PROBALY WRONG 8275 * THIS TABLE IS USED FOR THE ITALIAN ITF KEYBOARD PAGE 179 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8276 * 8277 * This table was added by Anny Randel on 3/31/84 8278 ***************************************************************************** 8279 8280 0000628E 30 KTRANS2 DC.B '0','.',',','+','1','2','3','-' * $3C - $43 8281 00006296 34 DC.B '4','5','6','*','7','8','9','/' * $44 - $4B 8282 0000629E 45 DC.B 'E','(',')','^','!','@','#','$' * $4C - $53 8283 000062A6 25 DC.B '%','^','&','*','(',')','-','=' * $54 - $5B 8284 000062AE 5B DC.B '[',']','M',$27,',','.','/',' ' * $5C - $63 8285 000062B6 4F DC.B 'O','P','K','L','Q','Z','E','R' * $64 - $6B 8286 000062BE 54 DC.B 'T','Y','U','I','A','S','D','F' * $6C - $73 8287 000062C6 47 DC.B 'G','H','J',',','W','X','C','V' * $74 - $7B 8288 000062CE 42 DC.B 'B','N' 8289 000062D0 30 DC.B '0','.',',','+','1','2','3','-' * $3C - $43 8290 000062D8 34 DC.B '4','5','6','*','7','8','9','/' * $44 - $4B 8291 000062E0 45 DC.B 'E','(',')','^','1','2','3','4' * $4C - $53 8292 000062E8 35 DC.B '5','6','7','8','9','0','_','+' * $54 - $5B 8293 000062F0 7B DC.B '{','}','m',$34,'<','>','?',' ' * $5C - $63 8294 000062F8 6F DC.B 'o','p','k','l','q','z','e','r' * $64 - $6B 8295 00006300 74 DC.B 't','y','u','i','a','s','d','f' * $6C - $73 8296 00006308 67 DC.B 'g','h','j','?','w','x','c','v' * $74 - $7B 8297 00006310 62 DC.B 'b','n' 8298 8299 ***************************************************************************** 8300 * KTRANS3: FRENCH STYLE KEYCODE TRANSLATION TABLE 8301 * THIS TABLE IS ONLY VALID FOR "A-Z", "a-z", AND "0-9" 8302 * ALL OTHER KEYCODES ARE PROBALY WRONG 8303 * THIS TABLE IS USED FOR THE FRENCH, AND 8304 * BELGIAN ITF KEYBOARDS 8305 * 8306 * This table was added by Anny Randel on 3/31/84 8307 ***************************************************************************** 8308 8309 00006312 30 KTRANS3 DC.B '0','.',',','+','1','2','3','-' * $3C - $43 8310 0000631A 34 DC.B '4','5','6','*','7','8','9','/' * $44 - $4B 8311 00006322 45 DC.B 'E','(',')','^','!','@','#','$' * $4C - $53 8312 0000632A 25 DC.B '%','^','&','*','(',')','-','=' * $54 - $5B 8313 00006332 5B DC.B '[',']','M',$27,',','.','/',' ' * $5C - $63 8314 0000633A 4F DC.B 'O','P','K','L','A','Z','E','R' * $64 - $6B 8315 00006342 54 DC.B 'T','Y','U','I','Q','S','D','F' * $6C - $73 8316 0000634A 47 DC.B 'G','H','J',',','W','X','C','V' * $74 - $7B 8317 00006352 42 DC.B 'B','N' 8318 00006354 30 DC.B '0','.',',','+','1','2','3','-' * $3C - $43 8319 0000635C 34 DC.B '4','5','6','*','7','8','9','/' * $44 - $4B 8320 00006364 45 DC.B 'E','(',')','^','1','2','3','4' * $4C - $53 8321 0000636C 35 DC.B '5','6','7','8','9','0','_','+' * $54 - $5B 8322 00006374 7B DC.B '{','}','m',$34,'<','>','?',' ' * $5C - $63 8323 0000637C 6F DC.B 'o','p','k','l','a','z','e','r' * $64 - $6B 8324 00006384 74 DC.B 't','y','u','i','q','s','d','f' * $6C - $73 8325 0000638C 67 DC.B 'g','h','j','?','w','x','c','v' * $74 - $7B 8326 00006394 62 DC.B 'b','n' 8327 8328 **************************************************************************** 8329 * 8330 * WHICHTABLE: 8331 * This table maps a given language to a given keycode translation table. 8332 * PAGE 180 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8333 * The languages are mapped as follows: 8334 * 8335 * Using KTRANS (U.S.ASCII based): 8336 * U.S. $1F U.K. $13 8337 * KATAKANA $1D LATIN SPANISH $1E 8338 * CANADIAN ENG. $07 DUTCH $0D 8339 * SWEDISH $0E FINNISH $16 8340 * EUR. SPANISH $13 NOWEGIAN $1A 8341 * DANISH $1C CANADIAN FRENCH $08 8342 * 8343 * All undefined language codes are currently assigned to KTRANS. 8344 * 8345 * Using KTRANS1 (GERMAN based): 8346 * GERMAN $0F 8347 * SWISS GERMAN $19 8348 * SWISS FRENCH $03 8349 * 8350 * Using KTRANS2 (ITALIAN based): 8351 * ITALIAN $0B 8352 * 8353 * Using KTRANS3 (FRENCH based): 8354 * FRENCH $1B 8355 * BELGIAN $15 8356 * 8357 * These modifications by Anny Randel, March 31, 1984 8358 **************************************************************************** 8359 8360 00006396 0000 6186 WHICHTABLE DC.L KTRANS,KTRANS,KTRANS,KTRANS1 * $00 - $03 8361 000063A6 0000 6186 DC.L KTRANS,KTRANS,KTRANS,KTRANS * $04 - $07 8362 000063B6 0000 6186 DC.L KTRANS,KTRANS,KTRANS,KTRANS2 * $08 - $0B 8363 000063C6 0000 6186 DC.L KTRANS,KTRANS,KTRANS,KTRANS1 * $0C - $0F 8364 000063D6 0000 6186 DC.L KTRANS,KTRANS,KTRANS,KTRANS * $10 - $13 8365 000063E6 0000 6186 DC.L KTRANS,KTRANS3,KTRANS,KTRANS * $14 - $17 8366 000063F6 0000 6186 DC.L KTRANS,KTRANS1,KTRANS,KTRANS3 * $18 - $1B 8367 00006406 0000 6186 DC.L KTRANS,KTRANS,KTRANS,KTRANS * $1C - $1F 8368 8369 ****************************************************************************** 8370 * BEEP: ($1C8) Cause Keyboard to Beep Programably * 8371 * D2 CONTAINS THE DURATION AND FREQUENCY * 8372 ****************************************************************************** 8373 00006416 4280 BEEP CLR.L D0 8374 00006418 72A3 moveq #$A3,d1 8375 0000641A 6100 FC60 BSR KBD_WCMD 8376 0000641E 3202 MOVE.W D2,D1 8377 00006420 6100 FC66 BSR KBD_WDATA 8378 00006424 E049 LSR.W #8,D1 8379 00006426 6100 FC60 BSR KBD_WDATA 8380 0000642A 4E75 RTS 8381 8382 ****************************************************************************** 8383 * IGNOREKBD: Stop Keyboard NMI and Ignore It * 8384 ****************************************************************************** 8385 0000642C 13FC 00B2 IGNOREKBD MOVE.B #$B2,KBDSTATUS STOP NMI 0042 8003 8386 00006434 0839 0002 IGNORE___ btst #2,int_hpibstatus wait for interrupt to go away {ag} 0047 8005 8387 0000643C 66F6 bne ignore___ {ag} PAGE 181 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8388 0000643E 4E73 rte CONTINUE 8389 8390 ****************************************************************************** 8391 * R_NMI: Keyboard NMI handler * 8392 ****************************************************************************** 8393 00006440 6000 FC3A x_wcmd bra kbd_wcmd Save Space 8394 8395 00006444 48E7 E000 r_nmi movem.l d0-d2,-(sp) 8396 00006448 4280 clr.l d0 No timeouts 8397 0000644A 1439 0042 move.b kbdstatus,d2 Read status 8003 8398 00006450 725F moveq #$5F,d1 Mask keyboard interrupts 8399 00006452 61EC bsr x_wcmd 8400 00006454 72B2 moveq #$B2,d1 Clear Reset 8401 00006456 61E8 bsr x_wcmd Do it twice to make sure 8402 00006458 61E6 bsr x_wcmd 8403 0000645A 6100 FBB8 bsr kbd_cwait Wait until it's done 8404 0000645E 613C bsr.s getctrl Get the control key twice 8405 00006460 613A bsr.s getctrl 8406 00006462 0801 0001 btst #1,d1 Is ctrl key down 8407 00006466 4CDF 0007 movem.l (sp)+,d0-d2 8408 0000646A 660C bne.s r_nmi1 Not down 8409 0000646C 4879 0088 pea monitor_entry Ctrl key down, look for Monitor 0024 8410 00006472 4EBA E9D2 jsr rtn_to_monitor 8411 00006476 584F addq #4,sp Pop off monitor_entry address 8412 * 8413 * If RESETs are locked out, just pend it and return 8414 * 8415 00006478 2F0C r_nmi1 move.l a4,-(sp) Save Register 8416 0000647A 2878 FED4 movea.l f_area,a4 8417 0000647E 082C 0001 btst #mb_lock,m_b(a4) 0054 8418 00006484 670A beq.s r_nmi2 Not Locked out 8419 00006486 197C 0002 move.b #2,r_lock(a4) Locked out: log it and return 0055 8420 0000648C 285F movea.l (sp)+,a4 8421 0000648E 4E73 rte 8422 00006490 1C38 FED2 r_nmi2 move.b sysflag,d6 Required by entry point 8423 00006494 41FA 9F6A lea reset,a0 8424 00006498 6000 DF6C bra go Ctrl key not down 8425 8426 0000649C 6100 FBD2 getctrl bsr kbd_cw2 Wait until ready 8427 000064A0 13FC 0005 move.b #5,kbdstatus 0042 8003 8428 000064A8 1039 0042 getctrl1 move.b kbdstatus,d0 8003 8429 000064AE 0800 0001 btst #1,d0 8430 000064B2 66F4 bne.s getctrl1 8431 000064B4 0800 0000 btst #0,d0 8432 000064B8 67EE beq.s getctrl1 8433 000064BA 1239 0042 move.b kbddata,d1 8001 8434 000064C0 C07C 00F0 and #$F0,d0 8435 000064C4 B07C 0040 cmp #$40,d0 8436 000064C8 66DE bne.s getctrl1 8437 000064CA 4E75 rts PAGE 182 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8438 8439 ****************************************************************************** 8440 * RINIT_A: Initialize Input Device * 8441 * Save Interrupt Level * 8442 * Lock out Interrupts * 8443 * Flush 8041 * 8444 * Set Mask to Interrupt on Keyboard/rpg & Reset * 8445 * Find out what Language it is * 8446 * Setup NMI Vectors * 8447 * Set ATTENDED and CONFIGURE to false * 8448 * Clear Input Buffer * 8449 * If there is a remote Keyboard set it up also * 8450 * Clear Menu Keyprocessor State * 8451 * Restore Interrupt Level * 8452 ****************************************************************************** 8453 ****************************************************************************** 8454 * RINIT_D: Initialize Input Device * 8455 ****************************************************************************** 8456 000064CC 48E7 80C0 rinit_d movem.l a0-a1/d0,-(sp) Save Registers 8457 000064D0 2278 FED4 movea.l f_area,a1 Point to LOWRAM 8458 000064D4 40E7 move sr,-(sp) Save Interrupt Level 8459 000064D6 337C 4EF9 move #jmpop,rinit(a1) Set up Vectors 02A4 8460 000064DC 237C 0000 move.l #rinit_d,rinit+2(a1) 64CC 02A6 8461 000064E4 6000 00C0 bra rinit3 8462 000064E8 6100 FB86 riwtd bsr kbd_cw2 Send data in D0.b 8463 000064EC 13C0 0042 move.b d0,kbddata 8001 8464 000064F2 4E75 rts 8465 000064F4 6100 FB7A riwtc bsr kbd_cw2 Send command in D0.b 8466 000064F8 13C0 0042 move.b d0,kbdstatus 8003 8467 000064FE 4E75 rts 8468 00006500 48E7 80C0 rinit_a movem.l a0-a1/d0,-(sp) Save Registers 8469 00006504 2278 FED4 movea.l f_area,a1 Point to LOWRAM 8470 00006508 40E7 move sr,-(sp) Save Interrupt Level 8471 0000650A 007C 2700 ori #$2700,sr Lock out interrupts 8472 0000650E 1039 0042 move.b kbdstatus,d0 Flush 8041 8003 8473 00006514 1039 0042 move.b kbddata,d0 8001 8474 0000651A 70A0 moveq #$A0,d0 set rates 8475 0000651C 61D6 bsr riwtc 8476 0000651E 4200 clr.b d0 8477 00006520 61C6 bsr riwtd 00 ms delay for auto-repeat 8478 00006522 61C4 bsr riwtd 00 ms auto repeat counter 8479 00006524 61C2 bsr riwtd 0 ms input repeat rate 8480 00006526 7001 moveq #1,d0 10 ms 8481 00006528 61BE bsr riwtd 8482 0000652A 705C moveq #$5C,d0 Setup mask for keyboard/rpg &reset 8483 0000652C 61C6 bsr riwtc 8484 8485 * This section added by Anny Randel to handle foreign ITF keyboard (3/31/84) 8486 8487 0000652E 4229 02CD clr.b kbdtype(a1) Assume old style kbd 8488 00006532 7011 moveq #$11,d0 Determine kbd type PAGE 183 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8489 00006534 61BE bsr riwtc 8490 00006536 6100 00C0 bsr kbdata_filter 8491 0000653A 0800 0005 btst #5,d0 Is it an ITF??? 8492 0000653E 6706 beq.s rinit0 No, branch 8493 00006540 137C 0001 move.b #1,kbdtype(a1) Yes, save in f_area 02CD 8494 8495 * End of section added for ITF keyboard 8496 8497 00006546 7012 rinit0 moveq #$12,d0 Determine keyboard language 8498 00006548 61AA bsr riwtc 8499 0000654A 6100 00AC rinit1 bsr kbdata_filter Filter out non-data 8500 0000654E 1340 02CC rinit2 move.b d0,kbdlang(a1) 8501 8502 00006552 0C29 0001 cmpi.b #1,kbdtype(a1) Check for ITF keyboard 02CD 8503 00006558 6614 bne.s rinit2_1 8504 0000655A 303C 0000 move #0,d0 Zero timeout 8505 0000655E 323C 00EB move #$EB,d1 Send command to reconfigure loop 8506 00006562 4EBA FB18 jsr kbd_wcmd 8507 00006566 323C 0097 move #$97,d1 8508 0000656A 4EBA FB1C jsr kbd_wdata 8509 8510 0000656E 31FC 4EF9 rinit2_1 move #jmpop,lvl1v Setup Interrupt Vector FFBE 8511 00006574 21FC 0000 move.l #kbdisr,lvl1v+2 6664 FFC0 8512 0000657C 31FC 4EF9 move #jmpop,kbd_resetv FF34 8513 00006582 21FC 0000 move.l #r_nmi,kbd_resetv+2 Setup NMI Vectors 6444 FF36 8514 0000658A 31FC 4EF9 move #jmpop,lvl7v Setup NMI Decoder for Level 7 FF9A 8515 00006590 21FC 0000 move.l #nmi_decode,lvl7v+2 4E80 FF9C 8516 00006598 337C 4EF9 move #jmpop,rinit(a1) Set up Vectors 02A4 8517 0000659E 237C 0000 move.l #rinit_a,rinit+2(a1) 6500 02A6 8518 000065A6 337C 4EF9 rinit3 move #jmpop,rstatus(a1) 02AA 8519 000065AC 237C 0000 move.l #rstatus_a,rstatus+2(a1) 661C 02AC 8520 000065B4 337C 4EF9 move #jmpop,rdb(a1) 02B0 8521 000065BA 237C 0000 move.l #rdb_a,rdb+2(a1) 6630 02B2 8522 000065C2 08A9 0003 bclr #attended,booleans(a1) Set ATTENDED to false 000B 8523 000065C8 08A9 0002 bclr #configure,booleans(a1) Set CONFIGURE to false 000B 8524 000065CE 4269 02C6 clr rwait(a1) Clear input buffer 8525 000065D2 337C 02B6 move #rbuff,rhead(a1) 02C8 8526 000065D8 337C 02B6 move #rbuff,rtail(a1) 02CA 8527 000065DE 4229 02D2 clr.b boot_sel(a1) Menu Boot Subselector is cleared PAGE 184 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8528 000065E2 137C 0020 move.b #' ',boot_char(a1) Boot character is set to space 02D3 8529 000065E8 6100 087A bsr remote_set Set-up any remote keyboard 8530 000065EC 6100 0446 bsr keydisp Display Menu Keyprocessor State 8531 000065F0 46DF move (sp)+,sr Restore Interrupt Level 8532 000065F2 4CDF 0301 movem.l (sp)+,a0-a1/d0 Restore Registers 8533 000065F6 4E75 rts 8534 8535 000065F8 1039 0042 kbdata_filter move.b kbdstatus,d0 Wait for Interrupt 8003 8536 000065FE 0800 0000 btst #0,d0 8537 00006602 67F4 beq.s kbdata_filter 8538 00006604 1F39 0042 move.b kbddata,-(sp) Get data 8001 8539 0000660A C07C 00F0 and #$F0,d0 Filter anything other than data 8540 0000660E B03C 0040 cmp.b #$40,d0 Any real data out there? 8541 00006612 6704 beq.s kbdata_filter1 Return if real data 8542 00006614 101F move.b (sp)+,d0 8543 00006616 60E0 bra.s kbdata_filter Reject and Try again 8544 00006618 101F kbdata_filter1 move.b (sp)+,d0 8545 0000661A 4E75 rts 8546 ****************************************************************************** 8547 * RSTATUS: Check for Input Character Available * 8548 * Sets Condition to Non-zero if there is a character, zero otherwise * 8549 ****************************************************************************** 8550 0000661C 2F08 rstatus_a move.l a0,-(sp) Save Register 8551 0000661E 2078 FED4 movea.l f_area,a0 Point to LOWRAM 8552 00006622 4A68 02C6 tst rwait(a0) 8553 00006626 6704 beq.s rstatus1 Zero? 8554 00006628 44FC 0000 move #0,ccr 8555 0000662C 205F rstatus1 movea.l (sp)+,a0 Restore Register 8556 0000662E 4E75 rts 8557 8558 ****************************************************************************** 8559 * RDB: Get Input Character Into D0.b after waiting for one to be present. * 8560 ****************************************************************************** 8561 00006630 48E7 40C0 rdb_a movem.l a0-a1/d1,-(sp) Save Registers 8562 00006634 2278 FED4 movea.l f_area,a1 Point to LOWRAM 8563 00006638 4EA9 02AA rdb1 jsr rstatus(a1) Wait for a Character Ready 8564 0000663C 67FA beq.s rdb1 8565 0000663E 3229 02C8 move rhead(a1),d1 Get a character from the queue 8566 00006642 41F1 1000 lea 0(a1,d1),a0 8567 00006646 1010 move.b (a0),d0 8568 00006648 5269 02C8 addq #1,rhead(a1) 8569 0000664C 5369 02C6 subq #1,rwait(a1) Free space 8570 00006650 0C69 02C6 cmpi #rbuff+16,rhead(a1) Increment pointer 02C8 8571 00006656 6606 bne.s rdb2 8572 00006658 337C 02B6 move #rbuff,rhead(a1) 02C8 8573 0000665E 4CDF 0302 rdb2 movem.l (sp)+,a0-a1/d1 Restore Registers 8574 00006662 4E75 rts 8575 8576 ****************************************************************************** 8577 * KBDISR: Input Interrupt Service Handler * 8578 * Filters out all except: * 8579 * keys A-Z, a-z, 0-9 (Makes Nationalized Keyboards easy) * PAGE 185 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8580 * ENTER * 8581 * It is assumed that machine is attended if any key other than * 8582 * CTRL-C or the knob is hit. * 8583 * CTRL-C causes configure mode to be entered. * 8584 * ENTER toggles stop bit for searching * 8585 * * 8586 * * 8587 * * 8588 * if ENTER then * 8589 * begin * 8590 * toggle stop bit * 8591 * set attended to true * 8592 * return * 8593 * end * 8594 * else if CTRL-C and not Configure Mode then * 8595 * begin * 8596 * if RESET locked out then * 8597 * begin * 8598 * if RESET is not pending then pend a CTRL-C * 8599 * end * 8600 * else * 8601 * if RESET is not pending then begin * 8602 * set configure mode to true * 8603 * call configure mode * 8604 * end; * 8605 * end * 8606 * else * 8607 * begin * 8608 * set attended to true * 8609 * convert key based on language * 8610 * filter non- A-Z, a-z, 0-9 * 8611 * add key to queue if room * 8612 * increment rwait if room * 8613 * end * 8614 * if not Configure Mode then call keyprocessor * 8615 ****************************************************************************** 8616 00006664 48E7 E0C0 kbdisr movem.l a0-a1/d0-d2,-(sp) Save Registers 8617 00006668 2278 FED4 movea.l f_area,a1 Point to LOWRAM 8618 * 8619 * Get Key and Status from 8041 8620 * 8621 0000666C 4280 clr.l d0 8622 0000666E 1239 0042 move.b kbdstatus,d1 get key 8003 8623 00006674 1039 0042 move.b kbddata,d0 8001 8624 * 8625 * Filter non-keys 8626 * 8627 0000667A 0801 0007 btst #7,d1 7=1 for key; fall thru for keys 8628 0000667E 6700 010E beq kbdisr7 8629 00006682 0801 0006 btst #6,d1 6=0 for key 8630 00006686 6600 0106 bne kbdisr7 8631 * 8632 * Check for Control-C 8633 * 8634 0000668A 0C40 007A cmpi #$7A,d0 C Key ? PAGE 186 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8635 0000668E 6606 bne.s kbdr0 No, then look for ENTER 8636 00006690 0801 0005 btst #5,d1 Control Key ? 8637 00006694 6716 beq.s kbdisr0 Yes, Then try to go to Configure Mode 8638 * 8639 * Check for ENTER 8640 * 8641 00006696 0C40 0039 kbdr0 cmpi #$39,d0 ENTER Key ? 8642 0000669A 6648 bne.s kbdisr1 No, then look for other Keys 8643 0000669C 0869 0002 bchg #mb_stop,m_b(a1) Toggle stop bit 0054 8644 000066A2 08E9 0003 kbdr1 bset #attended,booleans(a1) Boot is now attended 000B 8645 000066A8 6000 00E4 bra kbdisr7 8646 * 8647 * If RESET is locked out, don't go to Configure Mode Now 8648 * 8649 000066AC 0829 0001 kbdisr0 btst #mb_lock,m_b(a1) Check for RESET Lock out 0054 8650 000066B2 6712 beq.s kbdisr0_1 Not locked out 8651 000066B4 4A29 0055 tst.b r_lock(a1) If nothing pending, pend CONFIG. 8652 000066B8 6600 00D4 bne kbdisr7 Something pending, ignore this 8653 000066BC 137C 0001 move.b #1,r_lock(a1) Pend a Configure Mode 0055 8654 000066C2 6000 00CA bra kbdisr7 Return 8655 * 8656 * If RESET is not pending then go to Configure Mode Now 8657 * 8658 000066C6 0C29 0002 kbdisr0_1 cmpi.b #2,r_lock(a1) Check for Pending RESET 0055 8659 000066CC 6700 00C0 beq kbdisr7 Yes, then Ignore this 8660 000066D0 0829 0002 btst #configure,booleans(a1) if Already in Configure mode then 000B 8661 000066D6 6600 00B6 bne kbdisr7 ignore PAUSE 8662 * 8663 * Entry Used by UNLOCK 8664 * 8665 000066DA 08E9 0002 kbdisr0_2 bset #configure,booleans(a1) Go to Configure Mode 000B 8666 000066E0 6000 00C0 bra confmode 8667 000066E4 08E9 0003 kbdisr1 bset #attended,booleans(a1) Boot is Now Attended 000B 8668 000066EA 0C00 003C cmpi.b #$3C,d0 Convert Key to ASCII 8669 000066EE 6D00 009E blt kbdisr7 Ignore < $3C keycode 8670 000066F2 6100 FA40 bsr read_trns translate 8671 000066F6 4840 swap d0 Ascii in lower 8 bits 8672 * 8673 * Entry Point for REMOTE Interface ISR's 8674 * 8675 000066F8 08E9 0003 kbdisr1_1 bset #attended,booleans(a1) Boot is Now Attended 000B 8676 000066FE 0C29 0000 cmpi.b #0,kbdtype(a1) Make sure it's an old style kbd 02CD 8677 00006704 6600 0026 bne kbdisr4 If it's not, skip over german stuff 8678 00006708 0C29 0002 cmpi.b #2,kbdlang(a1) Check for German Keyboard 02CC 8679 0000670E 661C bne.s kbdisr4 8680 00006710 B03C 0059 cmp.b #'Y',d0 If y,Y,z,Z then switch to PAGE 187 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8681 00006714 6712 beq.s kbdisr3 z,Z,y,Y via xor 3 8682 00006716 B03C 005A cmp.b #'Z',d0 8683 0000671A 670C beq.s kbdisr3 8684 0000671C B03C 0079 cmp.b #'y',d0 8685 00006720 6706 beq.s kbdisr3 8686 00006722 B03C 007A cmp.b #'z',d0 8687 00006726 6604 bne.s kbdisr4 8688 00006728 0A00 0003 kbdisr3 eori.b #3,d0 8689 0000672C B03C 0030 kbdisr4 cmp.b #'0',d0 Filter non A-Z, a-z, 0-9 8690 00006730 6548 bcs.s kbdisr6 if < 0 then ignore it 8691 00006732 B03C 0039 cmp.b #'9',d0 if <=9 then use it 8692 00006736 631A bls.s kbdisr2 8693 00006738 B03C 0041 cmp.b #'A',d0 if < A then ignore it 8694 0000673C 653C bcs.s kbdisr6 8695 0000673E B03C 005A cmp.b #'Z',d0 if <= Z then use it 8696 00006742 630E bls.s kbdisr2 8697 00006744 B03C 0061 cmp.b #'a',d0 if < a then ignore it 8698 00006748 6530 bcs.s kbdisr6 8699 0000674A B03C 007A cmp.b #'z',d0 if <= z then use it 8700 0000674E 6302 bls.s kbdisr2 8701 00006750 6028 bra.s kbdisr6 Anything else then ignore it 8702 00006752 0C69 0010 kbdisr2 cmpi #16,rwait(a1) Check for Full Queue 02C6 8703 00006758 6720 beq.s kbdisr6 If so, then ignore character 8704 0000675A 3229 02CA move rtail(a1),d1 Add character to queue 8705 0000675E 41F1 1000 lea 0(a1,d1),a0 8706 00006762 1080 move.b d0,(a0) 8707 00006764 5269 02CA addq #1,rtail(a1) 8708 00006768 0C69 02C6 cmpi #rbuff+16,rtail(a1) Check for wrap around 02CA 8709 0000676E 6606 bne.s kbdisr5 8710 00006770 337C 02B6 move #rbuff,rtail(a1) 02CA 8711 00006776 5269 02C6 kbdisr5 addq #1,rwait(a1) Increment waiting 8712 0000677A 0829 0002 kbdisr6 btst #configure,booleans(a1) configure mode? 000B 8713 00006780 660C bne.s kbdisr7 branch if so 8714 00006782 0C69 0080 cmpi #$0080,remote_adr(a1) remote console? 009A 8715 00006788 660A bne.s kbdisr8 branch if so 8716 0000678A 6100 0224 kbdisr6_5 bsr keyproc call the keyboard processor 8717 0000678E 4CDF 0307 kbdisr7 movem.l (sp)+,a0-a1/d0-d2 Restore Registers 8718 00006792 4E73 rte 8719 8720 00006794 4A29 0048 kbdisr8 tst.b key_lock(a1) remote key processing locked out? 8721 00006798 67F0 beq kbdisr6_5 branch if not; process it 8722 0000679A 08E9 0000 bset #0,key_pending(a1) else indicate key pending 0049 8723 000067A0 60EC bra kbdisr7 and return w/o processing key 8724 8725 ****************************************************************************** 8726 * CONFMODE: Configure Mode Supervisor * 8727 * drop int level * 8728 * Clear Screen;Clear Stack * 8729 * if no command in 5 minutes Restart * 8730 * while true do * 8731 * begin * PAGE 188 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8732 * read a key * 8733 * if t then set self-test to long and enter self-test * 8734 * if r then test hi res CRT and enter at self-test 8735 * if 5 then switch to 50 Hz and enter at self-test * 8736 * if 6 then switch to 60 Hz and enter at self-test * 8737 * end * 8738 ****************************************************************************** 8739 000067A2 027C F000 confmode andi #$F000,sr Drop int level to zero 8740 000067A6 6100 EE5E bsr menuclr Clear menu area 8741 000067AA 3029 0052 move height(a1),d0 Clear line height-1 8742 000067AE 5340 subq #1,d0 8743 000067B0 6100 EE22 bsr clrline 8744 000067B4 41FA EFD8 lea confmmsg,a0 Indicate Configure mode 8745 000067B8 6100 EDF8 bsr putmsg 8746 000067BC 4FF8 FDAC lea boot_stack,sp Clear stack 8747 * 8748 * Put up 4 lines of Menu. Unless on a 50 wide crt, then only put up 2 lines. 8749 * 8750 000067C0 41FA 0180 lea confdisp,a0 Set a0 to point to header message 8751 000067C4 323C 0001 move #1,d1 Message goes in row 0 (d1-1) 8752 000067C8 6100 0160 bsr confmenu Print menu header 8753 000067CC 41FA 0182 lea confdispt,a0 Set a0 to point to 'T' message 8754 000067D0 5241 addq #1,d1 Message goes on next line 8755 000067D2 6100 0156 bsr confmenu Print 'T' menu line 8756 000067D6 0838 0006 btst #6,sysflag Look for hi res CRT (Gator) FED2 8757 000067DC 6700 0010 beq confmode1 None, so skip 'R' menu line 8758 000067E0 41FA 0188 lea confdispr,a0 A0 = 'R' menu message 8759 000067E4 5241 addq #1,d1 Message goes on the next line 8760 000067E6 6100 0142 bsr confmenu Print 'R' menu message 8761 000067EA 6000 001E bra confmode3 Skip over 50/60 Hz stuff 8762 000067EE 0838 0000 confmode1 btst #0,sysflag 50 or 80 wide CRT ? FED2 8763 000067F4 6614 bne.s confmode3 50 wide, so skip '5' & '6' msgs 8764 000067F6 41FA 0196 confmode2 lea confdisp5,a0 Set a0 to point to '5' msg 8765 000067FA 5241 addq #1,d1 Mesg goes in next row 8766 000067FC 6100 012C bsr confmenu Print '5' menu line 8767 00006800 41FA 019D lea confdisp6,a0 Set a0 to point to '6' msg 8768 00006804 5241 addq #1,d1 Mesg goes in next row 8769 00006806 6100 0122 bsr confmenu Print '6' menu line 8770 0000680A 223C 00E4 confmode3 move.l #15000000,d1 Time out in 5 minutes E1C0 8771 00006810 5381 confmode4 subq.l #1,d1 8772 00006812 6724 beq.s confmode5 8773 00006814 4EA9 02AA jsr rstatus(a1) Wait for a character 8774 00006818 67F6 beq.s confmode4 No character yet 8775 0000681A 4EA9 02B0 jsr rdb(a1) Get the character 8776 0000681E B03C 0054 cmp.b #'T',d0 8777 00006822 6720 beq.s confmodt 8778 00006824 B03C 0035 cmp.b #'5',d0 8779 00006828 6742 beq.s confmod6 8780 0000682A B03C 0036 cmp.b #'6',d0 8781 0000682E 6752 beq.s confmod8 8782 00006830 B03C 0052 cmp.b #'R',d0 8783 00006834 6762 beq.s confmodr 8784 00006836 60D8 bra.s confmode4 Try again 8785 * PAGE 189 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8786 * Entry also used by UNLOCK 8787 * 8788 00006838 1C38 FED2 confmode5 move.b sysflag,d6 Required by entry point 8789 0000683C 41FA 9BC2 lea reset,a0 8790 00006840 6000 DBC4 bra go 8791 00006844 007C 2700 confmodt ori #$2700,sr Lock out Interrupts 8792 00006848 49F8 F7E4 lea minram-f_areatop,a4 Copy LOWRAM Up to Safety 8793 0000684C 204C movea.l a4,a0 8794 0000684E 45F8 FAC0 lea minram,a2 8795 00006852 20D9 confmodt0 move.l (a1)+,(a0)+ 8796 00006854 B5C8 cmpa.l a0,a2 8797 00006856 62FA bhi.s confmodt0 8798 00006858 21CC FED4 move.l a4,f_area 8799 0000685C 08AC 0004 bclr #lowram_ok,booleans(a4) Force a new memory test 000B 8800 00006862 08EC 0001 bset #ram_test,booleans(a4) Do a Long self-test 000B 8801 00006868 4EFA 9F44 confmodt1 jmp self_test Re-do some of initialization 8802 0000686C 0829 0007 confmod6 btst #bb_pres,booleans(a1) If Burgess Board set to 80 Wide 000B 8803 00006872 6706 beq.s confmod7 8804 00006874 08B8 0000 bclr #0,sysflag FED2 8805 0000687A 08E9 0000 confmod7 bset #h_5060,booleans(a1) Do a 50 Hz 000B 8806 00006880 60E6 bra.s confmodt1 8807 00006882 0829 0007 confmod8 btst #bb_pres,booleans(a1) If Burgess Board, set to 50 Wide 000B 8808 00006888 6706 beq.s confmod9 8809 0000688A 08F8 0000 bset #0,sysflag FED2 8810 00006890 08A9 0000 confmod9 bclr #h_5060,booleans(a1) Do a 60 Hz 000B 8811 00006896 60D0 bra.s confmodt1 8812 00006898 0838 0006 confmodr btst #6,sysflag Is it a Gator? FED2 8813 0000689E 6602 bne.s hi_res_ram_tst Yes -- test RAM 8814 000068A0 60C6 bra confmodt1 Return to self-test 8815 8816 0000 68A2 hi_res_ram_tst equ * 8817 000068A2 303C 001D move #gatorf,d0 8818 000068A6 4EBA B1BE jsr led_state 8819 000068AA 6100 EC94 bsr gatorclear Clear display 8820 000068AE 207C 0056 movea.l #hrsel,a0 Put CRT card addr in a0 0000 8821 000068B4 317C 0003 move #3,g_rrr(a0) Set up Repl. Rule Reg. to 4008 8822 * write to frame buffer memory 8823 * 8824 * GET FRAME BUFFER ADDRESS 8825 * 8826 000068BA 1228 4001 move.b gstat(a0),d1 Read status reg to get FB addr 8827 000068BE 0281 0000 andi.l #$0F,d1 Save only Frame Buffer addr bits 000F 8828 000068C4 243C 0000 move.l #20,d2 0014 8829 000068CA E5A9 lsl.l d2,d1 Shift FB addr bits PAGE 190 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8830 000068CC 2441 movea.l d1,a2 A2 = Frame Buffer start address 8831 * (start addr for mem test) 8832 * 8833 * GET MASK FOR RAM TEST 8834 * 8835 000068CE 14BC 0000 move.b #0,(a2) 8836 000068D2 157C 00FF move.b #255,1(a2) 0001 8837 000068D8 1012 move.b (a2),d0 8838 000068DA 122A 0001 move.b 1(a2),d1 8839 000068DE 157C 0000 move.b #0,1(a2) 0001 8840 000068E4 4640 not d0 8841 000068E6 C200 and.b d0,d1 D1.b = mask of graphics planes 8842 8843 000068E8 1F01 move.b d1,-(sp) Extend mask to fill long 8844 000068EA 1F41 0001 move.b d1,1(sp) 8845 000068EE 3F17 move.w (sp),-(sp) 8846 000068F0 2E1F move.l (sp)+,d7 D7 = Mask for memory test 8847 8848 * 8849 * GET ENDING ADDR OF FRAME BUFFER 8850 * 8851 000068F2 0108 0005 movep.w g_width(a0),d0 D0 = Width of Frame Buffer 8852 000068F6 0308 0009 movep.w g_height(a0),d1 D1 = Height of Frame Buffer 8853 000068FA C0C1 mulu d1,d0 D0 = Size of Frame Buffer 8854 000068FC 224A movea.l a2,a1 A1 = Start of Frame Buffer 8855 000068FE D3C0 adda.l d0,a1 A1 = End of Frame Buffer 8856 * (end addr for mem test) 8857 8858 00006900 6100 B29E bsr bytram DO MEMORY TEST 8859 8860 8861 00006904 4A40 tst d0 If d0=0 then passed 8862 00006906 671E beq.s hi_res_ram_test1 Branch if passed 8863 8864 00006908 6100 B17C bsr led_fail Indicate failure to leds 8865 0000690C 6100 EC32 bsr gatorclear Clear display 8866 00006910 41FA F041 lea badgator,a0 8867 00006914 6100 B212 bsr failing Put Failure on CRT(if possible) 8868 00006918 6100 B398 bsr mem_fail0 8869 0000691C 41FA EEA3 lea retrymsg,a0 Tell user to reset to retry 8870 00006920 6100 ED64 bsr displin Putmsg on next to bottom line 8871 00006924 60FE bra * Wait forever for user to reset 8872 8873 00006926 6000 FF40 hi_res_ram_test1 bra confmodt1 Return 8874 8875 0000 692A confmenu equ * 8876 * This routine assumes d1 is set up for tabxy 8877 * And that a0 points to a null term. string 8878 0000692A 3029 0046 move width(a1),d0 d0 = width of CRT 8879 0000692E E248 lsr #1,d0 d0 = width/2 8880 00006930 5240 addq #1,d0 Add one for tabxy 8881 00006932 4EA9 003C jsr tabxy(a1) Tab to desired location 8882 00006936 1018 confmenu1 move.b (a0)+,d0 D0 contains character from message 8883 00006938 6706 beq.s confmenu2 If d0 = 0 then we're thru with msg 8884 0000693A 4EA9 0036 jsr wtb(a1) Print character PAGE 191 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8885 0000693E 60F6 bra.s confmenu1 8886 00006940 4E75 confmenu2 rts Return 8887 8888 00006942 20 confdisp dc.b ' KEY ACTION',0 8889 00006950 20 confdispt dc.b ' T Extended Self-Test',0 8890 0000696A 20 confdispr dc.b ' R High Resolution CRT RAM Test',0 8891 0000698E 20 confdisp5 dc.b ' 5 50 Hz CRT',0 8892 0000699F 20 confdisp6 dc.b ' 6 60 Hz CRT',0 8893 8894 ****************************************************************************** 8895 * KEYPROC: Booter Menu Keyprocessor * 8896 * For each character in the queue go thru the state machine below. * 8897 * * 8898 * Start: * 8899 * Number:=0 * 8900 * || * 8901 * || * 8902 * || * 8903 * || * 8904 * +---------------++ || ++-----+ * 8905 * |Non 0-9 And || || || |0-9 Typed: * 8906 * |Non A-Z Typed: \/ \/ \/ |Number:=(Number*10+Digit) * 8907 * |Number:=0 ---------------------- | Mod 100 * 8908 * +--------------| Number State: |--+ * 8909 * +------->| boot_char(a4)=' ' |<---------+ * 8910 * | ---------------------- | * 8911 * | || | * 8912 * | || | * 8913 * | || |Non 0-9 And * 8914 * |0-9 Typed: ||A-Z Typed: |Non A-Z Typed: * 8915 * |Number:=Digit ||Number Saved |Number:=0 * 8916 * | || | * 8917 * | \/ | * 8918 * | ---------------------- | * 8919 * +--------| Boot Chosen State: |----------+ * 8920 * | boot_char(a4)#' ' | * 8921 * ---------------------- * 8922 * || /\ * 8923 * || ||A-Z Typed: Number=boot_sel(a4) * 8924 * || ||Number:=0 * 8925 * |+-----------+| * 8926 * +-------------+ * 8927 ****************************************************************************** 8928 000069B0 48E7 C008 keyproc movem.l a4/d0-d1,-(sp) Save Registers 8929 000069B4 2878 FED4 movea.l f_area,a4 Point to LOWRAM area 8930 000069B8 4EAC 02AA keyproc1 jsr rstatus(a4) Check for something in Queue 8931 000069BC 6772 beq.s keyproc7 Nothing then done 8932 000069BE 4EAC 02B0 jsr rdb(a4) Get a character 8933 000069C2 B03C 0041 cmp.b #'A',d0 Look for A-Z or a-z 8934 000069C6 6524 bcs.s keyproc4 8935 000069C8 B03C 005A cmp.b #'Z',d0 8936 000069CC 630C bls.s keyproc2 8937 000069CE B03C 0061 cmp.b #'a',d0 8938 000069D2 6518 bcs.s keyproc4 8939 000069D4 B03C 007A cmp.b #'z',d0 8940 000069D8 6212 bhi.s keyproc4 PAGE 192 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8941 000069DA 0C2C 0020 keyproc2 cmpi.b #' ',boot_char(a4) If not in Number state 02D3 8942 000069E0 6704 beq.s keyproc3 then 8943 000069E2 422C 02D2 clr.b boot_sel(a4) Clear sub-selector 8944 000069E6 1940 02D3 keyproc3 move.b d0,boot_char(a4) Set boot_char 8945 000069EA 60CC bra.s keyproc1 Check for more keys 8946 000069EC 0C2C 0020 keyproc4 cmpi.b #' ',boot_char(a4) If not already in Number state 02D3 8947 000069F2 670A beq.s keyproc5 then 8948 000069F4 197C 0020 move.b #' ',boot_char(a4) Go to number state 02D3 8949 000069FA 422C 02D2 clr.b boot_sel(a4) and clear number 8950 000069FE B03C 0030 keyproc5 cmp.b #'0',d0 Check for non-number 8951 00006A02 6526 bcs.s keyproc6 Non-number 8952 00006A04 B03C 0039 cmp.b #'9',d0 8953 00006A08 6220 bhi.s keyproc6 Non-number 8954 00006A0A 4880 ext d0 Convert d0 to decimal 8955 00006A0C 0440 0030 subi #'0',d0 8956 00006A10 48C0 ext.l d0 8957 00006A12 4281 clr.l d1 8958 00006A14 122C 02D2 move.b boot_sel(a4),d1 8959 00006A18 C2FC 000A mulu #10,d1 8960 00006A1C D280 add.l d0,d1 8961 00006A1E 82FC 0064 divu #100,d1 8962 00006A22 4841 swap d1 8963 00006A24 1941 02D2 move.b d1,boot_sel(a4) 8964 00006A28 608E bra.s keyproc1 Check for more keys 8965 00006A2A 422C 02D2 keyproc6 clr.b boot_sel(a4) 8966 00006A2E 6088 bra.s keyproc1 Check for more keys 8967 00006A30 4CDF 1003 keyproc7 movem.l (sp)+,a4/d0-d1 Restore Registers 8968 * Display current state 8969 * fall into keydisp routine 8970 8971 ****************************************************************************** 8972 * KEYDISP: Display Menu Keyprocessor state * 8973 * Put menu state up as three characters in upper right hand corner -1 * 8974 ****************************************************************************** 8975 00006A34 48E7 C088 keydisp movem.l a0/a4/d0-d1,-(sp) Save Registers 8976 00006A38 2878 FED4 movea.l f_area,a4 Point to LOWRAM area 8977 00006A3C 2F2C 004A move.l prthead(a4),-(sp) Save Current print head position 8978 00006A40 322C 0052 move height(a4),d1 tabxy width-3,height 8979 00006A44 302C 0046 move width(a4),d0 8980 00006A48 5740 subq #3,d0 8981 00006A4A 4EAC 003C jsr tabxy(a4) 8982 00006A4E 594F subq #4,sp Reserve space for string 8983 00006A50 204F movea.l sp,a0 8984 00006A52 4240 clr d0 put out 2 digit sub-selector 8985 00006A54 102C 02D2 move.b boot_sel(a4),d0 number with leading spaces 8986 00006A58 6100 9FFC bsr putnum 8987 00006A5C 1017 move.b (sp),d0 8988 00006A5E 4EAC 0036 jsr wtb(a4) 8989 00006A62 102F 0001 move.b 1(sp),d0 8990 00006A66 4EAC 0036 jsr wtb(a4) 8991 00006A6A 584F addq #4,sp 8992 00006A6C 102C 02D3 move.b boot_char(a4),d0 put out boot selector character 8993 00006A70 4EAC 0036 jsr wtb(a4) 8994 00006A74 295F 004A move.l (sp)+,prthead(a4) Restore current print head PAGE 193 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM HUMAN INTERFACE DRIVERS (BOOTHI)" 8995 00006A78 4240 clr d0 8996 00006A7A 4241 clr d1 8997 00006A7C 4EAC 003C jsr tabxy(a4) Restore print head 8998 00006A80 4CDF 1103 movem.l (sp)+,a0/a4/d0-d1 Restore Registers 8999 00006A84 4E75 rts 9000 9001 ****************************************************************************** 9002 * LOCK: Lock out Keyboard Resets * 9003 ****************************************************************************** 9004 00006A86 2F0C lock move.l a4,-(sp) Save a4 9005 00006A88 2878 FED4 movea.l f_area,a4 9006 00006A8C 422C 0055 clr.b r_lock(a4) Nothing Pending Yet 9007 00006A90 08EC 0001 bset #mb_lock,m_b(a4) Lock out 0054 9008 00006A96 285F movea.l (sp)+,a4 Restore a4 9009 00006A98 4E75 rts 9010 9011 ****************************************************************************** 9012 * UNLOCK: Unlock Keyboard Resets, Service any pending * 9013 ****************************************************************************** 9014 00006A9A 2F09 unlock move.l a1,-(sp) Save a4 9015 00006A9C 40E7 move sr,-(sp) Lock out Interrupts 9016 00006A9E 007C 2700 ori #$2700,sr 9017 00006AA2 2278 FED4 movea.l f_area,a1 9018 00006AA6 08A9 0001 bclr #mb_lock,m_b(a1) Unlock Resets 0054 9019 00006AAC 4A29 0055 tst.b r_lock(a1) Check for something pending 9020 00006AB0 6714 beq.s unlock1 Nothing Pending 9021 * 9022 * Handle Pending Reset 9023 * 9024 00006AB2 0C29 0001 cmpi.b #1,r_lock(a1) Check for Configure Mode 0055 9025 00006AB8 6700 FC20 beq kbdisr0_2 Go to Configure Mode 9026 00006ABC 0C29 0002 cmpi.b #2,r_lock(a1) Check for RESET 0055 9027 00006AC2 6700 FD74 beq confmode5 Do the RESET Now 9028 * 9029 * Finish Up 9030 * 9031 00006AC6 46DF unlock1 move (sp)+,sr Restore Interrupt Level 9032 00006AC8 225F movea.l (sp)+,a1 Restore a4 9033 00006ACA 4E75 rts 9034 PAGE 194 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9037 include GREG:BOOTRHI 9038 * sccs info: @(#) bootrhi 8.1 84/05/04 00:12:57 * 9039 9040 ****************************************************************************** 9041 ****************************************************************************** 9042 *** *** 9043 *** BOOTROM 3.0 Remote Human Interface Drivers *** 9044 *** *** 9045 *** CRT Layout during BOOTROM 3.0 Control of Machine *** 9046 *** WINIT_R Initializes External CRT *** 9047 *** WTB_R Writes Character in D0 at Printhead *** 9048 *** TABXY_R Sets Printhead to X(D0), Y(D1) *** 9049 *** *** 9050 *** Card Drivers: *** 9051 *** Remote_find Try to Find a Remote Human Interface *** 9052 *** Remote_init Initialize Remote I/O Card *** 9053 *** Remote_send Send a Character to a Remote I/O Card *** 9054 *** Remote_flush Flush all buffered characters output *** 9055 *** Remote_set Set up any Remote Keyboard *** 9056 *** Rem626_isr Interrupt Routine for 98626 *** 9057 *** *** 9058 ****************************************************************************** 9059 ****************************************************************************** 9060 9061 * 9062 * REMOTE_SUNLOCK - re-enable key processing 9063 * 9064 * note: a0 must point to f_area upon entry 9065 * 9066 00006ACC 5228 0048 rem_sun_proc addq.b #1,key_lock(a0) prevent keyproc recursion 9067 00006AD0 6100 FEDE bsr keyproc process the key(s) 9068 9069 00006AD4 5328 0048 remote_sunlock subq.b #1,key_lock(a0) decrement lock level 9070 00006AD8 6608 bne.s rem_sun_ret branch if still locked 9071 00006ADA 08A8 0000 bclr #0,key_pending(a0) any keys pending? 0049 9072 00006AE0 66EA bne rem_sun_proc branch if so 9073 00006AE2 4E75 rem_sun_ret rts return PAGE 195 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9075 ****************************************************************************** 9076 * WINIT_R: Initializes External CRT * 9077 * * 9078 * Initialize and Turn on CRT Controller. * 9079 * Blank CRT Memory. * 9080 * width:=80;prthead:=0;crtst:=0 * 9081 * height:=24;crtlst:=crtst+height*width; * 9082 * set_up_vectors; * 9083 ****************************************************************************** 9084 00006AE4 48E7 E080 winit_r movem.l a0/d0-d2,-(sp) Save Registers 9085 00006AE8 2078 FED4 movea.l f_area,a0 Point to LOWRAM area 9086 * 9087 * Terminals are 80 wide by 24 lines high 9088 * 9089 00006AEC 317C 0050 move #80,width(a0) 80 Wide 0046 9090 00006AF2 42A8 004A clr.l prthead(a0) prthead:=0 9091 00006AF6 42A8 0042 clr.l crtst(a0) Start of CRT 9092 00006AFA 317C 0018 move #24,height(a0) 24 Line Display 0052 9093 00006B00 3028 0052 move height(a0),d0 Compute End of Display Plus One 9094 00006B04 C0E8 0046 mulu width(a0),d0 9095 00006B08 D0A8 0042 add.l crtst(a0),d0 9096 00006B0C 2140 004E move.l d0,crtlst(a0) 9097 00006B10 4228 0048 clr.b key_lock(a0) init key processing lockout counter 9098 00006B14 4228 0049 clr.b key_pending(a0) init key pending flag 9099 * 9100 * Set-up wtb Vectors 9101 * 9102 00006B18 317C 4EF9 move #jmpop,winit(a0) Set up Vectors 0030 9103 00006B1E 217C 0000 move.l #winit_r,winit+2(a0) 6AE4 0032 9104 00006B26 317C 4EF9 move #jmpop,tabxy(a0) 003C 9105 00006B2C 217C 0000 move.l #tabxy_r,tabxy+2(a0) 6BB8 003E 9106 00006B34 317C 4EF9 move #jmpop,wtb(a0) 0036 9107 00006B3A 217C 0000 move.l #wtb_r,wtb+2(a0) 6B78 0038 9108 * 9109 * Clear Screen by Escape H and Escape J 9110 * 9111 00006B42 5228 0048 addq.b #1,key_lock(a0) disable key processing 9112 00006B46 40E7 move sr,-(sp) Lock out Interrupts 9113 00006B48 007C 2700 ori #$2700,sr 9114 9115 00006B4C 701B moveq #27,d0 Escape H 9116 00006B4E 6100 0262 bsr remote_send 9117 00006B52 7048 moveq #'H',d0 9118 00006B54 6100 025C bsr remote_send 9119 00006B58 701B moveq #27,d0 Escape J 9120 00006B5A 6100 0256 bsr remote_send 9121 00006B5E 704A moveq #'J',d0 9122 00006B60 6100 0250 bsr remote_send 9123 PAGE 196 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9124 00006B64 7201 moveq #1,d1 tabxy 1,1 9125 00006B66 7001 moveq #1,d0 9126 00006B68 4EA8 003C jsr tabxy(a0) 9127 9128 00006B6C 46DF move (sp)+,sr Restore Interrupts 9129 00006B6E 6100 FF64 bsr remote_sunlock re-enable key processing 9130 9131 00006B72 4CDF 0107 movem.l (sp)+,d0-d2/a0 Restore Registers 9132 00006B76 4E75 rts 9133 9134 ****************************************************************************** 9135 * WTB_A: Writes Character in D0 at Printhead * 9136 * Character in d0 is printed to CRT at prthead. * 9137 * Prthead is then incremented. DON't Send Control Characters to this. * 9138 * Scrolling simply wraps around. It is assumed that prthead is modified * 9139 * only by WTB, WINIT, and TABXY. * 9140 * * 9141 * mem[prthead]:=char;prthead:=prthead+1; * 9142 * if prthead>=crtlst then * 9143 * begin * 9144 * tabxy 1,1; * 9145 * prthead:=crtst; * 9146 * end; * 9147 ****************************************************************************** 9148 00006B78 48E7 C0C0 wtb_r movem.l a0-a1/d0-d1,-(sp) Save Registers 9149 00006B7C 2078 FED4 movea.l f_area,a0 Point to LOWRAM 9150 00006B80 5228 0048 addq.b #1,key_lock(a0) disable key processing 9151 00006B84 40E7 move sr,-(sp) Lock out Interrupts 9152 00006B86 007C 2700 ori #$2700,sr 9153 00006B8A 6100 0226 bsr remote_send Write out the Character 9154 00006B8E 52A8 004A addq.l #1,prthead(a0) Increment Printhead 9155 00006B92 2268 004A movea.l prthead(a0),a1 9156 00006B96 B3E8 004E cmpa.l crtlst(a0),a1 Update Prthead 9157 00006B9A 6D0C blt.s wbr2 9158 00006B9C 2268 0042 movea.l crtst(a0),a1 9159 00006BA0 7001 moveq #1,d0 9160 00006BA2 7201 moveq #1,d1 9161 00006BA4 4EA8 003C jsr tabxy(a0) Tabxy 1,1 9162 00006BA8 2149 004A wbr2 move.l a1,prthead(a0) 9163 00006BAC 46DF wbr3 move (sp)+,sr Restore Interrupts 9164 00006BAE 6100 FF24 bsr remote_sunlock re-enable key processing 9165 00006BB2 4CDF 0303 movem.l (sp)+,a0-a1/d0-d1 Restore Registers 9166 00006BB6 4E75 rts 9167 9168 ****************************************************************************** 9169 * TABXY_r: Sets Printhead to X(D0), Y(D1) * 9170 * Compute Current X,Y from prthead. Make mod to X if Non-Zero. * 9171 * Make mod to Y if Non-Zero. Compute new prthead from X,Y. * 9172 * * 9173 * x:=((prthead-crtst) mod width); * 9174 * y:=((prthead-crtst) div width)+1; * 9175 * if d0.b>0 then * 9176 * begin * 9177 * x:=((d0.b-1) mod width); * 9178 * wtb(&a C; * 9179 * end; * 9180 * if d1.b>0 then * PAGE 197 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9181 * begin * 9182 * y:=((d1.b-1) mod height); * 9183 * wtb(&a Y; * 9184 * end; * 9185 * prthead:=y*width+x+crtst; * 9186 ****************************************************************************** 9187 00006BB8 48E7 F0E0 tabxy_r movem.l a0-a2/d0-d3,-(sp) Save Registers 9188 00006BBC 2078 FED4 movea.l f_area,a0 Point to LOWRAM 9189 00006BC0 5228 0048 addq.b #1,key_lock(a0) disable key processing 9190 00006BC4 40E7 move sr,-(sp) Lock out Interrupts 9191 00006BC6 007C 2700 ori #$2700,sr 9192 00006BCA 2428 004A move.l prthead(a0),d2 x2(d2):=((prthead-crtst) mod 9193 00006BCE 94A8 0042 sub.l crtst(a0),d2 width) 9194 00006BD2 84E8 0046 divu width(a0),d2 9195 00006BD6 3602 move d2,d3 y2(d3):=((prthead-crtst) mod 9196 00006BD8 4842 swap d2 width) 9197 00006BDA 4A00 tst.b d0 if x1(d0.b)>0 then 9198 00006BDC 6F0E ble.s tbrxy1 x2(d2):=(d0.b-1) mod width 9199 00006BDE 4880 ext d0 9200 00006BE0 48C0 ext.l d0 9201 00006BE2 5380 subq.l #1,d0 9202 00006BE4 80E8 0046 divu width(a0),d0 9203 00006BE8 4840 swap d0 9204 00006BEA 3400 move d0,d2 9205 00006BEC 3002 tbrxy1 move d2,d0 9206 00006BEE 613E bsr.s tabrxy3 9207 00006BF0 7043 moveq #'C',d0 Column 9208 00006BF2 6100 01BE bsr remote_send 9209 00006BF6 4A01 tst.b d1 if y1(d1.b)>0 then 9210 00006BF8 6F0E ble.s tbrxy2 y2(d3):=(d1.b-1) mod height 9211 00006BFA 4881 ext d1 9212 00006BFC 48C1 ext.l d1 9213 00006BFE 5381 subq.l #1,d1 9214 00006C00 82E8 0052 divu height(a0),d1 9215 00006C04 4841 swap d1 9216 00006C06 3601 move d1,d3 9217 00006C08 3003 tbrxy2 move d3,d0 9218 00006C0A 6122 bsr.s tabrxy3 9219 00006C0C 7059 moveq #'Y',d0 Row 9220 00006C0E 6100 01A2 bsr remote_send 9221 00006C12 C6E8 0046 mulu width(a0),d3 prthead:=y2*width+x2+crtst 9222 00006C16 D642 add d2,d3 9223 00006C18 48C3 ext.l d3 9224 00006C1A D6A8 0042 add.l crtst(a0),d3 9225 00006C1E 2143 004A move.l d3,prthead(a0) 9226 00006C22 46DF move (sp)+,sr Restore sr 9227 00006C24 6100 FEAE bsr remote_sunlock re-enable key processing 9228 00006C28 4CDF 070F movem.l (sp)+,a0-a2/d0-d3 9229 00006C2C 4E75 rts 9230 9231 * Move Cursor Absolute at value in d0 9232 00006C2E 2F00 tabrxy3 move.l d0,-(sp) Save Registers 9233 00006C30 701B moveq #27,d0 Escape 9234 00006C32 6100 017E bsr remote_send 9235 00006C36 7026 moveq #'&',d0 & 9236 00006C38 6100 0178 bsr remote_send 9237 00006C3C 7061 moveq #'a',d0 a PAGE 198 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9238 00006C3E 6100 0172 bsr remote_send 9239 00006C42 201F move.l (sp)+,d0 9240 00006C44 4E50 FFF6 link a0,#-10 Reserve Space on Stack to Create 9241 00006C48 43E8 FFF6 lea -10(a0),a1 Ascii Digits of Value 9242 00006C4C 48E7 FE00 movem.l d0-d6,-(sp) Save Registers 9243 00006C50 4880 ext d0 9244 00006C52 48C0 ext.l d0 9245 00006C54 6100 E040 bsr bin_to_dec 9246 00006C58 4CDF 007F movem.l (sp)+,d0-d6 Restore Registers 9247 00006C5C 1028 FFF6 move.b -10(a0),d0 Send 1st digit for sure 9248 00006C60 6100 0150 bsr remote_send 9249 00006C64 45E8 FFF7 lea -9(a0),a2 9250 00006C68 B3CA cmpa.l a2,a1 If longer than one digit, send 2nd 9251 00006C6A 6708 beq.s tabrxy4 9252 00006C6C 1028 FFF7 move.b -9(a0),d0 9253 00006C70 6100 0140 bsr remote_send 9254 00006C74 4E58 tabrxy4 unlk a0 9255 00006C76 4E75 rts PAGE 199 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9257 * 9258 * 98626/98644 card offsets 9259 * 9260 0000 0003 r_intlvl equ 3 9261 0000 0005 r_bsw equ 5 9262 0000 0007 r_lsw equ 7 9263 0000 0011 r_data equ 17 9264 0000 0011 r_lsb equ r_data 9265 0000 0013 r_ier equ r_data+2 9266 0000 0013 r_msb equ r_ier 9267 0000 0015 r_iir equ r_ier+2 9268 0000 0017 r_lcr equ r_iir+2 9269 0000 0019 r_mcr equ r_lcr+2 9270 0000 001B r_lsr equ r_mcr+2 9271 0000 001D r_msr equ r_lsr+2 9272 9273 * 9274 * 98644 baud rate and line characteristics 9275 * 9276 0000 000E dbr644 equ $0E baud rate: 9600 baud 9277 0000 0043 dlc644 equ $43 line char: 8 bit/char; 1 stop bit; no parity; xon/xoff 9278 PAGE 200 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9280 ****************************************************************************** 9281 * Remote_find: Try to Find a Remote Human Interface * 9282 * If One is Found: Remote_type(f_area) = card type/software handshake * 9283 * 000000XX = 98626/98644 * 9284 * Remote_adr(f_area) = address of I/O Card * 9285 * If none Found: Remote_adr(f_area) = $800000 * 9286 * Remote_type(f_area) = $FF * 9287 ****************************************************************************** 9288 9289 00006C78 48E7 FFCE remote_find movem.l d0-d7/a0/a1/a4-a6,-(sp) Save Registers 9290 9291 * 9292 * Start Scan at Select Code 0: $60 0000 9293 * 9294 00006C7C 2878 FED4 movea.l f_area,a4 9295 00006C80 297C 0060 move.l #$600000,remote_adr(a4) Start at Select Code 0 0000 009A 9296 00006C88 50EC 009E st remote_type(a4) no remote human interface (yet) 9297 9298 00006C8C 4DFA 006E rem_find_loop lea rem_find_stk,a6 Handle a Missing Card 9299 00006C90 2A4F movea.l sp,a5 Save Stack Pointer 9300 9301 * 9302 * Check I/O Card for Remote Bit 9303 * 9304 00006C92 206C 009A movea.l remote_adr(a4),a0 Point to Card base in a0 9305 00006C96 7400 moveq #0,d2 No ID yet 9306 00006C98 1428 0001 move.b 1(a0),d2 Get ID field 9307 00006C9C 0882 0007 bclr #7,d2 test and clear remote bit 9308 00006CA0 675E beq.s rem_find_nxt branch if not remote 9309 9310 * 9311 * Check for 98626/98644 Cards 9312 * 9313 00006CA2 0C02 0002 rem_find_sio cmpi.b #2,d2 98626 card? 9314 00006CA6 6706 beq.s rem_find_sio1 branch if so 9315 00006CA8 0C02 0042 cmpi.b #66,d2 98644 card? 9316 00006CAC 6652 bne.s rem_find_nxt branch if not 9317 9318 00006CAE 5288 rem_find_sio1 addq.l #1,a0 test needs this base 9319 00006CB0 6100 DF44 bsr siotst Test the Card 9320 00006CB4 5388 subq.l #1,a0 back to the standard base 9321 00006CB6 4A00 tst.b d0 d0=0 is Okay 9322 00006CB8 6646 bne.s rem_find_nxt Bad SIO go to next one 9323 9324 00006CBA 7043 moveq #dlc644,d0 98644 default line characteristics 9325 00006CBC 0C02 0042 cmpi.b #66,d2 98644 card? 9326 00006CC0 6704 beq.s rem_find_sio2 branch if so 9327 00006CC2 1028 0007 move.b r_lsw(a0),d0 get 98626 line characteristics 9328 00006CC6 EC08 rem_find_sio2 lsr.b #6,d0 isolate software handshake bits 9329 00006CC8 1940 009E move.b d0,remote_type(a4) Set Type to SIO / SW HS 9330 9331 * 9332 * Set-up Remote Card 9333 * 9334 00006CCC 43F8 FDD2 rem_find_set lea fubuffer,a1 Build Message 9335 00006CD0 41FA ED79 lea remotemsg,a0 PAGE 201 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9336 00006CD4 12D8 move.b (a0)+,(a1)+ Copy "Remote Interface at " 9337 00006CD6 66FC bne.s *-2 9338 00006CD8 5349 subq #1,a1 Adjust Pointer 9339 9340 00006CDA 701F moveq #$1F,d0 prepare to... 9341 00006CDC C06C 009A and.w remote_adr(a4),d0 Compute Select Code 9342 00006CE0 6100 DFB4 bsr bin_to_dec 9343 00006CE4 4219 clr.b (a1)+ Terminate String 9344 00006CE6 41F8 FDD2 lea fubuffer,a0 9345 00006CEA 6100 E94E bsr sftmsg Put up CRT Message 9346 9347 00006CEE 397C 0001 move #1,nxt_sline(a4) Reset Message Line Number 02D4 9348 00006CF4 6140 bsr.s remote_init Initialize Remote Card 9349 00006CF6 6100 FDEC bsr winit_r Initialize Screen 9350 00006CFA 6034 bra.s rem_find_ret Done 9351 9352 * 9353 * Handle Bus Errors 9354 * 9355 00006CFC 2E4D rem_find_stk movea.l a5,sp Restore Stack 9356 00006CFE 7400 moveq #0,d2 No ID 9357 9358 * 9359 * Try next Select Code 9360 * 9361 00006D00 0202 001F rem_find_nxt andi.b #$1F,d2 isolate primary ID 9362 00006D04 7004 moveq #4,d0 bump value for quad-wide cards 9363 00006D06 0C02 001A cmpi.b #26,d2 quad-wide primary? 9364 00006D0A 6710 beq.s rem_find_nxt1 branch if so 9365 00006D0C 7002 moveq #2,d0 bump value for double-wide cards 9366 00006D0E 0C02 001C cmpi.b #28,d2 double-wide primary? 9367 00006D12 6708 beq.s rem_find_nxt1 branch if so 9368 00006D14 0C02 001D cmpi.b #29,d2 double-wide primary? 9369 00006D18 6702 beq.s rem_find_nxt1 branch if so 9370 00006D1A 7001 moveq #1,d0 bump value for single-wide cards 9371 00006D1C D16C 009A rem_find_nxt1 add d0,remote_adr(a4) bump UPPER WORD appropriately 9372 00006D20 0C6C 0080 cmpi #$0080,remote_adr(a4) test UPPER WORD only 009A 9373 00006D26 6500 FF64 bcs rem_find_loop branch if still in ext io space 9374 00006D2A 397C 0080 move #$0080,remote_adr(a4) in case doubles or quads cross 009A 9375 * 9376 * Done 9377 * 9378 00006D30 4CDF 73FF rem_find_ret movem.l (sp)+,d0-d7/a0/a1/a4-a6 Restore Registers 9379 00006D34 4E75 rts PAGE 202 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9381 ****************************************************************************** 9382 * Remote_init: Initialize Remote I/O Card * 9383 ****************************************************************************** 9384 9385 00006D36 48E7 E0C8 remote_init movem.l d0-d2/a0/a1/a4,-(sp) Save Registers 9386 9387 * 9388 * Determine which card it is 9389 * 9390 00006D3A 2878 FED4 movea.l f_area,a4 9391 00006D3E 206C 009A movea.l remote_adr(a4),a0 Get Card Address 9392 00006D42 707C moveq #$7C,d0 prepare to... 9393 00006D44 C02C 009E and.b remote_type(a4),d0 isolate the card type bits 9394 00006D48 6642 bne.s rem_init_ret return if out of range 9395 * 9396 * (jump table envisioned here as more card types supported) 9397 * 9398 9399 * 9400 * Initialize 98626/98644 Cards 9401 * 9402 00006D4A 707F rem_init_sio moveq #$7F,d0 prepare to... 9403 00006D4C C028 0001 and.b 1(a0),d0 extract primary & secondary ID's 9404 9405 00006D50 720E moveq #dbr644,d1 98644 default baud rate 9406 00006D52 7443 moveq #dlc644,d2 98644 default line characteristics 9407 00006D54 0C00 0042 cmpi.b #66,d0 98644 card? 9408 00006D58 6708 beq.s rem_init_sio1 branch if so 9409 9410 00006D5A 1228 0005 move.b r_bsw(a0),d1 read 98626 baud rate 9411 00006D5E 1428 0007 move.b r_lsw(a0),d2 read 98626 line characteristics 9412 9413 00006D62 C27C 000F rem_init_sio1 and.w #$000F,d1 isolate baud rate bits 9414 00006D66 E349 lsl #1,d1 two bytes per table entry 9415 00006D68 43FB 1028 lea baud(d1),a1 point to appropriate table entry 9416 00006D6C 117C 0080 move.b #$80,r_lcr(a0) Set DLAB Bit of LCR for Baud Access 0017 9417 00006D72 1159 0013 move.b (a1)+,r_msb(a0) Set MSB of Baud 9418 00006D76 1151 0011 move.b (a1),r_lsb(a0) Set LSB of Baud 9419 9420 00006D7A C43C 003F and.b #$3F,d2 mask off handshake type 9421 00006D7E 1142 0017 move.b d2,r_lcr(a0) set line characteristics 9422 00006D82 117C 0005 move.b #$05,r_ier(a0) enable receive & break interrupts 0013 9423 9424 00006D88 51EC 009F sf remote_xoff(a4) initialize software handshake flag 9425 9426 * 9427 * Done 9428 * 9429 00006D8C 4CDF 1307 rem_init_ret movem.l (sp)+,d0-d2/a0/a1/a4 Restore Registers 9430 00006D90 4E75 rts 9431 9432 * 9433 * Baud Rate Table 9434 * 9435 00006D92 0C00 baud dc 3072 50 Baud PAGE 203 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9436 00006D94 0800 dc 2048 75 9437 00006D96 0574 dc 1396 110 9438 00006D98 0476 dc 1142 134.5 9439 00006D9A 0400 dc 1024 150 9440 00006D9C 0300 dc 768 200 9441 00006D9E 0200 dc 512 300 9442 00006DA0 0100 dc 256 600 9443 00006DA2 0080 dc 128 1200 9444 00006DA4 0055 dc 85 1800 9445 00006DA6 0040 dc 64 2400 9446 00006DA8 002B dc 43 3600 9447 00006DAA 0020 dc 32 4800 9448 00006DAC 0015 dc 21 7200 9449 00006DAE 0010 dc 16 9600 9450 00006DB0 0008 dc 8 19200 PAGE 204 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9452 ****************************************************************************** 9453 * Remote_send Send a Character in D0 to a Remote I/O Card * 9454 ****************************************************************************** 9455 9456 00006DB2 48E7 C088 remote_send movem.l d0-d1/a0/a4,-(sp) save registers 9457 9458 * 9459 * Determine which card/handshake type it is 9460 * 9461 00006DB6 2878 FED4 movea.l f_area,a4 9462 00006DBA 206C 009A movea.l remote_adr(a4),a0 get card address 9463 00006DBE 7200 moveq #0,d1 prepare to... 9464 00006DC0 122C 009E move.b remote_type(a4),d1 get card/handshake type bits 9465 00006DC4 B27C 0004 cmp #4,d1 out of range? 9466 00006DC8 646A bcc.s rem_send_ret branch if so 9467 00006DCA E341 asl #1,d1 two bytes per table entry 9468 00006DCC 323B 1006 move rem_send_tbl(d1),d1 load jump offset to routine 9469 00006DD0 4EFB 1002 jmp rem_send_tbl(d1) jump to appropriate routine 9470 9471 00006DD4 002A rem_send_tbl dc rem_sio_ENQ-rem_send_tbl 0 98626/98644 ENQ/ACK 9472 00006DD6 004A dc rem_sio_XON-rem_send_tbl 1 98626/98644 XON/XOFF 9473 00006DD8 0052 dc rem_sio_NHS-rem_send_tbl 2 98626/98644 no handshake 9474 00006DDA 0052 dc rem_sio_NHS-rem_send_tbl 3 98626/98644 no handshake 9475 9476 * 9477 * 98626/98644 routine to fake an isr if necessary 9478 * 9479 00006DDC 0828 0006 rem_sio_fisr btst #6,r_intlvl(a0) requesting an interrupt? 0003 9480 00006DE2 6602 bne.s rem_sio_fisr2 branch if so 9481 00006DE4 4E75 rem_sio_fisr1 rts return 9482 9483 00006DE6 0838 0002 rem_sio_fisr2 btst #M68000,sysflag2 are we on a 68000? FEDA 9484 00006DEC 6602 bne.s rem_sio_fisr3 branch if so 9485 00006DEE 4267 clr -(sp) push the 6801X short format code 9486 00006DF0 487A FFF2 rem_sio_fisr3 pea rem_sio_fisr1 push the return address 9487 00006DF4 40E7 move sr,-(sp) push the status register 9488 00006DF6 007C 2700 ori #$2700,sr lock out real interrupts 9489 00006DFA 6000 00AE bra rem_sio_isr and fake an interrupt 9490 9491 * 9492 * 98626/98644 ENQ/ACK 9493 * 9494 00006DFE 532C 009F rem_sio_ENQ subq.b #1,remote_xoff(a4) decrement and test state info 9495 00006E02 6A22 bpl.s rem_sio_NHS branch if OK to send 9496 9497 00006E04 61D6 rem_sio_ENQ1 bsr rem_sio_fisr fake an isr if necessary 9498 00006E06 0828 0005 btst #5,r_lsr(a0) transmitter holding empty? 001B 9499 00006E0C 67F6 beq.s rem_sio_ENQ1 branch if not 9500 00006E0E 117C 0005 move.b #ENQ,r_data(a0) send an ENQuire 0011 9501 9502 00006E14 61C6 rem_sio_ENQ2 bsr rem_sio_fisr fake an isr if necessary 9503 00006E16 4A2C 009F tst.b remote_xoff(a4) test state info 9504 00006E1A 6A0A bpl.s rem_sio_NHS branch if OK to send PAGE 205 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9505 00006E1C 60F6 bra rem_sio_ENQ2 else keep looping 9506 9507 * 9508 * 98626/98644 XON/XOFF 9509 * 9510 00006E1E 61BC rem_sio_XON bsr rem_sio_fisr fake an isr if necessary 9511 00006E20 4A2C 009F tst.b remote_xoff(a4) transmitting turned off? 9512 00006E24 66F8 bne rem_sio_XON branch if so 9513 9514 * 9515 * 98626/98644 no handshake 9516 * 9517 00006E26 61B4 rem_sio_NHS bsr rem_sio_fisr fake an isr if necessary 9518 00006E28 0828 0005 btst #5,r_lsr(a0) transmitter holding empty? 001B 9519 00006E2E 67F6 beq.s rem_sio_NHS branch if not 9520 00006E30 1140 0011 move.b d0,r_data(a0) send the character 9521 9522 * 9523 * Done 9524 * 9525 00006E34 4CDF 1103 rem_send_ret movem.l (sp)+,d0-d1/a0/a4 restore registers 9526 00006E38 4E75 rts PAGE 206 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9528 ****************************************************************************** 9529 * Remote_flush: Flush all buffered characters output * 9530 ****************************************************************************** 9531 9532 00006E3A 48E7 8088 remote_flush movem.l d0/a0/a4,-(sp) Save Registers 9533 9534 * 9535 * Determine which card it is 9536 * 9537 00006E3E 2878 FED4 movea.l f_area,a4 9538 00006E42 206C 009A movea.l remote_adr(a4),a0 Get Card Address 9539 00006E46 707C moveq #$7C,d0 prepare to... 9540 00006E48 C02C 009E and.b remote_type(a4),d0 isolate the card type bits 9541 00006E4C 6610 bne.s rem_flsh_ret return if out of range 9542 * 9543 * (jump table envisioned here as more card types supported) 9544 * 9545 9546 * 9547 * flush 98626/98644 Cards 9548 * 9549 00006E4E 0828 0005 rem_flsh_sio btst #5,r_lsr(a0) transmitter holding empty? 001B 9550 00006E54 67F8 beq.s rem_flsh_sio branch if not 9551 00006E56 0828 0006 btst #6,r_lsr(a0) transmitter shift empty? 001B 9552 00006E5C 67F0 beq.s rem_flsh_sio branch if not 9553 * 9554 * Done 9555 * 9556 00006E5E 4CDF 1101 rem_flsh_ret movem.l (sp)+,d0/a0/a4 Restore Registers 9557 00006E62 4E75 rts 9558 PAGE 207 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9560 ****************************************************************************** 9561 * Remote_set: Set up any Remote Keyboard * 9562 ****************************************************************************** 9563 9564 00006E64 48E7 8088 remote_set movem.l d0/a0/a4,-(sp) save registers 9565 9566 * 9567 * Check if there is a remote Keyboard 9568 * 9569 00006E68 2878 FED4 movea.l f_area,a4 9570 00006E6C 206C 009A movea.l remote_adr(a4),a0 get card address 9571 00006E70 4A2C 009E tst.b remote_type(a4) is there a remote console? 9572 00006E74 6B2E bmi.s rem_stup_ret branch if not 9573 00006E76 6100 FEBE bsr remote_init initialize the card 9574 9575 * 9576 * Determine which card it is 9577 * 9578 00006E7A 707C moveq #$7C,d0 prepare to... 9579 00006E7C C02C 009E and.b remote_type(a4),d0 isolate the card type bits 9580 00006E80 6622 bne.s rem_stup_ret return if out of range 9581 * 9582 * (jump table envisioned here as more card types supported) 9583 * 9584 9585 * 9586 * Set-up a 98626/98644 Card 9587 * 9588 00006E82 117C 0080 rem_stup_sio move.b #$80,r_intlvl(a0) enable card (SR is $2700 now) 0003 9589 00006E88 7030 moveq #$30,d0 prepare to... 9590 00006E8A C028 0003 and.b r_intlvl(a0),d0 get the card interrupt level 9591 00006E8E E848 lsr #4,d0 int level relative to 3 9592 00006E90 C0FC 0006 mulu #6,d0 six bytes per pseudo vector 9593 00006E94 41F8 FFB2 lea lvl3v,a0 level 3 psuedo vector 9594 00006E98 90C0 suba d0,a0 point to appropriate psuedo vector 9595 00006E9A 30FC 4EF9 move #jmpop,(a0)+ Set-up Interrupt Level 9596 00006E9E 20FC 0000 move.l #rem_sio_isr,(a0)+ 6EAA 9597 * 9598 * Done 9599 * 9600 00006EA4 4CDF 1101 rem_stup_ret movem.l (sp)+,d0/a0/a4 restore registers 9601 00006EA8 4E75 rts PAGE 208 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9603 ****************************************************************************** 9604 * REM626_ISR: Input Interrupt Service Handler for a 98626 Card * 9605 * Filters out all except: * 9606 * keys A-Z, a-z, 0-9 (Makes Nationalized Keyboards easy) * 9607 * Break (Does same as RESET) * 9608 * ENTER (RETURN) * 9609 * Control-C is Configure Mode call * 9610 * It is assumed that machine is attended if any key other than * 9611 * CTRL-C is hit. * 9612 * CTRL-C causes configure mode to be entered. * 9613 * ENTER toggles stop bit for searching * 9614 * * 9615 * * 9616 * * 9617 * if ENTER then * 9618 * begin * 9619 * toggle stop bit * 9620 * set attended to true * 9621 * return * 9622 * end * 9623 * else if CTRL-C and not Configure Mode then * 9624 * begin * 9625 * if RESET locked out then * 9626 * begin * 9627 * if RESET is not pending then pend a CTRL-PAUSE * 9628 * end * 9629 * else * 9630 * if RESET is not pending then begin * 9631 * set configure mode to true * 9632 * call configure mode * 9633 * end; * 9634 * end * 9635 * else * 9636 * begin * 9637 * set attended to true * 9638 * convert key based on language * 9639 * filter non- A-Z, a-z, 0-9 * 9640 * add key to queue if room * 9641 * increment rwait if room * 9642 * end * 9643 * if not Configure Mode then call keyprocessor * 9644 ****************************************************************************** 9645 9646 00006EAA 48E7 E0C0 rem_sio_isr movem.l a0-a1/d0-d2,-(sp) Save Registers 9647 00006EAE 2278 FED4 movea.l f_area,a1 Point to LOWRAM 9648 00006EB2 2069 009A movea.l remote_adr(a1),a0 Get Card Address 9649 * 9650 * Find out what caused interrupt 9651 * 9652 00006EB6 1028 0015 move.b r_iir(a0),d0 9653 00006EBA 0C00 0004 cmpi.b #4,d0 Is a Received Character? 9654 00006EBE 672E beq.s sio_isr_char Yes 9655 9656 00006EC0 0828 0007 btst #7,3(a0) enabled for interrupts? 0003 9657 00006EC6 6716 beq.s sio_isr_ret branch if not; haven't been setup 9658 * PAGE 209 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9659 * Check for Break bit 9660 * 9661 00006EC8 0828 0004 btst #4,r_lsr(a0) break bit set? 001B 9662 00006ECE 670E beq.s sio_isr_ret branch if not 9663 * 9664 * If RESETs are locked out, just pend it and return 9665 * 9666 00006ED0 0829 0001 btst #mb_lock,m_b(a1) 0054 9667 00006ED6 670A beq.s sio_isr_reset Not Locked out 9668 00006ED8 137C 0002 move.b #2,r_lock(a1) Locked out: log it and return 0055 9669 00006EDE 6000 F8AE sio_isr_ret bra kbdisr7 9670 9671 00006EE2 1C38 FED2 sio_isr_reset move.b sysflag,d6 Required by interface 9672 00006EE6 41FA 9518 lea reset,a0 9673 00006EEA 6000 D51A bra go Ctrl key not down 9674 * 9675 * It's a Character 9676 * 9677 00006EEE 1028 0011 sio_isr_char move.b r_data(a0),d0 Get Character 9678 9679 * 9680 * Determine which card/handshake type it is 9681 * 9682 00006EF2 7200 moveq #0,d1 prepare to... 9683 00006EF4 1229 009E move.b remote_type(a1),d1 get card/handshake type bits 9684 00006EF8 B27C 0004 cmp #4,d1 out of range? 9685 00006EFC 64E0 bcc.s sio_isr_ret branch if so 9686 00006EFE E341 asl #1,d1 two bytes per table entry 9687 00006F00 323B 1006 move sio_isr_tbl(d1),d1 load jump offset to routine 9688 00006F04 4EFB 1002 jmp sio_isr_tbl(d1) jump to appropriate routine 9689 9690 00006F08 0008 sio_isr_tbl dc sio_isr_ENQ-sio_isr_tbl 0 98626/98644 ENQ/ACK 9691 00006F0A 0016 dc sio_isr_XON-sio_isr_tbl 1 98626/98644 XON/XOFF 9692 00006F0C 002E dc sio_isr_NHS-sio_isr_tbl 2 98626/98644 no handshake 9693 00006F0E 002E dc sio_isr_NHS-sio_isr_tbl 3 98626/98644 no handshake 9694 9695 * 9696 * 98626/98644 ENQ/ACK 9697 * 9698 00006F10 0C00 0006 sio_isr_ENQ cmpi.b #ACK,d0 ACKnowledge? 9699 00006F14 6620 bne.s sio_isr_NHS branch if not 9700 00006F16 137C 004E move.b #78,remote_xoff(a1) now OK to transmit 009F 9701 00006F1C 60C0 bra sio_isr_ret return 9702 9703 * 9704 * 98626/98644 XON/XOFF 9705 * 9706 00006F1E 0C00 0011 sio_isr_XON cmpi.b #DC1,d0 XON? 9707 00006F22 6606 bne.s sio_isr_XON1 branch if not 9708 00006F24 51E9 009F sf remote_xoff(a1) turn on transmitting 9709 00006F28 60B4 bra sio_isr_ret return 9710 9711 00006F2A 0C00 0013 sio_isr_XON1 cmpi.b #DC3,d0 XOFF? PAGE 210 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM REMOTE HUMAN INTERFACE DRIVERS (BOOTRHI)" 9712 00006F2E 6606 bne.s sio_isr_NHS branch if not 9713 00006F30 50E9 009F st remote_xoff(a1) turn off transmitting 9714 00006F34 60A8 bra sio_isr_ret return 9715 9716 * 9717 * 98626/98644 no handshake 9718 * 9719 00006F36 0828 0007 sio_isr_NHS btst #7,3(a0) enabled for interrupts? 0003 9720 00006F3C 67A0 beq sio_isr_ret branch if not; haven't been setup 9721 9722 00006F3E 0C00 000D cmpi.b #CR,d0 CR ? 9723 00006F42 660A bne.s sio_isr_cc No it's some other character 9724 00006F44 0869 0002 bchg #mb_stop,m_b(a1) Toggle stop bit 0054 9725 00006F4A 6000 F756 bra kbdr1 Return, but set attended 9726 * 9727 * Check for Configure Mode (Control-C) 9728 * 9729 00006F4E 0C00 0003 sio_isr_cc cmpi.b #3,d0 Control-C ? 9730 00006F52 6700 F758 beq kbdisr0 Yes, try to go to Configure Mode 9731 00006F56 6000 F7A0 bra kbdisr1_1 Enter Keyboard Routine 9732 PAGE 211 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 9735 include ../BROM/BTMINIDRV 9736 * sccs info: @(#) btminidrv 8.1 84/05/04 00:15:33 * 9737 9738 ****************************************************************************** 9739 ****************************************************************************** 9740 *** *** 9741 *** Internal Mini-Floppy Drivers *** 9742 *** *** 9743 *** Entries Supported Internally: *** 9744 *** FLPY_RST1 Initialize The Floppy Drivers w/o SYSFLAG *** 9745 *** FNOT_PRESENT Floppy not present Error *** 9746 *** *** 9747 *** Entries Supported Externally for Old Systems: *** 9748 *** FLPYREAD ($120) One Sector Read With Move *** 9749 *** FLPY_WRT ($124) One Sector Write *** 9750 *** FINTRUPT ($128) ISR For Minifloppy *** 9751 *** FLPYINIT ($12C) Minifloppy Format (INITIALIZE) *** 9752 *** FLPYMREAD ($130) Multi-Sector Read With Move *** 9753 *** FLPYMWRITE ($134) Multi-Sector Write *** 9754 *** FLPYSREAD ($138) One Sector Read No Move *** 9755 *** FLPY_RST ($144) Initialize The Floppy Drivers *** 9756 *** FMSGS ($1BC) Floppy Error Messages *** 9757 *** FWAITINR ($1CC) *** 9758 *** F_SET_UP ($1D0) *** 9759 *** FMOTORON ($1D4) *** 9760 *** F_CLOCK ($1D8) *** 9761 *** FTRKINIT ($1DC) *** 9762 *** FSECTBLE ($1E0) *** 9763 *** FRESET ($1E4) *** 9764 *** FSETDRIVE ($1E8) Set Floppy Controller To Drive *** 9765 *** *** 9766 ****************************************************************************** 9767 ****************************************************************************** 9768 00006F5A 3B7C 0820 fnot_present move #2080,-2(a5) {gll} FFFE 9769 00006F60 2E6D FFF6 movea.l -10(a5),sp {gll} 9770 00006F64 4E75 rts {gll} 9771 9772 00006F66 0C38 00FF FSETDRIVE cmpi.b #255,ndrives Check for No Device Present {gll} FED8 9773 00006F6C 6734 beq.s fsetdrive1 {gll} 9774 00006F6E 48E7 C080 MOVEM.L A0/D0/D1,-(SP) 9775 00006F72 7000 MOVEQ #0,D0 9776 00006F74 1038 FED3 MOVE.B DRIVE,D0 9777 00006F78 2078 FED4 MOVEA.L F_AREA,A0 9778 00006F7C E548 LSL #2,D0 D0 = DRIVE # * 4 9779 00006F7E 1230 0004 MOVE.B 4(A0,D0),D1 D1 = TRKSIDE 9780 00006F82 0C01 00FF CMPI.B #$FF,D1 Do I know where this drive is ? 9781 00006F86 670C BEQ.S FSD2 No, so it doesn't matter 9782 00006F88 9230 0006 sub.b 6(a0,d0),d1 subtract foffset 9783 00006F8C E209 LSR.B #1,D1 Strip off side 9784 00006F8E 13C1 0044 MOVE.B D1,TRKREG Update floppy controller with track # C002 9785 00006F94 1230 0005 FSD2 MOVE.B 5(A0,D0),D1 D1 = XCMDCOPY 9786 00006F98 13C1 0044 MOVE.B D1,XCMDREG This should set the drive no. 5000 9787 00006F9E 4CDF 0103 MOVEM.L (SP)+,A0/D1/D0 PAGE 212 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 9788 00006FA2 4E75 fsetdrive1 RTS 9789 * 9790 * BOOT ROM EXTENTIONS TO FLOPPY DRIVERS 9791 * 9792 *********************************************************************** 9793 * * 9794 * Mini-floppy MULTI_SECTOR 'READ' * 9795 * * 9796 * Parameter stack: * 9797 * * 9798 * sp + 12 - NUMBER OF SECTORS TO READ * 9799 * sp + 8 - logical record number * 9800 * sp + 4 - data buffer address pointer * 9801 * sp ---> - return address * 9802 * * 9803 *********************************************************************** 9804 9805 9806 *********************************************************************** 9807 * * 9808 * FLPYMREAD * 9809 * * 9810 * Outer block minifloppy 'read' routine. The necessary modules * 9811 * are called to perform the minifloppy read function. * 9812 * * 9813 * a0 - xcmdcopy memory pointer r * 9814 * a1 - trkside memory pointer r * 9815 * a4 - floppy xcmdreg pointer r * 9816 * a6 - flag byte memory pointer r * 9817 * d4 - physical track and side passed to this routine r * 9818 * d7 - copy of extended command register (xcmdreg) r/w * 9819 * * 9820 *********************************************************************** 9821 9822 00006FA4 0C38 00FF FLPYMREAD cmpi.b #255,ndrives Check for No Device Present {gll} FED8 9823 00006FAA 67AE beq fnot_present {gll} 9824 00006FAC 2F0E move.l a6,-(sp) save a6 for pascal 9825 00006FAE 6100 07EA bsr f_set_up set up registers and motor on 9826 00006FB2 6100 0834 BSR DRIVECHK 9827 00006FB6 6100 0440 bsr fmotoron turn on floppy motor 9828 00006FBA 6100 038C FRD_Q_SECT bsr fconvert logical to side-track conversion 9829 00006FBE B811 cmp.b (a1),d4 is floppy already at trk & side? 9830 00006FC0 6704 beq.s frd_quic branch if no seek is necessary 9831 00006FC2 6100 0482 bsr fseek move head to desired side-track 9832 00006FC6 6100 0396 frd_quic bsr fread read data into floppy buffer 9833 00006FCA 6100 040C bsr fbufmem move data from floppy to memory 9834 00006FCE 06AF 0000 ADDI.L #256,8(SP) INCREMENT THE ADDRESS 0100 0008 9835 00006FD6 52AF 000C ADDQ.L #1,12(SP) INCREMENT THE SECTOR NUMBER 9836 00006FDA 53AF 0010 SUBQ.L #1,16(SP) DECRIMENT SECTOR COUNT 9837 00006FDE 66DA BNE FRD_Q_SECT 9838 00006FE0 0887 0000 bclr #0,d7 reset motor on bit 9839 00006FE4 1887 move.b d7,(a4) turn off floppy motor 9840 00006FE6 1087 move.b d7,(a0) store away xcmdreg copy 9841 00006FE8 0896 0000 bclr #0,(a6) reset 'miniflop driver active' 9842 00006FEC 2C5F movea.l (sp)+,a6 restore a6 for pascal PAGE 213 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 9843 00006FEE 205F movea.l (sp)+,a0 get return pointer 9844 00006FF0 DEFC 000C adda #12,SP pop parameters 9845 00006FF4 4ED0 jmp (a0) 9846 9847 9848 *********************************************************************** 9849 * * 9850 * Mini-floppy 'READ' don't move to user ram * 9851 * * 9852 * Parameter stack: * 9853 * * 9854 * sp + 8 - logical record number * 9855 * sp + 4 - data buffer address pointer * 9856 * sp ---> - return address * 9857 * * 9858 *********************************************************************** 9859 9860 9861 *********************************************************************** 9862 * * 9863 * FLPYSREAD * 9864 * * 9865 * Outer block minifloppy 'read' routine. The necessary modules * 9866 * are called to perform the minifloppy read function. * 9867 * * 9868 * a0 - xcmdcopy memory pointer r * 9869 * a1 - trkside memory pointer r * 9870 * a4 - floppy xcmdreg pointer r * 9871 * a6 - flag byte memory pointer r * 9872 * d4 - physical track and side passed to this routine r * 9873 * d7 - copy of extended command register (xcmdreg) r/w * 9874 * * 9875 *********************************************************************** 9876 9877 00006FF6 0C38 00FF flpysread cmpi.b #255,ndrives Check for No Device Present {gll} FED8 9878 00006FFC 6700 FF5C beq fnot_present {gll} 9879 00007000 2F0E move.l a6,-(sp) save a6 for pascal 9880 00007002 6100 0796 bsr f_set_up set up registers and motor on 9881 00007006 6100 07E0 BSR DRIVECHK 9882 0000700A 6100 03EC bsr fmotoron turn on floppy motor 9883 0000700E 6100 0338 bsr fconvert logical to side-track conversion 9884 00007012 B811 cmp.b (a1),d4 is floppy already at trk & side? 9885 00007014 6704 beq.s frd_squik branch if no seek is necessary 9886 00007016 6100 042E bsr fseek move head to desired side-track 9887 0000701A 6100 0342 frd_squik bsr fread read data into floppy buffer 9888 0000701E 0887 0000 bclr #0,d7 reset motor on bit 9889 00007022 1887 move.b d7,(a4) turn off floppy motor 9890 00007024 1087 move.b d7,(a0) store away xcmdreg copy 9891 00007026 0896 0000 bclr #0,(a6) reset 'miniflop driver active' 9892 0000702A 2C5F movea.l (sp)+,a6 restore a6 for pascal 9893 0000702C 205F movea.l (sp)+,a0 get return pointer 9894 0000702E 508F addq.l #8,sp pop parameters 9895 00007030 4ED0 jmp (a0) 9896 9897 9898 *********************************************************************** PAGE 214 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 9899 * * 9900 * Mini-floppy MULTI-SECTOR 'WRITE' * 9901 * * 9902 * Parameter stack: * 9903 * * 9904 * sp + 12 - number of sectors to read * 9905 * sp + 8 - logical record number * 9906 * sp + 4 - data buffer address pointer * 9907 * sp ---> - return address * 9908 * * 9909 *********************************************************************** 9910 9911 *********************************************************************** 9912 * * 9913 * FLPYMWRITE * 9914 * * 9915 * Outer block minifloppy 'WRITE' routine. The necessary modules * 9916 * are called to perform the minifloppy write function. * 9917 * * 9918 * a0 - xcmdcopy memory pointer r * 9919 * a1 - trkside memory pointer r * 9920 * a4 - floppy xcmdreg pointer r * 9921 * a6 - flag byte memory pointer r * 9922 * d4 - physical track and side passed to this routine r * 9923 * d7 - copy of extended command register (xcmdreg) r/w * 9924 * * 9925 *********************************************************************** 9926 9927 00007032 0C38 00FF flpymwrite cmpi.b #255,ndrives Check for No Device Present {gll} FED8 9928 00007038 6700 FF20 beq fnot_present {gll} 9929 0000703C 2F0E move.l a6,-(sp) save a6 for pascal 9930 0000703E 6100 075A bsr f_set_up set up registers and motor on 9931 00007042 6100 07A4 BSR DRIVECHK 9932 00007046 6100 03B0 bsr fmotoron turn on floppy motor 9933 0000704A 6100 02FC FLPY_QW_SECT bsr fconvert logical to side-track conversion 9934 0000704E B811 cmp.b (a1),d4 is floppy already at trk & side 9935 00007050 6704 beq.s fwrtquic branch if no seek is necessary 9936 00007052 6100 03F2 bsr fseek move head to desired side-track 9937 00007056 6100 082A fwrtquic bsr fmembuf move data from memory to floppy 9938 0000705A 6100 07A4 bsr fwrite write data into floppy buffer 9939 0000705E 06AF 0000 ADDI.L #256,8(SP) INCREMENT THE ADDRESS 0100 0008 9940 00007066 52AF 000C ADDQ.L #1,12(SP) INCREMENT THE SECTOR NUMBER 9941 0000706A 53AF 0010 SUBQ.L #1,16(SP) DECRIMENT THE SECTOR COUNT 9942 0000706E 66DA BNE FLPY_QW_SECT 9943 00007070 0887 0000 bclr #0,d7 reset motor on bit 9944 00007074 1887 move.b d7,(a4) turn off floppy motor 9945 00007076 1087 move.b d7,(a0) store away xcmdreg copy 9946 00007078 0896 0000 bclr #0,(a6) reset 'miniflop driver active' 9947 0000707C 2C5F movea.l (sp)+,a6 restore a6 for pascal 9948 0000707E 205F movea.l (sp)+,a0 get return pointer 9949 00007080 DEFC 000C adda #12,sp pop parameters 9950 00007084 4ED0 jmp (a0) 9951 *--------------------------------------------------- 9952 * BOOT ROM MISC. UTILITIES 9953 *--------------------------------------------------- PAGE 215 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 9954 * FLOPPY DRIVER ERROR MESSAGES 9955 * 9956 * D0 CONTAINS ERROR CODE IN LOW WORD 9957 * A1 CONTAINS BUFFER ADDRESS 9958 * 9959 * USES D0-D7 AND A0-A1 9960 * 9961 00007086 4286 FMSGS CLR.L D6 SAVE THE CODE 9962 00007088 3C00 MOVE.W D0,D6 9963 0000708A 2E06 MOVE.L D6,D7 9964 0000708C 8CFC 03E8 DIVU #1000,D6 SEPARATE NUMBER AND SOURCE CODE 9965 00007090 4846 SWAP D6 GET REMAINDER IN LOW WORD 9966 00007092 4280 CLR.L D0 9967 00007094 3006 MOVE.W D6,D0 9968 00007096 2F06 MOVE.L D6,-(SP) 9969 00007098 6100 DBFC BSR BIN_TO_DEC CONVERT THE NUMBER TO ASCII 9970 0000709C 2C1F MOVE.L (SP)+,D6 9971 0000709E 12FC 002C MOVE.B #',',(A1)+ PUT OUT A COMMA 9972 000070A2 4846 SWAP D6 GET QUOTIENT IN LOW WORD 9973 000070A4 4280 CLR.L D0 9974 000070A6 3006 MOVE.W D6,D0 9975 000070A8 6100 DBEC BSR BIN_TO_DEC CONVERT THE NUMBER TO ASCII 9976 000070AC 12FC 0020 MOVE.B #' ',(A1)+ PUT OUT A BLANK 9977 * 9978 000070B0 41FA 0022 LEA MTABLE,A0 FIND THE MESSAGE TEXT 9979 000070B4 BE50 FMSGLOOP CMP.W (A0),D7 9980 000070B6 670C BEQ.S FMSGOUT 9981 000070B8 4A50 TST.W (A0) 9982 000070BA 6604 BNE.S FMSGNEXT 9983 000070BC 4219 CLR.B (A1)+ ADD DELIMITER 9984 000070BE 4E75 RTS 9985 000070C0 5888 FMSGNEXT ADDQ.L #4,A0 9986 000070C2 60F0 BRA FMSGLOOP 9987 000070C4 3068 0002 FMSGOUT MOVEA.W 2(A0),A0 9988 000070C8 D1FC 0000 adda.l #MTABLE,A0 Compute absolute address of message {gll} 70D4 9989 000070CE 6100 DC28 BSR MOVEBYTES 9990 000070D2 4E75 RTS 9991 * 9992 000070D4 042A MTABLE DC.W 1066,MSG661-MTABLE All Messages relative to MTABLE {gll} 9993 000070D8 0812 DC.W 2066,MSG662-MTABLE 9994 000070DC 0BFA DC.W 3066,MSG663-MTABLE 9995 000070E0 0FE2 DC.W 4066,MSG664-MTABLE 9996 000070E4 0438 DC.W 1080,MSG801-MTABLE 9997 000070E8 0820 DC.W 2080,MSG801-MTABLE 9998 000070EC 0C08 DC.W 3080,MSG801-MTABLE 9999 000070F0 1F90 DC.W 8080,MSG808-MTABLE 10000 000070F4 2378 DC.W 9080,MSG808-MTABLE 10001 000070F8 0439 DC.W 1081,MSG811-MTABLE 10002 000070FC 0821 DC.W 2081,MSG811-MTABLE 10003 00007100 0C09 DC.W 3081,MSG813-MTABLE 10004 00007104 0FF1 DC.W 4081,MSG814-MTABLE 10005 00007108 13D9 DC.W 5081,MSG815-MTABLE 10006 0000710C 17C1 DC.W 6081,MSG816-MTABLE 10007 00007110 1BA9 DC.W 7081,MSG817-MTABLE 10008 00007114 043B DC.W 1083,MSG831-MTABLE 10009 00007118 0823 DC.W 2083,MSG831-MTABLE PAGE 216 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10010 0000711C 043C DC.W 1084,MSG841-MTABLE 10011 00007120 0824 DC.W 2084,MSG842-MTABLE 10012 00007124 0C0C DC.W 3084,MSG811-MTABLE 10013 00007128 043F DC.W 1087,MSG871-MTABLE 10014 0000712C 0440 DC.W 1088,MSG881-MTABLE 10015 00007130 17CA DC.W 6090,MSG906-MTABLE 10016 00007134 1BB2 DC.W 7090,MSG906-MTABLE 10017 00007138 1F9A DC.W 8090,MSG908-MTABLE 10018 0000713C 2382 DC.W 9090,MSG909-MTABLE 10019 00007140 2B52 DC.W 11090,MSG9011-MTABLE 10020 00007144 0000 DC.W 0000,000000 10021 * 10022 00007148 49 MSG661 DC.B 'INIT .. BAD TRACK 0 , SIDE 0',0 10023 00007165 49 MSG662 DC.B 'INIT .. TOO MANY BAD TRACKS',0 10024 00007181 49 MSG663 DC.B 'INIT .. LOST DATA',0 10025 00007193 49 MSG664 DC.B 'INIT .. TIME OUT',0 10026 000071A4 44 MSG801 DC.B 'DOOR OPEN / NO MEDIA',0 10027 000071B9 4D MSG808 DC.B 'MEDIA CHANGED',0 10028 000071C7 53 MSG811 DC.B 'SEEK .. TRACK NOT FOUND',0 10029 000071DF 53 MSG813 DC.B 'SEEK .. NO TRACK 0',0 10030 000071F2 52 MSG814 DC.B 'READ .. LOST DATA',0 10031 00007204 57 MSG815 DC.B 'WRITE .. LOST DATA',0 10032 00007217 53 MSG816 DC.B 'SEEK .. LOST DATA',0 10033 00007229 57 MSG817 DC.B 'WRITE .. ADDRESS CRC ERROR',0 10034 00007244 4D MSG831 DC.B 'MEDIA PROTECTED',0 10035 00007254 52 MSG841 DC.B 'READ .. SECTOR NOT FOUND',0 10036 0000726D 57 MSG842 DC.B 'WRITE .. SECTOR NOT FOUND',0 10037 00007287 53 MSG871 DC.B 'SEEK .. ADDRESS CRC ERROR',0 10038 000072A1 52 MSG881 DC.B 'READ .. CRC ERROR',0 10039 000072B3 55 MSG906 DC.B 'UNEXPECTED INTERRUPT',0 10040 000072C8 54 MSG908 DC.B 'TIMEOUT DURING INTERRUPT',0 10041 000072E1 49 MSG909 DC.B 'INTERRUPTS LOCKED OUT',0 10042 000072F7 44 MSG9011 DC.B 'DRIVE NOT RESPONDING',0 10043 * 10044 * flpyread 10045 10046 *********************************************************************** 10047 * * 10048 * Mini-floppy driver * 10049 * * 10050 *********************************************************************** 10051 * * 10052 * Mini-floppy entry points * 10053 * * 10054 * These mass-memory (floppy) drivers can be entered in one of * 10055 * three primary places, determined by the name of the pascal calling * 10056 * procedure: 'INITIALIZE', 'READ', and 'WRITE'. Each of these * 10057 * routines calls a set of modules (subroutines) to perform its * 10058 * driver function. * 10059 * * 10060 * For reasons of speed, most parameters are passed from module * 10061 * to module via the registers. The assigned definition of all the * 10062 * the registers remains relatively constant thoughout these drivers. * 10063 * The head of each routine defines the register usages for that * 10064 * routine. Those people making direct entrys into any module must * 10065 * establish register and global storage requirements prior to entry. * 10066 * * PAGE 217 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10067 *********************************************************************** 10068 10069 *********************************************************************** 10070 * * 10071 * Flag byte bit definitions * 10072 * * 10073 * Bit # Use * 10074 * ===== ================================================ * 10075 * 0 minifloppy driver active (valid interrupt) * 10076 * 1 expecting interrupt (set while awaiting intr) * 10077 * 2 interrupt occured (set by interrupt handler) * 10078 * 3 (not used) * 10079 * 4 restore flag (set when a restore has occured) * 10080 * 5 reset flag (set on reset during read or write) * 10081 * 6 (not used) * 10082 * 7 (not used) * 10083 * * 10084 *********************************************************************** 10085 10086 *********************************************************************** 10087 * * 10088 * Mini-floppy 'READ' * 10089 * * 10090 * Parameter stack: * 10091 * * 10092 * sp + 8 - logical record number * 10093 * sp + 4 - data buffer address pointer * 10094 * sp ---> - return address * 10095 * * 10096 *********************************************************************** 10097 10098 10099 *********************************************************************** 10100 * * 10101 * FLPYREAD * 10102 * * 10103 * Outer block minifloppy 'read' routine. The necessary modules * 10104 * are called to perform the minifloppy read function. * 10105 * * 10106 * a0 - xcmdcopy memory pointer r * 10107 * a1 - trkside memory pointer r * 10108 * a4 - floppy xcmdreg pointer r * 10109 * a6 - flag byte memory pointer r * 10110 * d4 - physical track and side passed to this routine r * 10111 * d7 - copy of extended command register (xcmdreg) r/w * 10112 * * 10113 *********************************************************************** 10114 10115 0000730C 0C38 00FF flpyread cmpi.b #255,ndrives Check for No Device Present {gll} FED8 10116 00007312 6700 FC46 beq fnot_present {gll} 10117 00007316 2F0E move.l a6,-(sp) save a6 for pascal 10118 00007318 6100 0480 bsr f_set_up set up registers and motor on 10119 0000731C 6100 04CA BSR DRIVECHK 10120 00007320 6100 00D6 bsr fmotoron turn on floppy motor 10121 00007324 6122 bsr.s fconvert logical to side-track conversion 10122 00007326 B811 cmp.b (a1),d4 is floppy already at trk & side? PAGE 218 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10123 00007328 6704 beq.s frd_quik branch if no seek is necessary 10124 0000732A 6100 011A bsr fseek move head to desired side-track 10125 0000732E 612E frd_quik bsr.s fread read data into floppy buffer 10126 00007330 6100 00A6 bsr fbufmem move data from floppy to memory 10127 00007334 0887 0000 bclr #0,d7 reset motor on bit 10128 00007338 1887 move.b d7,(a4) turn off floppy motor 10129 0000733A 1087 move.b d7,(a0) store away xcmdreg copy 10130 0000733C 0896 0000 bclr #0,(a6) reset 'miniflop driver active' 10131 00007340 2C5F movea.l (sp)+,a6 restore a6 for pascal 10132 00007342 205F movea.l (sp)+,a0 get return pointer 10133 00007344 508F addq.l #8,sp pop parameters 10134 00007346 4ED0 jmp (a0) 10135 10136 *********************************************************************** 10137 * * 10138 * FCONVERT * 10139 * * 10140 * This subroutine is used to convert the logical record address * 10141 * passed on the system stack, sp + 18 (at time used), to a target * 10142 * side, track, and sector * 10143 * An offset stored in 'own' common memory and determined during * 10144 * the previous floppy access is added to this target address to * 10145 * account for possible spared tracks. In the long term, this will * 10146 * reduce the total number of floppy seeks required. The dimension * 10147 * of the offset is 'sides'. * 10148 * No error checking is done. It is assumed that the logical record * 10149 * is a valid address. * 10150 * * 10151 * sp - (a7) stack pointer r * 10152 * d3 - used to manipulate the offset address r/w * 10153 * d4 - physical track and side (lsb = side) w * 10154 * d5 - logical track and side (lsb = side) r/w * 10155 * d6 - physical and logical sector w * 10156 * * 10157 *********************************************************************** 10158 10159 00007348 3A2F 0012 fconvert move.w 18(sp),d5 get logical address from stack 10160 0000734C 3C05 move.w d5,d6 copy to sector register 10161 0000734E CC7C 000F and.w #$F,d6 convert to sector address 10162 00007352 E84D lsr.w #4,d5 target track and (side=lsb) 10163 * move.b foffset,d3 {ag} 10164 00007354 1629 0002 move.b 2(A1),d3 get previous offset from 'own' {ag} 10165 00007358 1805 move.b d5,d4 copy target trk/side to seek reg 10166 0000735A D803 add.b d3,d4 seek track and (side=lsb) 10167 0000735C 4E75 rts 10168 10169 *********************************************************************** 10170 * * 10171 * FREAD * 10172 * * 10173 * This subroutine is used to read data from the floppy media into * 10174 * the floppy ram buffer. * 10175 * If and error occures on attempting to read the data from the * 10176 * media, three retrys are attempted before reporting an error code * 10177 * and aborting the read. * 10178 * * 10179 * a2 - flopper fbuffer pointer r * PAGE 219 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10180 * a3 - floppy cmdreg pointer r * 10181 * a4 - floppy xcmdreg pointer r * 10182 * d0 - general - floppy status register copy - error # r/w * 10183 * d1 - sr reg copy prior to interrupt disable w * 10184 * d5 - logical track and side r * 10185 * d6 - sector to be read r * 10186 * d7 - copy of extended command register (xcmdreg) r/w * 10187 * sr - disable interrupts r/w * 10188 * * 10189 *********************************************************************** 10190 10191 *fread move.b #3,re_rdwrt initialize reread counter to 3 {ag} 10192 10193 0000735E 2F08 fread move.l a0,-(sp) save a0 for now {ag} 10194 00007360 2078 FED4 movea.l f_area,a0 a0 points to floppy temp area {ag} 10195 00007364 5248 addq #1,a0 {ag} 10196 00007366 10BC 0003 move.b #3,(a0) {ag} 10197 10198 0000736A 13C6 0044 fretryrd move.b d6,secreg write sector to sector register C004 10199 00007370 1012 move.b (a2),d0 dummy read of floppy buffer 10200 00007372 08C7 0005 bset #5,d7 set local bit in xcmdreg 10201 00007376 08C7 0004 bset #4,d7 set read bit in xcmdreg 10202 0000737A 40C1 move sr,d1 copy current interrupt level 10203 0000737C 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 10204 00007380 0805 0000 btst #0,d5 is side zero or one desired? 10205 00007384 6706 beq.s f_side_0 branch to command for side zero 10206 00007386 16BC 008A move.b #$8A,(a3) issue read side one to cmd reg 10207 0000738A 6004 bra.s f_side_1 jump over side zero command 10208 0000738C 16BC 0082 f_side_0 move.b #$82,(a3) issue read side zero to cmd reg 10209 00007390 1887 f_side_1 move.b d7,(a4) send copy to xcmdreg 10210 00007392 6100 0552 bsr fwaitinr wait for interrupt 10211 00007396 1013 move.b (a3),d0 get status word from floppy 10212 00007398 0200 00BC andi.b #$BC,d0 check bits 2, 3, 4, 5 and 7 10213 0000739C 6604 bne.s frdretry if error bit set, retry 10214 0000739E 205F movea.l (sp)+,a0 {ag} 10215 000073A0 4E75 rts 10216 10217 *frdretry subi.b #1,re_rdwrt decrement reread counter {ag} 10218 000073A2 5310 frdretry subq.b #1,(a0) {ag} 10219 10220 000073A4 66C4 bne.s fretryrd is reread count expired (zero)? 10221 000073A6 0800 0007 btst #7,d0 is error bit 7 set? 10222 000073AA 6708 beq.s fbit3tst branch if not set 10223 000073AC 303C 0438 move.w #1080,d0 \\\\\\\\ error 80,1 //////// 10224 000073B0 6000 04EC bra ferrexit abort with error 10225 000073B4 0800 0003 fbit3tst btst #3,d0 is error bit 3 set? 10226 000073B8 6708 beq.s fbit2tst if not, test bit 2 10227 000073BA 303C 0440 move.w #1088,d0 \\\\\\\\ error 88,1 //////// 10228 000073BE 6000 04DE bra ferrexit abort with error 10229 000073C2 0800 0002 fbit2tst btst #2,d0 is error bit 2 set? 10230 000073C6 6708 beq.s frnf_err if not, default bit 4 or 5 error 10231 000073C8 303C 0FF1 move.w #4081,d0 \\\\\\\\ error 81,4 //////// 10232 000073CC 6000 04D0 bra ferrexit abort with error 10233 000073D0 303C 043C frnf_err move.w #1084,d0 \\\\\\\\ error 84,1 //////// 10234 000073D4 6000 04C8 bra ferrexit abort with error 10235 PAGE 220 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10236 *********************************************************************** 10237 * * 10238 * FBUFMEM * 10239 * * 10240 * This subroutine transfers 256 bytes (one sector) from the * 10241 * floppy buffer to the memory buffer pointed to by the pascal * 10242 * parameter left on the system stack at sp + 20 (at time used). * 10243 * There is no error checking to be done. * 10244 * * 10245 * a0 - memory buffer address r/w * 10246 * a2 - floppy ram buffer address r * 10247 * sp - (a7) stack pointer r * 10248 * d0 - contains constant value of 64 r/w * 10249 * d1 - used as a one long word buffer r/w * 10250 * * 10251 *********************************************************************** 10252 10253 000073D8 48E7 00A0 fbufmem movem.l a0/a2,-(sp) stack a0, a2 (need two temps) 10254 000073DC 206F 0014 movea.l 20(sp),a0 get memory buffer address 10255 000073E0 203C 0000 move.l #64,d0 initialize 8 * 64 = 256 bytes 0040 10256 000073E6 034A 0000 fbufloop movep.l 0(a2),d1 floppy buffer to temp reg 10257 000073EA 20C1 move.l d1,(a0)+ temp reg to memory buffer 10258 000073EC 504A addq.w #8,a2 add 8 to form word boundry 10259 000073EE 5300 subq.b #1,d0 decrement 8byte counter 10260 000073F0 6EF4 bgt.s fbufloop have 256 bytes been transfered? 10261 000073F2 4CDF 0500 movem.l (sp)+,a0/a2 restore stacked a0, a2 10262 000073F6 4E75 rts 10263 10264 *********************************************************************** 10265 * * 10266 * FMOTORON * 10267 * * 10268 * This subroutine is used to turn on the floppy drive motor if * 10269 * it is not already running, and keep it on if it is already on. * 10270 * A check for media change is made prior to the attempt to turn * 10271 * on the motor. * 10272 * * 10273 * a0 - xcmdcopy memory pointer r * 10274 * a3 - floppy cmdreg pointer r * 10275 * a4 - floppy xcmdreg pointer r * 10276 * d0 - copy of floppy status - elaspted time for clock r/w * 10277 * d7 - copy of extended command register (xcmdreg) r/w * 10278 * * 10279 *********************************************************************** 10280 10281 000073F8 6134 fmotoron bsr.s fmediack has media been changed? 10282 000073FA 08C7 0000 bset #0,d7 set motor on bit for xcmdreg 10283 000073FE 1887 move.b d7,(a4) send copy to xcmdreg 10284 00007400 1087 move.b d7,(a0) send xcmdreg to copy 10285 00007402 1013 move.b (a3),d0 get floppy status 10286 00007404 0800 0007 btst #7,d0 is drive ready? 10287 00007408 6602 bne.s fwaitinx wait for index pulse if not rdy 10288 0000740A 4E75 fmotorts rts 10289 10290 0000740C 11FC 0006 fwaitinx move.b #6,retry 50ms x 6 = 300ms max wait time FED9 PAGE 221 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10291 00007412 7032 fmtrloop moveq #50,d0 initialize for 50 milliseconds 10292 00007414 6100 055A bsr f_clock wait 50 milliseconds 10293 00007418 1013 move.b (a3),d0 get floppy status 10294 0000741A 0800 0007 btst #7,d0 is drive ready? 10295 0000741E 67EA beq.s fmotorts branch if not yet index hole 10296 00007420 5338 FED9 subq.b #1,retry decrement retry counter 10297 00007424 6EEC bgt.s fmtrloop branch if 300ms not yet elasped 10298 00007426 303C 0820 move.w #2080,d0 \\\\\\\\ error 80,2 //////// 10299 0000742A 6000 0472 bra ferrexit abort with error 10300 10301 *********************************************************************** 10302 * * 10303 * FMEDIACK * 10304 * * 10305 * This subroutine is used to determine if the media has been * 10306 * removed from or replaced into the drive. * 10307 * * 10308 * a4 - extended status reg pointer r * 10309 * d0 - floppy status register copy - error number r/w * 10310 * * 10311 *********************************************************************** 10312 10313 0000742E 1014 fmediack move.b (a4),d0 get extended status reg 10314 00007430 0800 0001 btst #1,d0 is media change bit set? 10315 00007434 6602 bne.s fchanged report media fchangedif bit on 10316 00007436 4E75 rts 10317 10318 00007438 4239 0044 fchanged clr.b clrxstus clear floppy extended status 5400 10319 0000743E 303C 1F90 move.w #8080,d0 \\\\\\\\ error 80,8 //////// 10320 00007442 6000 0466 bra frstexit abort with error (in ferrexit) 10321 * flpyseek 10322 10323 *********************************************************************** 10324 * * 10325 * Fseek * 10326 * * 10327 * This routine attempts to move the head to the desired target * 10328 * track and selects the desired head (side 0 or 1). Error checking * 10329 * is performed to insure the target track and side have been located.* 10330 * It should be noted that spare tracks will cause a seek error * 10331 * to occure, thus a new track and side address must be calculated * 10332 * in an attempt to locate the correct target address. * 10333 * Note also that a seek without verify followed by a read address * 10334 * is performed rather that a seek with verify. Using the seek with * 10335 * verify causes a one second hardware loop to be entered for every * 10336 * seek error that occures (and hence for every spared track encount- * 10337 * ered). Also by reading the address it is possible to calculate * 10338 * a new address using that present address and the target address * 10339 * rather than stepping one track at a time. * 10340 * Five reseeks are attempted twice; five before and five more * 10341 * again after a restore of the drive. * 10342 * * 10343 * a1 - trkside memory pointer r * 10344 * a3 - floppy cmdreg pointer r * 10345 * a4 - floppy xcmdreg pointer r * 10346 * a6 - flag byte memory pointer r * PAGE 222 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10347 * d0 - temperary storage - error number r/w * 10348 * d1 - sr copy prior to interrupt disable w * 10349 * d2 - present track and side after a read address r * 10350 * d3 - offset (number of spare tracks passed over) r/w * 10351 * d4 - physical track and side passed to this routine r/w * 10352 * d5 - logical track and side passed to this routine r * 10353 * d7 - copy of extended command register (xcmdreg) r/w * 10354 * sr - disable interrupts r/w * 10355 * * 10356 * Bug history: * 10357 * {bug100} - check for negative offset fixed 12/17/80 dfk * 10358 * * 10359 *********************************************************************** 10360 10361 00007446 7001 fseek moveq #1,d0 wait one millisecond for 10362 00007448 6100 0526 bsr f_clock write head (erase) to settle 10363 0000744C 1011 move.b (a1),d0 get current floppy track/side 10364 0000744E 6C10 bge.s f_track valid track if not negative 10365 00007450 40C1 move sr,d1 copy current interrupt level 10366 00007452 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 10367 00007456 16BC 000A move.b #$0A,(a3) restore floppy to trk 0 10368 0000745A 6100 048A bsr fwaitinr wait for op complete 10369 0000745E 4240 clr.w d0 force to track zero if negative 10370 00007460 E208 f_track lsr.b #1,d0 strip off side bit (=trk) 10371 00007462 13C0 0044 move.b d0,trkreg write track to floppy C002 10372 00007468 0896 0004 bclr #4,(a6) clear restore bit in flag byte 10373 10374 * move.b #5,reseek initialize reseek to 5 {ag} 10375 0000746C 2F08 move.l a0,-(sp) {ag} 10376 0000746E 2078 FED4 movea.l f_area,a0 {ag} 10377 00007472 117C 0005 move.b #5,2(a0) {ag} 0002 10378 00007478 205F movea.l (sp)+,a0 {ag} 10379 10380 0000747A 1004 freseek move.b d4,d0 get seek track and side 10381 0000747C 0200 0001 andi.b #1,d0 derive the side 10382 00007480 E508 lsl.b #2,d0 align side bit for xcmdref 10383 00007482 0887 0002 bclr #2,d7 zero the side bit 10384 00007486 8E00 or.b d0,d7 set side bit in xcmd reg copy 10385 00007488 1004 move.b d4,d0 get seek track and side 10386 0000748A E208 lsr.b #1,d0 convert to track 10387 0000748C 13C0 0044 move.b d0,datareg write track to data register C006 10388 00007492 0887 0001 bclr #1,d7 zero pre-comp bit in xcmd copy 10389 00007496 0C00 0012 cmpi.b #18,d0 is track less than 18? 10390 0000749A 6D04 blt.s fseektrk branch if less than 18 10391 0000749C 08C7 0001 bset #1,d7 set pre-comp bit in xcmd copy 10392 000074A0 1887 fseektrk move.b d7,(a4) write copy to xcmdreg 10393 000074A2 40C1 move sr,d1 copy current interrupt level 10394 000074A4 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 10395 000074A8 16BC 0018 move.b #$18,(a3) seek and load without verify 10396 000074AC 6100 0438 bsr fwaitinr wait for operation complete 10397 000074B0 700F moveq #15,d0 wait 15 milliseconds for 10398 000074B2 6100 04BC bsr f_clock heads to settle 10399 000074B6 6100 00A8 bsr frdaddrs read address from floppy 10400 000074BA 0896 0005 bclr #5,(a6) was a reset done in frdaddrs ? PAGE 223 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10401 000074BE 664E bne.s frestore restore and restart seek op 10402 000074C0 B405 cmp.b d5,d2 are we on the desired trk/side? 10403 000074C2 660E bne.s fseekerr error if wrong track or side 10404 000074C4 1005 move.b d5,d0 get current logical track 10405 000074C6 E208 lsr.b #1,d0 strip off side bit 10406 000074C8 13C0 0044 move.b d0,trkreg set floppy track reg = log. trk. C002 10407 000074CE 1284 move.b d4,(a1) store current trk/side 10408 000074D0 4E75 rts 10409 10410 *fseekerr subi.b #1,reseek decrement reseek counter {ag} 10411 000074D2 2F08 fseekerr move.l a0,-(sp) {ag} 10412 000074D4 2078 FED4 movea.l f_area,a0 {ag} 10413 000074D8 5328 0002 subq.b #1,2(a0) {ag} 10414 000074DC 205F movea.l (sp)+,a0 {ag} 10415 10416 000074DE 6F2E ble.s frestore go back & calculate new address 10417 000074E0 0C02 00FF cmpi.b #$FF,d2 check read addr for spared track 10418 000074E4 6722 beq.s fstepone branch if spared track 10419 000074E6 0C02 0045 cmpi.b #$45,d2 read addr > trk 34 side 1 ? 10420 000074EA 6E22 bgt.s frestore branch if addr to high 10421 000074EC 1005 move.b d5,d0 get target track and side 10422 000074EE 9002 sub.b d2,d0 subtract present ads from target 10423 000074F0 D800 add.b d0,d4 add difference to seek trk/side 10424 000074F2 D003 add.b d3,d0 add offset to difference 10425 000074F4 1600 move.b d0,d3 copy new offset to offset reg 10426 000074F6 0C03 0005 foffchk cmpi.b #5,d3 five allows for one step error 10427 000074FA 6E12 bgt.s frestore branch if offset too great 10428 000074FC 4A03 tst.b d3 is offset negative ? {bug100} 10429 000074FE 6D0E blt.s frestore hardware miss-stepped {bug100} 10430 *fstoroff move.b d3,foffset store away new offset {ag} 10431 00007500 1343 0002 fstoroff move.b d3,2(A1) store away new offset {ag} 10432 00007504 6000 FF74 bra freseek retry with new calculated addr 10433 10434 00007508 5204 fstepone addq.b #1,d4 increment seek trk/side 10435 0000750A 5203 addq.b #1,d3 increment offset 10436 0000750C 60E8 bra.s foffchk branch and store offset 10437 10438 0000750E 08D6 0004 frestore bset #4,(a6) is restore flag set? set flag 10439 00007512 6708 beq.s fskrstor restore if flag was not set 10440 00007514 303C 0439 move.w #1081,d0 \\\\\\\\ error 81,1 //////// 10441 00007518 6000 0384 bra ferrexit abort with error 10442 0000751C 0887 0002 fskrstor bclr #2,d7 clear side bit in xcmd reg copy 10443 00007520 1887 move.b d7,(a4) set xcmd reg side bit to zero 10444 00007522 40C1 move sr,d1 copy current interrupt level 10445 00007524 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 10446 00007528 16BC 000A move.b #$0A,(a3) restore floppy to trk 0 10447 0000752C 6100 03B8 bsr fwaitinr wait for op complete 10448 00007530 612E bsr.s frdaddrs read address, should be zero 10449 00007532 0816 0005 btst #5,(a6) was a reset done in frdaddrs ? 10450 00007536 6708 beq.s fchkaddr if no reset then check addr 10451 00007538 303C 0C09 move.w #3081,d0 \\\\\\\\ error 81,3 //////// 10452 0000753C 6000 0360 bra ferrexit abort with error 10453 00007540 4A02 fchkaddr tst.b d2 are we on track and side zero? 10454 00007542 6708 beq.s fzerooff go zero offset if trk/side = 0 10455 00007544 303C 0821 move.w #2081,d0 \\\\\\\\ error 81,2 //////// 10456 00007548 6000 0354 bra ferrexit abort with error PAGE 224 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10457 0000754C 4203 fzerooff clr.b d3 reset offset to zero 10458 0000754E 1805 move.b d5,d4 set seek trk/side = target 10459 10460 * move.b #5,reseek retry 5 more times after restore {ag} 10461 00007550 2F08 move.l a0,-(sp) {ag} 10462 00007552 2078 FED4 movea.l f_area,a0 {ag} 10463 00007556 117C 0005 move.b #5,2(a0) {ag} 0002 10464 0000755C 205F movea.l (sp)+,a0 {ag} 10465 10466 0000755E 60A0 bra.s fstoroff start over after the restore 10467 10468 *********************************************************************** 10469 * * 10470 * FRDADDRS * 10471 * * 10472 * This subroutine is used to determine the present address of the * 10473 * floppy drive heads and side by use of a 'read address' command. * 10474 * If and error occures on attempting to read the address from the * 10475 * floppy, three retry are tried twice; three before a reset is done * 10476 * and three times again after a reset is attempted. If all these * 10477 * attempts fail an error code is returned. * 10478 * * 10479 * a2 - floppy fbuffer pointer r * 10480 * a3 - floppy cmdreg pointer r * 10481 * a4 - floppy xcmdreg pointer r * 10482 * a6 - flag byte memory pointer r * 10483 * d0 - general - floppy status register copy - error # r/w * 10484 * d1 - sr reg copy prior to interrupt disable w * 10485 * d2 - present track and side (lsb = side) w * 10486 * d7 - copy of extended command register (xcmdreg) r/w * 10487 * sr - disable interrupts r/w * 10488 * * 10489 *********************************************************************** 10490 10491 00007560 0896 0005 frdaddrs bclr #5,(a6) clear reset bit in flag byte 10492 00007564 11FC 0003 fretryad move.b #3,retry initialize retry counter to 3 FED9 10493 0000756A 1012 fadretry move.b (a2),d0 dummy read of floppy buffer 10494 0000756C 08C7 0005 bset #5,d7 set local bit in xcmdreg 10495 00007570 40C1 move sr,d1 copy current interrupt level 10496 00007572 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 10497 00007576 16BC 00C0 move.b #$C0,(a3) send read address command 10498 0000757A 1887 move.b d7,(a4) send copy to xcmdreg 10499 0000757C 6100 0368 bsr fwaitinr wait for interrupt 10500 00007580 1412 move.b (a2),d2 get track number from floppy 10501 00007582 E30A lsl.b #1,d2 start conversion to trk-side 10502 00007584 102A 0002 move.b 2(a2),d0 get side from floppy 10503 00007588 0200 0001 andi.b #1,d0 strip off side bit 10504 0000758C 8400 or.b d0,d2 add side bit to trk/side 10505 0000758E 1013 move.b (a3),d0 get status byte from floppy 10506 00007590 0200 001C andi.b #$1C,d0 check bits 2,3, and 4 10507 00007594 6602 bne.s ferretry if error bit set, check retrys 10508 00007596 4E75 rts 10509 10510 00007598 5338 FED9 ferretry subq.b #1,retry decrement retry counter(zero)? 10511 0000759C 66CC bne.s fadretry is retry count expired (zero)? PAGE 225 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10512 0000759E 08D6 0005 bset #5,(a6) is resetflag set? set flag 10513 000075A2 6604 bne.s fadrserr if flag was set, record error 10514 000075A4 6126 bsr.s freset reset the floppy drive 10515 000075A6 60BC bra.s fretryad try again 10516 000075A8 0800 0004 fadrserr btst #4,d0 is error bit 4 set? 10517 000075AC 6708 beq.s ftst3bit if not, test bit 3 10518 000075AE 303C 0C0C move.w #3084,d0 \\\\\\\\ error 84,3 //////// 10519 000075B2 6000 02EA bra ferrexit abort with error 10520 000075B6 0800 0003 ftst3bit btst #3,d0 is error bit 3 set? 10521 000075BA 6708 beq.s fbit2err if not, default to bit 2 error 10522 000075BC 303C 043F move.w #1087,d0 \\\\\\\\ error 87,1 //////// 10523 000075C0 6000 02DC bra ferrexit abort with error 10524 000075C4 303C 17C1 fbit2err move.w #6081,d0 \\\\\\\\ error 81,6 //////// 10525 000075C8 6000 02D4 bra ferrexit abort with error 10526 10527 *********************************************************************** 10528 * * 10529 * FRESET * 10530 * * 10531 * This subroutine is used to reset the floppy drive and its * 10532 * controller. It is used as a last ditch effort to recover from * 10533 * an error condition, and just prior to a media initialization. * 10534 * * 10535 * a0 - xcmdcopy memory pointer r * 10536 * a1 - trkside memory pointer r * 10537 * a3 - floppy cmdreg pointer r * 10538 * a4 - floppy xcmdreg pointer r * 10539 * d0 - f_clock time (centiseconds) w * 10540 * d1 - sr reg copy prior to interrupt disable w * 10541 * d7 - copy of extended command register (xcmdreg) r/w * 10542 * sr - disable interrupts r/w * 10543 * * 10544 * Bug history: * 10545 * {bug80} - side zero bit not being reset fixed 12/15/80 dfk * 10546 * * 10547 *********************************************************************** 10548 10549 000075CC 6100 FE60 freset bsr fmediack has media been removed? 10550 000075D0 1013 fresetqk move.b (a3),d0 get status byte from floppy 10551 000075D2 0800 0002 btst #2,d0 is track 0 bit set ? 10552 000075D6 671C beq.s fdoreset branch if not on track zero 10553 000075D8 4239 0044 clr.b trkreg clear floppy track reg C002 10554 000075DE 13FC 0004 move.b #4,datareg step in; insure not on trk # -1 0044 C006 10555 000075E6 40C1 move sr,d1 copy current interrupt level 10556 000075E8 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 10557 000075EC 16BC 0018 move.b #$18,(a3) seek, head loaded without verify 10558 000075F0 6100 02F4 bsr fwaitinr wait for operation complete 10559 *fdoreset bclr #3,d7 turn off reset/ (reset quick) {bug80} 10560 000075F4 0207 00F1 fdoreset andi.b #$F1,d7 reset, side zero, pre-comp/ {bug80} 10561 000075F8 1887 move.b d7,(a4) send copy to xcmdreg 10562 000075FA 700A moveq #10,d0 initialize clock for 10 ms 10563 000075FC 6100 0372 bsr f_clock wait 10 milliseconds 10564 00007600 08C7 0003 bset #3,d7 turn off reset pulse 10565 00007604 40C1 move sr,d1 copy current interrupt level 10566 00007606 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> PAGE 226 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10567 0000760A 1887 move.b d7,(a4) send to xcmd register 10568 0000760C 6100 02D8 bsr fwaitinr wait for command to complete 10569 00007610 1087 move.b d7,(a0) save xcmdreg copy 10570 00007612 4239 0044 clr.b clrxstus clear extended status register 5400 10571 * clr.b foffset set offset to zero {ag} 10572 00007618 4229 0002 clr.b 2(a1) set offset to zero {ag} 10573 0000761C 12BC 00FF move.b #$FF,(a1) force seek on next read/write 10574 00007620 4E75 rts 10575 10576 10577 *********************************************************************** 10578 * * 10579 * Power-on floppy start-up * 10580 * * 10581 * Note: this routine must be called anytime a power-on or a hard- * 10582 * reset is done. It does not require that interrupts be * 10583 * enabled. * 10584 * * 10585 * a0 - xcmdcopy memory pointer r * 10586 * a1 - trkside memory pointer r * 10587 * a3 floppy cmdreg pointer r * 10588 * a4 - floppy xcmdreg pointer r * 10589 * a5 - g$, pascal global data area pointer r * 10590 * a6 - flag byte memory pointer r * 10591 * d0 - timeout counter r/w * 10592 * d2 - sr reg copy prior to interrupt lockout r/w * 10593 * d3 - xstatus register contents r/w * 10594 * d7 - copy of extended command register (xcmdreg) r/w * 10595 * * 10596 * Bug history: * 10597 * {bug81} - error 90 wrong source number fixed 12/15/80 dfk * 10598 * * 10599 *********************************************************************** 10600 10601 *********************************************************************** 10602 * 10603 * The following floppy reset routine resets the floppy(s) and 10604 * determines whether there are one or two floppies in the 10605 * machine. 10606 * 10607 00007622 6100 97E8 FLPY_RST bsr reinit_timer kludge for old systems' sake after a RESET inst 10608 00007626 0C38 00FF cmpi.b #255,ndrives Check for presence {gll} FED8 10609 0000762C 6776 beq.s just_rts1 {gll} 10610 0000762E 2F0E FLPY_RST1 MOVE.L A6,-(SP) 10611 00007630 4238 FED3 CLR.B DRIVE Select drive 0 {ag} 10612 10613 00007634 2078 FED4 movea.l f_area,a0 10614 00007638 117C 0010 move.b #$10,5(A0) 0005 10615 0000763E 117C 0050 move.b #$50,9(a0) {ag} 0009 10616 10617 00007644 6168 BSR.S f_pwr_on power on the first drive {ag} 10618 00007646 4A38 FED8 tst.b ndrives {ag} 10619 0000764A 6752 beq.s just_rts {ag} PAGE 227 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10620 0000764C 5238 FED3 ADDQ.B #1,DRIVE Select drive 1 {ag} 10621 00007650 4E55 FFF6 LINK A5,#-10 Set up my own error {ag} 10622 00007654 487A 0050 PEA one_drive_ONLY {ag} 10623 00007658 2B4F FFF6 MOVE.L SP,-10(A5) {ag} 10624 0000765C 6150 BSR.s f_pwr_on {ag} 10625 0000765E 4E5D UNLK A5 {ag} 10626 00007660 40C2 MOVE SR,D2 Save the status register {ag} 10627 00007662 007C 2700 ORI #$2700,SR Mask all interrupts 10628 00007666 16BC 0002 MOVE.B #$02,(A3) Restore drive 1 10629 0000766A 6100 0096 bsr fponwait 10630 0000766E 0800 0004 btst #4,d0 10631 00007672 6624 bne.s one_drive 10632 00007674 4238 FED3 CLR.B DRIVE 10633 00007678 6100 0120 BSR F_SET_UP Select drive 0 10634 0000767C 16BC 0040 MOVE.B #64,(A3) step in 10635 00007680 6100 0080 BSR FPONWAIT 10636 00007684 16BC 0062 move.b #$62,(a3) step out 10637 00007688 6178 bsr.s fponwait 10638 10639 0000768A 0813 0002 BTST #2,(A3) Am I at track zero ? 10640 0000768E 6608 BNE.S ONE_DRIVE Yes, so this is an early rev floppy board 10641 00007690 11FC 0001 TWO_DRIVES MOVE.B #1,NDRIVES No FED8 10642 00007696 6004 BRA.S JUST_DRIVE 10643 00007698 4238 FED8 ONE_DRIVE CLR.B NDRIVES 10644 0000769C 46C2 JUST_DRIVE MOVE D2,SR 10645 0000769E 2C5F JUST_RTS MOVEA.L (SP)+,A6 10646 000076A0 4238 FED3 clr.b drive 10647 000076A4 4E75 just_rts1 RTS 10648 ****************************************************************************** 10649 * This routine figures out that there is * 10650 * only one drive when an error occurs * 10651 * during power-up of the second floppy * 10652 * * 10653 * * 10654 * Modified by: Anny Randel * 10655 * Date: Dec. 14, 1983 * 10656 * Purpose: Use timer when present * 10657 ****************************************************************************** 10658 000076A6 16BC 00D0 one_drive_ONLY move.b #$d0,(a3) stop the previous command now ! 10659 000076AA 4E5D unlk a5 10660 000076AC 60EA BRA ONE_DRIVE 10661 10662 000076AE 31FC 4EF9 f_pwr_on move.w #$4EF9,flpyvctr jmp instruction for intr vector FFB8 10663 000076B4 21FC 0000 move.l #fintrupt,flpyvctr+2 jmp location for interrupt vectr 7916 FFBA 10664 000076BC 6100 00DC bsr f_set_up set up address registers 10665 000076C0 1013 move.b (a3),d0 reset any interrupt from floppy 10666 000076C2 4216 clr.b (a6) clear floppy fflag byte 10667 000076C4 1E38 FED3 MOVE.B DRIVE,D7 {ag} 10668 000076C8 ED4F LSL #6,D7 {ag} 10669 000076CA 8E3C 0010 OR.B #$10,D7 initiate xcmdreg copy {ag} 10670 * move.b #$10,d7 initiate xcmdreg copy {ag} 10671 000076CE 4239 0044 clr.b clrxstus clear xstatus reg 5400 10672 000076D4 40C2 move sr,d2 copy current interrupt level PAGE 228 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10673 000076D6 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 10674 000076DA 1887 move.b d7,(a4) send reset command to xcmdreg 10675 000076DC 700A moveq #10,d0 initialize clock for 10 ms 10676 000076DE 6100 0290 bsr f_clock reset pulse is 10 ms long 10677 000076E2 08C7 0003 bset #3,d7 turn off reset pulse 10678 000076E6 1887 move.b d7,(a4) send to xcmdreg 10679 000076E8 6118 bsr.s fponwait wait for interrupt 10680 000076EA 4239 0044 clr.b trkreg clear floppy track reg C002 10681 000076F0 13FC 0003 move.b #3,datareg step in; insure not on trk # -1 0044 C006 10682 000076F8 16BC 0010 move.b #$10,(a3) seek, head unloaded no verify 10683 000076FC 6104 bsr.s fponwait wait for interrupt 10684 000076FE 6152 bsr.s fposetup set up (initialize) floppy 10685 00007700 4E75 rts 10686 10687 ******** START OF ANNY'S CHANGES ******* 10688 00007702 0838 0001 fponwait btst #timer_absent,sysflag2 timer absent? FEDA 10689 00007708 6626 bne.s fponwt1 branch if so 10690 0000770A 2F3C 001E move.l #2000000,-(sp) push microsec value (2 seconds) 8480 10691 00007710 4857 pea (sp) push loc 10692 00007712 4EBA DABE jsr start_timer get timeout value 10693 00007716 201F fponint1 move.l (sp)+,d0 pop timeout value into d0 10694 00007718 1614 move.b (a4),d3 get xstatus register 10695 0000771A 0803 0003 btst #3,d3 is interrupt bit set? 10696 0000771E 662E bne.s frstintr branch if interrupt occured 10697 00007720 2F00 move.l d0,-(sp) push timeout value 10698 00007722 4857 pea (sp) push it's location 10699 00007724 4EBA DACC jsr check_timer timed out yet??? 10700 00007728 6AEC bpl fponint1 branch if not timed out 10701 0000772A 588F addq.l #4,sp pop stack 10702 0000772C 7001 moveq #1,d0 prepare to... 10703 0000772E 6006 bra.s fponintr test one more time! 10704 ******** START OF ANNY'S CHANGES ******* 10705 10706 00007730 203C 0006 fponwt1 move.l #400000,d0 wait two seconds for intr 1A80 10707 00007736 1614 fponintr move.b (a4),d3 get xstatus register 10708 00007738 0803 0003 btst #3,d3 is interrupt bit set ? 10709 0000773C 6610 bne.s frstintr branch if interrupt occured 10710 0000773E 5380 subq.l #1,d0 decrement timeout counter 10711 00007740 6EF4 bgt.s fponintr branch if not timed out 10712 10713 00007742 610E fponint2 bsr.s fposetup set up (initialize) floppy 10714 * move.w #3090,-2(a5) \\\\\\\\ error 90,3 //////// {bug81} 10715 00007744 3B7C 2B52 move.w #11090,-2(a5) \\\\\\\\ error 90,11 //////// {bug81} FFFE 10716 0000774A 2E6D FFF6 movea.l -10(a5),sp return to pascal error escapei 10717 0000774E 1013 frstintr move.b (a3),d0 reset interrupt from floppy 10718 00007750 4E75 rts 10719 10720 00007752 1087 fposetup move.b d7,(a0) store xcmdreg copy 10721 * clr.b foffset set offset to zero {ag} 10722 00007754 4229 0002 clr.b 2(a1) set offset to zero {ag} 10723 00007758 12BC 00FF move.b #$FF,(a1) force seek on first read/write PAGE 229 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10724 0000775C 46C2 move d2,sr restore interrupt <<<<<<<<<<<<<< 10725 0000775E 4E75 rts 10726 * flpywrt 10727 10728 *********************************************************************** 10729 * * 10730 * Mini-floppy 'WRITE' * 10731 * * 10732 * Parameter stack: * 10733 * * 10734 * sp + 8 - logical record number * 10735 * sp + 4 - data buffer address pointer * 10736 * sp ---> - return address * 10737 * * 10738 *********************************************************************** 10739 10740 *********************************************************************** 10741 * * 10742 * FLPY-WRT * 10743 * * 10744 * Outer block minifloppy 'WRITE' routine. The necessary modules * 10745 * are called to perform the minifloppy write function. * 10746 * * 10747 * a0 - xcmdcopy memory pointer r * 10748 * a1 - trkside memory pointer r * 10749 * a4 - floppy xcmdreg pointer r * 10750 * a6 - flag byte memory pointer r * 10751 * d4 - physical track and side passed to this routine r * 10752 * d7 - copy of extended command register (xcmdreg) r/w * 10753 * * 10754 *********************************************************************** 10755 10756 00007760 0C38 00FF flpy_wrt cmpi.b #255,ndrives Check for No Device Present {gll} FED8 10757 00007766 6700 F7F2 beq fnot_present {gll} 10758 0000776A 2F0E move.l a6,-(sp) save a6 for pascal 10759 0000776C 612C bsr.s f_set_up set up registers and motor on 10760 0000776E 6178 BSR.s DRIVECHK 10761 00007770 6100 FC86 bsr fmotoron turn on floppy motor 10762 00007774 6100 FBD2 bsr fconvert logical to side-track conversion 10763 00007778 B811 cmp.b (a1),d4 is floppy already at trk & side 10764 0000777A 6704 beq.s fwrtquik branch if no seek is necessary 10765 0000777C 6100 FCC8 bsr fseek move head to desired side-track 10766 00007780 6100 0100 fwrtquik bsr fmembuf move data from memory to floppy 10767 00007784 617A bsr.s fwrite write data into floppy buffer 10768 00007786 0887 0000 bclr #0,d7 reset motor on bit 10769 0000778A 1887 move.b d7,(a4) turn off floppy motor 10770 0000778C 1087 move.b d7,(a0) store away xcmdreg copy 10771 0000778E 0896 0000 bclr #0,(a6) reset 'miniflop driver active' 10772 00007792 2C5F movea.l (sp)+,a6 restore a6 for pascal 10773 00007794 205F movea.l (sp)+,a0 get return pointer 10774 00007796 508F addq.l #8,sp pop parameters 10775 00007798 4ED0 jmp (a0) 10776 10777 *********************************************************************** 10778 * * 10779 * F-SET-UP * PAGE 230 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10780 * * 10781 * Used at beginning of each entry routine to set up registers * 10782 * and set driver active flag. * 10783 * * 10784 * a0 - xcmdcopy memory pointer r/w * 10785 * a1 - trkside memory pointer r/w * 10786 * a2 - floppy fbuffer pointer w * 10787 * a3 - floppy cmdreg pointer w * 10788 * a4 - floppy xcmdreg (write) and xstatus (read) pointer w * 10789 * a6 - flag byte memory pointer r/w * 10790 * d7 - copy of extended command register (xcmdreg) w * 10791 * * 10792 *********************************************************************** 10793 10794 * 10795 *f_set_up lea xcmdcopy,a0 xcmdreg copy memory pointer {ag} 10796 * lea trkside,a1 trkside memory pointer {ag} 10797 * lea fbuffer,a2 floppy buffer pointer {ag} 10798 * lea cmdreg,a3 floppy command reg pointer {ag} 10799 * lea xcmdreg,a4 floppy extented command reg ptr {ag} 10800 * lea fflags,a6 flags byte memory pointer {ag} 10801 * bset #0,(a6) set 'miniflop driver active' {ag} 10802 * move.b (a0),d7 initialize xcmdcopy in d7 {ag} 10803 * rts {ag} 10804 10805 0000779A 2078 FED4 f_set_up MOVEA.L F_AREA,A0 {ag} 10806 0000779E 4DE8 0003 LEA 3(A0),A6 {ag} 10807 000077A2 43E8 0004 LEA 4(A0),A1 {ag} 10808 000077A6 41E8 0005 LEA 5(A0),A0 {ag} 10809 000077AA 45F9 0044 LEA FBUFFER,A2 {ag} E000 10810 000077B0 47F9 0044 LEA CMDREG,A3 {ag} C000 10811 000077B6 49F9 0044 LEA XCMDREG,A4 {ag} 5000 10812 000077BC 7E00 MOVEQ #0,D7 {ag} 10813 000077BE 1E38 FED3 MOVE.B DRIVE,D7 {ag} 10814 000077C2 E54F LSL #2,D7 {ag} 10815 000077C4 D0C7 ADDA D7,A0 {ag} 10816 000077C6 D2C7 ADDA D7,A1 {ag} 10817 000077C8 DCC7 ADDA D7,A6 {ag} 10818 000077CA 08D6 0000 BSET #0,(A6) {ag} 10819 000077CE 1E11 MOVE.B (A1),D7 d7 = trkside {ag} 10820 000077D0 BE3C 00FF CMP.B #$FF,D7 {ag} 10821 000077D4 670C BEQ.S I_LOST_IT {ag} 10822 000077D6 9E29 0002 sub.b 2(a1),d7 subtract offset 10823 000077DA E20F LSR.B #1,D7 {ag} 10824 000077DC 13C7 0044 MOVE.B D7,TRKREG Set up the track register {ag} C002 10825 000077E2 1E10 I_LOST_IT MOVE.B (A0),D7 {ag} 10826 000077E4 1887 move.b d7,(a4) 10827 000077E6 4E75 RTS {ag} 10828 000077E8 4A38 FED3 DRIVECHK TST.B DRIVE {ag} 10829 000077EC 670E BEQ.S DRIVEOK {ag} 10830 000077EE 4A38 FED8 TST.B NDRIVES {ag} 10831 000077F2 6608 BNE.S DRIVEOK {ag} 10832 000077F4 303C 043A MOVE #1082,D0 {ag} PAGE 231 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10833 000077F8 6000 00B0 BRA frstexit {ag} 10834 000077FC 1E10 DRIVEOK move.b (a0),d7 Put xcmdcopy in D7 {ag} 10835 000077FE 4E75 RTS 10836 10837 *********************************************************************** 10838 * * 10839 * FWRITE * 10840 * * 10841 * This subroutine is used to write data from a memory buffer into * 10842 * the floppy ram buffer. * 10843 * If and error occures on attempting to write the data on to the * 10844 * media, three retrys are attempted before reporting an error code * 10845 * and aborting the write. * 10846 * * 10847 * a2 - flopper fbuffer pointer r * 10848 * a3 - floppy cmdreg pointer r * 10849 * a4 - floppy xcmdreg pointer r * 10850 * d0 - general - floppy status register copy - error # r/w * 10851 * d1 - sr reg copy prior to interrupt disable w * 10852 * d5 - logical track and side r * 10853 * d6 - sector to be written r * 10854 * d7 - copy of extended command register (xcmdreg) r/w * 10855 * sr - disable interrupts r/w * 10856 * * 10857 *********************************************************************** 10858 10859 *fwrite move.b #3,re_rdwrt reread also used as rewrite cntr {ag} 10860 00007800 2F08 fwrite move.l a0,-(sp) {ag} 10861 00007802 2078 FED4 movea.l f_area,a0 {ag} 10862 00007806 5248 addq #1,a0 {ag} 10863 00007808 10BC 0003 move.b #3,(a0) {ag} 10864 10865 0000780C 13C6 0044 fretrywt move.b d6,secreg write sector to sector register C004 10866 00007812 1012 move.b (a2),d0 dummy read of floppy buffer 10867 00007814 0887 0004 bclr #4,d7 reset read bit in xcmdreg 10868 00007818 08C7 0005 bset #5,d7 set local bit in xcmdreg 10869 0000781C 40C1 move sr,d1 copy current interrupt level 10870 0000781E 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 10871 00007822 0805 0000 btst #0,d5 is side zero or one desired? 10872 00007826 6706 beq.s f_0_side branch to command for side zero 10873 00007828 16BC 00AA move.b #$AA,(a3) issue write side one to cmd reg 10874 0000782C 6004 bra.s f_1_side jump over side zero command 10875 0000782E 16BC 00A2 f_0_side move.b #$A2,(a3) issue write side zero to cmd reg 10876 00007832 1887 f_1_side move.b d7,(a4) send copy to xcmdreg 10877 00007834 6100 00B0 bsr fwaitinr wait for interrupt 10878 00007838 1013 move.b (a3),d0 get status word from floppy 10879 0000783A 0200 00FC andi.b #$FC,d0 check bits 2, 3, 4, 5, 6 and 7 10880 0000783E 6608 bne.s fwtretry if error bit set, retry 10881 00007840 08C7 0004 bset #4,d7 set xcmdreg copy to read standby 10882 00007844 205F movea.l (sp)+,a0 {ag} 10883 00007846 4E75 rts 10884 10885 00007848 0800 0006 fwtretry btst #6,d0 is write protect bit set? 10886 0000784C 662E bne.s fwrtprot branch if write protected 10887 * subi.b #1,re_rdwrt decrement rewrite (reread) cntr {ag} 10888 0000784E 5310 subq.b #1,(a0) {ag} PAGE 232 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10889 10890 00007850 66BA bne.s fretrywt is rewrite count expired (zero)? 10891 00007852 0800 0007 btst #7,d0 is error bit 7 set? 10892 00007856 6706 beq.s ftstbit4 branch if bit is not set 10893 00007858 303C 0C08 move.w #3080,d0 \\\\\\\\ error 80,3 //////// 10894 0000785C 6040 bra.s ferrexit abort with error 10895 0000785E 0800 0004 ftstbit4 btst #4,d0 is error bit 4 set? 10896 00007862 6706 beq.s ftstbit3 if not, test bit 3 10897 00007864 303C 0824 move.w #2084,d0 \\\\\\\\ error 84,2 //////// 10898 00007868 6034 bra.s ferrexit abort with error 10899 0000786A 0800 0003 ftstbit3 btst #3,d0 is error bit 3 set? 10900 0000786E 6706 beq.s flosterr if not, default bit 2 or 5 error 10901 00007870 303C 1BA9 move.w #7081,d0 \\\\\\\\ error 81,7 //////// 10902 00007874 6028 bra.s ferrexit abort with error 10903 00007876 303C 13D9 flosterr move.w #5081,d0 \\\\\\\\ error 81,5 //////// 10904 0000787A 6022 bra.s ferrexit abort with error 10905 0000787C 303C 043B fwrtprot move.w #1083,d0 \\\\\\\\ error 83,1 //////// 10906 00007880 601C bra.s ferrexit abort with error 10907 10908 *********************************************************************** 10909 * * 10910 * FMEMBUF * 10911 * * 10912 * This subroutine transfers 256 bytes (one sector) from buffer * 10913 * memory pointed to by the pascal parameter left on the stack * 10914 * at sp + 20 (at time used) to the floppy ram buffer. * 10915 * There is no error checking to be done. * 10916 * * 10917 * a0 - memory buffer address r/w * 10918 * a2 - floppy ram buffer address r * 10919 * sp - (a7) stack pointer r * 10920 * d0 - contains constant value of 64 r/w * 10921 * d1 - used as a one long word buffer r/w * 10922 * * 10923 *********************************************************************** 10924 10925 00007882 48E7 00A0 fmembuf movem.l a0/a2,-(sp) stack a0, a2 (need two temps) 10926 00007886 206F 0014 movea.l 20(sp),a0 get memory buffer address 10927 0000788A 7040 moveq #64,d0 initialize 4 * 64 = 256 bytes 10928 0000788C 2218 floopbuf move.l (a0)+,d1 memory buffer to temp reg 10929 0000788E 03CA 0000 movep.l d1,0(a2) temp reg to floppy buffer 10930 00007892 504A addq.w #8,a2 add 8 to form word boundry 10931 00007894 5300 subq.b #1,d0 decrement 8-byte loop counter 10932 00007896 6EF4 bgt.s floopbuf have 256 bytes been transferred? 10933 00007898 4CDF 0500 movem.l (sp)+,a0/a2 restore stacked a0, a2 10934 0000789C 4E75 rts 10935 10936 *********************************************************************** 10937 * * 10938 * FERREXIT * 10939 * * 10940 * This routine accomplishes the abort and exit of all the * 10941 * mass memory routines. The floppy is reset and left in remote * 10942 * on track zero, side zero, and motor off. * 10943 * This routine is totally self contained (no other subroutines * 10944 * are called) to prevent the possibility of endless recurrsive loops.* 10945 * * PAGE 233 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 10946 * a1 - trkside memory pointer r * 10947 * a3 - floppy cmdreg pointer r * 10948 * a4 - floppy xcmdreg pointer r * 10949 * a5 - g$, pascal global data area pointer r * 10950 * a6 - flag byte memory pointer r * 10951 * sp - (a7) stack pointer r * 10952 * d0 - error code number passed into this routine r * 10953 * d1 - temperary general purpose storage r/w * 10954 * * 10955 *********************************************************************** 10956 10957 0000789E 1214 ferrexit move.b (a4),d1 get extended status for media ck 10958 000078A0 0801 0001 btst #1,d1 is media fchangedbit set? 10959 000078A4 6704 beq.s frstexit branch if not set 10960 000078A6 303C 2378 move.w #9080,d0 \\\\\\\\ error 80,9 //////// 10961 000078AA 4A38 FED3 frstexit tst.b drive {ag} 10962 000078AE 670C beq.s frstex2 {ag} 10963 000078B0 18BC 0058 move.b #$58,(a4) {ag} 10964 000078B4 137C 0058 move.b #$58,1(a1) {ag} 0001 10965 000078BA 600A bra.s frstex3 {ag} 10966 000078BC 18BC 0018 frstex2 move.b #$18,(a4) floppy standby, * motor off * 10967 000078C0 137C 0018 move.b #$18,1(a1) save xcmdreg copy 0001 10968 000078C6 16BC 00D0 frstex3 move.b #$d0,(a3) cancel any floppy commands 10969 000078CA 4239 0044 clr.b clrxstus clear extended status register 5400 10970 000078D0 4216 clr.b (a6) clear flag bits 10971 * clr.b foffset zero the offset variable {ag} 10972 000078D2 4229 0002 clr.b 2(a1) zero the offset variable {ag} 10973 000078D6 12BC 00FF move.b #$FF,(a1) force seek on next read/write 10974 000078DA 3B40 FFFE move.w d0,-2(a5) store error code for escape 10975 000078DE 2E6D FFF6 movea.l -10(a5),sp return to pascal error escape 10976 000078E2 1213 move.b (a3),d1 clear any interrupt from floppy 10977 000078E4 4E75 fierrts rts 10978 10979 *********************************************************************** 10980 * * 10981 * FWAITINR * 10982 * * 10983 * This is the interrupt handler routine. This routine is entered * 10984 * just prior to enabling interrupts. The 'isr' is enterd when the * 10985 * interrupt occures. The interrupt must occure within 2 seconds of * 10986 * calling this routine or a error is reported. Likewise, if an * 10987 * interrupt occures which was not expected by this routine an * 10988 * error is reported. * 10989 * * 10990 * a3 - floppy cmdreg pointer r * 10991 * a4 - floppy xcmdreg pointer r * 10992 * a6 - flag byte memory pointer r * 10993 * 2(a6) = xcmdcopy 10994 * d0 - clock elasped time counter - error number r/w * 10995 * d1 - sr reg copy prior to interrupt disable w * 10996 * d7 - copy of extended command register (xcmdreg) r/w * 10997 * * 10998 *********************************************************************** 10999 PAGE 234 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11000 *fwaitinr move.b d7,xcmdcopy store away current xcmdreg {ag} 11001 000078E6 1D47 0002 fwaitinr move.b d7,2(a6) {ag} 11002 11003 000078EA 08D6 0001 bset #1,(a6) set expecting interrupt flag bit 11004 000078EE 0896 0002 bclr #2,(a6) clear 'interrupt occured' flag 11005 000078F2 46C1 move d1,sr enable interrupts <<<<<<<<<<<<<< 11006 000078F4 303C 07D0 move.w #2000,d0 initialize clock for 2 seconds 11007 000078F8 0C41 2200 cmpi.w #$2200,d1 ** check for locked out floppy * 11008 000078FC 6C12 bge.s flockout branch if locked out 11009 000078FE 6170 bsr.s f_clock wait two second for interrupt 11010 * move.b xcmdcopy,d7 xcmdreg changed during interrupt {ag} 11011 00007900 1E2E 0002 move.b 2(a6),d7 {ag} 11012 11013 00007904 0896 0001 bclr #1,(a6) test and reset "await intr" flag 11014 00007908 67DA beq.s fierrts jump over error if normal 11015 0000790A 303C 1F9A move.w #8090,d0 \\\\\\\\ error 90,8 //////// 11016 0000790E 608E bra.s ferrexit abort with error 11017 11018 00007910 303C 2382 flockout move.w #9090,d0 \\\\\\\\ error 90,9 //////// 11019 00007914 6088 bra.s ferrexit 11020 11021 *isrisrisrisrisrisrisr interrupt entry point isrisrisrisrisrisrisrisr 11022 11023 00007916 0C38 00FF fintrupt cmpi.b #255,ndrives Check for No Device Present {gll} FED8 11024 0000791C 673A beq.s fintrend1 {gll} 11025 0000791E 48E7 8080 movem.l a0/d0,-(sp) need two work registers in isr 11026 00007922 2078 FED4 movea.l f_area,a0 {ag} 11027 00007926 7000 moveq #0,d0 {ag} 11028 00007928 1038 FED3 move.b drive,d0 {ag} 11029 0000792C E548 lsl #2,D0 {ag} 11030 0000792E 41F0 0003 lea 3(a0,d0),a0 {ag} 11031 11032 * move.b xcmdcopy,d0 get current xcmdreg setting {ag} 11033 00007932 1028 0002 move.b 2(a0),d0 {ag} 11034 11035 00007936 0880 0005 bclr #5,d0 clear local bit in xcmd reg 11036 0000793A 13C0 0044 move.b d0,xcmdreg send to xcmdreg 5000 11037 * move.b d0,xcmdcopy update xcmdreg copy for rte {ag} 11038 00007940 1140 0002 move.b d0,2(a0) {ag} 11039 11040 00007944 1039 0044 move.b cmdreg,d0 reset interrupt bit from floppy C000 11041 * bclr #1,fflags test and reset "await intr" flag {ag} 11042 0000794A 0890 0001 bclr #1,(a0) {ag} 11043 11044 0000794E 670A beq.s fintrerr jump to error routine if flag=0 11045 * bset #2,fflags reset clock to zero wait time {ag} 11046 00007950 08D0 0002 bset #2,(a0) {ag} 11047 11048 00007954 4CDF 0101 fintrend movem.l (sp)+,a0/d0 restore isr working register 11049 00007958 4E73 fintrend1 rte return from interrupt 11050 11051 *fintrerr btst #0,fflags not in mf driver when intr'ed? {ag} 11052 0000795A 0810 0000 fintrerr btst #0,(a0) {ag} 11053 PAGE 235 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11054 0000795E 67F4 beq.s fintrend enable and exit if not massmem 11055 00007960 2EBC 0000 move.l #6090,(sp) \\\\\\\\ error 90,6 //////// 17CA 11056 00007966 41FA FF36 lea ferrexit,a0 abort with error 11057 0000796A 2F48 000A move.l a0,10(sp) overwrite return address for rte 11058 0000796E 60E4 bra.s fintrend branch and exit isr 11059 11060 *********************************************************************** 11061 * * 11062 * F_CLOCK * 11063 * * 11064 * This is the elasped time counter routine. The time to be * 11065 * wasted away is passed in register d0.w in milli-seconds. The * 11066 * routine exits when that time expires. The routine also exits * 11067 * before the elasped time expires if the 'intr occured' flag is set. * 11068 * * 11069 * IF NO TIMER PRESENT: * 11070 * * 11071 * a6 - flag byte memory pointer r * 11072 * d0 - clock elasped time counter r/w * 11073 * d1 - one milli-second counter r/w * 11074 * * 11075 * IF TIMER PRESENT (see below): * 11076 * * 11077 * sp+4 = delay in micro seconds * 11078 * * 11079 * * 11080 * NOTE: This file modified to use timer routines when a timer * 11081 * is present. If no timer is present, the processor is assumed * 11082 * to be an MC68000 running a 8 MHz. * 11083 * * 11084 * Modified by: Anny Randel * 11085 * Date: Dec. 5, 1983 * 11086 * Purpose: Use timer when present to have 68010/12 * 11087 * compatibility * 11088 * * 11089 * Modified again: Dec. 11, 1983 * 11090 * Purpose: Fix to work with modified timer routines * 11091 * * 11092 * Modified again: Dec. 12, 1983 * 11093 * Purpose: Fix to work with once again modified timer * 11094 * routines * 11095 * * 11096 * Modified again: Feb. 8, 1984 * 11097 * Purpose: Handle special case of D0 = 0 * 11098 * * 11099 * Bug fix 3/13/84 time parameter is a word, not a long * 11100 * * 11101 * ASSUMES: - number of millisecs to delay in d0.w * 11102 * * 11103 *********************************************************************** 11104 11105 ****** START OF ANNY'S CHANGES ****** 11106 11107 00007970 0838 0001 f_clock btst #timer_absent,sysflag2 timer absent? FEDA 11108 00007976 662A bne.s f_clock1 branch if so PAGE 236 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11109 11110 00007978 48C0 ext.l d0 extend to long 11111 0000797A 2F00 move.l d0,-(sp) Pass parameter 11112 0000797C 6700 0020 beq clkext1 If zero, then get out 11113 00007980 4857 pea (sp) by reference to milli_to_micro 11114 00007982 4EBA D824 jsr milli_to_micro Convert milliseconds to microseconds 11115 * Returns usec conversion in (sp) 11116 00007986 4857 pea (sp) Pass by reference to start_timer 11117 00007988 4EBA D848 jsr start_timer Read timer and calculate timeout 11118 * value which is returned in (sp) 11119 0000798C 0896 0002 ftstcd bclr #2,(a6) Test and clear 'intr occured???' 11120 00007990 660C bne.s clkext1 Pop and exit if intr completed 11121 11122 00007992 4857 pea (sp) Pass by reference timeout value 11123 00007994 4EBA D85C jsr check_timer Chk timer, bras on bpl if not timed out 11124 00007998 6AF2 bpl ftstcd branch if not timed out 11125 0000799A 0896 0002 bclr #2,(a6) one final test! 11126 11127 0000799E 588F clkext1 addq.l #4,sp Pop stack 11128 000079A0 4E75 rts 11129 11130 ****** END OF ANNY'S CHANGES ****** 11131 11132 000079A2 223C 0000 f_clock1 move.l #200,d1 initialize milli-counter 00C8 11133 000079A8 0896 0002 fmillsec bclr #2,(a6) test and clear 'intr occured???' 11134 000079AC 6608 bne.s clkexit exit if interrupt completed 11135 000079AE 5381 subq.l #1,d1 decrement milli-counter 11136 000079B0 6EF6 bgt.s fmillsec exit loop if 1 millisecond 11137 000079B2 5340 subq.w #1,d0 decrement elaspt time counter 11138 000079B4 6EEC bgt.s f_clock1 exit if time expired 11139 000079B6 4E75 clkexit rts 11140 * flpyinit 11141 11142 * The following are offsets to reg. A6 after the LINK A6 is executed: 11143 11144 0000 0040 message equ 64 crt message pointer parameter 11145 0000 003F intleav equ 63 interleave BYTE parameter 11146 FFFF FFF0 sectable equ -16 sector table 11147 FFFF FFE0 ffsectbl equ -32 'spare' sector table (= ff's) 11148 FFFF FFDC margnerr equ -36 one long word, two word-bit-maps 11149 FFFF FFDB lgclside equ -37 logical side number 11150 FFFF FFDA sparecnt equ -38 number of spared tracks 11151 FFFF FFD6 nmi_save equ -42 saved keyboard timer pseudo vctr 11152 FFFF FFD4 jmpjsrop equ -44 saved pseudo vector's jmp/jsr 11153 11154 FFFF FF9A nmi_jxx equ $ffffff9a jmp or jsr op location 11155 FFFF FF9C nmivectr equ $ffffff9c keyboard timer pseudo vector adr 11156 11157 0000 4EF9 jump_op equ $4ef9 hex code for a 68000 'jmp' op 11158 11159 *********************************************************************** 11160 * 11161 * Mini-floppy 'INITIALIZE' 11162 * 11163 * Parameter stack: 11164 * PAGE 237 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11165 * sp + 6 - crt message line pointer 11166 * sp + 4 - interleave (one WORD long) 11167 * sp ---> - return address 11168 * 11169 *********************************************************************** 11170 11171 *********************************************************************** 11172 * 11173 * FLPYINIT 11174 * 11175 * Minifloppy 'initialize' routine. There are four modules: the 11176 * outer module controls the track to track set-ups (track numbering, 11177 * data content, gap length, and message display), and sparing of 11178 * tracks. The 'ftrkinit' module does the actual writting of the 11179 * info on the track/side of the media and the verifing of that data 11180 * write. 11181 * Two modules deal with the sector table: 'fsectble' generates 11182 * the table with the required interleave, and 'rotatsec' shifts the 11183 * sector format for each track/side. Note that the interleave 11184 * factor has no effect on the time required to perform the initiali- 11185 * zation as the sector table is used during the verify phase also. 11186 * Before the 'movem' register save and after the 'movem' register 11187 * restore the registers are defined as shown in 'f-set-up'. 11188 * 11189 * ao - current data pattern r/w 11190 * a1 - initialize flag byte pointer r/w 11191 * a2 - floppy datareg pointer r/w 11192 * a3 - floppy cmdreg pointer r 11193 * a4 - floppy xcmdreg/xstatus pointer r 11194 * a6 - LINK space pointer r/w 11195 * d0 - general purpose temperary storage register - err # r/w 11196 * d1 - loop counter r/w 11197 * d2 - data to be written onto the media r/w 11198 * d3 - logical track number r/w 11199 * d4 - logical side number r/w 11200 * d5 - constant value of 1 (0ne) r/w 11201 * d6 - constant value of 9 (nine) r/w 11202 * d7 - copy of xcmdreg, and sector counter r/w 11203 * 11204 * Bug history: 11205 * {bug75} - overwriting trk 33/1 fixed 12/10/80 dfk 11206 * {bug96} - add pre-comp code fixed 12/16/80 dfk 11207 * 11208 * 11209 * Modified by: Anny Randel 11210 * Date: Dec. 14, 1983 11211 * Purpose: Use timer when present 11212 * 11213 *********************************************************************** 11214 11215 000079B8 49 fmessage dc.b 'INITIALIZE: TRACK , SIDE , SPARED ' 11216 11217 000079E0 0C38 00FF flpyinit cmpi.b #255,ndrives Check for No Device Present {gll} FED8 11218 000079E6 6700 F572 beq fnot_present {gll} 11219 000079EA 2F0E move.l a6,-(sp) save a6 reg. for pascal rtn 11220 000079EC 6100 FDAC bsr f_set_up set up registers PAGE 238 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11221 000079F0 6100 FDF6 BSR DRIVECHK 11222 000079F4 6100 FA02 bsr fmotoron turn on floppy motor 11223 000079F8 6100 FBD2 bsr freset restore drive to ground zero 11224 000079FC 0813 0006 btst #6,(a3) is media write protected? 11225 00007A00 6708 beq.s flockous branch if not protected 11226 00007A02 303C 0823 move.w #2083,d0 \\\\\\\\ error 83,2 //////// 11227 00007A06 6000 FE96 bra ferrexit abort with error 11228 00007A0A 40C1 flockous move sr,d1 copy current interrupt level 11229 00007A0C 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 11230 00007A10 16BC 000A move.b #$0A,(a3) force head load with a restore 11231 00007A14 6100 FED0 bsr fwaitinr wait for op complete 11232 00007A18 303C 0190 move.w #400,d0 initialize clock for 400 ms 11233 00007A1C 6100 FF52 bsr f_clock be sure head loaded, up to speed 11234 00007A20 40E7 move sr,-(sp) save current sr status 11235 00007A22 007C 2700 ori #$2700,sr disable interrupts >>>>>>>>>>>>> 11236 00007A26 48E7 7FF8 movem.l d1-d7/a0-a4,-(sp) save 'f_set_up' enviroment 11237 00007A2A 4E56 FFD4 link a6,#-44 sector table and work storage 11238 00007A2E 6100 042C bsr fsectble create sector table (interlaeve) 11239 00007A32 7000 moveq #0,d0 clear registers for format wrt 11240 00007A34 7200 moveq #0,d1 11241 00007A36 7400 moveq #0,d2 11242 00007A38 7600 moveq #0,d3 11243 00007A3A 7800 moveq #0,d4 11244 00007A3C 7A01 moveq #1,d5 constant value of 1 11245 00007A3E 7C09 moveq #9,d6 constant value of 9 11246 11247 * move.b d7,xcmdcopy save xcmdreg copy {ag} 11248 00007A40 2078 FED4 movea.l f_area,a0 {ag} 11249 00007A44 1238 FED3 move.b drive,d1 {ag} 11250 00007A48 E549 lsl #2,d1 {ag} 11251 00007A4A 1187 1005 move.b d7,5(a0,d1) {ag} 11252 00007A4E 7200 moveq #0,d1 {ag} 11253 11254 00007A50 7E00 moveq #0,d7 clear register for format wrt 11255 00007A52 4211 clr.b (a1) clear initialize flag byte 11256 00007A54 42AE FFDC clr.l margnerr(a6) clear margin error bit maps 11257 00007A58 426E FFDA clr.w sparecnt(a6) clear spare count and lgclside 11258 00007A5C 206E 0040 movea.l message(a6),a0 get message crt display location 11259 00007A60 45FA FF7E lea fmessage+40,a2 get message location (last byte) 11260 00007A64 123C 004E move.b #78,d1 40 bytes, 0 thru 78 odd addrs 11261 00007A68 11A2 1001 fnxtchar move.b -(a2),1(a0,d1) display one byte 11262 00007A6C 5501 subq.b #2,d1 decrement display index/counter 11263 00007A6E 6CF8 bge.s fnxtchar loop until all message displayed 11264 00007A70 45F9 0044 lea datareg,a2 for speed, a2 = pointer C006 11265 00007A76 4878 3A98 fintside pea 15000 push microsecond value (15 ms) 11266 00007A7A 6100 8584 bsr miscasm_delay delay 11267 00007A7E 6100 01A2 bsr fdispcyl display cylinder and spares 11268 00007A82 143C 004B move.b #75,d2 post index gap length = 75 11269 00007A86 307C 005B movea.w #$5B,a0 data pattern to be written 11270 00007A8A 6100 01CE bsr ftrkinit initialize the track 11271 00007A8E 0811 0001 btst #1,(a1) abort type error? 11272 00007A92 6600 0144 bne ferr66_3 branch if error 11273 00007A96 0811 0000 btst #0,(a1) test write trk error flag 11274 00007A9A 6600 00F4 bne fspartrk branch spare trk if error 11275 00007A9E 143C 005F move.b #95,d2 post index gap length = 95 11276 00007AA2 307C 0025 movea.w #$25,a0 data pattern to be written PAGE 239 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11277 00007AA6 6100 01B2 bsr ftrkinit initialize the track 11278 00007AAA 0811 0001 btst #1,(a1) abort type error? 11279 00007AAE 6600 0128 bne ferr66_3 branch if error 11280 00007AB2 0811 0000 btst #0,(a1) test write trk error flag 11281 00007AB6 6600 00D8 bne fspartrk branch to spare trk if error 11282 00007ABA 7455 moveq #85,d2 post index gap length = 85 11283 00007ABC 307C 0055 movea.w #$55,a0 data pattern to be written 11284 00007AC0 6100 0198 bsr ftrkinit initialize the track 11285 00007AC4 0811 0001 btst #1,(a1) abort type error? 11286 00007AC8 6600 010E bne ferr66_3 branch if error 11287 00007ACC 0811 0000 btst #0,(a1) test write trk error flag 11288 00007AD0 6600 00BE bne fspartrk branch to spare trk if error 11289 00007AD4 7455 moveq #85,d2 post index gap length = 85 11290 00007AD6 307C 0020 movea.w #$20,a0 data pattern to be written 11291 00007ADA 6100 017E bsr ftrkinit initialize the track 11292 00007ADE 0811 0001 btst #1,(a1) abort type error? 11293 00007AE2 6600 00F4 bne ferr66_3 branch if error 11294 00007AE6 0811 0000 btst #0,(a1) test write trk error flag 11295 00007AEA 6600 00A4 bne fspartrk branch to spare trk if error 11296 00007AEE 42AE FFDC clr.l margnerr(a6) clear mrgn err bit (sector) maps 11297 00007AF2 086E 0000 flogaddr bchg #0,lgclside(a6) side bit copy for displaying FFDB 11298 00007AF8 0844 0000 bchg #0,d4 test and 'not' logical side bit 11299 00007AFC 671C beq.s fnxtside track stays same if side was 0 11300 00007AFE D605 add.b d5,d3 increment track number by one 11301 00007B00 0811 0004 btst #4,(a1) test 'lasttrks' flag 11302 00007B04 6614 bne.s fnxtside branch if set 11303 00007B06 0C03 0021 cmpi.b #33,d3 tracks 0 thru 32, then 'lasttrks' 11304 * bge.s finitend branch to end if done {bug75} 11305 00007B0A 6D0E blt.s fnxtside branch if not last user trk/side {bug75} 11306 00007B0C 08D1 0004 bset #4,(a1) set 'lasttrks' flag {bug75} 11307 00007B10 7004 moveq #4,d0 max of four spared tracks {bug75} 11308 00007B12 902E FFDA sub.b sparecnt(a6),d0 subtract actual spared tracks {bug75} 11309 00007B16 1D40 FFDC move.b d0,margnerr(a6) store diff in margin bits area {bug75} 11310 00007B1A 6100 0380 fnxtside bsr rotatsec rotate the sector table 11311 00007B1E 4878 03E8 fphyaddr pea 1000 push microsecond value 11312 00007B22 6100 84DC bsr miscasm_delay delay 11313 * move.b xcmdcopy,d7 get xcmdreg copy {ag} 11314 00007B26 2078 FED4 fwrtstl1 movea.l f_area,a0 {ag} 11315 00007B2A 7E00 moveq #0,d7 {ag} 11316 00007B2C 1E38 FED3 move.b drive,d7 {ag} 11317 00007B30 E54F lsl #2,d7 {ag} 11318 00007B32 41F0 7005 lea 5(a0,d7),a0 {ag} 11319 00007B36 1E10 move.b (a0),d7 {ag} 11320 11321 00007B38 0847 0002 bchg #2,d7 test and compliment side bit 11322 00007B3C 6716 beq.s fphyside track stays same if side was 0 11323 00007B3E 13FC 0058 move.b #$58,cmdreg step in, update, no verify 0044 C000 11324 00007B46 6100 00B8 bsr finitisr wait for interrupt 11325 00007B4A 0C03 0012 cmpi.b #18,d3 are we on track #18 side 0 ? {bug96} 11326 00007B4E 6604 bne.s fphyside branch if not on track #18/0 {bug96} 11327 00007B50 08C7 0001 bset #1,d7 set pre-comp bit in xcmdreg {bug96} 11328 00007B54 1887 fphyside move.b d7,(a4) write side bit to floppy 11329 * move.b d7,xcmdcopy save xcmdreg copy {ag} 11330 00007B56 1087 move.b d7,(a0) {ag} 11331 PAGE 240 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11332 00007B58 0811 0004 btst #4,(a1) test 'lasttrks' flag 11333 00007B5C 6604 bne.s flastrks branch if set 11334 00007B5E 6000 FF16 bra fintside initialize next track/side 11335 11336 *finitend bset #4,(a1) set 'lasttrks' flag {bug75} 11337 * moveq #4,d0 max of four spared tracks {bug75} 11338 * sub.b sparecnt(a6),d0 subtract actual spared tracks {bug75} 11339 * move.b d0,margnerr(a6) store diff in margin bits area {bug75} 11340 00007B62 9B2E FFDC flastrks sub.b d5,margnerr(a6) decrement last tracks count 11341 * ble.s fintunlk branch if all tracks written {bug75} 11342 00007B66 6D0E blt.s fintunlk branch if all tracks written {bug75} 11343 00007B68 7455 moveq #85,d2 post index gap length = 85 11344 00007B6A 307C 0020 movea.w #$20,a0 data pattern to be written 11345 00007B6E 6100 00EA bsr ftrkinit initialize the track 11346 00007B72 6000 FF7E bra flogaddr branch and write next track 11347 11348 00007B76 4E5E fintunlk unlk a6 return temp storage to stack 11349 00007B78 4CDF 1FFE movem.l (sp)+,d1-d7/a0-a4 restore registers 11350 00007B7C 4216 clr.b (a6) clear flags bits 11351 00007B7E 46DF move (sp)+,sr enable interrupts <<<<<<<<<<<<<< 11352 00007B80 0887 0000 bclr #0,d7 reset motor on bit 11353 00007B84 6100 FA4A bsr fresetqk reset drive for fresh start 11354 00007B88 2C5F movea.l (sp)+,a6 restore a6 for pascal rtn 11355 00007B8A 205F movea.l (sp)+,a0 get return pointer 11356 00007B8C 548F addq.l #2,sp pop parameter 11357 00007B8E 4ED0 jmp (a0) 11358 11359 ******** end of outer loop ******************************************** 11360 11361 00007B90 522E FFDA fspartrk addq.b #1,sparecnt(a6) add one to spare tracks counter 11362 00007B94 0C2E 0004 cmpi.b #4,sparecnt(a6) is there more than four spares? FFDA 11363 00007B9A 6E34 bgt.s ferr66_2 abort initialize with error 11364 00007B9C 4A03 tst.b d3 is this track zero? 11365 00007B9E 6E06 bgt.s foktospr if not track 0 then ok to spare 11366 00007BA0 0804 0000 btst #0,d4 is this side zero? 11367 00007BA4 6722 beq.s ferr66_1 if side 0 then abort init 11368 00007BA6 48E7 1800 foktospr movem.l d3-d4,-(sp) stack logical track side 11369 00007BAA 307C 00FF movea.w #$ff,a0 data pattern for spare track 11370 00007BAE 7455 moveq #85,d2 post index gap lenght =85 11371 00007BB0 163C 00FF move.b #$ff,d3 spare track # = ff 11372 00007BB4 183C 00FF move.b #$ff,d4 spare side # = ff 11373 00007BB8 6152 bsr.s fswaptbl save sectbl and replace with f's 11374 00007BBA 6100 009E bsr ftrkinit spare (write) the track 11375 00007BBE 614C bsr.s fswaptbl restore sectbl and the f's 11376 00007BC0 4CDF 0018 movem.l (sp)+,d3-d4 restore trk and side 11377 00007BC4 6000 FF58 bra fphyaddr try next track/side 11378 11379 00007BC8 6158 ferr66_1 bsr.s fdispcyl display final spare track count 11380 00007BCA 303C 042A move.w #1066,d0 \\\\\\\\ error 66,1 //////// 11381 00007BCE 6022 bra.s finiterr 11382 00007BD0 6150 ferr66_2 bsr.s fdispcyl display final spare track count 11383 00007BD2 303C 0812 move.w #2066,d0 \\\\\\\\ error 66,2 //////// 11384 00007BD6 601A bra.s finiterr 11385 00007BD8 6148 ferr66_3 bsr.s fdispcyl display final spare track count 11386 00007BDA 303C 0BFA move.w #3066,d0 \\\\\\\\ error 66,3 //////// 11387 00007BDE 6012 bra.s finiterr PAGE 241 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11388 00007BE0 6100 0258 ferr66_4 bsr f_to_off kill keyboard timeout 11389 00007BE4 303C 0FE2 move.w #4066,d0 \\\\\\\\ error 66,4 //////// 11390 00007BE8 6008 bra.s finiterr 11391 00007BEA 6100 024E ferr90_7 bsr f_to_off kill keyboard timeout 11392 00007BEE 303C 1BB2 move.w #7090,d0 \\\\\\\\ error 90,7 //////// 11393 00007BF2 4E5E finiterr unlk a6 return temp storage to stack 11394 00007BF4 4CDF 1FFE movem.l (sp)+,d1-d7/a0-a4 restore registers 11395 00007BF8 4216 clr.b (a6) clear fflags 11396 00007BFA 46DF move (sp)+,sr enable interrupts <<<<<<<<<<<<<< 11397 00007BFC 6000 FCA0 bra ferrexit abort initialization 11398 11399 00007C00 1014 finitisr move.b (a4),d0 get xstatue register 11400 00007C02 0800 0003 btst #3,d0 is interrupt bit set? 11401 00007C06 67F8 beq.s finitisr wait for interrupt 11402 00007C08 1013 move.b (a3),d0 reset interrupt from floppy 11403 00007C0A 4E75 rts 11404 11405 11406 00007C0C 720F fswaptbl moveq #15,d1 table index/counter 11407 00007C0E 1036 10F0 fswploop move.b sectable(a6,d1),d0 temp store one table entry 11408 00007C12 1DB6 10E0 move.b ffsectbl(a6,d1),sectable(a6,d1) move one table entry 10F0 11409 00007C18 1D80 10E0 move.b d0,ffsectbl(a6,d1) one entry now switched 11410 00007C1C 5301 subq.b #1,d1 decrement index/counter 11411 00007C1E 6CEE bge.s fswploop branch until all switched 11412 00007C20 4E75 rts 11413 11414 00007C22 206E 0040 fdispcyl movea.l message(a6),a0 initialize display address 11415 00007C26 D0FC 0025 adda #37,a0 start of 'track' field 11416 00007C2A 2003 move.l d3,d0 copy track number 11417 00007C2C 80FC 000A divu #10,d0 convert to decimal number 11418 00007C30 611A bsr.s fdispchr display msd of track number 11419 00007C32 4840 swap d0 get next half of track number 11420 00007C34 6116 bsr.s fdispchr display lsd of track number 11421 00007C36 D0FC 000E adda #14,a0 start of 'side' field 11422 00007C3A 102E FFDB move.b lgclside(a6),d0 get side number 11423 00007C3E 610C bsr.s fdispchr display side number 11424 00007C40 D0FC 0012 adda #18,a0 start of 'spares' field 11425 00007C44 102E FFDA move.b sparecnt(a6),d0 get number of spares 11426 00007C48 6102 bsr.s fdispchr display number of spares 11427 00007C4A 4E75 rts 11428 11429 00007C4C 0000 0030 fdispchr ori.b #$30,d0 convert number to ascii 11430 00007C50 0200 003F andi.b #$3f,d0 insure valid number 11431 00007C54 1080 move.b d0,(a0) send number to crt 11432 00007C56 5488 addq.l #2,a0 increment crt address 11433 00007C58 4E75 rts 11434 11435 *********************************************************************** 11436 * 11437 * ftrkinit 11438 * 11439 * One entire track is written to comply with the HP LIF standard, 11440 * and then read (verify) up to three times per track. The first 11441 * verify pass to complete error free terminates the verification 11442 * phase for that track. If a margin error occures, the sector it 11443 * occured in has a corresponding bit set in a bit map. Three margin PAGE 242 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11444 * errors must occure in the same sector for all three verification 11445 * passes before that track is spared. The first side of the first 11446 * track cannot be spared. A 'not ready', 'write protect', or 'lost 11447 * data' error aborts the initialize while all other errors will 11448 * cause the track to be spared. All tracks out to physical trk/side 11449 * 35/1 are initialized, but tracks beyond logical trk/side 32/1 are 11450 * not verified. 11451 * The hardware keyboard timeout mechanism is used while interrupts 11452 * are locked out to detect catastrophic errors (door open). 11453 * 11454 * Initialize flag byte: 11455 * a1@ 11456 * ----------------------------------------------------------------- 11457 * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 11458 * ----------------------------------------------------------------- 11459 * 11460 * Bit # Definition 11461 * 0 Spare flag - spare the track 11462 * 1 Error abort flag - abort initialize 11463 * 2 Verify pass 2 - second verify pass 11464 * 3 Verify pass 3 - third verify pass 11465 * 4 Lasttrks - init'ing tracks beyond logical 32/1 11466 * 5 Write error retry - one allowed 11467 * 6 Verify retry 1 - first verify retry 11468 * 7 Verify retry 2 - second retry 11469 * 11470 * Bug history: 11471 * {bug95} - false lost data errors fixed 12/16/80 dfk 11472 * 11473 *********************************************************************** 11474 11475 00007C5A 0211 0010 ftrkinit andi.b #$10,(a1) clear all but 'lasttrks' flag 11476 00007C5E 6100 0190 fwrttrk bsr f_tof_on set up keyboard timeout 11477 00007C62 7C09 moveq #9,d6 reinitialize to constant value 9 11478 00007C64 7E0F moveq #15,d7 initialize to 16 sectors (0 ref) 11479 00007C66 1202 move.b d2,d1 count = (75,95,85) 11480 00007C68 744E moveq #$4e,d2 data = 4e 11481 00007C6A 16BC 00F4 move.b #$f4,(a3) issue write track (format) 11482 00007C6E 612E bsr.s finitwrt post index gap 11483 00007C70 7210 fnextsec moveq #16,d1 count = 16 11484 00007C72 744E moveq #$4e,d2 data = 4e 11485 00007C74 6128 bsr.s finitwrt gap 1 11486 00007C76 720C moveq #12,d1 count = 12 11487 00007C78 4202 clr.b d2 data = 00 11488 00007C7A 6122 bsr.s finitwrt preamble 11489 00007C7C 7203 moveq #3,d1 count = 3nd of preamble 11490 00007C7E 74F5 dc.w $74f5 data = f5 11491 00007C80 611C bsr.s finitwrt end of preamble 11492 00007C82 1205 move.b d5,d1 count = 1 11493 00007C84 74FE dc.w $74fe data = fe 11494 00007C86 6116 bsr.s finitwrt id address mark 11495 00007C88 1205 move.b d5,d1 count = 1 11496 00007C8A 1403 move.b d3,d2 data = logical track number 11497 00007C8C 6110 bsr.s finitwrt track number 11498 00007C8E 1205 move.b d5,d1 count = 1 11499 00007C90 1404 move.b d4,d2 data = logical side number 11500 00007C92 610A bsr.s finitwrt side number PAGE 243 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11501 00007C94 1205 move.b d5,d1 count = 1 11502 00007C96 1436 70F0 move.b sectable(a6,d7),d2 data = sector number (from tbl) 11503 00007C9A 6102 bsr.s finitwrt sector number 11504 00007C9C 6012 bra.s fwrtrecl (subr placed next for speed) 11505 11506 00007C9E 1014 finitwrt move.b (a4),d0 get extended status register 11507 00007CA0 C006 and.b d6,d0 mask data-req and interrupt bits 11508 00007CA2 67FA beq finitwrt stay in loop till bit 0 or 3 11509 00007CA4 C005 and.b d5,d0 is this a data request? 11510 00007CA6 675C beq.s fintrer branch if unexpected interrupt 11511 00007CA8 1482 move.b d2,(a2) write data pattern to datareg 11512 00007CAA 5341 subq.w #1,d1 write out desired number bytes 11513 00007CAC 6EF0 bgt.s finitwrt branch back till all bytes done 11514 00007CAE 4E75 rts 11515 11516 00007CB0 1205 fwrtrecl move.b d5,d1 count = 1 11517 00007CB2 1405 move.b d5,d2 data = 1 11518 00007CB4 61E8 bsr.s finitwrt record length 11519 00007CB6 1205 move.b d5,d1 count = 1 (two bytes) 11520 00007CB8 74F7 dc.w $74f7 data = f7 11521 00007CBA 61E2 bsr.s finitwrt crc 11522 00007CBC 7216 moveq #22,d1 count = 22 11523 00007CBE 744E moveq #$4e,d2 data = 4e 11524 00007CC0 61DC bsr.s finitwrt gap 2 11525 00007CC2 720C moveq #12,d1 count = 12 11526 00007CC4 4202 clr.b d2 data = 00 11527 00007CC6 61D6 bsr.s finitwrt sync field 11528 00007CC8 7203 moveq #3,d1 count = 3 11529 00007CCA 74F5 dc.w $74f5 data = f5 11530 00007CCC 61D0 bsr.s finitwrt end of sync field 11531 00007CCE 1205 move.b d5,d1 count = 1 11532 00007CD0 74FB dc.w $74fb data = fb 11533 00007CD2 61CA bsr.s finitwrt data address mark 11534 00007CD4 323C 0100 move.w #256,d1 count = 256 11535 00007CD8 3408 move.w a0,d2 data = (5b,25,55) 11536 00007CDA 61C2 bsr.s finitwrt data pattern bytes 11537 00007CDC 1205 move.b d5,d1 count = 1 (two bytes) 11538 00007CDE 74F7 dc.w $74f7 data = f7 11539 00007CE0 61BC bsr.s finitwrt crc 11540 00007CE2 1205 move.b d5,d1 count = 1 11541 00007CE4 74FF dc.w $74ff data = ff 11542 00007CE6 61B6 bsr.s finitwrt (for 1791-01 fcd chip) 11543 00007CE8 721C moveq #28,d1 count = 28 11544 00007CEA 744E moveq #$4e,d2 data = 4e 11545 00007CEC 61B0 bsr.s finitwrt gap 3 11546 00007CEE 9E05 sub.b d5,d7 16 sectors done? 11547 00007CF0 6C00 FF7E bge fnextsec loop until done 11548 00007CF4 744E moveq #$4e,d2 write 4e's until index pulse 11549 00007CF6 1014 fwaitend move.b (a4),d0 get extended status register 11550 00007CF8 C006 and.b d6,d0 mask data-req and interrupt bits 11551 00007CFA 67FA beq.s fwaitend repeat until bit 0 or 3 11552 00007CFC C005 and.b d5,d0 is this a data request? 11553 00007CFE 6708 beq.s ftrkend exit loop if interrupt (index) 11554 00007D00 1482 move.b d2,(a2) write 4e to data register 11555 00007D02 60F2 bra.s fwaitend continue 4e's until interrupt 11556 11557 00007D04 6000 FEE4 fintrer bra ferr90_7 return error 90,7 PAGE 244 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11558 11559 00007D08 1013 ftrkend move.b (a3),d0 reset interrupt from floppy 11560 00007D0A 6100 012E bsr f_to_off kill keyboard timeout 11561 00007D0E 0811 0004 btst #4,(a1) test 'lasttrks' flag bit 11562 00007D12 6600 008C bne fverexit exit if set 11563 00007D16 0200 00E4 andi.b #$e4,d0 test bits 2,5,6,7 11564 00007D1A 6600 0086 bne fiwrterr branch if any error bits set 11565 00007D1E 0891 0000 bclr #0,(a1) is this a spare track operation? 11566 00007D22 667C bne.s fverexit branch if just sparing a track 11567 * move.b xcmdcopy,d7 get current xcmdreg setting {ag} 11568 00007D24 2F08 move.l a0,-(sp) {ag} 11569 00007D26 7E00 moveq #0,d7 {ag} 11570 00007D28 1E38 FED3 move.b drive,d7 {ag} 11571 00007D2C E54F lsl #2,d7 {ag} 11572 00007D2E 2078 FED4 movea.l f_area,a0 {ag} 11573 00007D32 1E30 7005 move.b 5(a0,d7),d7 {ag} 11574 00007D36 205F movea.l (sp)+,a0 {ag} 11575 11576 00007D38 13C3 0044 fverify move.b d3,trkreg track register = current log trk C002 11577 00007D3E 3C3C 000F move.w #15,d6 initialize to 16 sector read 11578 00007D42 6100 00B0 fversec bsr f_tov_on set up keyboard timeout 11579 00007D46 13F6 60F0 move.b sectable(a6,d6),secreg desired sector to sector reg 0044 C004 11580 00007D4E 0211 002F andi.b #$2F,(a1) reset verify retry flags 11581 00007D52 0007 0030 ori.b #$30,d7 set local and read bits 11582 00007D56 0804 0000 btst #0,d4 which logical side? 11583 00007D5A 6706 beq.s fverify0 branch if side zero 11584 00007D5C 16BC 008A move.b #$8a,(a3) issue read side one to cmdreg 11585 00007D60 6004 bra.s fverify1 jump over side zero command 11586 00007D62 16BC 0082 fverify0 move.b #$82,(a3) issue read side zero to cmdreg 11587 00007D66 1887 fverify1 move.b d7,(a4) send copy to xcmdreg 11588 00007D68 1214 fverwait move.b (a4),d1 get extended status register 11589 00007D6A 0801 0003 btst #3,d1 has interrupt occured? 11590 00007D6E 67F8 beq.s fverwait branch (loop) until interrupt 11591 00007D70 0887 0005 bclr #5,d7 turn off local bit in xcmd 11592 00007D74 1887 move.b d7,(a4) send to xcmdreg of floppy 11593 00007D76 1013 move.b (a3),d0 reset interrupt from floppy 11594 00007D78 6100 00C0 bsr f_to_off kill keyboard timeout 11595 00007D7C 0801 0002 btst #2,d1 did a margin error occure? 11596 00007D80 6654 bne.s fmrgnerr branch if margin error occured 11597 00007D82 1013 fchkerrs move.b (a3),d0 get status word from floppy {bug95} 11598 *fchkerrs andi.b #$fc,d0 any error bits 2 thru 7? {bug95} 11599 00007D84 0200 00FC andi.b #$fc,d0 any error bits 2 thru 7? {bug95} 11600 00007D88 6628 bne.s fvererr branch if error 11601 00007D8A 5306 subq.b #1,d6 decrement sector counter 11602 00007D8C 6CB4 bge.s fversec verify next sector 11603 00007D8E 4A6E FFDE tst.w margnerr+2(a6) margin error on this pass ??? 11604 00007D92 670C beq.s fverexit verify complete (bra) if no err 11605 00007D94 08D1 0002 bset #2,(a1) set and check verify pass 2 flag 11606 00007D98 679E beq.s fverify verify track again if not set 11607 00007D9A 08D1 0003 bset #3,(a1) set and check verify pass 3 flag 11608 00007D9E 6798 beq.s fverify verify track again if not set 11609 00007DA0 4E75 fverexit rts 11610 11611 00007DA2 0200 0024 fiwrterr andi.b #$24,d0 status bits 2 or 5 ? 11612 00007DA6 6728 beq.s fifailed abort initialization PAGE 245 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11613 00007DA8 08D1 0005 bset #5,(a1) set and test write retry flag 11614 00007DAC 6700 FEB0 beq fwrttrk branch retry not yet attempted 11615 00007DB0 601E bra.s fifailed initialization abort 11616 11617 00007DB2 1200 fvererr move.b d0,d1 make a second working copy 11618 00007DB4 0200 00C4 andi.b #$C4,d0 not rdy, wrt protect, lost data? 11619 00007DB8 6616 bne.s fifailed branch if error 11620 00007DBA 0201 0038 andi.b #$38,d1 fault, rnf, or crc type error? 11621 00007DBE 6624 bne.s fsparflg branch if error 11622 00007DC0 08D1 0006 bset #6,(a1) has one retry been tried? 11623 00007DC4 6700 FF72 beq fverify branch and perform first retry 11624 00007DC8 08D1 0007 bset #7,(a1) has two retrys been treid ? 11625 00007DCC 6700 FF6A beq fverify branch to perform second retry 11626 00007DD0 08D1 0001 fifailed bset #1,(a1) set the error abort flag 11627 00007DD4 4E75 rts 11628 11629 00007DD6 202E FFDC fmrgnerr move.l margnerr(a6),d0 get margin error map words 11630 00007DDA 0DC0 bset d6,d0 test/set sector margin err flag1 11631 00007DDC 670C beq.s fvercont continue verify if not set 11632 00007DDE 4840 swap d0 get second margin error map word 11633 00007DE0 0DC0 bset d6,d0 test/set sector margin err flag2 11634 00007DE2 6706 beq.s fvercont continue verify if not set 11635 00007DE4 08D1 0000 fsparflg bset #0,(a1) set the spare track flag 11636 00007DE8 4E75 rts 11637 11638 00007DEA 2D40 FFDC fvercont move.l d0,margnerr(a6) save (no need to swap back) 11639 00007DEE 6092 bra.s fchkerrs continue, check for other errors 11640 11641 00007DF0 70D4 f_tof_on dc.w $70d4 (moveq #$d4,d0) need 440ms timeout for trk wrt 11642 00007DF2 6002 bra.s f_tmo_on 11643 00007DF4 707C f_tov_on moveq #$7c,d0 need 1320ms timeout for verify 11644 00007DF6 3D78 FF2E f_tmo_on move.w kbd_fastv,jmpjsrop(a6) save jmp or jsr op for nmi vctr .ag. FFD4 11645 00007DFC 2D78 FF30 move.l kbd_fastv+2,nmi_save(a6) save current nmi ptr value .ag. FFD6 11646 00007E02 31FC 4EF9 move.w #jump_op,kbd_fastv move jump op code for nmi vctr .ag. FF2E 11647 00007E08 487A FDD6 pea ferr66_4 floppy error routine to stack .ag. 11648 00007E0C 21DF FF30 move.l (sp)+,kbd_fastv+2 error routine pointer to nmi 11649 00007E10 611C bsr.s fwaitkbd wait for keyboard ready 11650 00007E12 13FC 00B2 move.b #$b2,kcmdaddr keyboard attention command 0042 8003 11651 00007E1A 6112 bsr.s fwaitkbd wait for keyboard ready 11652 00007E1C 13C0 0042 move.b d0,kbddata least signf. byte, centisec's 8001 11653 00007E22 610A bsr.s fwaitkbd (two's compliment) 11654 00007E24 13FC 00FF move.b #$ff,kbddata msb, timeout = 0 " 0042 8001 11655 00007E2C 4E75 rts 11656 11657 00007E2E 0839 0001 fwaitkbd btst #1,kbdstatus is keyboard ready ? 0042 8003 11658 00007E36 66F6 bne.s fwaitkbd loop until ready 11659 00007E38 4E75 rts 11660 11661 00007E3A 61F2 f_to_off bsr.s fwaitkbd wait for keyboard ready PAGE 246 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11662 00007E3C 13FC 00B2 move.b #$b2,kcmdaddr reset interrupt 0042 8003 11663 11664 * move.w #100,d0 .ag. 11665 *f_towait subq.w #1,d0 delay for keyboard to respond .ag. 11666 * bgt.s f_towait .ag. 11667 11668 00007E44 0839 0002 f_towait btst #2,int_hpibstatus .ag. 0047 8005 11669 00007E4C 66F6 bne.s f_towait .ag. 11670 11671 00007E4E 31EE FFD4 move.w jmpjsrop(a6),kbd_fastv restore saved jmp or jsr op .ag. FF2E 11672 00007E54 21EE FFD6 move.l nmi_save(a6),kbd_fastv+2 restore saved nmi vector ptr .ag. FF30 11673 00007E5A 4E75 rts 11674 11675 *********************************************************************** 11676 * 11677 * fsectble 11678 * 11679 * Take the interlaeve factor (obtained from the stack) and gener- 11680 * ate a table in memory which contains the correct sequence for 11681 * sector addresses per track (one byte per sector). Also build 11682 * another equally sized table containing all $FF's. Note that the 11683 * table is actually built backwards in memory, i.e. the last sector 11684 * number is the first entry in the table. While being built, a one 11685 * word bit map is used to maintain a 'space available' record for 11686 * the sector table. 11687 * 11688 * a6 - LINK space pointer r 11689 * d0 - interleave factor obtained from stack r/w 11690 * d1 - loop counter r/w 11691 * d2 - index into table r/w 11692 * d3 - sector bit map r/w 11693 * 11694 *********************************************************************** 11695 11696 00007E5C 4283 fsectble clr.l d3 clear sector map register 11697 00007E5E 740F moveq #15,d2 initialize index to sector table 11698 00007E60 4281 clr.l d1 clear loop and sector counter 11699 00007E62 4280 clr.l d0 clear interleave register 11700 00007E64 102E 003F move.b intleav(a6),d0 get interleave from stack 11701 00007E68 80FC 0010 divu #16,d0 convert interleave to 0 - 15 11702 00007E6C 4840 swap d0 get remainder (mod 16) 11703 * move.b d0,intleav(a6) store for use in rotate table {ag} 11704 00007E6E 05C3 secloop bset d2,d3 set mapped sector in map reg 11705 00007E70 1D81 20F0 move.b d1,sectable(a6,d2) sector to mapped table location 11706 00007E74 1DBC 00FF move.b #$ff,ffsectbl(a6,d2) fill one entry in spare table 20E0 11707 00007E7A 5201 addq.b #1,d1 increment counter 11708 00007E7C 0C01 000F cmpi.b #15,d1 have all 16 sectors been done? 11709 00007E80 6F0A ble.s nextsec next sector if not done 11710 00007E82 5600 ADDQ.B #3,D0 {ag} 11711 00007E84 9002 SUB.B D2,D0 {ag} 11712 00007E86 1D40 003F MOVE.B D0,INTLEAV(A6) {ag} 11713 00007E8A 4E75 rts PAGE 247 [3.3a] 6/29/89 08:33:30 "3.0 BOOTROM INTERNAL MINIFLOPPY DRIVERS (BTMINIDRV)" 11714 11715 00007E8C 9400 nextsec sub.b d0,d2 decrement by interleave amount 11716 00007E8E 6C04 bge.s sectest test for mapping if no wrap 11717 00007E90 0602 0010 addi.b #16,d2 wrap around zero 11718 00007E94 0503 sectest btst d2,d3 is mapped location empty? 11719 00007E96 67D6 beq.s secloop branch if empty 11720 00007E98 5302 subq.b #1,d2 check next location for empty 11721 00007E9A 60F8 bra.s sectest does index point to empty entry 11722 11723 *********************************************************************** 11724 * 11725 * Rotate sector table 11726 * 11727 * The sector table is rotated by three plus the interleave factor 11728 * obtained from the stack. The algorithm used is very simple: the 11729 * entire table is rotated one position per pass; the number of 11730 * passes determines the total positions rotated. 11731 * 11732 * a6 - LINK space pointer 11733 * d0 - loop couunter, intialily set to 15 11734 * d1 - sector table offset 11735 * d2 - temperary storage for sector table entry 11736 * d3 - temperary storage for sector table entry 11737 * d4 - interleave factor number of times to rotate 11738 * 11739 *********************************************************************** 11740 11741 00007E9C 48E7 F800 rotatsec movem.l d0-d4,-(sp) stack, need some work regs 11742 00007EA0 182E 003F move.b intleav(a6),d4 get interleave factor from stack 11743 * addq.b #3,d4 stagger rotate by three {ag} 11744 00007EA4 142E FFFF move.b sectable+15(a6),d2 get first entry in sector table 11745 00007EA8 700F rintrlev moveq #15,d0 16 entries in sector tbl (0 rel) 11746 00007EAA 2200 move.l d0,d1 index for destination(move.long) 11747 00007EAC 5301 rotaloop subq.b #1,d1 destination = source index - 1 11748 00007EAE 1636 10F0 move.b sectable(a6,d1),d3 save destination entry 11749 00007EB2 1D82 10F0 move.b d2,sectable(a6,d1) store source 11750 00007EB6 1403 move.b d3,d2 destination becomes new source 11751 00007EB8 5300 subq.b #1,d0 decrement loop counter 11752 00007EBA 6EF0 bgt.s rotaloop 11753 00007EBC 1D42 FFFF move.b d2,sectable+15(a6) store last entry in 1st location 11754 00007EC0 5304 subq.b #1,d4 repeat = interleave factor 11755 00007EC2 6EE4 bgt.s rintrlev 11756 00007EC4 4CDF 001F movem.l (sp)+,d0-d4 pop saved work registers 11757 00007EC8 4E75 rts 11758 11759 end PASS 1 ERRORS: 0 PASS 2 ERRORS: 0