PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 1 SBC6120 ROM Monitor bts6120.plx 1 .TITLE SBC6120 ROM Monitor 2 3 4 ; Copyright (C) 2001-2010 by R. Armstrong, Milpitas, California. 5 ; Copyright (C) 1983 by R. Armstrong, Indianapolis, Indiana. 6 ; 7 ; This program is free software; you can redistribute it and/or modify 8 ; it under the terms of the GNU General Public License as published by 9 ; the Free Software Foundation; either version 2 of the License, or 10 ; (at your option) any later version. 11 ; 12 ; This program is distributed in the hope that it will be useful, but 13 ; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 ; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 ; for more details. 16 ; 17 ; You should have received a copy of the GNU General Public License along 18 ; with this program; if not, write to the Free Software Foundation, Inc., 19 ; 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 ; 21 22 ; This is the ROM monitor for the SBC6120 computer system, which is a Harris 23 ; HM6120 (a PDP-8 for all practical purposes) microprocessor based single board 24 ; computer. The SBC6120 is intended as a platform for developing other HM6120 25 ; systems and experimenting with various ideas for peripherals, and this gives 26 ; it a rather eclectic mix of hardware: 27 ; 28 ; * 64KW (that's 64K twelve bit WORDS) of RAM - 32KW for panel memory and 29 ; 32KW for conventional memory. 30 ; 31 ; * 32KW of EPROM used for bootstrapping - it contains this software. 32 ; 33 ; * Up to 2Mb (real eight bit bytes this time) of battery backed up, 34 ; non-volatile SRAM used as a RAM disk for OS/8. The RAM disk can be 35 ; mapped into the HM6120 panel memory space. 36 ; 37 ; * A fairly elaborate memory management system which controls the mapping 38 ; of RAM, EPROM and RAM disk into panel memory. 39 ; 40 ; * A real, straight-8, compatible console terminal interface. The control 41 ; logic is implemented in a GAL and no 6121 is used (as it is in both 42 ; models of DECmate). 43 ; 44 ; * A single digit octal display used to show POST error codes. 45 ; 46 ; * An IDE disk interface, implemented by a 8255 PPI 47 ; 48 ; This particular piece of software started life in 1983 as a bootstrap 49 ; program for an elaborate Intersil IM6100 system planned by the author. The 50 ; software was developed and tested on an 6100 emulator running on a 51 ; DECsystem-10, but it never saw any actual hardware. Although I built several 52 ; simpler 6100 based systems, the one intended for this software proved to be 53 ; too elaborate and complex and was never built. Until now, that is... 54 55 56 .HM6120 57 .STACK PAC1, POP1, PPC1, RTN1 6215 6235 6205 6225 58 .NOWARN F PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 2 BTS6120 Memory Layout bts6120.plx 59 .TITLE BTS6120 Memory Layout 60 61 ; The EPROM in the SBC6120 is 32K twelve bit words, however the entire code 62 ; for BTS6120 currently fits within fields 0, 1 and 2. While it's executing, 63 ; however, there is a full 32K of panel RAM available for BTS6120. Currently 64 ; BTS6120 doesn't use fields three thru seven of panel RAM and these are free. 65 ; They could be used by an OS/8 program via the Copy Memory PR0 function, if 66 ; desired. 67 68 ; About Hooks: 69 ; In the FxVECTOR tables, some locations are registered as places that can be 70 ; hooked by an extension ROM. 3 words are reserved, which is enough for a CIF 71 ; or CXF, an indirect JMP, and the JMP address. Most hooks have 3 NOPs in 72 ; those three words, and execution can be continued just after those. 73 ; Hook locations are marked with a HOOK: comment 74 75 ; FIELD 0 76 ; Page Usage 77 ; ----- ---------------------------------------------------------------------- 78 ; 00000 data & initialized constants 79 ; 00200 SYSINI part 2, later overwritten by the command buffer 80 ; 00400 command line parsing, error routines and HElp command 81 ; 00600 error routines, RePeat, Terminal and VErsion commands 82 ; 01000 Examine and Deposit commands 83 ; 01200 examine and deposit subroutines 84 ; 01400 Block Move, ChecKsum, Clear and Fill Memory commands, Disasm stubs 85 ; 01600 Word Search and Breakpoint List commands 86 ; 02000 Breakpoint set and Remove commands and breakpoint subroutines 87 ; 02200 Proceed, Continue, SIngle step, TRace, Reset ans EXecute commands 88 ; 02400 Boot sniffer, OS/8 Bootstrap, Boot command 89 ; 02600 Check for RAM/IDE disk, Partition Map command, and Disk Formatter Pass 1 90 ; 03000 Disk formatter Pass 2, Disk Format, and RAM Disk Format commands 91 ; 03200 BIN (binary paper tape image) loader and LP command 92 ; 03400 Disk (RAM and IDE) Dump and Load commands 93 ; 03600 Disk buffer ASCII dump and load subroutines 94 ; 04000 PC Partition Copy command, PE Partition Compare routine 95 ; 04200 Flash Load command, Field 0 Vectors 96 ; 04400 Initialize/Show Extension ROM, RAM disk and IDE, call field 1 97 ; 04600 IDE spin up/down command, simple lexical functions, free 98 ; 05000 99 ; 05200 100 ; 05400 101 ; 05600 Front panel initialization, scan, LA, LXA, EXAM, DEP switches 102 ; 06000 Front panel CONT, START, BOOT, HALT switches, update display, power LED 103 ; 06200 SIXBIT, ASCII, decimal, and octal terminal output 104 ; 06400 address (15 bit) arithmetic, parsing and output 105 ; 06600 keyword scaner and search, decimal and octal input 106 ; 07000 miscellaneous formatted terminal input and output 107 ; 07200 command line scanner 108 ; 07400 terminal input and output primitives 109 ; 07600 control panel entry and context save 110 111 ; FIELD 1 112 ; Page Usage 113 ; ----- ---------------------------------------------------------------------- 114 ; 10000 SYSINI part 1, later overwritten by field 1 variables 115 ; 10200 ROM monitor call (PR0) processor 116 ; 10400 RAM disk R/W, pack/unpack, and battery test routines 117 ; 10600 RAM disk address calculation and diagnostic tests 118 ; 11000 IDE disk initialization and ATA IDENTIFY DEVICE command 119 ; 11200 IDE sector read/write, LBA calculation 120 ; 11400 Wait for READY or DRQ 121 ; 11600 IDE read/write sector buffer, initialize partition map 122 ; 12000 Partition map functions, IDE I/O PR0 call, read/write IDE registers 123 ; 12200 I/O buffer management, Memory Move PR0 call, cross field calling PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 3 BTS6120 Memory Layout bts6120.plx 124 ; 12400 Extended Memory Move PR0 function, LIGHTS PR0 function, Field 1 Vectors 125 ; 12600 Flash ROM programming 126 ; 13000 SBC6120-RC RAM disk I/O, DS1221 battery test 127 ; 13200 to 17377 are used by command tables, error messages and help text 128 ; 17400 to 17777 are used as a temporary buffer for disk I/O 129 130 ; FIELD 2 131 ; Page Usage 132 ; ----- ---------------------------------------------------------------------- 133 ; 20000 Field 2 variables, zero page utility functions 134 ; 20200 Persistent settings support 135 ; 20400 Extension ROM management, field 2 vectors 136 ; 20600 Disassembler commands X, XP and TR. Disassembler code. 137 ; 21200 to 21277 Disassembler code 138 ; 21400 to 22377 Disassembler tables 139 ; 22400 to 27600 are currently free PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 4 Edit History bts6120.plx 140 .TITLE Edit History 141 142 143 ; 1 -- Change documentation of ER and DR commands to reflect the 144 ; new format (E and D " character between the 193 ; address (or register name) and the data (instead of a 194 ; space). 195 ; 196 ; 21 -- Update the BM command to use the new 15 bit addressing. 197 ; This now allows transfers to copy more than 4K, and to 198 ; cross field boundries. Also, make it illegal for the source 199 ; address to increment out of field 7. 200 ; 201 ; 22 -- Update the CK command for 15 bit addressing. This makes it 202 ; possible to checksum more than 4K of memory in one command. 203 ; 204 ; 23 -- Move the RDMEM routine to page 6400 (the page it was on had PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 5 Edit History bts6120.plx 205 ; 0 words free!). 206 ; 207 ; 24 -- Invent a RAM location KEY and store the WS command search 208 ; key there (not in VALUE). This fixes problems with the WS 209 ; command interacting with RDMEM. 210 ; 211 ; 25 -- Make the WS command apply the mask to the search key too. 212 ; Also, make WS poll the keyboard so that the operator may 213 ; control-C out of a long search. 214 ; 215 ; 26 -- Fix a few bugs in the BM command (these only occur when 216 ; transfers cross memory fields). Also change the syntax of 217 ; the command to accept a source address range (instead of 218 ; a destination address range). 219 ; 220 ; 27 -- Change the name of the SI command to TR (TRace). Then change 221 ; the old SN (single instruction with no register output) to 222 ; be SI. 223 ; 224 ; 30 -- Re-write the examine register to to save space. 225 ; 226 ; 31 -- Move all the register name strings to the text page. 227 ; Re-write the register typeout routines to take less space. 228 ; 229 ; 32 -- Make the examine command accept multiple operands seperated 230 ; by commas. 231 ; 232 ; 33 -- Implement the memory diagnostic routines (address test and 233 ; data test) and the MD command to execute them. 234 ; 235 ; 34 -- Invent the DEVERR routine to report device errors. Also, 236 ; re-write MEMERR to share as much code with deverr as 237 ; possible. 238 ; 239 ; 35 -- Make the memory data and address diagnostics interruptable 240 ; with a control-C (since they take a long time to execute). 241 ; 242 ; 36 -- Invent the REGTST routine to test hardware registers. This 243 ; is used to implement hardware diagnostics. 244 ; 245 ; 37 -- Implement the DPTEST routine to test hardware data paths 246 ; for faults. 247 ; 248 ; 40 -- Implement the EX command (to execute IOT instructions). 249 ; 250 ; 41 -- Implement the basic BIN loader routine (BINLOD). 251 ; 252 ; 42 -- Re-arrange code to more tightly pack memory pages (and free 253 ; another page of memory). 254 ; 255 ; 43 -- Re-define all IOT instructions to agree with the actual 256 ; hardware. 257 ; 258 ; 44 -- Re-write the CP trap and system initialization routines to 259 ; work correctly with the latest hardware design (including 260 ; the auto-start switches). 261 ; 262 ; 45 -- Add the HALT instruction trap routine (it types out the 263 ; message %HALTED @ faaaa)... 264 ; 265 ; 46 -- Ask the user before running diagnostics at startup (even 266 ; if he has enabled them via the auto-start switches). 267 ; 268 ; 47 -- Implement the TRAP routine to handle trapped IOTs. 269 ; PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 6 Edit History bts6120.plx 270 ; 50 -- Add the code to emulate a KL8E (via trapped IOTs). 271 ; 272 ; 51 -- Fix a bug in the CP trap routine which prevented it from 273 ; recognizing SI traps correctly. 274 ; 275 ; 52 -- Make sure the TR command types out the contents of the IR 276 ; correctly (add a CLA in an opportune location). 277 ; 278 ; 53 -- Make sure the CONT routine correctly restores the CPU 279 ; registers (add another CLA !!!). 280 ; 281 ; 54 -- Revise the monitor command summary in the introduction to 282 ; be more up to date. 283 ; 284 ; 55 -- Remove the optional count operand from the TR (trace) 285 ; command and always make it execute one instruction instead. 286 ; (The user can always combine it with the RP command to get 287 ; more than one.) 288 ; 289 ; 56 -- Make the BPT instruction use opcode 6077... 290 ; 291 ; 57 -- The BPT instruction is a trapped instruction, but the 292 ; CP entry routine removes breakpoints before the TRAP 293 ; routine is called. Thus TRAP can nenver identify a BPT 294 ; instruction. Solution: don't remove breakpoints in the 295 ; CP routine, but do it in all the routines that it calls 296 ; (except TRAP, of course). 297 ; 298 ; 60 -- Make the BPTINS routine call RDMEM instead of reading memory 299 ; itself. 300 ; 301 ; 61 -- Fix the P command so that other commands after it (after 302 ; a ';') will work too. Also, move the P command to the next 303 ; memory page (with CONT) to free space. 304 ; 305 ; 62 -- Add the BT command to run the disk bootstrap (which 306 ; presently just types a message to the effect that the disk 307 ; bootstrap is not implemented). 308 ; 309 ; 63 -- Implement the following routines: CLRCPU (to clear the 310 ; user's CPU registers in RAM), CLRIO (to clear all I/O 311 ; devices via a CAF), and CLRBUS (to clear the external 312 ; bus by asserting the INITIALIZE signal). 313 ; 314 ; 64 -- Add the MR command to perform a master reset of the CPU and 315 ; hardware... 316 ; 317 ; 65 -- Insure that the terminal flag is set after the CLRIO routine 318 ; (to avoid hanging the monitor)... 319 ; 320 ; 66 -- Define the PRL instruction (READ2 FTPIEB) to pulse the CPU 321 ; RUN/HALT flip-flop. 322 ; 323 ; 67 -- Invent the INIT routine to initialize all hardware which is 324 ; important to the monitor (and call it after a hardware reset 325 ; command). 326 ; 327 ; 70 -- Make the CONTinue routine clear the console status and set 328 ; the RUN flip-flop. 329 ; 330 ; 71 -- Invent the IN (initialize) command to completely initialize 331 ; all hardware and software (it is equivalent to pressing the 332 ; RESET button !). 333 ; 334 ; 72 -- Be sure the SLU mode gets initialized properly... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 7 Edit History bts6120.plx 335 ; 336 ; 73 -- Modify the CONOUT routine to timeout the console printer 337 ; flag and force characters out if it dosen't set after a 338 ; reasonable time (this prevents monitor hangs while debugging 339 ; programs which clear the flag). 340 ; 341 ; 74 -- Make the hardware diagnostic routine execute a master 342 ; reset (i.e. the CLEAR routine) after they are finished 343 ; (since they may leave the hardware in a strange state). 344 ; 345 ; 75 -- Change the monitor prompting character to $. 346 ; 347 ; 76 -- Implement the LP command to load paper tapes from the 348 ; console... 349 ; 350 ; 77 -- Initialize both the SLU mode and baud rate correctly when 351 ; the system is reset... 352 ; 353 ; 100 -- Go through the source and put .ORGs in places where they 354 ; have been left out... 355 ; 356 ; After almost 20 years, restart development for the SBC6120 board! 357 ; 358 ; 101 -- A "real" TLS instruction (as the SBC6120 has) doesn't clear 359 ; the AC, the way a "fake" TLS (implemented by a 6101 PIE 360 ; WRITE) does. This causes no end of problems for CONOUT and 361 ; everything that calls it! 362 ; 363 ; 102 -- Remove the terminal filler code (there's no terminal on the 364 ; planet that requires filler characters any more!) 365 ; 366 ; 103 -- Remove the TTY parameters table at TTYTAB. It's still 367 ; possible to set the TTY width and page size with the TW and 368 ; TP commands, but they now default to zero (disabled). 369 ; 370 ; 104 -- Remove the place holder code for IOT trapping and KL8 371 ; emulation. It was never used. 372 ; 373 ; 105 -- Expand the command line buffer to occupy all of RAM page 1, 374 ; and make the stack always fill whatever remains of page 0. 375 ; 376 ; 106 -- Rewrite to use the HM6120 built in hardware stack. 377 ; 378 ; 107 -- Some of the old SYSINI code was still left lying around, 379 ; and this code would clear RAM on startup. This is now a 380 ; bad idea, since it erases all our page zero vectors! 381 ; 382 ; 110 -- Unlike the 6100 software stack simulation, the 6120 PAC1/2 383 ; instructions don't clear the AC. Add a few CLAs to take 384 ; care of this difference. 385 ; 386 ; 111 -- The 6120 stack post decrements after a PUSH, so the stack 387 ; pointer needs to be initialized to the top of the stack, 388 ; not the TOS + 1... 389 ; 390 ; 112 -- Optimize the page zero constants based on the references 391 ; shown in the CREF listing. Add page zero constants for 392 ; popular numerical constants... 393 ; 394 ; 113 -- Do away with the SYNERR link (it's now the same as ZCOMERR). 395 ; 396 ; 114 -- Replace the ERROR link with a simple JMS @ZERROR, and 397 ; reclaim the page 0 RAM it used... 398 ; 399 ; 115 -- Do away with RAMINI and the page zero initialization code. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 8 Edit History bts6120.plx 400 ; It's no longer necessary, since we now initialize all RAM 401 ; from EPROM at startup. 402 ; 403 ; 116 -- Do away with the separate IF, DF and L "registers" and treat 404 ; everything as part of the PS (aka flags) register. 405 ; 406 ; 117 -- Move around, clean up, and generally re-organize the 407 ; E, D, BM, CK, CM and FM commands. 408 ; 409 ; 120 -- Change the examine register command to ER and the deposit 410 ; register command to DR. Make some other general changes 411 ; to the syntax of the E and D commands (e.g. require commas 412 ; between multiple items in the deposit list). 413 ; 414 ; 121 -- Change the address range delimiter to "-". 415 ; 416 ; 122 -- Move around, clean up and generally re-organize another 417 ; block of code; this time everything concerned with break 418 ; points, continue, start, proceed, and CP traps. 419 ; 420 ; 123 -- CONT: needs to use RSP1 to save the monitor's stack pointer, 421 ; not LSP1 !!! 422 ; 423 ; 124 -- If a transition occurs on CPREQ L while we're in panel mode, 424 ; then the 6120 sets the BTSTRP flag in the panel status 425 ; anyway. This will cause an immediate trap back to panel 426 ; mode the instant we try to continue or proceed. The answer 427 ; is to do a dummy PRS before continuing. 428 ; 429 ; 125 -- Move around, clean up and generally re-organize the 430 ; remainder of the code. Move messages and command tables to 431 ; field 1. Change message strings to packed ASCIZ instead of 432 ; SIXBIT. 433 ; 434 ; 126 -- The packed ASCIZ OUTSTR routine still has a few non-stack 435 ; holdovers - a JMS to OUTCHR and a JMP @OUTSTR to return. 436 ; This causes no end of strange symptoms! 437 ; 438 ; 127 -- Use the new \d and \t string escape feature of PALX to put 439 ; the system generation time in the monitor. 440 ; 441 ; 130 -- Start adding RAM disk support - add DISKRD and DISKWR 442 ; 443 ; 131 -- Add MCALL (monitor call, via 6120 PR0 trapped IOT) 444 ; 445 ; 132 -- Add DISKRW ROM call function for OS/8 RAM disk driver 446 ; 447 ; 133 -- We're starting to run short of room on page zero, so move 448 ; some of the temporary variables that are used only by one 449 ; routine to the same page as that routine. Now that we're 450 ; running out of RAM this is possible. 451 ; 452 ; 134 -- Move the breakpoint tables to page 1, field zero and make 453 ; the command buffer that much (about 24 words) smaller. 454 ; Since the breakpoint tables are only addressed indirectly 455 ; anyway, this hardly made a difference to the code... 456 ; 457 ; 135 -- Fold the MEMERR routine into DANDV and simplify it a little 458 ; to save space - just type the good and bad data, and don't 459 ; bother with typing the XOR... 460 ; 461 ; 136 -- TOCT3 types the three most significant digits, not the three 462 ; least significant ! Oooppppssssss.... 463 ; 464 ; 137 -- DDUMP uses COUNT to count the words output, but TOCT4 uses PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 9 Edit History bts6120.plx 465 ; it to count digits. Oooppssss... 466 ; 467 ; 140 -- Invent the BSETUP routine and rewrite the break point 468 ; functions to use it. This saves many words of memory. 469 ; 470 ; 141 -- Add the Format Disk (FD) command to "format" RAM disk. This 471 ; is really more of a memory diagnostic than a formatter, but 472 ; the name seems appropriate. 473 ; 474 ; 142 -- CALCDA has a off-by-one error that makes it fail for the 475 ; last 21 sectors of the RAM disk. 476 ; 477 ; 143 -- Invent the CONFRM routine and use it to make the Format Disk 478 ; command ask for confirmation before destroying anything. 479 ; 480 ; 144 -- Add the Disk downLoad command (DL). This accepts RAM disk 481 ; images in exactly the same format as output by DD. 482 ; 483 ; 145 -- Add the H (help) command and a very primitive help system 484 ; (it just types out a screen of one line descriptions for 485 ; every monitor command!). 486 ; 487 ; 146 -- Add a trace function to the DISKRW MCALL. 488 ; 489 ; 147 -- Accidentally typed a couple of JMSes when I should have 490 ; typed .PUSHJ! 491 ; 492 ; 150 -- In DLOAD, we have to use SAVCHR to get the break character 493 ; from OCTNW, not GET. 494 ; 495 ; 151 -- IOCLR L (generated by CAF) also clears the console UART, 496 ; which causes garbage if we happen to be transmitting a 497 ; character at the time. The easiest way to fix this is to 498 ; make the CLEAR routine wait for the console flag to set 499 ; (i.e. the transmitter is done) before executing a CAF. 500 ; 501 ; 152 -- The RAM DISK test at TSTUNI doesn't work if the DX pull 502 ; down resistors are removed because it fails to mask the 503 ; SRAM data to eight bits... 504 ; 505 ; 153 -- Add the infrastructure which allows the code to be split 506 ; between field 0 and 1, then move all the low level RAM disk 507 ; I/O and ROM call processing code to field 1. 508 ; 509 ; 154 -- Add SP1 and SP2 to the REGLST output (but it's still not 510 ; possible to deposit in them or examine them individually). 511 ; 512 ; 155 -- Move the ROM checksums from location 7600 to 0200. 513 ; 514 ; 156 -- Change the hardware so that the TIL311 is loaded via the 515 ; 6120 WSR (Write to Switch Register) instruction. 516 ; 517 ; 157 -- Begin adding basic IDE/ATA support. 518 ; 519 ; 160 -- Add the GETRDS (Get RAM Disk Size) and GETBAT (get backup 520 ; battery status) PR0 functions. 521 ; 522 ; 161 -- Fix a few bugs in the IDE code, and the basic drive 523 ; identification on bootup now works. 524 ; 525 ; 162 -- When programming the 8255 IDE interface, we have to change 526 ; the mode (input vs output) _before_ we set up the address 527 ; bits. If we don't then the address bits get cleared by 528 ; the #$&(*# 8255 when the mode is changed! 529 ; PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 10 Edit History bts6120.plx 530 ; 163 -- Add Get and Set Disk Partition mapping PR0 subfunctions. 531 ; 532 ; 164 -- Add Get IDE Disk Size subfunction to PR0. 533 ; 534 ; 165 -- Add the Copy Memory subfunction to PR0. 535 ; 536 ; 166 -- Add the last missing bits of IDE disk I/O. We're now ready 537 ; to try out the OS/8 device handler. 538 ; 539 ; 170 -- INIPMP needs to do a CLL to ensure that the link is in a 540 ; known state - otherwise it can sometimes quit too soon! 541 ; 542 ; 171 -- Extend the BOOT command to boot either IDE or RAM disk. 543 ; Add the "boot sniffer" to determine whether a volume 544 ; contains a real bootstrap and use it to make "B" with no 545 ; arguments search for a bootable volume (just like a real 546 ; computer!). 547 ; 548 ; 172 -- The disk download routine needs to call PNLBUF before it 549 ; attempts to write the buffer... 550 ; 551 ; 173 -- Make illegal PR0 functions print a message and return to 552 ; BTS6120 command level. This solves the problem of how to 553 ; skip over the arguments for a call we don't understand. 554 ; 555 ; 174 -- Make the MR (master reset) command initialize the IDE 556 ; drive and reset the partition map. 557 ; 558 ; 175 -- Add the PM command to edit/view the disk partition map. 559 ; 560 ; 176 -- Completely rewrite the RAM disk formatter code to create 561 ; two commands, RF to format a RAM disk an DF to format an 562 ; IDE disk partition. 563 ; 564 ; 177 -- PMEDIT screws up the disk LUN - there's a DCA that should 565 ; have been a TAD! 566 ; 567 ; 200 -- Fix a few bugs in the DF and RF routines - FMTARG is missing 568 ; a .POPJ, and the unit number gets corrupted in FMTARG 569 ; by the TOCT4S routine, which uses WORD. 570 ; 571 ; 201 -- The pin that corresponds to A17 on a 512K chip is an 572 ; alternate chip select on the 128K chips. Worse, this extra 573 ; chip select is active HIGH, which means that A17 must always 574 ; be set before the 128K chips will do anything! 575 ; 576 ; 202 -- Clean up all the help messages and make sure they agree 577 ; with the current state of all the commands. 578 ; 579 ; 203 -- Do away with F1CALL and create PUSHJ1 instead. Both allow 580 ; field 0 routines to call field 1, however the new one takes 581 ; one less word of code at the point of the call, which 582 ; helps a lot on some pages where words are tight. 583 ; 584 ; 204 -- Invent a few more page zero constants and use them to help 585 ; out on a few more pages where space is tight. 586 ; 587 ; 205 -- Make the disk related commands (DL, DD, and DF) verify that 588 ; an IDE disk is really present by checking for DKSIZE != 0. 589 ; Also make the DISKRW PR0 call return error -1 if no disk 590 ; is attached. 591 ; 592 ; [Start porting to the SBC6120 model 2 hardware] 593 ; 594 ; 206 -- Remove all the bicolor LED stuff - it doesn't exist in PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 11 Edit History bts6120.plx 595 ; the SBC6120 model 2. 596 ; 597 ; 207 -- The model 2 schematic accidentally switched CS1FX/CS3FX 598 ; and DIOR/DIOW in the IDE interface. Modify the code to 599 ; paramaterize all IDE interface bits and then change these 600 ; parameters to agree with the real hardware. 601 ; 602 ; 210 -- Remove all the unnecessary CLAs after PPI instructions 603 ; (in the model 2, these IOTs all clear the AC). 604 ; 605 ; 211 -- Fix the timeouts for the console flag and the LP command 606 ; so they're reasonable given the 4.9152Mhz clock of the 607 ; SBC6120 model 2. 608 ; 609 ; [SBC6120 now runs on the Model 2 hardware!] 610 ; 611 ; 212 -- Fix a nasty bug in the LBA calculation! 612 ; 613 ; 213 -- Fix TDECNW to handle unsigned numbers up to 4095 614 ; 615 ; 214 -- Change the "RAM: " in the RAM disk message to "NVR:" 616 ; to avoid confusion with the main memory.. 617 ; 618 ; 215 -- Add the PC (partition copy) command. 619 ; 620 ; 216 -- Added Memory Move Extended so that user programs may directly 621 ; access the extended (RAMdisk et al) memory area (jdk) 622 ; 623 ; [I/O board integration started] 624 ; 625 ; 217 -- changed battery test DF from 1 to 0. Also inhibited 626 ; battery message if no RAM installed (jdk) 627 ; 628 ; 220 -- added extension ROM support (jdk) 629 ; 630 ; 221 -- added PE (Partition Equal) command (jdk) 631 ; 632 ; 222 -- added persistent partition map using NVRAM (jdk) 633 ; 634 ; 223 -- change B (Boot) command to use IDE _Unit_ 0 (jdk) 635 ; 636 ; 224 -- added FL (Flash Load) command (jdk) 637 ; 638 ; 225 -- a few optimizations and clean up (jdk) 639 ; 640 ; 226 -- added vectors for TYPEIR, RANGE results (jdk) 641 ; 642 ; 227 -- changed to 3 fields (27256/512 now required) (jdk) 643 ; 644 ; 230 -- added hooks for front panel code (jdk) 645 ; 646 ; 231 -- integrated BRA's ramdisk v2 changes (jdk) 647 ; "Support two RAM disk boards (up to eight units)." 648 ; 649 ; 232 -- merged disassembler code from IOB into BTS (jdk) 650 ; 651 ; 233 -- made persistent variables more general (jdk) 652 ; 653 ; 234 -- added a couple of PRISLUs just to make sure the console is 654 ; initialized. (jdk) 655 ; 656 ; 235 -- fix in the disassembler - fix field calculation for indirect 657 ; operands of TAD/AND/ISZ/DCA (jdk) 658 ; 659 ; 236 -- Change battery status message to display only if failure PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 12 Edit History bts6120.plx 660 ; detected, so as to be compatible with NV controllers that 661 ; don't support this test. Need to investigate better ways 662 ; to handle this (jdk). 663 ; 664 ; 237 -- Added SC (scope) command to enable backspace on DEL (jdk) 665 ; 666 ; 240 -- Added ability to set RAM disk offset. Needed for IOB 667 ; hardware issue - 1st NVRAM location not reliable. 668 ; 669 ; [End I/O board integration] 670 ; 671 ; 241 -- Add UPDISP to keep the front panel data display alive. 672 ; Call UPDISP from the CONOUT wait loop; from INCHRS, and 673 ; (of course), from the CP timer interrupt service. 674 ; 675 ; 242 -- Rewrite INCHWL to be a crude sort of co-routine, so that 676 ; we can call INCHWL and SWSCAN in parallel from the main 677 ; command loop. 678 ; 679 ; 243 -- Add SWSCAN to scan the front panel control switches. 680 ; Call SWSCAN from the main command loop at BOOTS:... 681 ; 682 ; 244 -- Add the SC command to the help. 683 ; 684 ; 245 -- Change TAD UFLAGS at XTYPIR+2 to TAD @[UFLAGS]! 685 ; 686 ; 246 -- Invent FPINIT to consistently initialize the front panel. 687 ; Use the FPDTCT flag from FPINIT everywhere to determine 688 ; whether a front panel is attached. 689 ; 690 ; 247 -- Sync the display whenever the PC or PS register is 691 ; modified, or whenever a running program halts. 692 ; 693 ; 250 -- The code in CLRCOM (for the MR command) that attempts 694 ; to reset the IDE drive is woefully inadequate. It doesn't 695 ; send an IDENTIFY DEVICE command and it doesn't make any 696 ; attempt to figure out the drive's size, so as a consequence 697 ; after an MR command BTS6120 forgets that any IDE drive is 698 ; attached. Just remove the call to IDEINI from CLRCOM - 699 ; we don't really need it! 700 ; 701 ; 251 -- Implement the LIGHTS monitor call to give the main memory 702 ; program explicit control over the DATA LEDs. 703 ; 704 ; 252 -- Some gratuitous reformatting to make the listing prettier. 705 ; Change Jim's PC and IR variable names to XPC and XIR to 706 ; avoid confusion. 707 ; 708 ; 253 -- On a real PDP-8/E, the START-CLEAR switch simply clears 709 ; the AC and all I/O devices. It does not, as I had 710 ; believed, actually start executing a program. Fix our 711 ; START (now CLEAR) key to be the same. 712 ; 713 ; 254 -- Make most (all, I think) of the front panel switches 714 ; actually print on the console in addition to the LEDs. 715 ; 716 ; 255 -- Single Step (i.e. CONTinue while the HALT switch is on) 717 ; leaves the RUN LED turned on. Bad-bad! 718 ; 719 ; 256 -- Clear the panel program mode flag in the MR, ST and B 720 ; commands (all done thru CLRCPU) and for the front panel 721 ; CLEAR key. 722 ; 723 ; 257 -- Edit 242 accidentally broke LDBUF - fix it! 724 ; PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 13 Edit History bts6120.plx 725 ; 260 -- If the operator flips the HALT switch while a program is 726 ; doing lots of disk I/O, there's a good chance we'll miss 727 ; it. Invent CONT2 to check the state of the HALT switch 728 ; before exiting from any MUUO. 729 ; 730 ; 261 -- Implement the SPLK IOT and PANEL LOCK function. 731 ; 732 ; 262 -- Move the RLOFs around so that MCALLs don't make the RUN 733 ; LED blink. 734 ; 735 ; [End front panel integration] 736 ; 737 ; 263 -- Ensure RDSIZE is always set to zero for non-existent 738 ; SRAM chips (and the odd fields on the IOB6120!). 739 ; 740 ; 264 -- Re-arrange the startup code so that the RAMdisk battery 741 ; test occurs before the EXTROM setup. 742 ; 743 ; 265 -- Fix the RAMdisk detection code so it won't detect extra 744 ; RAMdisk chips on the original RAMdisk card (which didn't 745 ; decode EMA2!). 746 ; 747 ; 266 -- Write RDCHK1, which can correctly test the batteries on 748 ; the new DS1321 RAM disk board and the IOB6120 (which 749 ; doesn't have any low battery detection hardware!). 750 ; 751 ; 267 -- SETDAR doesn't always clear the LINK before it returns, 752 ; which causes spurious RAMdisk errors. 753 ; 754 ; 270 -- Remove some leftover debugging code in RDTEST that caused 755 ; a "phantom" RAMdisk unit 4 to always appear! 756 ; 757 ; 271 -- UPDISP reversed the rotary switch positions! 758 ; 759 ; [Start of modifications for SBC6120-RC] 760 ; 761 ; 272 -- Detect the RC model at startup and make HELLO print 762 ; "SBC6120-RC" rather than just "SBC6120" when appropriate. 763 ; 764 ; 273 -- Create SHOEXT, SHONVR and SHOIDE to free up some words on 765 ; the SYSIN2 page. Make SHOEXT explicitly say "IOB: Not 766 ; detected" if no IOB6120 is installed. 767 ; 768 ; 274 -- Skip the IDE and IOB startup and messages on the RC model. 769 ; 770 ; 275 -- The PC and PE commands should give a "?No disk" error if no 771 ; drive is attached (what _was_ Jim thinking???). 772 ; 773 ; 276 -- Make RDCHK1 correctly test the battery for SBC6120-RC RAM 774 ; disks. Set RDTYPE = +2 for RC model RAM disks. 775 ; 776 ; 277 -- Invent the RCSDAR, RCRDRD, and RCRDWR to read, write and 777 ; set the DAR for RC model RAM disks. Hook those routines 778 ; from the main SETDAR, RAMDRD, and RAMDWR routines. 779 ; 780 ; 300 -- RCSDAR should always return with the link cleared! 781 ; 782 ; 301 -- left out a TAD in RCRDWR ... 783 ; 784 ; 302 -- fix a typo in the help text. 785 ; 786 ; 303 -- Make the FL command alway say "?No flash" on the SBC6120-RC 787 ; model (the RC RAM disk apparently confuses Jim's code enough 788 ; to think it's a flash otherwise). 789 ; PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 14 Edit History bts6120.plx 790 ; 304 -- Spiff up the HELP command a bit so that it only prints 791 ; help that's appropriate to the current system configuration. 792 ; In particular, the RAM disk commands are printed only if a 793 ; RAM disk is present, IDE commands only if an IDE disk is 794 ; attached, and IOB6120 commands only if the IOB is attached. 795 ; 796 ; 305 -- If the RF or DF command is used with RP, then don't ask for 797 ; confirmation - just do it. This allows a format command to 798 ; repeat without operator intervention (useful for burn in 799 ; testing!). 800 ; 801 ; 306 -- Move around the call to SHOEXT so that the startup messages 802 ; make sense when an IOB6120 is actually installed. 803 ; 804 ; 307 -- Make the HElp command show the IDE disk commands when a CF 805 ; card is installed on the IOB6120 (w/o any real IDE drive). 806 ; 807 ; 310 -- RSP1 was duplicated in the disassembler table. 808 ; 809 ; 311 -- Add all the SBC6120 model 2 and model RC specific IOTs to 810 ; the disassembler tables... 811 ; 812 ; 312 -- Make the DF/RF and DL/RL commands display the current block 813 ; or page number on the FP6120 data LEDs. Note that the DD/RD 814 ; commands currently DON'T do this - I'd like them too, but 815 ; there aren't enough words left on the page... 816 ; 817 ; 313 -- Add the SD command to spin up or spin down IDE drives ... 818 ; 819 ; 314 -- Some fool (I guess that would be me!) forgot to modify RAMDRW 820 ; to support the new SBC6120-RC RAM disk. That means the RC 821 ; RAM disk worked great in BTS6120, but it'd fail miserably 822 ; when the OS/8 device driver tried to access it! 823 ; 824 ; 315 -- CHKRC is called by a JMS, but it's missing a zero word at 825 ; the entry point! 826 ; 827 ; 316 -- Blink the power LED on the RC2 model when the SRAM backup 828 ; battery is low ... 829 ; 830 ; 317 -- The SETPMP MUUO crashes because WRPSS depends on DF = 1. 831 ; 832 ; 320 -- Blink the power LED (fast blink this time) if any POST test 833 ; fails. Only the RC model has a power LED, so this has no 834 ; effect on the original SBC6120/FP6120. 835 ; 836 ; 321 -- Added support for 29F flash chips. 837 ; 838 ; [End of monitor edit history] 839 0321 VERSION=321 ; latest edit number 840 841 ; TODO 842 ; Make the non-volatile settings stuff work with the RC RAM disk 843 ; We could to this easily enough by carving one page off the end of the first 844 ; RAMdisk bank (just reduce the size by 1 page), but is it really worth it? 845 ; All this would save for the RC is the terminal settings. On the SBC6120 it 846 ; also saves the partition map, but of course the RC doesn't have that. 847 ; Add a "burn in" command to exercise new systems? 848 ; Make the RP command display the iteration number in the address LEDs? 849 ; The ROM test/checksums can't distiguish the case of shorted EMA bits 850 ; (as evidenced by David Power's SBC6120 that had EMA1 stuck at 0!) 851 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 15 SBC6120 IOTs and Definitions bts6120.plx 852 .TITLE SBC6120 IOTs and Definitions 853 854 855 ; The console terminal interface of the SBC6120 is actually straight -8 856 ; compatible, which is a proper subset of the KL8E except that the KCF, TFL, 857 ; KIE and TSK (or SPI, depending on which manual you read!) instructions are 858 ; omitted. Console interrupts are permanently enabled, as they were in the 859 ; original PDP-8. The console interface in the SBC6120 DOES NOT use a 6121, 860 ; so there'll be none of this skip-on-flag-and-clear-it nonsense with KSF or 861 ; TSF! 862 6031 KSF=6031 ; Skip of console receive flag is set 863 6032 KCC=6032 ; Clear receive flag and AC 864 6034 KRS=6034 ; OR AC with receive buffer and DON't clear the flag 865 6036 KRB=6036 ; Read receive buffer into AC and clear the flag 866 6041 TSF=6041 ; Skip if the console transmit flag is set 867 6042 TCF=6042 ; Clear transmit flag, but not the AC 868 6044 TPC=6044 ; Load AC into transmit buffer, but don't clear flag 869 6046 TLS=6046 ; Load AC into transmit buffer and clear the flag 870 6412 PRISLU=6412 ; set console to primary SLU (03/04) 871 872 ; 8255 PPI Interface IOTs... 873 6470 PRPA=6470 ; read PPI port A 874 6471 PRPB=6471 ; " " " B 875 6472 PRPC=6472 ; " " " C 876 6473 PRCR=6473 ; " " control register 877 6474 PWPA=6474 ; write PPI port A 878 6475 PWPB=6475 ; " " " B 879 6476 PWPC=6476 ; " " " C 880 6477 PWCR=6477 ; " " control register 881 882 ; Front panel (FP612) IOTs... 883 6430 CCPR=6430 ; clear AC, HALT SW REQ and 30Hz REQ flags 884 6431 SHSW=6431 ; skip on HALT SW REQ flag 885 6432 SPLK=6432 ; skip on panel lock 886 6433 SCPT=6433 ; skip on 30Hz timer REQ flag 887 6434 RFNS=6434 ; read function switches (BOOT, EXAM, DEP, ROTSW, etc) 888 6435 RLOF=6435 ; turn off RUN LED 889 6437 RLON=6437 ; " on " " 890 ;SBBLO2 (6436) skip on backup battery low (SBC6120-RC only!) 891 ;OSR (7404) read data switches 892 ;WSR (6246) write data LEDs (when ROTSW != MD) 893 6415 PLOF=6415 ; POWER LED off (SBC6120-RC only!) 894 6417 PLON=6417 ; " " on ( " " " ) 895 896 ; Other SBC6120 instructions... 897 6440 POST=6440 ; Display a 3 bit POST code 898 6236 BPT=PR3 ; Breakpoint trap instruction 899 900 ; Special ASCII control characters that get used here and there... 901 0000 CHNUL=000 ; A null character (for fillers) 902 0003 CHCTC=003 ; Control-C (Abort command) 903 0007 CHBEL=007 ; Control-G (BELL) 904 0010 CHBSP=010 ; Control-H (Backspace) 905 0011 CHTAB=011 ; Control-I (TAB) 906 0012 CHLFD=012 ; Control-J (Line feed) 907 0015 CHCRT=015 ; Control-M (carriage return) 908 0017 CHCTO=017 ; Control-O (Suppress output) 909 0021 CHXON=021 ; Control-Q (XON) 910 0022 CHCTR=022 ; Control-R (Retype command line) 911 0023 CHXOF=023 ; Control-S (XOFF) 912 0025 CHCTU=025 ; Control-U (Delete command line) 913 0033 CHESC=033 ; Control-[ (Escape) 914 0177 CHDEL=177 ; RUBOUT (Delete) 915 916 ; OPR microinstructions that load the AC with various special constants... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 16 SBC6120 IOTs and Definitions bts6120.plx 917 7200 NL0000=CLA ; all models 918 7201 NL0001=CLA IAC ; all models 919 7326 NL0002=CLA CLL CML RTL ; all models 920 7332 NL2000=CLA CLL CML RTR ; all models 921 7350 NL3777=CLA CLL CMA RAR ; all models 922 7330 NL4000=CLA CLL CML RAR ; all models 923 7352 NL5777=CLA CLL CMA RTR ; all models 924 7346 NL7775=CLA CLL CMA RTL ; all models 925 7346 NLM3=NL7775 ; all models 926 7344 NL7776=CLA CLL CMA RAL ; all models 927 7344 NLM2=NL7776 ; all models 928 7240 NL7777=CLA CMA ; all models 929 7240 NLM1=NL7777 ; all models 930 7325 NL0003=CLA STL IAC RAL ; PDP-8/I and later 931 7307 NL0004=CLA CLL IAC RTL ; PDP-8/I and later 932 7327 NL0006=CLA STL IAC RTL ; PDP-8/I and later 933 7333 NL6000=CLA STL IAC RTR ; PDP-8/I and later 934 7203 NL0100=CLA IAC BSW ; PDP-8/E and later 935 7215 NL0010=CLA IAC R3L ; HM6120 only PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 17 SBC6120 Memory Mapping Hardware bts6120.plx 936 .TITLE SBC6120 Memory Mapping Hardware 937 938 939 ; The SBC6120 has three memory subsystems - 64K words of twelve bit RAM, 940 ; 8K words of 12 bit EPROM (actually the EPROM is 16 bits wide, but the 941 ; hardware just throws away the extra four bits), and up to 2Mb of 8 bit 942 ; battery backed up SRAM for a RAM disk. 943 ; 944 ; The HM6120 on the other hand, has only two memory spaces - panel memory 945 ; and main memory, and each of these is limited to 32K words. The SBC6120 946 ; implements a simple memory mapping scheme to allow all three memory 947 ; subsystems to fit in the available address space. Up to four different 948 ; memory maps are possible, although only three are currently implemented. 949 ; 950 ; The memory map in use is selected by four IOT instructions, MM0, MM1 951 ; MM2 and (what else) MM3. Memory map changes take place immediately with 952 ; the next instruction fetch - there's no delay until the next indirect JMP 953 ; the way there is with a CIF instruction. 954 ; 955 ; The four memory maps implemented by the SBC6120 are: 956 ; 957 ; * Map 0 uses the EPROM for all direct memory accesses, including instruction 958 ; fetch, and uses the RAM for all indirect memory accesses. This is the 959 ; mapping mode set by the hardware after a power on reset. 960 ; 961 ; * Map 1 uses the RAM for all direct memory accesses, including instruction 962 ; fetch, and uses the EPROM for all indirect memory references. This mode 963 ; is the "complement" of map 0, and it's used by the panel memory bootstrap 964 ; to copy the EPROM contents to RAM. 965 ; 966 ; * Map 2 uses the RAM for all memory accesses, regardless. This is the 967 ; mapping mode used during almost all operation after booting. 968 ; 969 ; * Map 3 is the same as map 2, except that the RAM disk memory is enabled 970 ; for all indirect accesses. BEWARE - RAM disk memory is only eight bits 971 ; wide and reads and writes to this memory space only store and return the 972 ; lower byte of a twelve bit word. This mode is used only while we're 973 ; accessing the RAM disk. 974 ; 975 ; IMPORTANT! The memory mapping mode affects only 6120 control panel memory 976 ; accesses. Main memory is always mapped to RAM regardless of the mapping 977 ; mode selected. 978 979 ; DIRECT INDIRECT 980 ; -------- -------- 981 6400 MM0=6400 ; EPROM RAM (automatically selected by a RESET) 982 6401 MM1=6401 ; RAM EPROM (used during system initialization) 983 6402 MM2=6402 ; RAM RAM (used almost all the time) 984 6403 MM3=6403 ; RAM DISK (used to access RAM disk only) PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 18 System Startup and POST Codes bts6120.plx 985 .TITLE System Startup and POST Codes 986 987 988 ; Getting the SBC6120 monitor up and running after a power up is a little 989 ; harder than we might wish. Our first problem is that we're actually 990 ; executing code from the EPROM now, and a lot of the usual PDP-8 techniques 991 ; of "self manipulation" (e.g. a JMS instruction!) won't work because the 992 ; program store isn't writable. Our second problem is that all of panel 993 ; fields 0 and 1 are mapped to EPROM, and there's no RAM anywhere in these 994 ; fields at all, not even in page zero. 995 ; 996 ; Our final problem is that we can't even be sure that all the hardware is 997 ; working correctly at this point. If some part isn't working, for example, 998 ; the RAM, we'd like to provide at least some kind of diagnostic message 999 ; before we end up lost forever. The minimum set of system components that 1000 ; this monitor needs to have working before it can print a prompt and execute 1001 ; commands is 1) the CPU, 2) the ROM, 3) the RAM, and 4) the console terminal. 1002 ; 1003 ; This means we need to accomplish two things during a cold boot - first, 1004 ; to execute a simple power on self test (aka POST), and second, to copy this 1005 ; monitor's code from EPROM to panel RAM where we can execute it without 1006 ; restriction. 1007 ; 1008 ; The SBC6120 has a single digit LED display that the program can set, via 1009 ; the POST instruction. At the beginning of each step in testing and 1010 ; initialization we set this digit to a particular value, and then if that 1011 ; test or startup part fails, we simply halt and the display remains at the 1012 ; last value set. The digits and their associated failure modes are: 1013 ; 1014 ; 7 - CPU failure (or it's not a 6120) 1015 ; 6 - panel RAM bootstrap failure 1016 ; 5 - RAM checksum failure 1017 ; 4 - memory test failure 1018 ; 3 - currently unused (reserved for 6121 failure?) 1019 ; 2 - console terminal failure 1020 ; 1 - panel monitor running (success!) 1021 ; 0 - user (main memory) program running PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 19 System Startup, Part 1 bts6120.plx 1022 .TITLE System Startup, Part 1 1023 1024 1025 ; This code lives in field one, page zero of the EPROM and it's the first 1026 ; thing that gets executed after a power on clear. Its main job is to get 1027 ; the SBC6120 memory initialized, which it does it with these steps: 1028 ; 1029 ; 1 - execute a simple CPU test 1030 ; 2 - execute a very simple RAM test 1031 ; 3 - copy EPROM to panel RAM 1032 ; 4 - verify the firmware checksum 1033 ; 5 - execute an extensive test on the remaining memory 1034 ; 1035 ; After it's done, it jumps to the second phase of initialization, which 1036 ; lives in field zero. When this code starts we're in memory mapping mode 1037 ; zero, which means that all instructions are being executed from EPROM and 1038 ; RAM can be addressed only indirectly. When it finishes, all code will be 1039 ; in panel RAM and we'll be running in memory mapping mode two, which means 1040 ; that all memory accesses go to RAM and the EPROM is inaccesible. 1041 ; 1042 ; After system initialization is complete, all this code is over written 1043 ; with page zero variables and storage for field one. 1044 10200 .FIELD 1 1045 10000 .PAGE 0 1046 1047 ; Location zero of field 1 (and field 0, for that matter) must contain a 1048 ; zero for the checksum routine. See the code at ROMCHK: for a discussion. 1049 10000 0000 0000 1050 1051 ; The first step is the CPU test, which is trivially simple. We just 1052 ; verify that we're actually running on a HM6120 and let it go at that... 1053 10001 6447 SYSINI: POST+7 ; set the POST code to 7 1054 10002 7215 CLA IAC R3L ; Only a 6120 has the R3L instruction 1055 10003 1177 TAD [-10] ; Did we get the right answer? 1056 10004 7440 SZA ; ??? 1057 10005 5147 JMP PFAIL1 ; Nope - halt forever 1058 1059 ; Before we copy the boot code to panel RAM, do a primitive (and it's really 1060 ; primitive!) test of RAM just to make sure there's something there we can 1061 ; read and write. Remember that at this point we're using memory map 0, so 1062 ; all direct references are to EPROM, but all indirect references are to RAM. 1063 10006 6446 POST+6 ; set the POST code to six 1064 10007 6276 SPD ; be sure we're accessing panel memory now! 1065 10010 7200 CLA ; ... 1066 10011 1176 TAD [2525] ; write an alternating bit pattern 1067 10012 3575 DCA @[ROMCPY] ; ... to RAM location zero 1068 10013 1174 TAD [5252] ; and write the complement to location 1 1069 10014 3573 DCA @[ROMCPY+1] ; ... 1070 10015 1575 TAD @[ROMCPY] ; now read them both back 1071 10016 1573 TAD @[ROMCPY+1] ; and add them up 1072 10017 7040 CMA ; and the result should be -1 1073 10020 7440 SZA ; ???? 1074 10021 5147 JMP PFAIL1 ; low RAM failure 1075 1076 ; Copy all of the EPROM moving code, which is six words starting at the label 1077 ; ROMCPY, from EPROM to exactly the same location in RAM. There's no way to 1078 ; use a loop to do this since we don't have any RAM that we can access directly 1079 ; to use as a pointer! 1080 10022 1040 TAD ROMCPY ; copy this one word from EPROM 1081 10023 3575 DCA @[ROMCPY] ; ... to RAM 1082 10024 1041 TAD ROMCPY+1 ; and do it for the entire routine 1083 10025 3573 DCA @[ROMCPY+1] ; ... 1084 10026 1042 TAD ROMCPY+2 ; ... 1085 10027 3572 DCA @[ROMCPY+2] ; ... 1086 10030 1043 TAD ROMCPY+3 ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 20 System Startup, Part 1 bts6120.plx 1087 10031 3571 DCA @[ROMCPY+3] ; ... 1088 10032 1044 TAD ROMCPY+4 ; ... 1089 10033 3570 DCA @[ROMCPY+4] ; ... 1090 10034 1045 TAD ROMCPY+5 ; ... 1091 10035 3567 DCA @[ROMCPY+5] ; ... 1092 1093 ; Now it gets tricky. At this instant we're still running in EPROM, and the 1094 ; first two instructions (at ROMCP0) get executed from EPROM. As soon as we 1095 ; execute the MM1 at ROMCPY:, however, the very next instruction is fetched 1096 ; from RAM. This should work, because the previous code has copied the six 1097 ; words that make up the ROMCPY loop from EPROM to exactly the same location 1098 ; in RAM. 1099 ; 1100 ; The loop the copies an entire field from EPROM to RAM, executing from RAM 1101 ; the whole time. It actually over writes itself in the process, but since it 1102 ; over writes itself with a copy of the exact same code we should be OK. By 1103 ; the time it falls thru the ISZ at the end of the loop, the subsequent code 1104 ; should exist in RAM. 1105 ; 1106 ; After copying field 1, we copy fields 2, 3, and 0. There is another 1107 ; subtlety here. The next step will be to checksum the RAM copy, but we're 1108 ; modifying it before we get there! Without some adjustment, the checksum 1109 ; will fail. As it turns out, there is a simple fix- the self-modifying code 1110 ; location is initialized with the value we expect it to have when the copy 1111 ; is complete. This actual instance of the value is never actually executed, 1112 ; but it is seen by the checksum generator and incorporated into the checksum, 1113 ; so everything works out. Although the first time thru we executed ROMCP0 1114 ; from EPROM, the next time thru we execute it from RAM, which is OK because 1115 ; it got copied during the first pass. 1116 ; BTW, Field 3 gets copied to RAM, but BTS6120 is only 3 fields long. Since 1117 ; there won't be a valid checksum in field 3, we will ignore it. 1118 ; 1119 ; Say goodbye to memory map 0 - we'll never need it again! 1120 1121 ; This loop copies all of a field, except location 0, from EPROM to RAM. 1122 10036 7201 ROMCP0: CLA IAC ; always start with location 1, not zero 1123 10037 3566 DCA @[0] ; save the address pointer here 1124 10040 6401 ROMCPY: MM1 ; (1) address RAM directly, EPROM indirectly 1125 10041 1400 TAD @0 ; (2) and load a word from EPROM 1126 10042 6402 MM2 ; (3) address RAM for all memory accesses 1127 10043 3400 DCA @0 ; (4) and store the word in RAM 1128 10044 2000 ISZ 0 ; (5) have we done an entire field? 1129 10045 5040 JMP ROMCPY ; (6) nope - keep copying 1130 10046 6214 RDF ; which field did we just copy? 1131 10047 7450 SNA ; was it 0? 1132 10050 5056 JMP ROMCP1 ; yes, finished copying fields 1133 10051 1165 TAD [CDF 1] ; no, make it a CDF to the next field 1134 10052 0164 AND [7737] ; wrap it around from CDF 3 to CDF 0 1135 10053 3054 DCA .+1 ; and store it to be executed 1136 10054 6201 CDF 0 ; change to new field *** see note above *** 1137 10055 5036 JMP ROMCP0 ; and copy it 1138 10056 ROMCP1: 1139 1140 ; When we leave this loop, we're using memory map 2 which means panel RAM 1141 ; is used everywhere and the EPROM is inaccessible. We'll stay in this mapping 1142 ; mode forever, except when we're accessing the RAM disk. 1143 1144 ; Each field of the panel ROM contains a 12 bit checksum, put there by the 1145 ; PDP2HEX program and calculated so that the sum of all words in the field, 1146 ; including the checksum word, will be zero. Now we'll compute and verify the 1147 ; checksum of both RAM fields, which proves that our RAMs work, that the 1148 ; EPROMS were programmed correctly, and that we copied them correctly. 1149 ; 1150 ; It might seem a better to do this before on the EPROMs before we've copied 1151 ; them to RAM, but the answer is that it's just impossible to compute a PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 21 System Startup, Part 1 bts6120.plx 1152 ; checksum using memory map 0 - there's no directly addressible RAM to use for 1153 ; address pointers or for storing the sum! 1154 ; 1155 ; Another issue here is the use of self-modifying code here and in the ROM 1156 ; copy function. Here, like above, we finesse the issue by initializing the 1157 ; modified location to the value it's expected to have (CDF 1) when this field 1158 ; is checksummed. 1159 ; 1160 ; One last subtle point is that we're keeping an address pointer in location 1161 ; zero of RAM, which wasn't in the EPROM when PDP2HEX calculated its checksum. 1162 ; This actually works by accident (er - excuse me, "Design"), since we keep 1163 ; our pointer in location zero of RAM, it will have the value zero when we 1164 ; checksum it. Coincidentally, this is exactly the same value that's in 1165 ; location zero of the ROM image. 1166 1167 ; This loop checksums one RAM field... 1168 10056 6445 POST+5 ; set the POST code to five 1169 10057 6221 CDF 2 ; checksum field 2 first 1170 10060 7201 ROMCHK: CLA IAC ; and start with location 1 (skip zero) 1171 10061 3000 DCA 0 ; ... 1172 10062 1400 ROMCH0: TAD @0 ; add up another word from RAM 1173 10063 2000 ISZ 0 ; have we done an entire field? 1174 10064 5062 JMP ROMCH0 ; nope - keep adding 1175 10065 7640 SZA CLA ; yes - did the checksum pass? 1176 10066 5147 JMP PFAIL1 ; RAM checksum failure 1177 10067 6214 RDF ; get the field we just did 1178 10070 7450 SNA ; was it field 0? 1179 10071 5076 JMP ROMCH1 ; yes, we're done 1180 10072 1163 TAD [6171] ; no, make it previous CDF by adding [CDF 0]-10 1181 10073 3074 DCA .+1 ; and store for execution next 1182 10074 6211 CDF 1 ; *** see note above *** 1183 10075 5060 JMP ROMCHK ; continue checksumming 1184 10076 ROMCH1: 1185 1186 ; The next step is to run a memory test on the remaining fields (2 thru 7) 1187 ; of panel memory and all fields of main memory. It's not a very sophisticated 1188 ; test - it just writes each memory location with its address in the first pass 1189 ; and then reads it back in the second, but it does prove that there's at least 1190 ; some memory out there listening. 1191 ; 1192 ; Before we do that, however, we do an even simpler test to verify that the 1193 ; panel data flag is working and that main memory and panel memory are two 1194 ; separate and distinct memory spaces... 1195 1196 ; Make sure that panel memory and main memory are distinct... 1197 10076 6444 POST+4 ; set the POST code to four 1198 10077 7240 STA ; put -1 in location 0 of panel memory 1199 10100 3566 DCA @[0] ; ... 1200 10101 6266 CPD ; and then put 0 in the same location 1201 10102 3566 DCA @[0] ; ... of main memory 1202 10103 6276 SPD ; back to panel memory 1203 10104 2566 ISZ @[0] ; and increment -1 1204 10105 5147 JMP PFAIL1 ; if it doesn't skip something is wrong 1205 1206 ; Test all eight fields of main memory... 1207 ; CLA ; and start testing with field zero 1208 10106 6266 CPD ; address main memory again 1209 10107 4122 MEMTS1: JMS FLDTST ; test this field, halt if it's bad 1210 10110 7440 SZA ; have we wrapped around to field 0 again ? 1211 10111 5107 JMP MEMTS1 ; no - test the next field 1212 1213 ; Then test only fields 3 thru 7 of panel memory... 1214 10112 6276 SPD ; address panel memory this time 1215 ;*** change this constant to 40 if testing extension ROM code in EPROM 1216 10113 1162 TAD [30] ; start testing with field 2 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 22 System Startup, Part 1 bts6120.plx 1217 10114 4122 MEMTS2: JMS FLDTST ; test this field, halt if it's bad 1218 10115 7440 SZA ; ... 1219 10116 5114 JMP MEMTS2 ; ... 1220 1221 ; As the last step in this part of the initialization, test the RAMdisk 1222 ; batteries (if a RAMdisk is installed). The DS1221 version of the RAMdisk 1223 ; requires that the battery test be performed before ANY other access to 1224 ; the RAMdisk array, so this has to happen before we can initialize the 1225 ; extension ROM. BTW, note that a) we have no stack yet, and b) the 1226 ; CK1221 routine also lives in field one, and c) CK1221 is only called 1227 ; once, from here! 1228 10117 4561 JMS @[CK1221] ; go test the DS1221 battery 1229 ; CDF 1 ; (CK1221 changes the DF!) 1230 1231 ; System initialization, part 1, is finished. The remainder of the code 1232 ; lives in field zero... 1233 10120 6203 CXF 0 1234 10121 5560 JMP @[SYSIN2] 1235 1236 ; This subroutine will test one field of either main memory or panel memory. 1237 ; It's a fairly simple minded test - it just writes each location with its 1238 ; address in the first pass and then reads it back in the second pass. If the 1239 ; test fails it just halts - there is no error return! 1240 10122 0000 FLDTST: 0 ; enter here with the field in the AC 1241 10123 1157 TAD [CDF 0] ; make a CDF instruction out of it 1242 10124 3125 DCA .+1 ; and execute it inline 1243 10125 7000 NOP ; gets over written with a CDF 1244 10126 3000 DCA 0 ; reset the address pointer 1245 10127 1000 FLDTS1: TAD 0 ; write each word with its address 1246 10130 3400 DCA @0 ; ... 1247 10131 2000 ISZ 0 ; have we done all 4K? 1248 10132 5127 JMP FLDTS1 ; nope - keep going 1249 10133 3000 DCA 0 ; yes - reset the s in field zeroaddress pointer 1250 10134 1000 FLDTS2: TAD 0 ; and make another pass to test 1251 10135 7041 CIA ; ... what we wrote 1252 10136 1400 TAD @0 ; ... 1253 10137 7440 SZA ; does this location contain the right value? 1254 10140 5147 JMP PFAIL1 ; no - just halt 1255 10141 2000 ISZ 0 ; yes - keep going for all 4K 1256 10142 5134 JMP FLDTS2 ; ... 1257 10143 6214 RDF ; get the data field we just tested 1258 10144 1156 TAD [10] ; and increment it for the caller 1259 10145 0155 AND [70] ; remove any overflow bits 1260 10146 5522 JMP @FLDTST ; return the next field to the caller 1261 1262 ; We jump here if any POST test fails so that we can blink the power LED. 1263 ; Unfortunately there isn't enough room for that on this page, so the real 1264 ; code lives with SYSIN2 in field 0 ... 1265 10147 6203 PFAIL1: CXF 0 ; change to field zero 1266 10150 5554 JMP @[PFAIL0] ; and go do the real code 1267 10154 0267 10155 0070 10156 0010 10157 6201 10160 0201 10161 3131 10162 0030 10163 6171 10164 7737 10165 6211 10166 0000 10167 0045 10170 0044 10171 0043 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 23 System Startup, Part 1 bts6120.plx 10172 0042 10173 0041 10174 5252 10175 0040 10176 2525 10177 7770 1268 10200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 24 System Startup, Part 2 bts6120.plx 1269 .TITLE System Startup, Part 2 1270 1271 1272 ; This routine is the second phase of system initialization, and it lives 1273 ; in page one of field zero. It's called at the end of the first phase, and 1274 ; it will: 1275 ; 1276 ; 1 - test and initialize any extra hardware (e.g. 6121 chips) 1277 ; 2 - test and initialize the console terminal 1278 ; 3 - initialize any RAM that needs it 1279 ; 4 - print a sign on message 1280 ; 5 - jump to the monitor restart address 1281 ; 1282 ; After this code finishes, the monitor is running and a prompt will have been 1283 ; printed on the terminal. This code code gets overwritten immediately by the 1284 ; monitor's command line buffer, which also lives in page 1 of field 0. 1285 00200 .FIELD 0 1286 00200 .PAGE 1 1287 1288 ; The PDP2HEX program (which converts BIN files into ROM images in Intel 1289 ; HEX format) stores a checksum of ROM field 0 in location 00200, which will 1290 ; later be used by the POST... 1291 00200 ROMCK0: .BLOCK 1 1292 1293 1294 ; Create a software stack and initialize the stack pointer.... 1295 00201 6203 SYSIN2: CXF 0 ; Be sure the IB and DF are both zero 1296 00202 6276 SPD ; Address CP memory with indirect cycles 1297 00203 7200 CLA ; just in case... 1298 00204 1377 TAD [STACK] ; reset the 6120 stack pointer 1299 00205 6217 LSP1 ; ... 1300 1301 ; The SBC6120-RC model is nearly identical to the original, EXCEPT for the 1302 ; RAMdisk implementation. At this point (before we check for the extension 1303 ; ROM, which is yet another pseudo-RAM disk implementation!) we want to figure 1304 ; out if this machine is the RC model. Turns out that's fairly easy to do 1305 ; because the RC has the SBBLO2 (6436) IOT - this skips on backup battery low, 1306 ; which we don't care about right now, but it also clears the AC. Yes, it's 1307 ; a bit unusual for a skip IOT to clear the AC, but the SBC6120-RC does that 1308 ; on purpose just so that we can use this IOT (which is a NOP on the original 1309 ; SBC6120/FP6120) to distinguish that machine. 1310 00206 7240 STA ; AC = -1 1311 00207 6436 SBBLO2 ; clear the AC if this is an SBC6120-RC 1312 00210 7000 NOP ; (don't care about the battery right now) 1313 00211 7640 SZA CLA ; skip if this is the RC model 1314 00212 5216 JMP SYSI20 ; nope - go ahead with the extension ROM test 1315 00213 7040 CMA ; RC model - set RCFLAG = -1 1316 00214 3035 DCA RCFLAG ; ... 1317 00215 5222 JMP SYSI21 ; and skip the extension ROM test 1318 1319 ; check for an extension ROM in ramdisk memory at DAR=0000, DF=1, O=0000. 1320 ; The check looks for a signature of 'SB' 'C6' at the start, and a valid 1321 ; checksum. 1322 00216 6443 SYSI20: POST+3 ; set the POST code to three 1323 00217 6222 CIF 2 1324 00220 6205 .PUSHJ @[EXTROM] ; and call the extension ROM check 00221 5776 1325 1326 ; The next stage in initialization is to test the console terminal. Since 1327 ; the SBC6120 hardware doesn't have a loopback mode we can't really verify that 1328 ; data is being sent and received correctly, but we can at least test that the 1329 ; flags set and clear at appropriate times. That way we'll know, at last, that 1330 ; we won't hang forever if we do a "TLS; JMP .-1" loop. 1331 00222 6442 SYSI21: POST+2 ; set the POST code to two 1332 00223 7200 CLA ; send a null character to the console PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 25 System Startup, Part 2 bts6120.plx 1333 00224 6046 TLS ; ... 1334 00225 6041 TSF ; and then wait for the flag to set 1335 00226 5225 JMP .-1 ; waiting forever, if necessary! 1336 00227 6042 TCF ; clear the console flag 1337 00230 6041 TSF ; and then test it again 1338 00231 7410 SKP ; good - it _isn't_ set! 1339 00232 5267 JMP PFAIL0 ; bad - it's still set, so the console fails 1340 00233 6046 TLS ; send another null 1341 00234 6041 TSF ; and be sure it sets one more time 1342 00235 5234 JMP .-1 ; ... 1343 1344 ; Now make sure we can clear the keyboard input flag, and that KCC also 1345 ; clears the AC. The latter proves that there is at least some hardware out 1346 ; there controlling the C lines for the console terminal, although it doesn't 1347 ; guarantee that we can receive data. 1348 00236 7240 STA ; Load the AC with -1 1349 00237 6032 KCC ; Clear the keyboard flag and the AC 1350 00240 7440 SZA ; Verify that the AC got cleared 1351 00241 5267 JMP PFAIL0 ; Nope - console test failed! 1352 00242 6031 KSF ; And test the keyboard flag 1353 00243 7410 SKP ; Good - it _isn't_ set! 1354 00244 5267 JMP PFAIL0 ; Bad - the keyboard test failed 1355 1356 ; Set the control panel entry vector in 7777 to be a "JMP CPSAVE" instruction. 1357 ; We have to do this in a rather awkward way because PALX won't assemble a 1358 ; current page reference to CPSAVE unless we're actually on the same page as 1359 ; CPSAVE! 1360 00245 6441 SYSIN3: POST+1 ; the monitor is up and running now 1361 00246 1375 TAD [CPSAVE&177 | 5200] 1362 00247 3774 DCA @[7777] 1363 1364 ; Do any RAM initialization that needs to be done... 1365 00250 6205 .PUSHJ @[RAMINIT] 00251 5773 1366 1367 ; Figure out if we have a front panel (FP6120) and, if we do, turn it on... 1368 00252 6205 .PUSHJ @[FPINIT] 00253 5772 1369 1370 ; Type out the system name... 1371 00254 6205 .PUSHJ @ZCRLF ; First start on a new line 00255 5510 1372 00256 6205 .PUSHJ @[HELLO] ; Finally add our name and version 00257 5771 1373 1374 ; Initialize the RAM disk array (if any) and show its configuration ... 1375 00260 6205 .PUSHJ @[SHONVR] ; ... 00261 5770 1376 1377 ; Finally, probe the IDE bus for any drive that might be attached. 1378 00262 6205 .PUSHJ @[SHOIDE] ; ... 00263 5767 1379 1380 ; HOOK: End of startup, after BTS6120 messages but before command prompt. 1381 ; Unlike most hooks, this one does not have continuation code after the 1382 ; three hook words; the interceptor must instead jump to RESTA, which 1383 ; is also a hook and therefore known to the extension ROM. 1384 ; 1385 ; To Jim's kludge I add this even bigger kludge - we only need to print 1386 ; out information about the IOB6120 _if_ it fails to initialize successfully. 1387 ; In that case we're printing the error code from IOB initialization to tell 1388 ; the user that the IOB6120 was detected but it failed to initialize (probably 1389 ; because the flash is corrupt). If the IOB does initialize successfully, then 1390 ; it will overwrite the next three instructions with a jump to the IOB6120 1391 ; startup code, and that will print out everything you ever wanted to know PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 26 System Startup, Part 2 bts6120.plx 1392 ; about your IOB6120. 1393 ; 1394 ; QED - put the call to SHOEXT here, and it will only be executed if there's 1395 ; no IOB installed OR if the IOB6120 fails to start up successfully... 1396 00264 6205 SYSIN9: .PUSHJ @[SHOEXT] ; (note that this takes two words!) 00265 5766 1397 00266 5527 JMP @ZRESTA ; And we're ready for commands... 1398 1399 1400 ; This routine blinks the power LED on the SBC6120-RC at a pretty fast rate 1401 ; (much faster than the lazy 1Hz rate we use for the battery low warning). It's 1402 ; called whenever a POST step fails, and just loops forever blinking the LED. 1403 ; FWIW, this has no effect on the original SBC6120 or the SBC6120/FP6120 combo, 1404 ; since neither implements the PLOF or PLON IOTs. 1405 00267 6415 PFAIL0: PLOF ; power LED off 1406 00270 7001 IAC ; delay for a short time 1407 00271 7440 SZA ; ... 1408 00272 5267 JMP PFAIL0 ; (going back to PFAIL0 makes the delay longer) 1409 00273 6417 PFAIL2: PLON ; now do the same thing for LED on 1410 00274 7001 IAC ; ... 1411 00275 7440 SZA ; ... 1412 00276 5273 JMP PFAIL2 ; ... 1413 00277 5267 JMP PFAIL0 ; and just do that forever 1414 00366 4404 00367 4476 00370 4434 00371 0711 00372 5600 00373 1144 00374 7777 00375 5202 00376 0400 00377 0177 1415 00400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 27 Field 0 Variables bts6120.plx 1416 .TITLE Field 0 Variables 1417 1418 1419 ; Page zero of field zero contains most of the runtime data for the monitor, 1420 ; including the saved state of the user (main memory) program. It is purposely 1421 ; NOT overlayed by any startup code so that it may also contain initialized 1422 ; variables, such as JMP/JMS vectors. Data in this page gets initialized 1423 ; automatically when the first phase of system initialization copies the EPROM 1424 ; to RAM. 1425 1426 ; These words contain the saved state of the main memory (aka user) 1427 ; program. The PC gets saved to location zero automatically by the 6120 1428 ; on any entry to control panel, and the rest get saved by the code around 1429 ; CPSAVE... 1430 00000 .ORG 0000 1431 00000 UPC: .BLOCK 1 ; program counter (saved by the hardware) 1432 00001 UAC: .BLOCK 1 ; accumulator 1433 00002 UFLAGS: .BLOCK 1 ; status (LINK, GT, IF, DF, etc) from GCF 1434 00003 UMQ: .BLOCK 1 ; MQ register 1435 00004 USP1: .BLOCK 1 ; 6120 stack pointer #1 1436 00005 USP2: .BLOCK 1 ; " " " #2 1437 00006 UIRPC: .BLOCK 1 ; program counter where IR was fetched from 1438 00007 UIR: .BLOCK 1 ; the last main memory instruction to be executed 1439 1440 ; Auto-index registers... 1441 00010 .ORG 0010 ; this must be at location 10 !!! 1442 00010 X1: .BLOCK 1 ; the first auto-index register 1443 00011 X2: .BLOCK 1 ; the second auto-index register 1444 00012 X3: .BLOCK 1 ; the third auto-index register 1445 00013 L: .BLOCK 1 ; the command line pointer 1446 1447 00020 .ORG 0020 ; don't put anything else in auto-index locations 1448 1449 ; Persistent settings - will be read from NVRAM if any exists - 1450 0020 FIRSTPSS=. 1451 00020 PARMAP: .BLOCK 10 ; unit number to partition map for eight OS/8 units 1452 00030 WIDTH: .BLOCK 1 ; the width of the terminal 1453 00031 LENGTH: .BLOCK 1 ; the number of lines on the screen 1454 00032 SCOPE: .BLOCK 1 ; 1 if DEL should backspace 1455 0033 LASTPSS=. 1456 ; - end of persistent settings 1457 1458 ; Extension ROM info 1459 EXTFLG: .DATA 0 ; 0=no ext. ROM, 1=OK, 2=Bad checksum, 3..=error code 00033 0000 1460 RAMBAS: .DATA -1 ; RAM disk starting offset - 1 in each field 00034 7777 1461 1462 ; Other miscellanous data ... 1463 RCFLAG: .DATA 0 ; -1 if this machine is a SBC6120-RC 00035 0000 1464 BLTIME: .DATA 0 ; timer for blinking the power LED 00036 0000 1465 1466 ; Command parameters... 1467 00037 ADDR: .BLOCK 1 ; the current address 1468 00040 ADRFLD: .BLOCK 1 ; the field of this command 1469 00041 PNLMEM: .BLOCK 1 ; non-zero if ADDR/ADRFLD references panel memory 1470 00042 HIGH: .BLOCK 1 ; the high end of an address range 1471 00043 LOW: .BLOCK 1 ; the low end of an address range 1472 00044 HGHFLD: .BLOCK 1 ; the field of the high address 1473 00045 LOWFLD: .BLOCK 1 ; the field of the low address 1474 00046 VALUE: .BLOCK 1 ; the data word or value 1475 00047 NAME: .BLOCK 1 ; the name of this command 1476 00050 CHKSUM: .BLOCK 1 ; the checksum of memory or tape PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 28 Field 0 Variables bts6120.plx 1477 00051 SIMFLG: .BLOCK 1 ; non-zero if we're executing a single instruction 1478 00052 SAVCHR: .BLOCK 1 ; a place to save a character 1479 1480 ; Terminal parameters... 1481 00053 CTRLO: .BLOCK 1 ; non-zero if output is supressed 1482 00054 XOFF: .BLOCK 1 ; non-zero if output is suspended 1483 00055 HPOS: .BLOCK 1 ; the current horizontal position 1484 00056 VPOS: .BLOCK 1 ; the current vertical position 1485 00057 IRMA: .BLOCK 1 ; the console flag timeout counter 1486 1487 ; Front panel data... 1488 00060 FPDTCT: .BLOCK 1 ; non-zero if a FP6120 is present 1489 00061 FNSTAT: .BLOCK 1 ; last known state of the function switches 1490 00062 BTSWCN: .BLOCK 1 ; number of times the BOOT switch was pushed 1491 00063 FPPGMM: .BLOCK 1 ; non-zero for FP "program" mode 1492 00064 FPPGMD: .BLOCK 1 ; program data for program mode 1493 1494 ; Parameters for the repeat command... 1495 00065 REPCNT: .BLOCK 1 ; the number of times to repeat 1496 00066 REPLOC: .BLOCK 1 ; the location to repeat from 1497 1498 ; Number I/O locations... 1499 00067 WORD: .BLOCK 1 ; the number being read or written 1500 00070 WORDH: .BLOCK 1 ; the high order bits of the last word read 1501 00071 COUNT: .BLOCK 1 ; the number of digits read or written 1502 00072 DIGITS: .BLOCK 1 ; counts digits for numeric input/output routines 1503 1504 ; Storage for RDDUMP, DDDUMP, RLLOAD and DLLOAD, RFRMAT, and DFRMAT... 1505 00073 RECSIZ: .BLOCK 1 ; disk (page, block) size 1506 00074 RECCNT: .BLOCK 1 ; number of records to dump 1507 00075 FMTCNT: .BLOCK 1 ; number of blocks/records processed by FORMAT 1508 0042 CPYSRC=HIGH ; source partition for PC command 1509 0043 CPYDST=LOW ; destination partition for PC command 1510 1511 ; Page zero vectors (to save literal space)... 1512 00076 7400 ZOUTCHR: OUTCHR ; type a single character 1513 00077 7063 ZTSPACE: TSPACE ; type a space 1514 00100 7131 ZBACKS: TBACKS ; type a backspace 1515 00101 6322 ZTOCT4: TOCT4 ; type an octal number 1516 00102 6352 ZTOCT4C: TOCT4C ; type an octal number followed by a CRLF 1517 00103 6355 ZTOCT4M: TOCT4M ; type an octal number, a CRLF, and goto RESTA 1518 00104 6347 ZTOCT4S: TOCT4S ; type an octal number followed by a space 1519 00105 6343 ZTOCT3: TOCT3 ; type a 3 digit octal number 1520 00106 6277 ZTDECNW: TDECNW ; type a decimal number 1521 00107 7077 ZTDOT: TDOT ; type a dot (".") 1522 00110 7104 ZCRLF: CRLF ; type a carriage return/line feed 1523 00111 6237 ZINLMES: INLMES ; type a string passed in-line 1524 00112 7477 ZINCHRS: INCHRS ; poll the operator for input 1525 00113 4617 ZSPACMP: SPACMP ; get the next non-blank command character 1526 00114 4621 ZSPACM0: SPACM0 ; get a non-blank character starting with the current 1527 00115 4647 ZBACKUP: BACKUP ; backup the command line pointer 1528 00116 4632 ZEOLTST: EOLTST ; test current character for end of line 1529 00117 4630 ZEOLNXT: EOLNXT ; test the next character for end of line 1530 00120 0465 ZGET: GET ; get the next character from the command line 1531 00121 6720 ZOCTNW: OCTNW ; scan an octal number 1532 00122 6460 ZRANGE: RANGE ; scan an address range (e.g. "0-7777") 1533 00123 6525 ZTSTADR: TSTADR ; compare the HIGH/HGHFLD to LOW/LOWFLD 1534 00124 6512 ZNXTADR: NXTADR ; increment ADDR/ADRFLD 1535 00125 1316 ZRDMEM: RDMEM ; read a word from main or panel memory 1536 00126 1342 ZDANDV: DANDV ; deposit (in memory) and verify 1537 00127 0400 ZRESTA: RESTA ; monitor restart vector 1538 00130 0453 ZCOMERR: COMERR ; report a command syntax error and restart 1539 00131 0600 ZERROR: ERROR ; print an error message and restart 1540 00132 4543 ZPUSHJ1: PUSHJ1 ; call a routine in field 1 and return to field 0 1541 00133 0025 ZRDPAGE: RDPAGE ; current RAM disk page number in field 1 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 29 Field 0 Variables bts6120.plx 1542 00134 0021 ZDKRBN: DKRBN ; current IDE disk block number in field 1 1543 1544 ; Page zero constants (to save literal space)... 1545 00135 0177 ZK177: 177 ; used everywhere as a mask for ASCII characters 1546 00136 0070 ZK70: 70 ; used as a mask for data/instruction fields 1547 00137 0007 ZK7: 7 ; yet another mask 1548 00140 7740 ZMSPACE: -" " ; an ASCII space character (or the negative there of) 1549 00141 7600 ZM128: -128. ; record size of RAM disk 1550 0141 ZK7600=ZM128 1551 00142 7400 ZM256: -256. ; record size of IDE disk 1552 0142 ZK7400=ZM256 1553 1554 ; Local storage for INCHWL... 1555 00143 CMDLEN: .BLOCK 1 ; the length of the current line 1556 00144 PROMPT: .BLOCK 1 ; the prompting character 1557 1558 ; The software stack occupies all of the rest of page zero. 1559 00145 STKSAV: .BLOCK 1 ; the last monitor SP is saved here by CONTINUE 1560 0177 STACK=0177 1561 0031 STKLEN=STACK-. ; Length of the stack (if anybody cares) 1562 00146 .BLOCK STKLEN 1563 1564 1565 ; Page one of field zero contains the second phase system initialization 1566 ; code, and it's over written by the command line buffer and break point 1567 ; tables after we're running. 1568 00200 .ORG 0200 1569 1570 ; The PDP2HEX program stores a checksum of ROM field 0 in location 00200, 1571 ; and we have to reserve space for it here so it doesn't get overwritten by 1572 ; any of our data. See the code at ROMCK0: for more discussion. 1573 00200 .BLOCK 1 1574 1575 ; Breakpoint storage... 1576 0010 MAXBPT=8. ; maximum number of breakpoints 1577 00201 BPTADR: .BLOCK MAXBPT ; address assigned to each breakpoint 1578 00211 BPTFLD: .BLOCK MAXBPT ; field of the breakpoint 1579 00221 BPTDAT: .BLOCK MAXBPT ; original data at the breakpoint 1580 0210 BPTEND=BPTADR+MAXBPT-1 ; end of the breakpoint address table 1581 1582 ; The command line buffer for INCHWL occupies all that remains of page one... 1583 0147 MAXCMD=0400-. ; space available for the command buffer 1584 00231 CMDBUF: .BLOCK MAXCMD ; and the actual command buffer PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 30 Monitor Main Loop bts6120.plx 1585 .TITLE Monitor Main Loop 1586 1587 00400 .PAGE 2 1588 1589 ; This routine will read commands from the terminal and execute them. It 1590 ; can be entered at RESTA to restart after a control-C or a fatal error, and 1591 ; at BOOTS after completion of a normal command... 1592 ; HOOK: Monitor reentry 1593 00400 7000 RESTA: NOP 1594 00401 7000 NOP 1595 00402 7000 NOP 1596 00403 6276 SPD ; Ensure that CP memory is always selected 1597 00404 6435 RLOF ; The RUN LED is off while we're here 1598 00405 7200 CLA ; And be sure the AC is cleared 1599 00406 1377 TAD [STACK] ; Point to the stack 1600 00407 6217 LSP1 ; Clean up the stack pointer 1601 00410 6205 .PUSHJ @ZCRLF ; Be sure the terminal is ready 00411 5510 1602 1603 ; Read another command line... 1604 00412 7200 BOOTS: CLA ; ... 1605 00413 1376 TAD [">"] ; Point to the prompt 1606 00414 6205 .PUSHJ @[INCHWL] ; Initialize the line input routine 00415 5775 1607 00416 6205 BOOTS0: .PUSHJ @[SWSCAN] ; Scan the switches while we're waiting 00417 5774 1608 00420 6205 .PUSHJ @[INCHW1] ; Read another character into the line 00421 5773 1609 00422 7650 SNA CLA ; EOL? 1610 00423 5216 JMP BOOTS0 ; Nope - keep reading 1611 00424 3065 DCA REPCNT ; Clear the repeat counter initially 1612 1613 ; Execute the next command... 1614 00425 6205 BOOTS1: .PUSHJ @[NAMENW] ; First identify a command 00426 5772 1615 00427 1047 TAD NAME ; Get the name we read 1616 00430 7650 SNA CLA ; Is this a null command ?? 1617 00431 5235 JMP BOOTS2 ; Yes -- just ignore it 1618 00432 1371 TAD [CMDTBL-1] ; Then point to the list of commands 1619 00433 6205 .PUSHJ @[MATCH] ; And look it up 00434 5770 1620 1621 ; See if there are more commands on this line... 1622 00435 1013 BOOTS2: TAD L ; Get the pointer to the last character 1623 00436 3067 DCA WORD ; And save it in a non-autoindex location 1624 00437 1467 TAD @WORD ; Get the last character we saw 1625 00440 1367 TAD [-073] ; Was it a command seperator ?? 1626 00441 7650 SNA CLA ; ???? 1627 00442 5225 JMP BOOTS1 ; Yes -- go execute another command 1628 1629 ; See if this command needs to be repeated... 1630 00443 7240 STA ; Load the AC with -1 1631 00444 1065 TAD REPCNT ; And add to the repeat counter 1632 00445 7510 SPA ; Is the counter positive ?? 1633 00446 5212 JMP BOOTS ; No -- go read anothter line 1634 00447 3065 DCA REPCNT ; Yes -- save the new count 1635 00450 1066 TAD REPLOC ; And get the location to start from 1636 00451 3013 DCA L ; Backup the command scanner 1637 00452 5225 JMP BOOTS1 ; Then go execute this command again PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 31 Command Error Processing bts6120.plx 1638 .TITLE Command Error Processing 1639 1640 1641 ; This routine is called when a syntax error is found in the command and it 1642 ; echo the part of the command which has already been scanned inside question 1643 ; marks (very much like TOPS-10 used to do!). After that, the monitor is 1644 ; restarted (i.e. the stack is cleaned up and another prompt issued). 1645 00453 7200 COMERR: CLA ; Ignore the contents of the AC 1646 00454 3413 DCA @L ; And mark the end of what was actually scanned 1647 00455 6205 .PUSHJ @[TQUEST] ; Type the first question mark 00456 5766 1648 00457 1365 TAD [CMDBUF-1] ; And point to the command line 1649 00460 6205 .PUSHJ @[TASCIZ] ; Echo that 00461 5764 1650 00462 6205 .PUSHJ @[TQUEST] ; Then type another question 00463 5766 1651 00464 5200 JMP RESTA ; Go restart the monitor PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 32 Get Next Command Character bts6120.plx 1652 .TITLE Get Next Command Character 1653 1654 1655 ; This routine will get the next character from the command line. If the 1656 ; character is lower case, it is folded to upper case. If the character is a 1657 ; TAB, it is converted to a space. And, if the character is ";" or "!" (the 1658 ; start of a comment) it is converted to zero (end of line). Finally, the 1659 ; character is returned in both the AC and location SAVCHR. 1660 00465 7200 GET: CLA ; Be sure the AC is safe to use 1661 00466 1413 TAD @L ; Get another character from the line 1662 00467 1363 TAD [-"A"-40] ; Compare this character to lower case A 1663 00470 7500 SMA ; ??? 1664 00471 5305 JMP GET1 ; It might be a lower case letter 1665 1666 ; The character is not lower case -- check for a TAB, ; or !... 1667 00472 1362 TAD ["A"+40-CHTAB] ; Is this a tab character ?? 1668 00473 7450 SNA ; ??? 1669 00474 1361 TAD [" "-CHTAB] ; Yes -- convert it to a space 1670 00475 1360 TAD [CHTAB-"!"] ; No -- Is it a ! character ?? 1671 00476 7450 SNA ; ??? 1672 00477 1357 TAD [-"!"] ; Yes -- Convert it to a null 1673 00500 1356 TAD ["!"-073] ; Last chance -- is it a ; ?? 1674 00501 7450 SNA ; ??? 1675 00502 1367 TAD [-073] ; Yes -- convert that to zero too 1676 00503 1355 TAD [073] ; No -- restore the original character 1677 00504 5311 JMP GET2 ; Then store the character and return 1678 1679 ; Here if the character might be lower case... 1680 00505 1354 GET1: TAD ["A"-"Z"] ; Compare to the other end of the range 1681 00506 7550 SPA SNA ; ??? 1682 00507 1353 TAD [-40] ; It's lower case -- convert to upper 1683 00510 1352 TAD ["Z"+40] ; Restore the correct character 1684 1685 ; Store the character and return... 1686 00511 3052 GET2: DCA SAVCHR ; Remember this character 1687 00512 1052 TAD SAVCHR ; And also return it in the AC 1688 00513 6225 .POPJ ; And that's it PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 33 H Command - Show Monitor Help bts6120.plx 1689 .TITLE H Command - Show Monitor Help 1690 1691 ; The H command generates a simple list of all monitor commands and a 1692 ; brief, one line, help message for each. The whole function is driven 1693 ; by a table of help messages stored in field one - this table contains 1694 ; a list of pointers and each pointer points to the packed ASCII text of 1695 ; a single line of help. We simply print each line and add a CRLF at the 1696 ; end. It's done this way (as a table of lines) rather than as a single, 1697 ; huge, string with embedded CRLFs because the automatic XOFF (i.e. terminal 1698 ; page) processing is done via the CRLF routine. Embedded CRLFs wouldn't 1699 ; automatically XOFF, and so most of the text would scroll right off the 1700 ; top of the CRT. 1701 00514 6205 HELP: .PUSHJ @ZEOLTST ; no arguments are allowed 00515 5516 1702 00516 4751 JMS @[TTEXTT] ; generic help for all models, part 1 1703 00517 4404 HLPP1 ; ... 1704 00520 4750 JMS @[CHKRAM] ; skip if a RAM disk is attached 1705 00521 5324 JMP HELP2 ; no RAM disk - skip this part 1706 00522 4751 JMS @[TTEXTT] ; print the RAM disk commands 1707 00523 4443 HLPRAM ; ... 1708 00524 4747 HELP2: JMS @[CHKIDE] ; skip if an IDE disk is attached 1709 00525 5330 JMP HELP3 ; no IDE disk - skip these commands 1710 00526 4751 JMS @[TTEXTT] ; print the IDE disk commands 1711 00527 4452 HLPIDE ; ... 1712 00530 1033 HELP3: TAD EXTFLG ; is an IOB6120 attached? 1713 00531 7650 SNA CLA ; skip if yes 1714 00532 5335 JMP HELP4 ; nope - skip the IOB6120 commands 1715 00533 4751 JMS @[TTEXTT] ; print the IOB6120 commands 1716 00534 4465 HLPIOB ; ... 1717 00535 4751 HELP4: JMS @[TTEXTT] ; generic help for all models, part 2 1718 00536 4471 HLPP2 ; ... 1719 00537 6225 .POPJ 1720 00547 2607 00550 2600 00551 6400 00552 0172 00553 7740 00554 7747 00555 0073 00556 7746 00557 7737 00560 7750 00561 0027 00562 0130 00563 7637 00564 6246 00565 0230 00566 7066 00567 7705 00570 6642 00571 3177 00572 6600 00573 7210 00574 5621 00575 7200 00576 0076 00577 0177 1721 00600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 34 Command Error Processing bts6120.plx 1722 .TITLE Command Error Processing 1723 1724 1725 ; This routine prints an error message and then restarts the monitor. Unlike 1726 ; nearly every other routine in the monitor this one is called via a JMS 1727 ; instruction rather than a .PUSHJ, and that so that the address of the error 1728 ; message can be passed in line, in the word after the JMS. 1729 ; 1730 ; CALL: 1731 ; JMS @ZERROR 1732 ;
1733 00600 0000 ERROR: 0 ; enter here with a JMS 1734 00601 7200 CLA ; the AC is unknown here 1735 00602 6205 .PUSHJ @[TQUEST] ; always type a question mark 00603 5777 1736 00604 1600 TAD @ERROR ; pick up the address of the message 1737 00605 6205 .PUSHJ @[OUTSTR] ; and type that out too 00606 5776 1738 00607 5527 JMP @ZRESTA ; restart the monitor and read another command PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 35 RP Command -- Repeat bts6120.plx 1739 .TITLE RP Command -- Repeat 1740 1741 1742 ; This command allows the rest of the command line to be repeated, and it 1743 ; accepts an optional argument which specifes the number of times to repeat, 1744 ; in decimal. The range for this argument is 1 to 2047 and if it is omitted, 1745 ; it defaults to 2047. Note that repeat commands may not be nested; a repeat 1746 ; command will cancel any previous repeat on the same command line. Any error 1747 ; or a control-C will terminate the repetition prematurely. 1748 00610 6205 REPEAT: .PUSHJ @ZSPACMP ; Get the next character 00611 5513 1749 00612 7650 SNA CLA ; Is it the end of the command ?? 1750 00613 5225 JMP REPEA1 ; Yes -- use the default count 1751 00614 6205 .PUSHJ @ZBACKUP ; No -- backup the scanner 00615 5515 1752 00616 6205 .PUSHJ @[DECNW] ; Then read a decimal number 00617 5775 1753 00620 6205 .PUSHJ @ZEOLTST ; Then test for the end of the line 00621 5516 1754 1755 ; Set up the repeat counter... 1756 00622 7240 STA ; Subtract one from the user's 1757 00623 1067 TAD WORD ; argument... 1758 00624 7410 SKP ; ... 1759 00625 7350 REPEA1: NL3777 ; If there's no argument, use 2047 1760 00626 3065 DCA REPCNT ; Set the repeat counter 1761 1762 ; Set up the repeat pointer... 1763 00627 1013 TAD L ; Get the current line pointer 1764 00630 3066 DCA REPLOC ; Remember where to start from 1765 00631 1466 TAD @REPLOC ; Then examine the current character 1766 00632 7650 SNA CLA ; Is the repeat the last command on the line ?? 1767 00633 3065 DCA REPCNT ; Yes -- this is all pointless after all 1768 00634 6225 .POPJ ; Then proceed with the next command PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 36 TW, TP, SC Commands - Set Terminal Width, Page and Scope bts6120.plx 1769 .TITLE TW, TP, SC Commands - Set Terminal Width, Page and Scope 1770 1771 1772 ; The TW command sets the terminal screen width to the value of its argument, 1773 ; which is a _decimal_ number. Screen widths are limited to the range 32..255. 1774 00635 6205 TWCOM: .PUSHJ @[DECNW] ; read a decimal operand again 00636 5775 1775 00637 6205 .PUSHJ @ZEOLTST ; then check for the end of the line 00640 5516 1776 00641 1067 TAD WORD ; get the desired width 1777 00642 7450 SNA ; is it zero ?? 1778 00643 5253 JMP TWCOM1 ; yes -- that disables automatic returns 1779 00644 1374 TAD [-32.] ; compare it to 32 1780 00645 7510 SPA ; is it at least 32 ?? 1781 00646 5256 JMP TFILV ; no -- ?ILLEGAL VALUE 1782 00647 1373 TAD [32.-255.] ; now compare it to 255 1783 00650 7540 SMA SZA ; it can't be bigger than that 1784 00651 5256 JMP TFILV ; but it is... 1785 00652 1372 TAD [255.] ; restore the original number 1786 00653 3030 TWCOM1: DCA WIDTH ; and set the terminal width 1787 00654 6222 TWCOM2: CIF 2 1788 00655 5771 JMP @[WRPSS] ; store it in NVRAM if it exists 1789 ; and we're all done 1790 1791 ; Here if the parameter value is illegal... 1792 00656 4531 TFILV: JMS @ZERROR ; yes -- it isn't legal 1793 00657 3432 ERRILV ; ?ILLEGAL VALUE 1794 1795 ; The TP command sets the terminal page size to the value of its argument, 1796 ; in _decimal_. Page sizes may range from 12 to 48, or zero. A value of zero 1797 ; disables the automatic XOFF function completely. 1798 00660 6205 TPCOM: .PUSHJ @[DECNW] ; Read a decimal operand 00661 5775 1799 00662 6205 .PUSHJ @ZEOLTST ; And check for the end of the line 00663 5516 1800 00664 1067 TAD WORD ; Get the value he gave 1801 00665 7450 SNA ; Is it zero ?? 1802 00666 5276 JMP TPCOM1 ; Yes -- that is legal (to disable) 1803 00667 1370 TAD [-12.] ; Compare it to 12 lines 1804 00670 7510 SPA ; We have to have at least that many 1805 00671 5256 JMP TFILV ; No -- ?ILLEGAL VALUE 1806 00672 1374 TAD [16.-48.] ; Then compare it to 48 1807 00673 7540 SMA SZA ; Is it more than that ?? 1808 00674 5256 JMP TFILV ; Yes -- that won't work, either 1809 00675 1367 TAD [48.] ; Restore the original number 1810 00676 3031 TPCOM1: DCA LENGTH ; And set the new terminal length 1811 00677 5254 JMP TWCOM2 1812 1813 ; The SC command sets the SCOPE flag to its operand. When non-zero, the 1814 ; line input command will respond to a DEL with a destructive backspace 1815 ; instead of the default echo. 1816 00700 6205 SCCOM: .PUSHJ @[DECNW] ; Read a decimal operand 00701 5775 1817 00702 6205 .PUSHJ @ZEOLTST ; And check for the end of the line 00703 5516 1818 00704 1067 TAD WORD ; Get the value he gave 1819 00705 3032 DCA SCOPE 1820 00706 5254 JMP TWCOM2 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 37 VE Command - Show System Name and Version bts6120.plx 1821 .TITLE VE Command - Show System Name and Version 1822 1823 1824 ; This routine will type the name and version of the monitor. It is called 1825 ; at startup, and by the VE command. 1826 00707 6205 VECOM: .PUSHJ @ZEOLNXT ; enter here for the VE command 00710 5517 1827 00711 4511 HELLO: JMS @ZINLMES ; type out "SBC6120" 1828 00712 4121 SYSNM0 ; ... 1829 00713 1035 TAD RCFLAG ; check the SBC6120-RC flag 1830 00714 7650 SNA CLA ; skip if this is the SBC6120-RC model 1831 00715 5320 JMP HELLO1 ; nope - this is the original deal 1832 00716 4511 JMS @ZINLMES ; add "-RC" to SBC6120 for this model 1833 00717 4167 SYSNM4 ; ... 1834 00720 4511 HELLO1: JMS @ZINLMES ; type out the name of the system 1835 00721 4127 SYSNM1 ; ... 1836 00722 1366 TAD [VERSION] ; get the present edit level 1837 00723 6205 .PUSHJ @ZTOCT3 ; type that in octal 00724 5505 1838 00725 4511 JMS @ZINLMES ; say 1839 00726 4142 SYSNM2 ; "Checksum " 1840 00727 1765 TAD @[ROMCK0] ; get the checksum of ROM field 0 1841 00730 6205 .PUSHJ @ZTOCT4S ; type that and a space 00731 5504 1842 00732 6211 CDF 1 ; then do the same for ROM field 1 1843 00733 1765 TAD @[ROMCK1] ; ... 1844 00734 6201 CDF 0 ; ... 1845 00735 6205 .PUSHJ @ZTOCT4S ; .... 00736 5504 1846 00737 6221 CDF 2 ; and do the same for ROM field 2 1847 00740 1765 TAD @[ROMCK2] ; ... 1848 00741 6201 CDF 0 ; ... 1849 00742 6205 .PUSHJ @ZTOCT4S ; ... 00743 5504 1850 00744 4511 JMS @ZINLMES ; finally, type the system date 1851 00745 4152 SYSNM3 ; ... 1852 00746 6205 .PUSHJ @ZCRLF ; finish that line 00747 5510 1853 00750 4511 JMS @ZINLMES ; then type the copyright notice 1854 00751 4172 SYSCRN ; ... 1855 00752 6205 .PUSHJ @ZCRLF 00753 5510 1856 00754 5510 JMP @ZCRLF ; finish that line and we're done 1857 00765 0200 00766 0321 00767 0060 00770 7764 00771 0243 00772 0377 00773 7441 00774 7740 00775 6662 00776 6200 00777 7066 1858 01000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 38 E and EP Commands -- Examine Main Memory or Panel Memory bts6120.plx 1859 .TITLE E and EP Commands -- Examine Main Memory or Panel Memory 1860 1861 1862 ; The E command allows the user to examine the contents of memory in octal, 1863 ; either one word at a time or an entire range of addresses. In the latter 1864 ; case a memory dump is printed with eight PDP-8 words per line. It accepts 1865 ; several forms of operands, for example: 1866 ; 1867 ; >E 1234 -> Examine location 1234 in the data field 1868 ; >E 01234 -> Examime location 1234 of field zero 1869 ; >E 41234 -> Examine location 1234, field 4 1870 ; >E 71000-2000 -> Examine locations 1000 through 2000, field 7 1871 ; >E 50000-77777 -> Examine location 0, field 5 thru 7777, field 7 1872 ; 1873 ; The EP command is identical to E, except that panel memory is examined 1874 ; rather than main memory. 1875 1876 ; Enter here for the EP command... 1877 01000 7240 EPMEM: STA ; set the PNLMEM flag 1878 01001 7410 SKP ; fall into the regular code 1879 ; Enter here for the E command... 1880 01002 7200 EMEM: CLA ; clear the PNLMEM flag 1881 01003 3041 DCA PNLMEM ; to reference main memory 1882 1883 ; Both forms join up here... 1884 01004 6205 EMEM0: .PUSHJ @ZRANGE ; go read an address range 01005 5522 1885 01006 7420 SNL ; was there just one address ??? 1886 01007 5242 JMP EONE ; yes -- just examine one location 1887 1888 ; Fix up the address range for multiple word examines... 1889 01010 1043 TAD LOW ; get the low boundry 1890 01011 0377 AND [7770] ; round it down to a multiple of 8 1891 01012 3037 DCA ADDR ; then it becomes the starting address 1892 01013 1042 TAD HIGH ; get the ending address 1893 01014 0377 AND [7770] ; round it up to a multiple of 8 1894 01015 1137 TAD ZK7 ; ... 1895 01016 3042 DCA HIGH ; and remember the last address to process 1896 1897 ; Type out lines of 8 memory locations... 1898 01017 6205 EMEM1: .PUSHJ @[TADDR] ; type out the address of the next word 01020 5776 1899 01021 6205 EMEM2: .PUSHJ @ZRDMEM ; go read a word from main memory 01022 5525 1900 01023 6205 .PUSHJ @ZTOCT4S ; type the word in octal 01024 5504 1901 01025 6205 .PUSHJ @ZTSTADR ; have we done all the locations ?? 01026 5523 1902 01027 7430 SZL ; are we there yet ??? 1903 01030 5244 JMP EMEM3 ; yes -- finish the line and return 1904 01031 6205 .PUSHJ @ZNXTADR ; no -- increment to the next address 01032 5524 1905 01033 1037 TAD ADDR ; get the current address 1906 01034 0137 AND ZK7 ; is it a multiple of 8 ?? 1907 01035 7640 SZA CLA ; ??? 1908 01036 5221 JMP EMEM2 ; no -- keep typing 1909 01037 6205 .PUSHJ @ZCRLF ; yes -- start on a new line 01040 5510 1910 01041 5217 JMP EMEM1 ; and type the next address 1911 1912 ; Here to examine a single memory location... 1913 01042 6205 EONE: .PUSHJ @[TMEM] ; type out the contents of memory 01043 5775 1914 ; and fall into the next range 1915 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 39 E and EP Commands -- Examine Main Memory or Panel Memory bts6120.plx 1916 ; Here when we've finished examining one range of addresses... 1917 01044 6205 EMEM3: .PUSHJ @ZCRLF ; finish the current line 01045 5510 1918 01046 6205 .PUSHJ @ZBACKUP ; backup the command line pointer 01047 5515 1919 01050 6205 .PUSHJ @ZSPACMP ; ... and get the next character 01051 5513 1920 01052 7450 SNA ; is it the end of the line ?? 1921 01053 6225 .POPJ ; yes -- just stop now 1922 01054 1374 TAD [-","] ; no -- check for a comma 1923 01055 7640 SZA CLA ; ???? 1924 01056 5530 JMP @ZCOMERR ; this isn't legal 1925 01057 5204 JMP EMEM0 ; yes -- do another operand 1926 1927 ; This routine will type the address and contents of the memory location 1928 ; indicated by registers ADDR and ADRFLD. 1929 01060 6205 TMEM: .PUSHJ @[TADDR] ; first type the address 01061 5776 1930 01062 6205 .PUSHJ @ZRDMEM ; then load the indicated word 01063 5525 1931 01064 5504 JMP @ZTOCT4S ; type it out and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 40 D and DP Commands -- Deposit in Main Memory or Panel Memory bts6120.plx 1932 .TITLE D and DP Commands -- Deposit in Main Memory or Panel Memory 1933 1934 1935 ; The D command allows the user to deposit one or more words in memory. The 1936 ; general format is: 1937 ; 1938 ; >D 60123 4567 -> Deposit 4567 into location 0123, field 6 1939 ; >D 40000 1,2,3,4 -> Deposit 0001 into location 0, field 4, and 0002 1940 ; into location 1, field 4, and 0003 into location 1941 ; 2, etc... 1942 ; 1943 ; The DP command is identical to D, except that panel memory is chaged rather 1944 ; than main memory. WARNING - there is no protection against changing the 1945 ; monitor when using this command, so it's up to the user to make sure the 1946 ; changes don't corrupt something important! 1947 1948 ; Enter here for the DP command... 1949 01065 7240 DPMEM: STA ; set the PNLMEM flag 1950 01066 7410 SKP ; fall into the regular code 1951 ; Enter here for the D command... 1952 01067 7200 DMEM: CLA ; clear the PNLMEM flag 1953 01070 3041 DCA PNLMEM ; to reference main memory 1954 1955 ; Both forms join up here... 1956 01071 6205 .PUSHJ @[RDADDR] ; Then read an address 01072 5773 1957 01073 6205 .PUSHJ @[SPATST] ; the next character has to be a space 01074 5772 1958 1959 ; Read words of data and deposit them... 1960 01075 6205 DMEM1: .PUSHJ @ZOCTNW ; read an octal operand 01076 5521 1961 01077 1067 TAD WORD ; get the data we found 1962 01100 6205 .PUSHJ @ZDANDV ; write and verify it 01101 5526 1963 01102 6205 .PUSHJ @ZNXTADR ; advance to the next address 01103 5524 1964 01104 6205 .PUSHJ @ZSPACM0 ; get the break character from OCTNW 01105 5514 1965 01106 7450 SNA ; was it the end of the line ?? 1966 01107 6225 .POPJ ; yes, we're done... 1967 01110 1374 TAD [-","] ; no - it has to be a comma otherwise 1968 01111 7640 SZA CLA ; ???? 1969 01112 5530 JMP @ZCOMERR ; bad command 1970 01113 5275 JMP DMEM1 ; go read and deposit another word PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 41 ER and DR Commands - Examine and Deposit in Registers bts6120.plx 1971 .TITLE ER and DR Commands - Examine and Deposit in Registers 1972 1973 1974 ; The ER command examines either a single register, when the register name 1975 ; is given as an argument, or all registers when no argument is given. For 1976 ; example: 1977 ; 1978 ; >ER AC - examine the AC 1979 ; >ER PC - examine the PC 1980 ; >ER - print all registers 1981 ; 1982 01114 6205 EREG: .PUSHJ @ZSPACMP ; get the next non-space character 01115 5513 1983 01116 7650 SNA CLA ; is it the end of line? 1984 01117 5771 JMP @[REGLSC] ; yes - type all registers and return 1985 01120 6205 .PUSHJ @ZBACKUP ; nope - backup the command scanner 01121 5515 1986 01122 6205 .PUSHJ @[NAMENW] ; and go read the register name 01123 5770 1987 01124 6205 .PUSHJ @ZEOLNXT ; now we have to be at the end of line 01125 5517 1988 01126 1367 TAD [ENAMES-1] ; point to the name table 1989 01127 6205 .PUSHJ @[MATCH] ; find it and call a routine to print 01130 5766 1990 01131 5510 JMP @ZCRLF ; finish the line and we're done 1991 1992 ; The DR command deposits a value in a register, and both a register name and 1993 ; an octal value are required arguments. For example: 1994 ; 1995 ; >DR AC 7777 - set the AC to 7777 1996 ; >DR SR 3345 - set the switch register to 3345 1997 ; 1998 01132 6205 DREG: .PUSHJ @[NAMENW] ; get the register name 01133 5770 1999 01134 6205 .PUSHJ @[SPANXT] ; the terminator has to be a space 01135 5765 2000 01136 6205 .PUSHJ @ZOCTNW ; read an octal number to deposit 01137 5521 2001 01140 6205 .PUSHJ @ZEOLTST ; followed by the end of the line 01141 5516 2002 01142 1364 TAD [DNAMES-1] ; point to the list of deposit names 2003 01143 5766 JMP @[MATCH] ; call the right routine and we're done 2004 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 42 Initialize Terminal, Breakpoint, Partition Map, etc bts6120.plx 2005 .TITLE Initialize Terminal, Breakpoint, Partition Map, etc 2006 2007 2008 01144 1363 RAMINIT: TAD [80.] ; the default terminal width is 80 2009 01145 3030 DCA WIDTH ; ... 2010 01146 3031 DCA LENGTH ; and automatic XOFF is disabled 2011 01147 6205 .PUSHJ @[CLRCPU] ; clear the saved user context 01150 5762 2012 01151 6205 .PUSHJ @[BPTCLR] ; clear the breakpoint tables 01152 5761 2013 01153 4532 JMS @ZPUSHJ1 ; (cross field call) 2014 01154 1713 INIPMP ; initialize the IDE disk partition map 2015 01155 6222 CIF 2 2016 01156 5760 JMP @[RDPSS] ; if NVRAM present, possibly overwrite some 2017 ; of these settings with stored ones 2018 01160 0201 01161 2026 01162 2312 01163 0120 01164 3361 01165 4637 01166 6642 01167 3345 01170 6600 01171 1240 01172 4641 01173 6435 01174 7724 01175 1060 01176 6417 01177 7770 2019 01200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 43 Deposit in Registers bts6120.plx 2020 .TITLE Deposit in Registers 2021 2022 2023 ; Here to deposit in the AC... 2024 01200 1067 DAC: TAD WORD ; Get his value 2025 01201 3001 DCA UAC ; And change the AC 2026 01202 6225 .POPJ ; Then that's all 2027 2028 ; Here to deposit in the PC... 2029 01203 1067 DPC: TAD WORD ; The same old routine... 2030 01204 3000 DCA UPC ; ... 2031 01205 5777 JMP @[EXMEM] ; sync the display with the new PC 2032 2033 ; Here to deposit in the MQ... 2034 01206 1067 DMQ: TAD WORD ; ... 2035 01207 3003 DCA UMQ ; ... 2036 01210 6225 .POPJ ; ... 2037 2038 ; Here to deposit in the PS... 2039 01211 1067 DPS: TAD WORD ; ... 2040 01212 0376 AND [6277] ; only these bits can actually change 2041 01213 7421 MQL ; save the new value for a minute 2042 01214 1002 TAD UFLAGS ; get the current status 2043 01215 0375 AND [1500] ; clear the complementary bits 2044 01216 7501 MQA ; or everything together 2045 01217 3002 DCA UFLAGS ; and update the PS 2046 01220 5777 JMP @[EXMEM] ; sync the display with the new IF 2047 2048 ; Here to deposit in the switch register... 2049 01221 1067 DSR: TAD WORD ; ... 2050 01222 6246 WSR ; Load the switch register 2051 01223 6225 .POPJ ; Then that's all 2052 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 44 Examine Registers bts6120.plx 2053 .TITLE Examine Registers 2054 2055 2056 ; This routine is called to type out all the important internal registers. 2057 ; It is used by the ER, and SI commands, and after breakpoints, traps and 2058 ; halts. 2059 01224 7200 REGLST: CLA ; be sure the AC is cleared 2060 01225 6205 .PUSHJ TYPEPC ; type the PC first 01226 5255 2061 01227 6205 .PUSHJ TYPEPS ; then the LINK 01230 5265 2062 01231 6205 .PUSHJ TYPEAC ; then the AC 01232 5252 2063 01233 6205 .PUSHJ TYPEMQ ; then the MQ 01234 5260 2064 01235 6205 .PUSHJ TYPSP1 ; user stack pointer 1 01236 5270 2065 01237 5273 JMP TYPSP2 ; and finally stack pointer 2 2066 2067 ; The same as REGLST, but with a carriage return added... 2068 01240 6205 REGLSC: .PUSHJ REGLST ; first type the registers 01241 5224 2069 01242 5510 JMP @ZCRLF ; type the carriage return and we're done 2070 2071 ; This routine types a register name followed by an octal register value. 2072 ; The latter is passed in the AC, and the register name is passed inline. 2073 01243 0000 TYPRG4: 0 ; enter here with a JMS instruction 2074 01244 3046 DCA VALUE ; save the register contents for a moment 2075 01245 1643 TAD @TYPRG4 ; and get the address of the register name 2076 01246 6205 .PUSHJ @[OUTSTR] ; type that 01247 5774 2077 01250 1046 TAD VALUE ; get the contents of the register 2078 01251 5504 JMP @ZTOCT4S ; type that in octal and leave a blank 2079 2080 ; This routine will type the last user AC contents... 2081 01252 1001 TYPEAC: TAD UAC ; get the contents of the register 2082 01253 4243 JMS TYPRG4 ; type it and return 2083 01254 3713 ACNAME ; "AC>" 2084 2085 ; This routine will type the last user PC... 2086 01255 1000 TYPEPC: TAD UPC ; the same old routine... 2087 01256 4243 JMS TYPRG4 ; ... 2088 01257 3716 PCNAME ; "PC>" 2089 2090 ; This routine will type the last user MQ contents... 2091 01260 1003 TYPEMQ: TAD UMQ ; ... 2092 01261 4243 JMS TYPRG4 ; ... 2093 01262 3721 MQNAME ; "MQ>" 2094 2095 ; This routine will type the last instruction executed... 2096 01263 6222 TYPEIR: CIF 2 2097 01264 5773 JMP @[XTYPIR] 2098 2099 ; This routine will type the current interrupt flags... 2100 01265 1002 TYPEPS: TAD UFLAGS ; get the flags 2101 01266 4243 JMS TYPRG4 ; ... 2102 01267 3732 PSNAME ; "PS>" 2103 2104 ; This routine will type the 6120 stack pointer #1... 2105 01270 1004 TYPSP1: TAD USP1 ; ... 2106 01271 4243 JMS TYPRG4 ; ... 2107 01272 3735 SP1NAM ; "SP1>" 2108 2109 ; This routine will type the 6120 stack pointer #2... 2110 01273 1005 TYPSP2: TAD USP2 ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 45 Examine Registers bts6120.plx 2111 01274 4243 JMS TYPRG4 ; ... 2112 01275 3741 SP2NAM ; "SP2>" 2113 2114 ; This routine will type the current switch register contents... 2115 01276 7604 TYPESR: LAS ; actually read the switch register 2116 01277 4243 JMS TYPRG4 ; ... 2117 01300 3727 SRNAME ; "SR>" PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 46 Read and Write Memory bts6120.plx 2118 .TITLE Read and Write Memory 2119 2120 2121 ; This routine will change the current data field to the field indicated in 2122 ; location ADRFLD. It's normally used by commands that read or write memory, 2123 ; such as Examine, Deposit, etc. Remember that on the 6120 the EMA works in 2124 ; panel memory as well, so don't forget to change back to field zero after 2125 ; you're done! 2126 01301 7200 CFIELD: CLA ; ... 2127 01302 1040 TAD ADRFLD ; get the desired field number 2128 01303 0136 AND ZK70 ; just in case! 2129 01304 1372 TAD [CDF 0] ; and make a CDF instruction 2130 01305 3306 DCA .+1 ; store that in memory 2131 01306 0000 0 ; isn't self manipulation wonderful? 2132 01307 6225 .POPJ ; that's all 2133 2134 ; This routine will set or clear the panel data flag according to the state 2135 ; of the PNLMEM flag. If PNLMEM is non-zero, the panel data flag is set and 2136 ; commands that access memory (e.g. Examine, Deposit, etc) access panel memory 2137 ; instead. If PNLMEM is zero, then the panel data flag is cleared and these 2138 ; commands access main memory. 2139 01310 7200 CPANEL: CLA ; don't expect anything from the caller 2140 01311 6276 SPD ; assume we're referencing panel memory 2141 01312 1041 TAD PNLMEM ; but get the flag to be sure 2142 01313 7650 SNA CLA ; non-zero means access panel memory 2143 01314 6266 CPD ; we were wrong - use main memory instead 2144 01315 6225 .POPJ ; and we're done 2145 2146 ; This short routine returns, in the AC and memory location VALUE, the 2147 ; contents of the memory location addressed by ADDR and ADRFLD. If PNLMEM is 2148 ; non-zero it reads panel memory to get the data; otherwise it reads main 2149 ; memory... 2150 01316 6205 RDMEM: .PUSHJ CFIELD ; first select the proper field 01317 5301 2151 01320 6205 .PUSHJ CPANEL ; then select main memory or panel memory 01321 5310 2152 01322 1437 TAD @ADDR ; load the data 2153 01323 3046 DCA VALUE ; save the contents in VALUE 2154 01324 1046 TAD VALUE ; and also return it in the AC 2155 01325 6276 SPD ; back to panel memory 2156 01326 6201 CDF 0 ; and back to the monitor's field 2157 01327 6225 .POPJ ; that's all there is 2158 2159 ; This routine will deposit the contents of the AC into the memory location 2160 ; specified by ADRFLD, ADDR and PNLMEM. It's the complement of RDMEM... 2161 01330 3046 WRMEM: DCA VALUE ; save the number to deposit 2162 01331 6205 .PUSHJ CFIELD ; be sure we're in the right field 01332 5301 2163 01333 6205 .PUSHJ CPANEL ; and the right memory space (panel vs main) 01334 5310 2164 01335 1046 TAD VALUE ; get the value back again 2165 01336 3437 DCA @ADDR ; store the data 2166 01337 6276 SPD ; back to panel memory 2167 01340 6201 CDF 0 ; and the monitor's data field 2168 01341 6225 .POPJ ; and return 2169 2170 ; This routine is just like WRMEM, except that it will read back the value 2171 ; deposited and verify that it is, in fact, correct! If it isn't (i.e. there's 2172 ; no memory at that address or the memory there isn't working) a ?MEM ERR 2173 ; message is generated and this command is aborted. 2174 01342 3367 DANDV: DCA GOOD ; save the original, good, value 2175 01343 1367 TAD GOOD ; ... 2176 01344 6205 .PUSHJ WRMEM ; store it 01345 5330 2177 01346 6205 .PUSHJ RDMEM ; read it back PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 47 Read and Write Memory bts6120.plx 01347 5316 2178 01350 7041 CIA ; make what we read negative 2179 01351 1367 TAD GOOD ; and compare it to the desired value 2180 01352 7650 SNA CLA ; did they match ?? 2181 01353 6225 .POPJ ; yes -- this memory is ok 2182 2183 ; Type a "?MEM ERR AT faaaa ..." message 2184 01354 4511 JMS @ZINLMES ; type out the first part of the message 2185 01355 3415 MEMMSG ; ... 2186 01356 6205 .PUSHJ @[TADDR] ; then type the address of the error 01357 5771 2187 01360 1367 TAD GOOD ; get the expected value 2188 01361 6205 .PUSHJ @ZTOCT4S ; type that out first 01362 5504 2189 01363 6205 .PUSHJ @ZRDMEM ; read what we actually get from memory 01364 5525 2190 01365 6205 .PUSHJ @ZTOCT4M ; then type that with a CRLF 01366 5503 2191 2192 ; Temporary storage for DANDV... 2193 01367 GOOD: .BLOCK 1 ; the "good" value we wrote to memory 01371 6417 01372 6201 01373 0712 01374 6200 01375 1500 01376 6277 01377 5751 2194 01400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 48 BM Command -- Memory Block Move bts6120.plx 2195 .TITLE BM Command -- Memory Block Move 2196 2197 2198 ; The BM command is used to move blocks of memory words from one location to 2199 ; another. It has three parameters - the source address range (two 15 bit 2200 ; numbers), and the destination address (a single 15 bit number). All words 2201 ; from the starting source address to the ending source address are transferred 2202 ; to the corresponding words starting at the destination address. More than 2203 ; one field may be transferred, and transfers may cross a field boundry. 2204 ; 2205 ; >BM 200-377 400 -> move all of page 1 in the current data field 2206 ; to page 2 of the same field. 2207 ; >BM 0-7777 10000 -> move all of field 0 to field 1 2208 ; >BM 00000-37777 40000 -> move fields 0 thru 3 to fields 4 thru 7 2209 ; 2210 ; Note that this command operates only on main memory - there is no 2211 ; corresponding block move command for panel memory! 2212 ; 2213 01400 6205 BMOVE: .PUSHJ @ZRANGE ; read the source address range 01401 5522 2214 01402 7420 SNL ; did he give 2 numbers ??? 2215 01403 5530 JMP @ZCOMERR ; no -- don't allow a one address range 2216 01404 6205 .PUSHJ @[RDADDR] ; now read the destination 01405 5777 2217 01406 6205 .PUSHJ @ZEOLTST ; this should be the end of the command 01407 5516 2218 01410 3041 DCA PNLMEM ; this command ALWAYS operates on main memory 2219 2220 ; Now copy words from the source to the destination... 2221 01411 6205 MOVE1: .PUSHJ @[SWPADR] ; swap the LOW/LOWFLD (the source address) 01412 5776 2222 01413 6205 .PUSHJ @ZRDMEM ; read a word from the source 01414 5525 2223 01415 6205 .PUSHJ @ZTSTADR ; go see if this is the last address 01416 5523 2224 01417 7630 SZL CLA ; is it the end ??? 2225 01420 7240 STA ; yes -- load -1 into the AC 2226 01421 3071 DCA COUNT ; and remember that fact for later 2227 01422 6205 .PUSHJ @ZNXTADR ; now increment the source address 01423 5524 2228 01424 6205 .PUSHJ @[SWPADR] ; swap the source back into LOW/LOWFLD 01425 5776 2229 01426 1046 TAD VALUE ; get the data we read from the source 2230 01427 6205 .PUSHJ @ZDANDV ; and deposit it in the destination 01430 5526 2231 01431 6205 .PUSHJ @ZNXTADR ; increment the destination address too 01432 5524 2232 01433 7430 SZL ; did we wrap out of field 7 ??? 2233 01434 5240 JMP MOVE2 ; yes -- stop here 2234 01435 2071 ISZ COUNT ; have we copied all the words ?? 2235 01436 5211 JMP MOVE1 ; no -- keep looping 2236 01437 6225 .POPJ ; yes -- that's all 2237 2238 ; Here if the destination address runs out of field 7... 2239 01440 4531 MOVE2: JMS @ZERROR ; don't allow that to continue 2240 01441 3466 ERRWRP ; ?WRAP AROUND PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 49 CK Command -- Checksum Memory bts6120.plx 2241 .TITLE CK Command -- Checksum Memory 2242 2243 2244 ; This command will compute the checksum of all memory locations between the 2245 ; two addresses specified and the resulting 12 bit value is then printed 2246 ; on the terminal. This is useful for testing memory, comparing blocks of 2247 ; memory, and so on. Note that the checksum algorithm used rotates the 2248 ; accumulator one bit between each words, so blocks of memory with identical 2249 ; contents in different orders will give different results. 2250 ; 2251 ; >CK 10000-10177 -> checksum all of page 0, field 1 2252 ; 2253 ; Note that this command operates only on main memory - there is no 2254 ; corresponding command for panel memory! 2255 01442 6205 CKMEM: .PUSHJ @ZRANGE ; read a two address range 01443 5522 2256 01444 7420 SNL ; two addresses are required 2257 01445 5530 JMP @ZCOMERR ; ... 2258 01446 6205 .PUSHJ @ZEOLTST ; be sure this is the end of the command 01447 5516 2259 01450 3041 DCA PNLMEM ; this command ALWAYS operates on main memory 2260 01451 3050 DCA CHKSUM ; and clear the checksum accumulator 2261 2262 ; Read words and checksum them... 2263 01452 1050 CKMEM1: TAD CHKSUM ; get the previous total 2264 01453 7104 CLL RAL ; and shift it left one bit 2265 01454 7430 SZL ; did we shift out a one ?? 2266 01455 7001 IAC ; yes -- shift it in the right end 2267 01456 3050 DCA CHKSUM ; save that for a while 2268 01457 6205 .PUSHJ @ZRDMEM ; and go read a word from real memory 01460 5525 2269 01461 1050 TAD CHKSUM ; add it to the checksum 2270 01462 3050 DCA CHKSUM ; save the new checksum 2271 01463 6205 .PUSHJ @ZTSTADR ; compare the addresses next 01464 5523 2272 01465 7430 SZL ; are we all done ?? 2273 01466 5277 JMP TCKSUN ; yes -- type the checksum and return 2274 01467 6205 .PUSHJ @ZNXTADR ; no -- increment the address 01470 5524 2275 01471 5252 JMP CKMEM1 ; and proceed 2276 2277 ; This routine will type out the checksum currently contained in location 2278 ; CHKSUM. If the checksum isn't zero, it will type a question mark (making 2279 ; a pseudo error message) first... 2280 01472 1050 TCKSUM: TAD CHKSUM ; see if the checksum is zero 2281 01473 7650 SNA CLA ; ??? 2282 01474 5277 JMP TCKSUN ; yes -- type it normally 2283 01475 6205 .PUSHJ @[TQUEST] ; no -- type a question mark first 01476 5775 2284 2285 ; Now type the checksum... 2286 01477 4511 TCKSUN: JMS @ZINLMES ; type out the checksum message 2287 01500 3404 CKSMSG ; ... 2288 01501 1050 TAD CHKSUM ; get the actual checksum 2289 01502 5502 JMP @ZTOCT4C ; type it with a CRLF and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 50 CM and FM Commands -- Clear Memory and Fill Memory bts6120.plx 2290 .TITLE CM and FM Commands -- Clear Memory and Fill Memory 2291 2292 2293 ; The FM command fills a range of memory locations with a constant. For 2294 ; example: 2295 ; 2296 ; >FM 7402 0-7777 -> fill all of field zero with HLT instructions 2297 ; >FM 7777 0-77777 -> fill all of memory with -1 2298 ; 2299 ; The second and third arguments (the address range) may be omitted, in 2300 ; which case all of memory is filled. 2301 ; 2302 ; Note that this command operates only on main memory - there is no 2303 ; corresponding command for panel memory! 2304 01503 6205 FLMEM: .PUSHJ @ZOCTNW ; read the constant to fill with 01504 5521 2305 01505 1067 TAD WORD ; get the desired value 2306 01506 5312 JMP CMEM0 ; then join the CM command 2307 2308 ; The CM command is identical to FM, except that the fill value is always 2309 ; zero (hence the name - "Clear" memory). For example: 2310 ; 2311 ; >CM 50000 57777 -> clear all of field 5 2312 ; >CM -> (with no arguments) clear all of memory! 2313 ; 2314 ; Like FM, this command operates only on main memory. There is no 2315 ; equivalent for panel memory. 2316 01507 6205 CMEM: .PUSHJ @ZGET ; advance the scanner to the break character 01510 5520 2317 01511 7200 CLA ; and throw it away for now 2318 01512 3046 CMEM0: DCA VALUE ; and fill with zeros 2319 01513 3037 DCA ADDR ; initialize the address range to start 2320 01514 3040 DCA ADRFLD ; at location 0000, field 0 2321 01515 7240 STA ; and to finish at location 7777, 2322 01516 3042 DCA HIGH ; ... 2323 01517 1136 TAD ZK70 ; field 7 2324 01520 3044 DCA HGHFLD ; ... 2325 01521 3041 DCA PNLMEM ; this command ALWAYS operates on main memory 2326 2327 ; See if there is an address range... 2328 01522 6205 .PUSHJ @ZSPACM0 ; get the break character 01523 5514 2329 01524 7650 SNA CLA ; is there any more out there ?? 2330 01525 5334 JMP CMEM1 ; no -- start filling 2331 01526 6205 .PUSHJ @ZBACKUP ; yes - backup to the first character 01527 5515 2332 01530 6205 .PUSHJ @ZRANGE ; and read the address range 01531 5522 2333 01532 6205 .PUSHJ @ZEOLTST ; then check for the end of the line 01533 5516 2334 2335 ; Clear/set memory locations... 2336 01534 1046 CMEM1: TAD VALUE ; get the value to store 2337 01535 6205 .PUSHJ @ZDANDV ; store it and verify 01536 5526 2338 01537 6205 .PUSHJ @ZTSTADR ; see if we have done all the addresses 01540 5523 2339 01541 7430 SZL ; well ?? 2340 01542 6225 .POPJ ; yes -- we can stop now 2341 01543 6205 .PUSHJ @ZNXTADR ; no -- increment the address field 01544 5524 2342 01545 5334 JMP CMEM1 ; then go clear this word PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 51 X / XP Command Stubs -- Disassemble memory bts6120.plx 2343 .TITLE X / XP Command Stubs -- Disassemble memory 2344 2345 ; stubs in field 0 call actual functions in field 2 2346 01546 6223 DISASM: CXF 2 2347 01547 5774 JMP @[CMDX] 2348 2349 01550 6223 DISASMP: CXF 2 2350 01551 5773 JMP @[CMDXP] 2351 01573 0603 01574 0600 01575 7066 01576 6540 01577 6435 2352 01600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 52 WS Command -- Word Search Memory bts6120.plx 2353 .TITLE WS Command -- Word Search Memory 2354 2355 2356 ; The WS command searches memory for a specific bit pattern. It accepts up 2357 ; to 4 operands: (1) the value to search for, (2) the starting search address, 2358 ; (3) the final search address, and (4) a search mask. All values except the 2359 ; first are optional and have appropriate defaults. Any location in the 2360 ; specified range which matches the given value after being masked is typed 2361 ; out along with its address. For example: 2362 ; 2363 ; >WS 6031 -> search all of memory for KSF instructions 2364 ; >WS 6031 30000-33777 -> search words 0..3377 of field 3 for KSFs 2365 ; >WS 6030 0-77777 7770 -> search memory for any keyboard IOTs 2366 ; 2367 ; N.B. this command operates only on main memory and there is no equivalent 2368 ; for panel memory. 2369 2370 ; Read the first (required) operand and set defaults for all the rest... 2371 01600 6205 SEARCH: .PUSHJ @ZOCTNW ; read the value to search for 01601 5521 2372 01602 1067 TAD WORD ; then get that 2373 01603 3272 DCA KEY ; and save it 2374 01604 3037 DCA ADDR ; set the starting address to 0 2375 01605 3040 DCA ADRFLD ; in field 0 2376 01606 7240 STA ; then stop at location 7777 2377 01607 3042 DCA HIGH ; ... 2378 01610 1136 TAD ZK70 ; field 7 2379 01611 3044 DCA HGHFLD ; ... 2380 01612 7240 STA ; and set the mask to 7777 2381 01613 3273 DCA MASK ; ... 2382 01614 3041 DCA PNLMEM ; this command _always_ searches main memory 2383 2384 ; Try to read any optional operands... 2385 01615 1052 TAD SAVCHR ; is there any more there ?? 2386 01616 7650 SNA CLA ; ??? 2387 01617 5233 JMP SEAR1 ; no -- start looking 2388 01620 6205 .PUSHJ @ZRANGE ; yes -- read the address range 01621 5522 2389 01622 1052 TAD SAVCHR ; is there a mask out there ?? 2390 01623 7650 SNA CLA ; ??? 2391 01624 5233 JMP SEAR1 ; no -- start looking 2392 01625 6205 .PUSHJ @ZOCTNW ; yes -- read the mask too 01626 5521 2393 01627 1067 TAD WORD ; load the mask 2394 01630 3273 DCA MASK ; and save that for later 2395 01631 6205 .PUSHJ @ZEOLTST ; this has to be the end of the line 01632 5516 2396 2397 ; Here to start the search... 2398 01633 3071 SEAR1: DCA COUNT ; count the number of matches we find 2399 01634 1272 TAD KEY ; get the search key 2400 01635 0273 AND MASK ; apply the mask to it too 2401 01636 7041 CIA ; make it negative 2402 01637 3272 DCA KEY ; and remember that instead 2403 2404 ; Look through memory for matches... 2405 01640 6205 SEAR2: .PUSHJ @ZINCHRS ; poll the operator for control-C 01641 5512 2406 01642 6205 .PUSHJ @ZRDMEM ; read a word from real memory 01643 5525 2407 01644 0273 AND MASK ; apply the mask to it 2408 01645 1272 TAD KEY ; and compare to the value 2409 01646 7640 SZA CLA ; does it match ?? 2410 01647 5256 JMP SEAR3 ; no -- skip it 2411 01650 6205 .PUSHJ @[TMEM] ; yes -- type the address and contents PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 53 WS Command -- Word Search Memory bts6120.plx 01651 5777 2412 01652 6205 .PUSHJ @ZCRLF ; then finish the line 01653 5510 2413 01654 7240 STA ; make the AC non-zero 2414 01655 3071 DCA COUNT ; and remember that we found a match 2415 01656 6205 SEAR3: .PUSHJ @ZTSTADR ; see if we have looked everywhere 01657 5523 2416 01660 7430 SZL ; well ?? 2417 01661 5265 JMP SEAR4 ; yes -- finish up now 2418 01662 6205 .PUSHJ @ZNXTADR ; no -- increment the address 01663 5524 2419 01664 5240 JMP SEAR2 ; and keep looking 2420 2421 ; Here at the end of the search... 2422 01665 1071 SEAR4: TAD COUNT ; see how many matches there were 2423 01666 7640 SZA CLA ; were there any at all ?? 2424 01667 6225 .POPJ ; yes -- that's fine 2425 01670 4531 JMS @ZERROR ; no -- give an error message 2426 01671 3444 ERRSRF ; ? SEARCH FAILS 2427 2428 ; Temporary storage for the SEARCH routine... 2429 01672 KEY: .BLOCK 1 ; a search key 2430 01673 MASK: .BLOCK 1 ; a search mask 2431 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 54 BL Command -- List Breakpoints bts6120.plx 2432 .TITLE BL Command -- List Breakpoints 2433 2434 2435 ; This command will list all the breakpoints which are currently set in 2436 ; the user's program. It has no operands... 2437 ; 2438 ; >BL 2439 ; 2440 01674 6205 BLIST: .PUSHJ @ZEOLNXT ; there should be no more 01675 5517 2441 01676 6205 .PUSHJ BSETUP ; set up X1, X2 and COUNT 01677 5324 2442 01700 3046 DCA VALUE ; count the number of breakpoints here 2443 2444 ; Loop through the breakpoint table and list all valid breakpoints... 2445 01701 1410 BLIST1: TAD @X1 ; get the address of this breakpoint 2446 01702 3037 DCA ADDR ; and remember that 2447 01703 1411 TAD @X2 ; then get the corresponding field 2448 01704 3040 DCA ADRFLD ; ... 2449 01705 1037 TAD ADDR ; let's see that address again 2450 01706 7650 SNA CLA ; is there really a breakpoint set here ?? 2451 01707 5315 JMP BLIST2 ; no -- on to the next one 2452 01710 6205 .PUSHJ @[TMEM] ; yes -- type out the address and memory 01711 5777 2453 01712 6205 .PUSHJ @ZCRLF ; finish this line 01713 5510 2454 01714 2046 ISZ VALUE ; and count the number we find 2455 01715 2071 BLIST2: ISZ COUNT ; are there more breakpoints to do? 2456 01716 5301 JMP BLIST1 ; yes - keep going 2457 2458 ; Here after going through the table... 2459 01717 1046 TAD VALUE ; see how many we found 2460 01720 7640 SZA CLA ; any at all ?? 2461 01721 6225 .POPJ ; yes -- that's great 2462 01722 4531 JMS @ZERROR ; no -- print an error message 2463 01723 3655 ERRNBP ; ?NONE SET 2464 2465 ; This routine will set up the pointers for traversing the break point 2466 ; table. X1 always points to the break point address table, X2 points to 2467 ; the break point field table, and X3 points to the break point data table. 2468 ; COUNT is initialized to the negative of the table size (all three tables 2469 ; are the same size) so that it can be used as an ISZ counter. This same 2470 ; arrangement of pointers is used by all the routines that operate on 2471 ; breakpoints. 2472 01724 7200 BSETUP: CLA ; just in case... 2473 01725 1376 TAD [BPTADR-1] ; X1 points to the address table 2474 01726 3010 DCA X1 ; ... 2475 01727 1375 TAD [BPTFLD-1] ; X2 points to the field table 2476 01730 3011 DCA X2 ; ... 2477 01731 1374 TAD [BPTDAT-1] ; X3 points to the data table 2478 01732 3012 DCA X3 ; ... 2479 01733 1373 TAD [-MAXBPT] ; and COUNT is the table size 2480 01734 3071 DCA COUNT ; ... 2481 01735 3041 DCA PNLMEM ; break points always refer to main memory! 2482 01736 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 55 Search for Breakpoints bts6120.plx 2483 .TITLE Search for Breakpoints 2484 2485 2486 ; This routine will search the breakpoint table to see if there is a one set 2487 ; at the location specified by ADDR and ADRFLD. If one is found, it will 2488 ; return with the LINK set and with X1/X2 pointing to the table entry. If 2489 ; there is no breakpoint at the specified address, it returns with the LINK 2490 ; cleared. 2491 01737 6205 BPTFND: .PUSHJ BSETUP ; set up X1, X2 and COUNT 01740 5324 2492 2493 ; Look through the entire table... 2494 01741 1410 BPTFN1: TAD @X1 ; get this breakpoint address 2495 01742 7450 SNA ; is there breakpoint here at all ?? 2496 01743 5357 JMP BPTFN2 ; no -- just forget it 2497 01744 7041 CIA ; make this address negative 2498 01745 1037 TAD ADDR ; and compare to what we want 2499 01746 7640 SZA CLA ; does it match ?? 2500 01747 5357 JMP BPTFN2 ; no -- on to the next one 2501 01750 1411 TAD @X2 ; yes -- get the field number 2502 01751 7041 CIA ; make that negative 2503 01752 1040 TAD ADRFLD ; and compare to the field we need 2504 01753 7640 SZA CLA ; do they match to ?? 2505 01754 5360 JMP BPTFN3 ; no -- keep looking 2506 01755 7120 STL ; yes -- set the LINK 2507 01756 6225 .POPJ ; and stop right now 2508 2509 ; Here if the current address dosen't match... 2510 01757 2011 BPTFN2: ISZ X2 ; increment the field pointer too 2511 01760 2071 BPTFN3: ISZ COUNT ; have we searched the entire table? 2512 01761 5341 JMP BPTFN1 ; no -- keep looking 2513 01762 7100 CLL ; yes -- clear the LINK 2514 01763 6225 .POPJ ; and return 2515 01773 7770 01774 0220 01775 0210 01776 0200 01777 1060 2516 02000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 56 BR Command -- Remove Breakpoints bts6120.plx 2517 .TITLE BR Command -- Remove Breakpoints 2518 2519 2520 ; The BR command removes a breakpoint at a specific address or, if no 2521 ; operand is given, removes all breakpoints. For example: 2522 ; 2523 ; >BR 17605 -> remove the breakpoint at location 7605, field 1 2524 ; >BR -> remove all breakpoints regardless of address 2525 ; 2526 02000 6205 BREMOV: .PUSHJ @ZGET ; get the next character 02001 5520 2527 02002 7650 SNA CLA ; is it the end of the line ?? 2528 02003 5226 JMP BPTCLR ; yes -- clear all breakpoints 2529 02004 6205 .PUSHJ @ZBACKUP ; no -- backup the scanner 02005 5515 2530 02006 6205 .PUSHJ @[OCTNI] ; then read an address 02007 5777 2531 02010 1067 TAD WORD ; get the breakpoint address 2532 02011 7450 SNA ; be sure it isn't location zero 2533 02012 5530 JMP @ZCOMERR ; that isn't legal 2534 02013 3037 DCA ADDR ; save the address of the breakpoint 2535 2536 ; Here to remove a single breakpoint... 2537 02014 6205 .PUSHJ @[BPTFND] ; look for this breakpoint it the table 02015 5776 2538 02016 7420 SNL ; did we find it ?? 2539 02017 5224 JMP BREMO1 ; no -- there's no breakpoint at that address 2540 02020 1010 TAD X1 ; yes -- get the pointer to BPTADR 2541 02021 3037 DCA ADDR ; and save it in a non-autoindex location 2542 02022 3437 DCA @ADDR ; clear the BPTADR entry (to remove it) 2543 02023 6225 .POPJ ; and that's all 2544 2545 ; Here if the breakpoint does not exist... 2546 02024 4531 BREMO1: JMS @ZERROR ; give an appropriate error message 2547 02025 3664 ERRNST ; ?NOT SET 2548 2549 ; Here to clear all breakpoints... 2550 02026 6205 BPTCLR: .PUSHJ @[BSETUP] ; setup X1, X2, X3 and COUNT 02027 5775 2551 02030 3410 BPTCL2: DCA @X1 ; clear this breakpoint 2552 02031 3411 DCA @X2 ; ... 2553 02032 3412 DCA @X3 ; ... 2554 02033 2071 ISZ COUNT ; have we done them all? 2555 02034 5230 JMP BPTCL2 ; no -- keep looping 2556 02035 6225 .POPJ ; yes -- that's it PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 57 BP Command -- Set Breakpoints bts6120.plx 2557 .TITLE BP Command -- Set Breakpoints 2558 2559 2560 ; The BP command sets a breakpoint in the main memory (aka user) program. 2561 ; It requires a single argument giving the 15 bit address where the breakpoint 2562 ; is to be set. For example: 2563 ; 2564 ; >BP 07605 -> set a breakpoint at location 7605, field 0 2565 ; >BP 7605 -> same, but in the current instruction field 2566 ; 2567 ; It's not possible to set a breakpoint at location zero in any field because 2568 ; the monitor uses zero as a marker for an unused breakpoint table entry. 2569 ; 2570 ; Note that this routine only enters the breakpoint into the table - nothing 2571 ; actually happens to the main memory program until we start running it and 2572 ; the BPTINS routine is called. 2573 02036 6205 BPTCOM: .PUSHJ @[OCTNI] ; go read the address 02037 5777 2574 02040 1067 TAD WORD ; get the address operand 2575 02041 7450 SNA ; be sure it isn't zero 2576 02042 5530 JMP @ZCOMERR ; no breakpoints at address zero 2577 02043 3037 DCA ADDR ; and put it in a safe place 2578 02044 6205 .PUSHJ @ZEOLTST ; then test for the end of the line 02045 5516 2579 2580 ; See if this breakpoint is already in the table.. 2581 02046 6205 .PUSHJ @[BPTFND] ; ... 02047 5776 2582 02050 7620 SNL CLA ; was it found ?? 2583 02051 5254 JMP BPTCO1 ; no -- go try to add it 2584 02052 4531 JMS @ZERROR ; yes -- say that it is already set 2585 02053 3672 ERRAST ; ?ALREADY SET 2586 2587 ; Here to search for a free location in the table... 2588 02054 6205 BPTCO1: .PUSHJ @[BSETUP] ; setup X1 and COUNT 02055 5775 2589 02056 2011 BPTCO2: ISZ X2 ; keep X1 and X2 in sync 2590 02057 1410 TAD @X1 ; get this table entry 2591 02060 7650 SNA CLA ; have we found an empty one ?? 2592 02061 5266 JMP BPTCO3 ; yes -- great 2593 02062 2071 ISZ COUNT ; have we searched the entire table? 2594 02063 5256 JMP BPTCO2 ; no -- keep trying 2595 02064 4531 JMS @ZERROR ; yes -- say that the table is full 2596 02065 3703 ERRBTF ; ?TABLE FULL 2597 2598 ; Here to insert the breakpoint in the table... 2599 02066 1010 BPTCO3: TAD X1 ; get the pointer to the free location 2600 02067 3043 DCA LOW ; and put it in a non-autoindex location 2601 02070 1037 TAD ADDR ; get the desired address 2602 02071 3443 DCA @LOW ; and store that in the table 2603 02072 1011 TAD X2 ; do the same with the field table 2604 02073 3043 DCA LOW ; ... 2605 02074 1040 TAD ADRFLD ; get the field we need 2606 02075 3443 DCA @LOW ; and put that in the table 2607 02076 6225 .POPJ ; then that's all PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 58 Insert Breakpoints in Memory bts6120.plx 2608 .TITLE Insert Breakpoints in Memory 2609 2610 2611 ; This routine will insert breakpoints in main memory (aka the user program) 2612 ; at the locations specified in the breakpoint table. The current contents of 2613 ; each breakpoint location are stored in CP memory in the BPTDAT table, and 2614 ; then are replaced by a BPT instruction. This routine is normally called 2615 ; just before returning control to the user's program. 2616 02077 6205 BPTINS: .PUSHJ @[BSETUP] ; set up X1, X2, X3 and COUNT 02100 5775 2617 2618 ; Loop through the table and insert the breakpoints... 2619 02101 1410 BPTIN1: TAD @X1 ; get the next address 2620 02102 7450 SNA ; is there a breakpoint set there ?? 2621 02103 5316 JMP BPTIN2 ; no -- proceed to the next one 2622 02104 3037 DCA ADDR ; yes -- save the address 2623 02105 1411 TAD @X2 ; and get the field 2624 02106 3040 DCA ADRFLD ; save that too 2625 02107 6205 .PUSHJ @ZRDMEM ; go read the contents of that location 02110 5525 2626 02111 3412 DCA @X3 ; save the user's data in the table 2627 02112 1374 TAD [BPT] ; then get a breakpoint instruction 2628 02113 6205 .PUSHJ @ZDANDV ; deposit that in the breakpoint location 02114 5526 2629 02115 5320 JMP BPTIN3 ; proceed to the next one 2630 2631 ; See if we have finished the table... 2632 02116 2011 BPTIN2: ISZ X2 ; keep the pointers in sync 2633 02117 2012 ISZ X3 ; ... 2634 02120 2071 BPTIN3: ISZ COUNT ; have we been all the way through ?? 2635 02121 5301 JMP BPTIN1 ; no -- keep going 2636 02122 6225 .POPJ ; yes -- quit now PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 59 Remove Breakpoints from Memory bts6120.plx 2637 .TITLE Remove Breakpoints from Memory 2638 2639 2640 ; This routine will restore the original contents of all breakpoint locations 2641 ; in the main memory program from the table at BPTDAT. It is normally called 2642 ; after a trap to CP memory occurs. Breakpoints must be restored so that the 2643 ; user may examine or change them. 2644 02123 6205 BPTRMV: .PUSHJ @[BSETUP] ; set up X1, X2, X3 and COUNT 02124 5775 2645 2646 ; Loop through the breakpoint table and restore all data... 2647 02125 1410 BPTRM1: TAD @X1 ; get the address of this breakpoint 2648 02126 7450 SNA ; is there one there at all ?? 2649 02127 5337 JMP BPTRM2 ; no -- on to the next one 2650 02130 3037 DCA ADDR ; yes -- remember the address 2651 02131 1411 TAD @X2 ; then get the correct field too 2652 02132 3040 DCA ADRFLD ; ... 2653 02133 1412 TAD @X3 ; finally get the original contents 2654 02134 6205 .PUSHJ @ZDANDV ; deposit and verify it back where it goes 02135 5526 2655 02136 5341 JMP BPTRM3 ; on to the next one 2656 2657 ; Here to advance to the next breakpoint... 2658 02137 2011 BPTRM2: ISZ X2 ; keep the pointers in sync 2659 02140 2012 ISZ X3 ; ... 2660 02141 2071 BPTRM3: ISZ COUNT ; have we done them all ?? 2661 02142 5325 JMP BPTRM1 ; no -- keep looping 2662 02143 6225 .POPJ ; yes -- that's it for this time PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 60 TR Command -- Single Instruction with Trace bts6120.plx 2663 .TITLE TR Command -- Single Instruction with Trace 2664 2665 2666 ; The TR command will execute one instruction of the user's program and then 2667 ; print the registers. It always executes one instruction, but it may be 2668 ; combined with the repeat (RP) command to execute multiple instructions. 2669 02144 6205 SICOM: .PUSHJ @ZEOLNXT ; there are no operands 02145 5517 2670 2671 ; Figure out what we are going to execute... 2672 02146 1002 TRACE: TAD UFLAGS ; get the instruction field 2673 02147 0136 AND ZK70 ; ... 2674 02150 3040 DCA ADRFLD ; so we can change to that field 2675 02151 1000 TAD UPC ; get the current main memory PC 2676 02152 3037 DCA ADDR ; and point to that 2677 02153 1000 TAD UPC ; also save a copy for the disassember 2678 02154 3006 DCA UIRPC ; to print 2679 02155 3041 DCA PNLMEM ; always access main memory 2680 02156 6205 .PUSHJ @ZRDMEM ; go read what we're about to execute 02157 5525 2681 02160 3007 DCA UIR ; remember that for later 2682 2683 ; Execute 1 instruction... 2684 02161 6205 .PUSHJ @[SINGLE] ; just like it says 02162 5773 2685 2686 ; Print all the registers... 2687 02163 6205 .PUSHJ @[TYPEIR] ; first type the UIR 02164 5772 2688 02165 5771 JMP @[REGLSC] ; and then print the rest and return 2689 02171 1240 02172 1263 02173 2202 02174 6236 02175 1724 02176 1737 02177 7000 2690 02200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 61 SI and P Commands - Single Instruction and Proceed bts6120.plx 2691 .TITLE SI and P Commands - Single Instruction and Proceed 2692 2693 2694 ; This routine will execute a single instruction of the user's program and 2695 ; then return to the caller. It is used directly to execute the SI command, 2696 ; and indirectly by many other commands... 2697 2698 ; Here for the SI command... 2699 02200 6205 SNCOM: .PUSHJ @ZEOLNXT ; make sure that there is no more 02201 5517 2700 2701 ; Setting the HALT flip flop will cause the HM6120 to immediately trap back 2702 ; to panel mode after it has executed exactly one instruction of the main 2703 ; memory program. This makes it easy to implement a single step function. 2704 ; 2705 ; Note that SINGLE is a subroutine which you can actually call, via a 2706 ; .PUSHJ, from anywhere in the monitor and it will return after the main 2707 ; memory instruction has been executed. This little bit of magic happens 2708 ; because the code at CONT1 saves the monitor stack and then restores 2709 ; it after the single instruction trap. 2710 02202 6003 SINGLE: PGO ; first make sure the HALT flip flop is cleared 2711 02203 7402 HLT ; then make sure it's set 2712 02204 7240 STA ; set the software single step flag 2713 02205 3051 DCA SIMFLG ; ... so that CPSAVE will know what to do 2714 02206 5227 JMP CONT1 ; then restore the registers and go 2715 2716 ; The P command is used to proceed after the main memory program has stopped 2717 ; at a breakpoint. You can't simply continue at this point because the PC 2718 ; points to the location of the breakpoint, and Continue would simply break 2719 ; again, instantly. The Proceed command gets around this problem by first 2720 ; executing a single instruction, and then contining normally. 2721 02207 6205 PROCEE: .PUSHJ @ZEOLNXT ; this command has no operands 02210 5517 2722 02211 6205 .PUSHJ SINGLE ; first execute the location under the BPT 02212 5202 2723 02213 5216 JMP CONT ; then restore the breakpoints and continue PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 62 C Command - Restore Main Memory Context and Continue bts6120.plx 2724 .TITLE C Command - Restore Main Memory Context and Continue 2725 2726 2727 ; This routine will restore all the user's registers and return to his 2728 ; program. It is called directly for the continue command, and is used 2729 ; indirectly (to change contexts) by several other commands. 2730 ; 2731 ; When this routine finishes in the most literal sense, the user mode 2732 ; program is running and the monitor is no longer active. However the 2733 ; CONT function can and will actually return, via a POPJ, if the user 2734 ; program causes a breakpoint or single instruction trap. This property is 2735 ; critical to the operation of the Proceed, TRace and Single Instruction 2736 ; commands! 2737 2738 ; Here for the continue command... 2739 02214 6205 CONTCM: .PUSHJ @ZEOLNXT ; continue has no operands 02215 5517 2740 2741 ; If we have a front panel and the HALT switch is currently DOWN, then 2742 ; we want to execute a single instruction only. Only if the HALT switch 2743 ; is UP (or if there's no front panel at all), do we run free! 2744 02216 4777 CONT: JMS @[CHKHLT] ; test the HALT switch 2745 02217 5776 JMP @[TRACE] ; down - trace one instruction instead 2746 ; up - proceed normally 2747 2748 ; Select free running mode and insert all breakpoints... 2749 02220 6205 .PUSHJ @[BPTINS] ; insert all breakpoints 02221 5775 2750 02222 3051 DCA SIMFLG ; clear our software single step flag 2751 02223 6003 PGO ; make sure the HALT flip-flop is cleared 2752 02224 5227 JMP CONT1 ; restore registers and resume 2753 2754 2755 ; The monitor call processor, MCALL, jumps here after it finishes executing 2756 ; a PR0 ROM call. Some of these calls, especially ones that access the disk, 2757 ; take a fairly long time and if the user flips the HALT switch while the 2758 ; program is doing a lot of disk I/O there's a good chance we'll miss it. 2759 ; To fix that, we check the state of the HALT switch after completing a 2760 ; ROM call and just halt if it's been flipped while were busy. 2761 02225 4777 CONT2: JMS @[CHKHLT] ; test the HALT switch 2762 02226 5774 JMP @[HALTED] ; down - pretend we halted after the MUUO 2763 ; otherwise fall into CONT1 and return 2764 2765 2766 ; Restore all registers and context switch. Naturally, part of this involves 2767 ; restoring the original user mode stack pointers, so before we lose our own 2768 ; stack forever, we save a copy of the last monitor stack pointer in RAM. It 2769 ; gets restored by the code at CPSAVE after a breakpoint or single instruction 2770 ; trap. 2771 ; 2772 ; Another gotcha - if a transition on CPREQ L occurs while we're in panel 2773 ; mode, the BTSTRP flag in the panel status will still set anyway. If that 2774 ; happens and we try to continue, the 6120 will trap back to panel mode 2775 ; immediately. The simplest fix for this is to do a dummy read of the panel 2776 ; status flags, which clears them. 2777 02227 6207 CONT1: RSP1 ; get our monitor's stack pointer 2778 02230 3145 DCA STKSAV ; and save it for later 2779 02231 6437 RLON ; turn the RUN LED on 2780 02232 6440 POST+0 ; and show post code 0 2781 02233 6430 CCPR ; make sure no panel request is pending 2782 02234 6000 PRS ; dummy read of panel status to clear BTSTRP 2783 02235 7200 CLA ; ... 2784 02236 1004 TAD USP1 ; reload stack pointer #1 2785 02237 6217 LSP1 ; ... 2786 02240 1005 TAD USP2 ; and stack #2 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 63 C Command - Restore Main Memory Context and Continue bts6120.plx 2787 02241 6237 LSP2 ; ... 2788 02242 1003 TAD UMQ ; restore the MQ register 2789 02243 7421 MQL ; ... 2790 02244 1002 TAD UFLAGS ; restore the flags, including IF, DF and LINK 2791 02245 6005 RTF ; ... 2792 02246 1001 TAD UAC ; restore the AC 2793 02247 6004 PEX ; exit panel mode 2794 02250 5400 JMP @UPC ; and, lastly, restore the PC 2795 2796 ; At this point we're running the main memory program. If that program 2797 ; causes a breakpoint or single instruction trap, then the HM6120 will enter 2798 ; the CPSAVE routine thru the vector at 7777. After it figures out the reason 2799 ; for the trap, CPSAVE will restore the original monitor's stack, from STKSAV, 2800 ; and execute a .POPJ. Only then will this routine "return". PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 64 ST Command -- Start a Main Memory Program bts6120.plx 2801 .TITLE ST Command -- Start a Main Memory Program 2802 2803 2804 ; The start command initializes the CPU registers and all I/O devices and 2805 ; then transfers control to a main memory (user) program. A single, optional, 2806 ; argument may be given to specify the start address of the the main memory 2807 ; program. If the start address is omitted, then the default is location 2808 ; 7777 of field 0 (this is a little strange by PDP-8 standards, but it's the 2809 ; typical reset vector for 6100 and 6120 devices). For example: 2810 ; 2811 ; >ST 00200 - start at location 200 in field 0 (DF is also 0) 2812 ; >ST 70200 - start at location 200 in field 7 (DF is also 7) 2813 ; >ST - start at location 7777 of field 0 (DF is also 0) 2814 ; 2815 02251 6205 START: .PUSHJ @ZGET ; get the next character 02252 5520 2816 02253 7650 SNA CLA ; is there anything out there ?? 2817 02254 5275 JMP START1 ; no -- use the defaults 2818 2819 ; Start at a specific (non-default) address... 2820 02255 6205 .PUSHJ @ZBACKUP ; backup to the start of the address 02256 5515 2821 02257 6205 .PUSHJ @[OCTNI] ; then read it 02260 5773 2822 02261 6205 .PUSHJ @ZEOLTST ; now it has to be the end of the line 02262 5516 2823 02263 6205 .PUSHJ CLRCPU ; clear the saved main memory registers 02264 5312 2824 02265 1067 TAD WORD ; and overwrite the PC with the desired address 2825 02266 3000 DCA UPC ; ... 2826 02267 1040 TAD ADRFLD ; get the start field 2827 02270 7112 CLL RTR ; and make the DF be the same 2828 02271 7106 CLL RTL ; ... 2829 02272 1040 TAD ADRFLD ; ... 2830 02273 3002 DCA UFLAGS ; those are the default processor flags 2831 02274 5216 JMP CONT ; insert any breakpoints and then go 2832 2833 ; Start at the default address. 2834 02275 6205 START1: .PUSHJ CLRCPU ; set all main saved CPU registers to default 02276 5312 2835 02277 5216 JMP CONT ; and then start there PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 65 MR Command - Master Reset bts6120.plx 2836 .TITLE MR Command - Master Reset 2837 2838 2839 ; The MR command executes a CAF instruction to assert IOCLR L and initialize 2840 ; all external I/O devices, and then it resets the saved state of the main 2841 ; memory program to the "default" values. From the point of view of an I/O 2842 ; device on the bus, this is equivalent to pressing the RESET button, but it 2843 ; doesn't actually reset the CPU itself (which would re-initialize this 2844 ; monitor!). This command doesn't have any effect on the contents of main 2845 ; memory. 2846 02300 6205 CLRCOM: .PUSHJ @ZEOLNXT ; There are no operands 02301 5517 2847 2848 ; Initialize the saved user context... 2849 02302 6205 .PUSHJ CLRCPU ; clear UAC, UPC, UMQ, etc... 02303 5312 2850 2851 ; Execute a CAF instruction to clear all I/O devices. On the IM6100 we 2852 ; couldn't do this, since CAF would also clear the CP flag (!), but the 6120 2853 ; designers allowed for this case. 2854 ; 2855 ; Unfortunately IOCLR L also resets the console UART, which plays havoc 2856 ; with any character that we might be transmitting at the moment. The only 2857 ; safe thing is to wait for the console to finish before executing the CAF. 2858 ; Note that this will _leave_ the console flag cleared, which is the way a 2859 ; real PDP-8 program should expect it (clearing a real PDP-8 clears the 2860 ; console flag too, after all). 2861 02304 6041 TSF ; has the console finished yet? 2862 02305 5304 JMP .-1 ; no - wait for it 2863 02306 6007 CAF ; clear all I/O flags 2864 2865 ; Reset the IDE disk too. If none is attached, then this is harmless... 2866 ;[250] JMS @ZPUSHJ1 ; (cross field call) 2867 ;[250] IDEINI ; reset the IDE disk and then return 2868 02307 4532 JMS @ZPUSHJ1 ; (cross field call) 2869 02310 1713 INIPMP ; and initialize the partition map 2870 02311 5772 JMP @[EXMEM] ; sync the FP6120 display and we're done 2871 2872 2873 ; This routine is called by the START and RESET commands and at system 2874 ; initialization to clear the saved user context... 2875 02312 7200 CLRCPU: CLA ; start with all zeros 2876 02313 3001 DCA UAC ; clear the AC 2877 02314 3003 DCA UMQ ; and the MQ 2878 02315 3002 DCA UFLAGS ; the DF, IF and LINK 2879 02316 3004 DCA USP1 ; stack pointer #1 2880 02317 3005 DCA USP2 ; and #2 2881 02320 3063 DCA FPPGMM ; clear the front panel program mode 2882 02321 7240 STA ; then finally set the PC to 7777 2883 02322 3000 DCA UPC ; ... 2884 02323 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 66 EX Command - Execute IOT Instructions bts6120.plx 2885 .TITLE EX Command - Execute IOT Instructions 2886 2887 2888 ; The EX command allows a user to type in and execute an IOT instruction 2889 ; directly from the terminal, which can be very useful for testing peripheral 2890 ; devices. Either one or two operands are allowed - the first is the octal 2891 ; code of the IOT to be executed, and the second (which is optional) is a 2892 ; value to be placed in the AC before the IOT is executed. If it is omitted, 2893 ; zero is placed in the AC. After the instruction is executed, the word SKIP 2894 ; is typed if the instruction skipped, along with the new contents of the AC. 2895 ; 2896 ; >EX 6471 -> execute IOT 6741 (the AC will be cleared) 2897 ; >EX 6474 1176 -> put 1176 in the AC and execute IOT 6474 2898 ; 2899 ; WARNING - some care must be exercised with this command, since executing 2900 ; the wrong IOT can crash the monitor! 2901 02324 6205 XCTCOM: .PUSHJ @ZOCTNW ; go read the IOT instruction code 02325 5521 2902 02326 1067 TAD WORD ; then get the value 2903 02327 3350 DCA XCTBLK ; save that where we'll execute it 2904 02330 3067 DCA WORD ; assume to use zero in the AC 2905 02331 1052 TAD SAVCHR ; next get the break character 2906 02332 7650 SNA CLA ; was it the end of the line ?? 2907 02333 5340 JMP XCT1 ; yes -- default to zero 2908 02334 6205 .PUSHJ @ZOCTNW ; no -- read another number 02335 5521 2909 02336 6205 .PUSHJ @ZEOLTST ; then test for the end of the line 02337 5516 2910 2911 ; Be sure the instruction is really an IOT... 2912 02340 1350 XCT1: TAD XCTBLK ; get the instruction 2913 02341 1371 TAD [-6000] ; compare it to 6000 2914 02342 7700 SMA CLA ; is it an IOT or OPR instruction ? 2915 02343 5346 JMP XCT2 ; yes -- that's OK 2916 02344 4531 JMS @ZERROR ; no -- don't allow this 2917 02345 3432 ERRILV ; ?ILLEGAL VALUE 2918 2919 ; Execute the instruction... 2920 02346 3071 XCT2: DCA COUNT ; will be non-zero if the IOT doesn't skip 2921 02347 1067 TAD WORD ; get the value we're supposed to put in the AC 2922 02350 7000 XCTBLK: NOP ; gets overwritten with the IOT to execute 2923 02351 2071 ISZ COUNT ; set the flag if it doesn't skip 2924 02352 3046 DCA VALUE ; and remember what is left in the AC 2925 2926 ; Print the results of the instruction.. 2927 02353 1071 TAD COUNT ; see if it skipped 2928 02354 7640 SZA CLA ; well ?? 2929 02355 5360 JMP XCT3 ; no -- no message 2930 02356 4511 JMS @ZINLMES ; yes -- say that it did 2931 02357 3477 SKPMSG ; ... 2932 02360 4511 XCT3: JMS @ZINLMES ; then print the AC after the instruction 2933 02361 3713 ACNAME ; ... 2934 02362 1046 TAD VALUE ; ... 2935 02363 5502 JMP @ZTOCT4C ; in octal, with a CRLF, and return 2936 02371 2000 02372 5751 02373 7000 02374 7711 02375 2077 02376 2146 02377 6031 2937 02400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 67 OS/8 Bootstrap bts6120.plx 2938 .TITLE OS/8 Bootstrap 2939 2940 2941 ; How to boot OS/8 (there's lots of documentation on how to write a device 2942 ; handler, even a system handler, but I couldn't find a description of how 2943 ; to make a bootable device anywhere!): 2944 ; 2945 ; The primary bootstrap for a device (the one which you have to toggle in 2946 ; with the switches!) normally loads cylinder 0, head 0, sector 0 (which is 2947 ; the equivalent to OS/8 logical block zero) into memory page zero field zero. 2948 ; The code loaded into page zero is then started in some device specific way, 2949 ; but usually the primary bootstrap is overwritten by this data and the CPU 2950 ; just "ends up" there. 2951 ; 2952 ; The first few words of block zero are called the secondary bootstrap, and 2953 ; it's normally found in the header for the system device handler. OS/8 BUILD 2954 ; copies this code from the handler to block zero when it builds the system 2955 ; device. The second half of block zero contains the system handler, what's 2956 ; resident in page 7600 while OS/8 is running, plus some OS/8 resident code 2957 ; that BUILD wraps around it. All of the second half of block zero must be 2958 ; loaded into page 7600, field 0 by the secondary bootstrap. 2959 ; 2960 ; The remainder of the first half of block zero, the part after the secondary 2961 ; bootstrap, contains the OS/8 resident code for field 1. This starts some 2962 ; where around offset 47 in the first half of block zero, and this code needs 2963 ; to be loaded into the corresponding locations of page 7600, field 1. The 2964 ; remaining words in page 7600, field 1 (i.e. those that belong to the 2965 ; secondary bootstrap) OS/8 uses for tables and their initial values are 2966 ; unimportant. It suffices to simply copy all of the first half of block zero 2967 ; to page 7600, field 1. 2968 ; 2969 ; All this discussion presupposes a single page system handler, as we have 2970 ; here. For a two page handler BUILD will put the second page in the first 2971 ; half of block 66 on the system device and I believe (although I can't 2972 ; guarantee it) that the second half of this block also contains an image 2973 ; of the OS/8 resident code at page 7600, field 1. This would make it the 2974 ; same as, excepting the bootstrap part, the first half of block zero. In 2975 ; the case of a two page handler, the secondary bootstrap is also responsible 2976 ; for loading the second handler page from block 66 into page 7600, field 2. 2977 ; OS/8 bootstrap code (secondary bootstrap). 2978 ; 2979 ; Once everything has been loaded, the secondary bootstrap can simply do a 2980 ; "CDF CIF 0" and then jump to location 7600 to load the keyboard monitor. 2981 ; 2982 ; The primary bootstrap for the SBC6120 RAM and IDE disks are six words 2983 ; loaded in locations 0 thru 5: 2984 ; 2985 ; 0000/ 6206 PR0 / execute a panel request 2986 ; 0001/ 0001 1 / 1 for RAM disk, 4 for IDE disk 2987 ; 0002/ 0100 0100 / read one page into field zero 2988 ; 0003/ 0000 0000 / location zero 2989 ; 0004/ 0000 0000 / from page/block zero of the device 2990 ; 0005/ 7402 HLT / should never get here 2991 ; 2992 ; If all goes well, the HLT in location 5 is never executed - it gets 2993 ; overwritten by the secondary bootstrap code before the ROM returns from 2994 ; the PR0 function. 2995 ; 2996 ; The B (BOOT) command in BTS6120 actually bypasses the primary bootstrap 2997 ; step and simply reads block zero of the boot device into page zero, field 2998 ; zero directly. The VM01 and ID01 secondary bootstraps all contain a special 2999 ; "key" in words 0 thru 4, the ones which would normally overwrite the primary 3000 ; boostrap, and BTS6120 looks for this key to identify a bootable volume. 3001 ; If the key is found, then BTS6120 simply jumps to main memory location 5 3002 ; to start the secondary bootstrap and finish loading OS/8. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 68 OS/8 Bootstrap bts6120.plx 3003 ; 3004 ; This system should also work for any other, non OS/8, system provided that 3005 ; it uses the same primary bootstrap shown above and that its secondary boot 3006 ; contains the special key in the first five words. As long as the secondary 3007 ; bootstrap starts at offset 5, the remainder of its code is unimportant to 3008 ; BTS6120 and it can do anything it likes. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 69 Boot Sniffer bts6120.plx 3009 .TITLE Boot Sniffer 3010 3011 3012 ; The secondary bootstraps for both VM01 and ID01 devices contain a special 3013 ; key, the ASCIZ string "BOOT", in the first five words. The caller is 3014 ; expected to read block zero of the boot device into memory, and then call 3015 ; this routine to examine page zero, field zero, of main memory to determine 3016 ; if a valid secondary bootstrap exists. If the key is found, then the LINK 3017 ; will be cleared on return... 3018 02400 1377 CKBOOT: TAD [BOOKEY-1] ; point X1 to the key string 3019 02401 3010 DCA X1 ; ... 3020 02402 7240 NL7777 ; and point X2 to page zero of main memory 3021 02403 3011 DCA X2 ; ... 3022 02404 7100 CKBOO1: CLL ; be sure the LINK is in a known state 3023 02405 1410 TAD @X1 ; get the next word of the key 3024 02406 7450 SNA ; have we done them all ? 3025 02407 6225 .POPJ ; yes - return success 3026 02410 7041 CIA ; make it negative 3027 02411 6266 CPD ; address main memory now 3028 02412 1411 TAD @X2 ; and compare our key to what's there 3029 02413 0135 AND ZK177 ; (PAL8 likes to set the high bit for ASCII!) 3030 02414 6276 SPD ; (back to panel memory) 3031 02415 7120 STL ; assume that we failed 3032 02416 7640 SZA CLA ; did the key match ? 3033 02417 6225 .POPJ ; nope - return with the LINK set 3034 02420 5204 JMP CKBOO1 ; yes - keep testing... 3035 3036 ; Ok, here it is - the magic key that makes a volume bootable! 3037 02421 BOOKEY: .ASCIZ /BOOT/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 70 B Command - Boot Disk bts6120.plx 3038 .TITLE B Command - Boot Disk 3039 3040 3041 ; The B command boots, or at least it tries to, either RAM or IDE disk. 3042 ; It can be used with an argument to specify the device to be booted, or 3043 ; without to ask BTS6120 to search for a bootable volume. For example: 3044 ; 3045 ; >B VM - boot device VMA0 3046 ; >B ID - boot device IDA0 3047 ; >B - search VMA0, then IDA0, for a bootstrap 3048 ; 3049 ; If no valid bootsrap can be found, then the message "?Not bootable" is 3050 ; printed. 3051 ; 3052 ; NOTE: It is currently only possible to bootstrap from unit zero for RAM 3053 ; disk, or partition zero in the case of IDE disk. 3054 ; 3055 ; NOTE also - the BOOT command ignores the state of the front panel (if 3056 ; any) RUN/HALT switch. In particular, it doesn't single step if the 3057 ; HALT switch is down when this command is executed. That seems like 3058 ; the most sensible thing. 3059 02426 6205 BOOT: .PUSHJ @ZSPACMP ; get the next non-space character 02427 5513 3060 02430 7650 SNA CLA ; is it the end of the line ? 3061 02431 5252 JMP BOOT1 ; yes - go search for a bootstrap 3062 02432 6205 .PUSHJ @ZBACKUP ; nope - backup to the first letter 02433 5515 3063 02434 6205 .PUSHJ @[NAMENW] ; and read the boot device name 02435 5776 3064 02436 6205 .PUSHJ @ZEOLNXT ; now there has to be an EOL 02437 5517 3065 3066 ; Here if a specific device name is given on the command line... 3067 02440 1375 TAD [BNAMES-1] ; point to the table of boot names 3068 02441 6205 .PUSHJ @[MATCH] ; go call the right boot routine 02442 5774 3069 02443 7430 SZL ; did we find a bootstrap ? 3070 02444 5262 JMP NOBOOT ; nope - print an error message 3071 3072 ; Now do the equivalent of a "ST 5" to start the bootstrap running... 3073 02445 6205 BOOTGO: .PUSHJ @[CLRCPU] ; clear all saved main memory state 02446 5773 3074 02447 1372 TAD [5] ; the secondary bootstrap starts at offset 5 3075 02450 3000 DCA UPC ; ... 3076 02451 5771 JMP @[CONT] ; cross your fingers! 3077 3078 ; Here to search for a bootable device... 3079 02452 6205 BOOT1: .PUSHJ BTVMA0 ; first try booting VMA0 02453 5264 3080 02454 7420 SNL ; did we succeed? 3081 02455 5245 JMP BOOTGO ; yes - go start the bootstrap 3082 02456 6205 .PUSHJ BTIDA0 ; nope - try IDA0 next 02457 5300 3083 02460 7420 SNL ; how about this? 3084 02461 5245 JMP BOOTGO ; yes - use that on instead 3085 3086 ; Here if no bootstrap can be found... 3087 02462 4531 NOBOOT: JMS @ZERROR ; print an error and return to command level 3088 02463 3530 ERRNBT ; ?NO BOOTSTRAP 3089 3090 3091 ; Here to attempt booting VMA0... 3092 02464 4532 BTVMA0: JMS @ZPUSHJ1 ; (cross field call) 3093 02465 0400 RDBOOT ; RAM disk primary bootstrap 3094 02466 6205 .PUSHJ CKBOOT ; is this volume bootable? PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 71 B Command - Boot Disk bts6120.plx 02467 5200 3095 02470 7430 SZL ; skip if yes 3096 02471 6225 .POPJ ; not bootable - just give up 3097 02472 4511 JMS @ZINLMES ; say 3098 02473 4107 VMAMSG ; "-VMA0" 3099 02474 6205 .PUSHJ @ZCRLF ; ... 02475 5510 3100 02476 7100 CLL ; be sure to return success 3101 02477 6225 .POPJ ; ... 3102 3103 3104 ; Here to attempt booting IDA0... 3105 02500 4532 BTIDA0: JMS @ZPUSHJ1 ; (cross field call) 3106 02501 1200 IDBOOT ; IDE disk primary bootstrap 3107 02502 6205 .PUSHJ CKBOOT ; is this volume bootable? 02503 5200 3108 02504 7430 SZL ; skip if yes 3109 02505 6225 .POPJ ; not bootable - just give up 3110 02506 4511 JMS @ZINLMES ; say 3111 02507 4114 IDAMSG ; "-IDA0" 3112 02510 6205 .PUSHJ @ZCRLF ; ... 02511 5510 3113 02512 7100 CLL ; and be sure to return success 3114 02513 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 72 Parse FORMAT Unit/Partition Argument bts6120.plx 3115 .TITLE Parse FORMAT Unit/Partition Argument 3116 3117 3118 ; This routine will parse the unit/partition number argument for FORMAT. 3119 ; Since this command is little on the dangerous side (it does erase all the 3120 ; data on the disk, after all!), we'll go to the extraordinary length of 3121 ; asking for confirmation before we do anything. Confirmation is nothing 3122 ; more than a single character (we don't wait for a carriage return) - "Y" 3123 ; continues with the format and anything else, including ^C, aborts... 3124 ; 3125 ; Assuming the user confirms, then the unit/partition number will be 3126 ; returned in the AC. If the user aborts, or if there are any syntax 3127 ; errors, then we restart the command scanner and never return. 3128 02514 6205 FMTARG: .PUSHJ @ZOCTNW ; read the unit/partition number 02515 5521 3129 02516 6205 .PUSHJ @ZEOLTST ; that has to be followed by the end of line 02517 5516 3130 02520 1065 TAD REPCNT ; is the format command repeated? 3131 02521 7640 SZA CLA ; skip if not 3132 02522 5336 JMP FMTAR1 ; yes - just do it without confirmation 3133 02523 4511 JMS @ZINLMES ; say 3134 02524 3745 FCFMSG ; "Format partition/unit " 3135 02525 1067 TAD WORD ; get the partition number once again 3136 02526 3046 DCA VALUE ; TOCT corrupts WORD, 3137 02527 1046 TAD VALUE ; .... so we have to stash it here 3138 02530 6205 .PUSHJ @ZTOCT4S ; and type it out 02531 5504 3139 02532 6205 .PUSHJ @[CONFRM] ; go wait for a "Y" or "y" 02533 5770 3140 02534 7620 SNL CLA ; did he confirm? 3141 02535 5527 JMP @ZRESTA ; no - just abort now 3142 02536 1046 FMTAR1: TAD VALUE ; yes he did - return the unit in the AC 3143 02537 6225 .POPJ ; ... 3144 3145 ; Here if the RAM disk unit number is illegal... 3146 02540 4531 NOUNIT: JMS @ZERROR ; ... 3147 02541 3432 ERRILV ; "?Illegal value" 3148 3149 ; This little routine verifies that a hard disk is attached to the system. 3150 ; If there is none, then an error message is printed and the command aborted. 3151 ; HOOK: an extension ROM can intercept this call in order to do its own 3152 ; checking if a disk is installed, e.g. in the case of a system with 3153 ; a storage device on a different interface. 3154 02542 7000 NODISK: NOP 3155 02543 7000 NOP 3156 02544 7000 NOP 3157 02545 4767 JMS @[CHKIDE] ; test DKSIZE to see if a disk is attached 3158 02546 7410 SKP ; no disk - print an error 3159 02547 6225 .POPJ ; there is a disk - return now 3160 02550 4531 JMS @ZERROR ; print a message and abort the command 3161 02551 3541 ERRNDK ; "?No disk" 3162 02567 2607 02570 7025 02571 2216 02572 0005 02573 2312 02574 6642 02575 3375 02576 6600 02577 2420 3163 02600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 73 Test for RAM Disk and/or IDE Disk bts6120.plx 3164 .TITLE Test for RAM Disk and/or IDE Disk 3165 3166 3167 ; This little routine will take the skip return if a RAM disk is installed 3168 ; on the current system, and the non-skip return if not ... 3169 02600 0000 CHKRAM: 0 3170 02601 6211 CDF 1 ; (RDTYPE lives in field 1) 3171 02602 1777 TAD @[RDTYPE] ; do we have a RAM disk attached? 3172 02603 6203 CXF 0 ; ... 3173 02604 7640 SZA CLA ; skip if no 3174 02605 2200 ISZ CHKRAM ; yes - take the skip return 3175 02606 5600 JMP @CHKRAM ; and we're done 3176 3177 3178 ; This little routine will take the skip return if an IDE disk is attached 3179 ; to the current system, and the non-skip return if none ... 3180 ; 3181 ; Things get a little bit tricky if an IOB6120 is installed, because the 3182 ; IOB firmware DOES NOT update DKSIZE if a CF card is installed on that device. 3183 ; Fortunately, we have a special routine to take care of just that case... 3184 02607 0000 CHKIDE: 0 3185 02610 4532 JMS @ZPUSHJ1 ; call CHKCFC in our field 1 3186 02611 2200 CHKCFC ; ... go see if an IOB6120 CF card is present 3187 02612 7640 SZA CLA ; skip if none 3188 02613 5220 JMP CHKID1 ; a CompactFlash card counts as an IDE drive 3189 02614 6211 CDF 1 ; (DKSIZE lives in field 1) 3190 02615 1776 TAD @[DKSIZE] ; do we have an IDE disk attached? 3191 02616 6203 CXF 0 ; ... 3192 02617 7640 SZA CLA ; skip if no 3193 02620 2207 CHKID1: ISZ CHKIDE ; yes - take the skip return 3194 02621 5607 JMP @CHKIDE ; and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 74 PM Command - Show and Edit Disk Partition Map bts6120.plx 3195 .TITLE PM Command - Show and Edit Disk Partition Map 3196 3197 3198 ; The PM command allows the default mapping of OS/8 units to IDE disk 3199 ; partitions to be changed. PM accepts two arguments, both of which are 3200 ; optional. The first argument is the OS/8 logical unit number, and the 3201 ; second argument a partition number, in octal. Used without any arguments, 3202 ; the PM command will display a list of all eight OS/8 units and their current 3203 ; mappings. With one argument, PM will display only the mapping for that 3204 ; unit, and with two arguments PM will change the mapping of that unit. 3205 ; 3206 ; >PM u pppp - map OS/8 ID01 unit u to IDE partition pppp 3207 ; >PM u - display the mapping for unit u 3208 ; >PM - display the mapping for all units 3209 ; 3210 02622 6205 PMEDIT: .PUSHJ @ZSPACMP ; get the next non-space character 02623 5513 3211 02624 7650 SNA CLA ; is it the end of the line ? 3212 02625 5263 JMP PMALL ; yes - show the entire map 3213 02626 6205 .PUSHJ @ZBACKUP ; nope - backup and read this character 02627 5515 3214 02630 6205 .PUSHJ @ZOCTNW ; it should be a unit number 02631 5521 3215 02632 1067 TAD WORD ; get the value we read 3216 02633 0375 AND [7770] ; and the unit number must be less than 7 3217 02634 7640 SZA CLA ; ?? 3218 02635 5261 JMP PMEDI1 ; nope - "Illegal value" 3219 02636 1067 TAD WORD ; transfer the unit number 3220 02637 3071 DCA COUNT ; to COUNT for later use 3221 3222 ; See if there's also a partition number on the line... 3223 02640 6205 .PUSHJ @ZSPACM0 ; get the next non-space character 02641 5514 3224 02642 7650 SNA CLA ; is it the end of the line? 3225 02643 5274 JMP PMSHOW ; yes - print the mapping for this unit only 3226 02644 6205 .PUSHJ @ZBACKUP ; nope - read what comes next 02645 5515 3227 02646 6205 .PUSHJ @ZOCTNW ; this should be the partition number 02647 5521 3228 02650 6205 .PUSHJ @ZEOLTST ; and then we have to be at the EOL 02651 5516 3229 3230 ; Here to change the mapping for a specific unit... 3231 02652 1071 TAD COUNT ; get the unit number 3232 02653 1374 TAD [PARMAP-1] ; and make an index into the mapping table 3233 02654 3010 DCA X1 ; ... 3234 02655 1067 TAD WORD ; get the desired mapping 3235 02656 3410 DCA @X1 ; and update the partition table 3236 02657 6222 CIF 2 3237 02660 5773 JMP @[WRPSS] ; store the PM in NVRAM if it exists 3238 ; and we're all done 3239 3240 ; Here if the unit number is illegal... 3241 02661 4531 PMEDI1: JMS @ZERROR ; say 3242 02662 3432 ERRILV ; "?Illegal value" and abort 3243 3244 3245 ; Here to show all eight entries in the entire partition map... 3246 02663 3071 PMALL: DCA COUNT ; start with unit zero 3247 02664 6205 .PUSHJ PMSHOW ; and show the mapping for that unit 02665 5274 3248 02666 2071 ISZ COUNT ; now onto the next one 3249 02667 1071 TAD COUNT ; have we done eight ? 3250 02670 1375 TAD [-10] ; ??? 3251 02671 7640 SZA CLA ; well ? PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 75 PM Command - Show and Edit Disk Partition Map bts6120.plx 3252 02672 5264 JMP PMALL+1 ; nope - keep going 3253 02673 6225 .POPJ ; yes, we can quit now 3254 3255 ; Here to show the mapping for the unit in COUNT... 3256 02674 4511 PMSHOW: JMS @ZINLMES ; say 3257 02675 4067 PM1MSG ; "Unit " 3258 02676 1071 TAD COUNT ; get the selected unit 3259 02677 6205 .PUSHJ @[TDIGIT] ; and type it 02700 5772 3260 02701 4511 JMS @ZINLMES ; now say 3261 02702 4074 PM2MSG ; " mapped to partition " 3262 02703 1071 TAD COUNT ; get the count again 3263 02704 1374 TAD [PARMAP-1] ; and index the partition table 3264 02705 3010 DCA X1 ; ... 3265 02706 1410 TAD @X1 ; get the partition mapped to this unit 3266 02707 5502 JMP @ZTOCT4C ; type it, in octal, and a CRLF PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 76 Disk Formatter, Pass 1 bts6120.plx 3267 .TITLE Disk Formatter, Pass 1 3268 3269 3270 ; Pass one of the RAM/IDE disk formatter writes every block with a simple 3271 ; test pattern consisting of alternating words filled with the block number 3272 ; and its complement. Although it's not too creative, this pattern does do 3273 ; two things - it guarantees that each block is unique (so we can make sure 3274 ; the disk addresssing is working!) and it does ensure that every bit gets 3275 ; tested with a zero and a one (so we can make sure the data lines are 3276 ; working). 3277 ; 3278 ; This routine expects that a number of memory locations will be initialized 3279 ; before it's called. RECSIZ must contain the negative of the logical record 3280 ; size for the device (-256 for IDE disk or -128 for RAM disk). FMTCNT should 3281 ; contain the negative of the device size, in blocks/pages, and FMTWRP (a 3282 ; location in this routine!) must be initialized with the address of the 3283 ; disk write routine... 3284 02710 4511 FMTP1: JMS @ZINLMES ; say 3285 02711 3765 FM1MSG ; ... "Writing " 3286 02712 7201 CLA IAC ; put the FP6120 data display 3287 02713 3063 DCA FPPGMM ; ... in "program" mode 3288 02714 6211 CDF 1 ; ... 3289 02715 3534 DCA @ZDKRBN ; reset the current disk block 3290 02716 3533 DCA @ZRDPAGE ; and page numbers 3291 3292 ; Fill the disk buffer with the test pattern... 3293 02717 1073 FMTP11: TAD RECSIZ ; get the negative of the record size 3294 02720 7130 CLL CML RAR ; and divide it by two 3295 02721 3071 DCA COUNT ; since we'll fill the buffer in word pairs 3296 02722 1371 TAD [DSKBUF-1] ; point X1 to the disk buffer 3297 02723 3010 DCA X1 ; ... 3298 02724 6211 CDF 1 ; (the disk buffer is in field 1) 3299 02725 1075 FMTP12: TAD FMTCNT ; get the current block/page number 3300 02726 3410 DCA @X1 ; store that 3301 02727 1075 TAD FMTCNT ; then store its complement 3302 02730 7040 CMA ; ... 3303 02731 3410 DCA @X1 ; in the next word 3304 02732 2071 ISZ COUNT ; have we done the whole buffer? 3305 02733 5325 JMP FMTP12 ; nope - keep filling 3306 02734 6201 CDF 0 ; return to our default field 3307 3308 ; Write the buffer to the disk... 3309 02735 4532 JMS @ZPUSHJ1 ; (cross field call) 3310 02736 2210 PNLBUF ; setup our temporary buffer in field 1 3311 02737 1073 TAD RECSIZ ; pass the record size to the I/O routine 3312 02740 4532 JMS @ZPUSHJ1 ; (cross field call) 3313 02741 FMTWRP: .BLOCK 1 ; modified to either DISKWR or RAMDWR 3314 02742 7430 SZL ; were there any errors ? 3315 02743 5770 JMP @[DIOERR] ; yes - quit now 3316 3317 ; See if we've done the whole disk... 3318 02744 7200 CLA ; ... 3319 02745 2075 ISZ FMTCNT ; increment the page/block counter 3320 02746 7410 SKP ; not done yet - keep going 3321 02747 6225 .POPJ ; all done! 3322 02750 6211 CDF 1 ; disk data lives in field 1 3323 02751 2534 ISZ @ZDKRBN ; increment the disk block number 3324 02752 2533 ISZ @ZRDPAGE ; and the RAM disk page number 3325 02753 1533 TAD @ZRDPAGE ; get the current page/block number again 3326 02754 6201 CDF 0 ; back to safe ground 3327 02755 3064 DCA FPPGMD ; display the current page/block on the FP6120 3328 02756 6205 .PUSHJ @ZINCHRS ; update the display and check for ^C 02757 5512 3329 3330 ; Print a dot every so often to make a simple "progress bar"... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 77 Disk Formatter, Pass 1 bts6120.plx 3331 02760 1073 TAD RECSIZ ; get the current record size 3332 02761 7040 CMA ; and make it a mask for the lower bits 3333 02762 0075 AND FMTCNT ; apply it to the current block/page number 3334 02763 7640 SZA CLA ; ... 3335 02764 5317 JMP FMTP11 ; not time for a dot yet 3336 02765 6205 .PUSHJ @ZTDOT ; print a dot to show our progress 02766 5507 3337 02767 5317 JMP FMTP11 ; and another page or block 3338 02770 3504 02771 7377 02772 7102 02773 0243 02774 0017 02775 7770 02776 0022 02777 0047 3339 03000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 78 Disk Formatter, Pass 2 bts6120.plx 3340 .TITLE Disk Formatter, Pass 2 3341 3342 3343 ; Pass two of the RAM/IDE disk formatter reads back every block and verifies 3344 ; that the test pattern written by pass 1 is there. If any block doesn't 3345 ; contain the data we expect, then a "Verification error" message will be 3346 ; printed, but verification continues. This routine expects all the same 3347 ; data to be set up in FMTCNT and RECSIZ as Pass 1, and in addition it 3348 ; expects FMTRDP to be initialized with the address of the disk read routine. 3349 03000 4511 FMTP2: JMS @ZINLMES ; say 3350 03001 3774 FM2MSG ; "Verifying" 3351 03002 6211 CDF 1 ; ... 3352 03003 3534 DCA @ZDKRBN ; reset the current disk block 3353 03004 3533 DCA @ZRDPAGE ; and page numbers 3354 03005 6201 CDF 0 ; ... 3355 3356 ; Read the next block/page from the disk... 3357 03006 4532 FMTP21: JMS @ZPUSHJ1 ; (cross field call) 3358 03007 2210 PNLBUF ; setup a temporary disk buffer in panel memory 3359 03010 1073 TAD RECSIZ ; pass the record size to DISKRD 3360 03011 4532 JMS @ZPUSHJ1 ; (cross field call) 3361 03012 FMTRDP: .BLOCK 1 ; gets modified to either DISKRD or RAMDRD! 3362 03013 7430 SZL ; any I/O errors ? 3363 03014 5777 JMP @[DIOERR] ; yes - just give up now 3364 3365 ; Verify that the data in the buffer matches what we wrote... 3366 03015 1073 TAD RECSIZ ; and get the block/page size 3367 03016 7130 CLL CML RAR ; divide it by two 3368 03017 3071 DCA COUNT ; because we'll test in double word pairs 3369 03020 1376 TAD [DSKBUF-1] ; point X1 to the disk buffer 3370 03021 3010 DCA X1 ; ... 3371 03022 6211 CDF 1 ; (disk buffer lives in field 1) 3372 03023 1075 FMTP22: TAD FMTCNT ; get the current block/page number 3373 03024 7041 CIA ; make it negative 3374 03025 1410 TAD @X1 ; and compare to the first word in the buffer 3375 03026 7640 SZA CLA ; it matches, no? 3376 03027 5263 JMP FMTP29 ; no - verify error! 3377 03030 1410 TAD @X1 ; the second word is the complement of the page 3378 03031 1075 TAD FMTCNT ; so that plus this 3379 03032 7001 IAC ; plus 1 should be zero! 3380 03033 7640 SZA CLA ; are we right? 3381 03034 5263 JMP FMTP29 ; no - verify error! 3382 03035 2071 ISZ COUNT ; have we done the whole buffer? 3383 03036 5223 JMP FMTP22 ; nope - keep testing 3384 03037 6201 CDF 0 ; return to our regular field 3385 3386 ; See if we've done the whole disk... 3387 03040 2075 FMTP23: ISZ FMTCNT ; increment the page/block counter 3388 03041 7410 SKP ; not done yet - keep going 3389 03042 6225 .POPJ ; all done! 3390 03043 6211 CDF 1 ; disk data lives in field 1 3391 03044 2534 ISZ @ZDKRBN ; increment the disk block number 3392 03045 2533 ISZ @ZRDPAGE ; and the RAM disk page number 3393 03046 1533 TAD @ZRDPAGE ; get the current page/block number again 3394 03047 6201 CDF 0 ; back to safe ground 3395 03050 3064 DCA FPPGMD ; display the current page/block on the FP6120 3396 03051 6205 .PUSHJ @ZINCHRS ; update display and check for ^C 03052 5512 3397 3398 ; Print a dot every so often to make a simple "progress bar"... 3399 03053 1073 TAD RECSIZ ; get the current record size 3400 03054 7040 CMA ; and make it a mask for the lower bits 3401 03055 0075 AND FMTCNT ; apply it to the current block/page number 3402 03056 7640 SZA CLA ; ... 3403 03057 5206 JMP FMTP21 ; not time for a dot yet PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 79 Disk Formatter, Pass 2 bts6120.plx 3404 03060 6205 .PUSHJ @ZTDOT ; print a dot to show our progress 03061 5507 3405 03062 5206 JMP FMTP21 ; and another page or block 3406 3407 ; Here if one (or more) words don't match.. 3408 03063 6201 FMTP29: CDF 0 ; restore the usual field 3409 03064 6205 .PUSHJ @ZCRLF ; we're in the middle of a line now 03065 5510 3410 03066 4511 JMS @ZINLMES ; so start a new one and print 3411 03067 4012 ERRDSK ; "?Verification error, block/page " 3412 03070 6211 CDF 1 ; (disk data is in field 1) 3413 03071 1534 TAD @ZDKRBN ; get the current block/page number 3414 03072 6201 CDF 0 ; ... 3415 03073 6205 .PUSHJ @ZTOCT4C ; and type it (in octal) 03074 5502 3416 03075 5240 JMP FMTP23 ; better luck with the next block PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 80 DF Command - Format IDE Disk Partition bts6120.plx 3417 .TITLE DF Command - Format IDE Disk Partition 3418 3419 3420 ; The DF command will "format" an IDE disk partition. The name is a misnomer 3421 ; because there's nothing about an IDE disk that needs formatting in the way 3422 ; a floppy does, but this command does write and then read back every single 3423 ; block of the partition which serves the useful function of testing the disk. 3424 ; It works in two passes - the first pass writes every block with a test 3425 ; pattern, and the second pass reads and verifies every block for the correct 3426 ; data. 3427 ; 3428 ; >DF pppp - format disk partition pppp 3429 ; 3430 03076 6205 DFRMAT: .PUSHJ @[NODISK] ; verify that a hard disk is attached 03077 5775 3431 03100 6205 .PUSHJ @[FMTARG] ; get the partition and ask for confirmation 03101 5774 3432 03102 6211 CDF 1 ; the IDE disk data lives in field one 3433 03103 3773 DCA @[DKPART] ; save the partition number 3434 03104 6201 CDF 0 ; ... 3435 03105 1142 TAD ZM256 ; the record size for IDE disk is 256 words 3436 03106 3073 DCA RECSIZ ; ... 3437 3438 ; Do pass 1... 3439 03107 3075 DCA FMTCNT ; an IDE partition always holds 4096 blocks 3440 03110 1372 TAD [DISKWR] ; point to the correct I/O routine 3441 03111 3771 DCA @[FMTWRP] ; and point pass 1 towards that 3442 03112 6205 .PUSHJ @[FMTP1] ; go do pass 1 03113 5770 3443 3444 ; And do pass 2... 3445 03114 3075 DCA FMTCNT ; reset the block count to 4096 3446 03115 1367 TAD [DISKRD] ; and point pass 2 to the disk read routine 3447 03116 3212 DCA FMTRDP ; ... 3448 03117 6205 .PUSHJ FMTP2 ; and away we go! 03120 5200 3449 3450 ; We've tested the entire disk... 3451 03121 4511 FRDONE: JMS @ZINLMES ; let the operator know we're done 3452 03122 4005 FM3MSG ; "Finished" 3453 03123 5510 JMP @ZCRLF ; finish the line and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 81 RF Command - Format a RAM Disk bts6120.plx 3454 .TITLE RF Command - Format a RAM Disk 3455 3456 3457 ; The RF command will "format" a RAM disk virtual drive and it's essentially 3458 ; identical to the DF command that formats IDE disks. 3459 ; 3460 ; >RF u - format RAM disk unit u 3461 ; 3462 03124 6205 RFRMAT: .PUSHJ @[FMTARG] ; get the unit and ask for confirmation 03125 5774 3463 03126 6211 CDF 1 ; the RAM disk data lives in field one 3464 03127 3766 DCA @[RDUNIT] ; save the unit 3465 03130 6201 CDF 0 ; ... 3466 03131 4532 JMS @ZPUSHJ1 ; (cross field call) 3467 03132 0722 RAMSEL ; try to select this RAM disk unit 3468 03133 7630 SZL CLA ; was the unit number legal ?? 3469 03134 5765 JMP @[NOUNIT] ; nope - quit while we're ahead! 3470 03135 1141 TAD ZM128 ; the record size for RAM disk is 128 words 3471 03136 3073 DCA RECSIZ ; ... 3472 3473 ; Do pass 1... 3474 03137 6211 CDF 1 ; get the size of this RAM disk unit 3475 03140 1764 TAD @[RAMUSZ] ; which is left here by RAMSEL 3476 03141 3075 DCA FMTCNT ; save it for pass 1 3477 03142 6201 CDF 0 ; ... 3478 03143 1363 TAD [RAMDWR] ; get the correct I/O routine 3479 03144 3771 DCA @[FMTWRP] ; and point pass 1 towards that 3480 03145 6205 .PUSHJ @[FMTP1] ; go do pass 1 03146 5770 3481 3482 ; And do pass 2... 3483 03147 6211 CDF 1 ; get the size of this RAM disk unit 3484 03150 1764 TAD @[RAMUSZ] ; which is left here by RAMSEL 3485 03151 3075 DCA FMTCNT ; save it for pass1 3486 03152 6201 CDF 0 ; ... 3487 03153 1362 TAD [RAMDRD] ; and point pass 2 to the disk read routine 3488 03154 3212 DCA FMTRDP ; ... 3489 03155 6205 .PUSHJ FMTP2 ; and away we go! 03156 5200 3490 3491 ; We've tested the entire disk... 3492 03157 5321 JMP FRDONE ; say "Finished" and we're done! 3493 03162 0407 03163 0422 03164 0046 03165 2540 03166 0024 03167 1214 03170 2710 03171 2741 03172 1244 03173 0020 03174 2514 03175 2542 03176 7377 03177 3504 3494 03200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 82 LP Command - Load Binary Paper Tapes from the Console bts6120.plx 3495 .TITLE LP Command - Load Binary Paper Tapes from the Console 3496 3497 3498 ; The LP command loads a "paper tape" in standard PDP-8 BIN loader format 3499 ; from the console. If the console is actually an ASR-33 and you actually 3500 ; have a real PDP-8 paper tape, then this will probably even work, but a more 3501 ; likely situation is that you're using a PC with a terminal emulator. In 3502 ; that case the paper tape image can be downloaded from the PC's disk. 3503 ; 3504 ; The loader accepts all standard BIN data frames, including field changes, 3505 ; and correctly calculates and verifies the tape checksum. If the checksum 3506 ; matches then the number of words loaded is printed - otherwise a checksum 3507 ; error message is generated. When initially started, this routine ignores 3508 ; all input until two consectutive leader codes (octal 200) are found - this 3509 ; allows us to ignore any extra ASCII characters from the terminal emulator 3510 ; (such as carriage returns, spaces, etc). 3511 ; 3512 ; Since we're using the real console, the same one that you're typing 3513 ; commands on, for input we have a problem in that we need some way to 3514 ; terminate loading. Control-C won't work since the BIN loader eats all 3515 ; eight bit characters. A hardware reset isn't a good idea, since the POST 3516 ; memory test will erase everything we've loaded. Instead we use a special 3517 ; routine, CONGET, to read characters from the console and this routine has a 3518 ; timeout built in. If we go approximately 5 seconds without any input then 3519 ; the loader is terminated. 3520 03200 6205 CONLOD: .PUSHJ @ZEOLNXT ; this command has no operands 03201 5517 3521 03202 3041 DCA PNLMEM ; files are always lodaded into main memory 3522 3523 ; Look for two consecutive bytes of leader code... 3524 03203 1377 BINLO1: TAD [-2] ; we need two bytes of leader/trailer 3525 03204 3071 DCA COUNT ; ... 3526 03205 6205 BINLO2: .PUSHJ CONGET ; go read a byte of input 03206 5325 3527 03207 1376 TAD [-200] ; is this a leader code ?? 3528 03210 7640 SZA CLA ; ?? 3529 03211 5203 JMP BINLO1 ; no -- keep looking for two 3530 03212 2071 ISZ COUNT ; yes -- is this the second in a row ?? 3531 03213 5205 JMP BINLO2 ; no -- go look for the next one 3532 3533 ; Here after we have 2 bytes of leader -- look for the end of the leader... 3534 03214 6205 BINLO3: .PUSHJ CONGET ; get another byte of data 03215 5325 3535 03216 1376 TAD [-200] ; are we still in the leader ?? 3536 03217 7450 SNA ; ??? 3537 03220 5214 JMP BINLO3 ; yes -- keep looking 3538 03221 1375 TAD [200] ; no -- restore the character 3539 03222 3067 DCA WORD ; and remember it for later 3540 3541 ; Now actually start loading data... 3542 03223 3050 DCA CHKSUM ; start with a zero checksum 3543 03224 1375 TAD [200] ; set the default load address to location 200 3544 03225 3037 DCA ADDR ; ... 3545 03226 3040 DCA ADRFLD ; in field zero 3546 3547 ; Decode the type of the next load record... 3548 03227 7621 BINLO5: CAM ; ... 3549 03230 1067 TAD WORD ; Get the last character we read 3550 03231 0375 AND [200] ; Is this a single byte frame ??? 3551 03232 7640 SZA CLA ; ?? 3552 03233 5301 JMP BINLO7 ; Yes -- this is EOF or a field setting 3553 3554 ; Load a two frame record (either data or an address)... 3555 03234 1067 TAD WORD ; get the first byte back again 3556 03235 3323 DCA BINCH1 ; and remember that PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 83 LP Command - Load Binary Paper Tapes from the Console bts6120.plx 3557 03236 6205 .PUSHJ CONGET ; then go read the next byte 03237 5325 3558 03240 3324 DCA BINCH2 ; and save that 3559 03241 1323 TAD BINCH1 ; get the first byte 3560 03242 0374 AND [77] ; trim it to just 6 bits 3561 03243 7002 BSW ; put it in the left half 3562 03244 7421 MQL ; and save it in the MQ for now 3563 03245 1324 TAD BINCH2 ; then get the second character 3564 03246 0374 AND [77] ; trim it to 6 bits too 3565 03247 7501 MQA ; and OR it with the first character 3566 03250 3046 DCA VALUE ; remember what we read 3567 3568 ; Determine what to do with this word... 3569 03251 6205 .PUSHJ CONGET ; look ahead one byte 03252 5325 3570 03253 3067 DCA WORD ; save that character 3571 03254 1067 TAD WORD ; and get it back 3572 03255 1376 TAD [-200] ; is this the end of the tape ?? 3573 03256 7650 SNA CLA ; ?? 3574 03257 5314 JMP BINLO8 ; yes -- we read a checksum word 3575 03260 1050 TAD CHKSUM ; no -- checksum the two characters we read 3576 03261 1323 TAD BINCH1 ; ... 3577 03262 1324 TAD BINCH2 ; ... 3578 03263 3050 DCA CHKSUM ; ... 3579 03264 1323 TAD BINCH1 ; then look at the first character 3580 03265 0373 AND [100] ; is this an address or data frame ?? 3581 03266 7640 SZA CLA ; skip if it's data 3582 03267 5276 JMP BINLO6 ; no -- it is an address 3583 3584 ; Load this word of data into memory... 3585 03270 1046 TAD VALUE ; get the word back 3586 03271 6205 .PUSHJ @ZDANDV ; and write it into memory 03272 5526 3587 03273 2037 ISZ ADDR ; automatically advance the address 3588 03274 7000 NOP ; (and ignore any wrap around) 3589 03275 5227 JMP BINLO5 ; then go process the next frame 3590 3591 ; This word is an address... 3592 03276 1046 BINLO6: TAD VALUE ; get the 12 bits of data 3593 03277 3037 DCA ADDR ; and change to that address 3594 03300 5227 JMP BINLO5 ; then go process the next frame 3595 3596 ; Here of the current frame is a field setting... 3597 03301 1067 BINLO7: TAD WORD ; get the last character back again 3598 03302 0373 AND [100] ; see if it is really a field frame 3599 03303 7650 SNA CLA ; ??? 3600 03304 5314 JMP BINLO8 ; no -- treat it like a trailer code 3601 03305 1067 TAD WORD ; get the field back 3602 03306 0136 AND ZK70 ; we only want these bits 3603 03307 3040 DCA ADRFLD ; and change to the selected field 3604 03310 6205 .PUSHJ CONGET ; Then look ahead one byte 03311 5325 3605 03312 3067 DCA WORD ; ... 3606 03313 5227 JMP BINLO5 ; and go process that frame 3607 3608 ; Here when we find the checksum byte... 3609 03314 1046 BINLO8: TAD VALUE ; get the checksum byte 3610 03315 7041 CIA ; make it negative 3611 03316 1050 TAD CHKSUM ; and add it to our checksum 3612 03317 3050 DCA CHKSUM ; this should leave zero 3613 03320 6205 .PUSHJ @[TCKSUM] ; go type the checksum and return 03321 5772 3614 03322 5203 JMP BINLO1 3615 3616 ; Temporary storage for BIN loader routine... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 84 LP Command - Load Binary Paper Tapes from the Console bts6120.plx 3617 03323 BINCH1: .BLOCK 1 ; the first of a two character frame 3618 03324 BINCH2: .BLOCK 1 ; the second of a two character frame PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 85 Paper Tape Console Input Routine bts6120.plx 3619 .TITLE Paper Tape Console Input Routine 3620 3621 3622 ; This routine will read a character from the console, waiting if there is 3623 ; none ready right now, and with a timeout if one doesn't arrive soon. It is 3624 ; intended to be used only with the paper tape binary loader routine, and most 3625 ; "textual" input should be done via the INCHRS or INCHWL routines. Since the 3626 ; user cannot type control-C to abort the paper tape loader (data is being read 3627 ; from the console, remember ?) this routine provides a timeout feature to 3628 ; prevent the monitor from becoming 'hung'. If no character is received from 3629 ; the console in approximately 10 seconds, a control-C is simulated by jumping 3630 ; to RESTA. 3631 0310 FTCONT=200. ; approximately 10 seconds with a 4.9152Mhz clock 3632 3633 03325 7200 CONGET: CLA ; ... 3634 03326 1371 TAD [-FTCONT] ; get the console timeout time 3635 03327 3057 DCA IRMA ; and set up a counter 3636 3637 ; Try to read a character... 3638 03330 6031 CONGE1: KSF ; is there a character there ??? 3639 03331 5335 JMP CONGE2 ; no -- check the timer 3640 03332 7200 CLA ; yes -- clear the timer 3641 03333 6036 KRB ; and get the character 3642 03334 6225 .POPJ ; then return that 3643 3644 ; Here to keep the timeout counter. The loop between CONGE1 and CONGE2 3645 ; requires 56 states, or approximately .1835 seconds at 2.5Mhz. This is 3646 ; executed FTCONT times for the overall timeout. 3647 03335 7001 CONGE2: IAC ; increment the timer 3648 03336 7440 SZA ; has it counted to 4096 ??? 3649 03337 5330 JMP CONGE1 ; no -- keep waiting 3650 03340 2057 ISZ IRMA ; yes -- have we waited long enough ?? 3651 03341 5330 JMP CONGE1 ; no -- wait a little longer 3652 03342 7325 NL0003 ; yes -- simulate a control-C 3653 03343 6205 .PUSHJ @ZOUTCHR ; echo ^C 03344 5476 3654 03345 5527 JMP @ZRESTA ; and restart 3655 3656 ; Write commands to the flash. This routine is here, rather 3657 ; than over with FLLOAD, because there's more room here. 3658 ; The command interfaces for 28F and 29F ignore the high address 3659 ; bits, so no need to load DAR here. 3660 3661 03346 0000 FLCMD0: 0 3662 03347 3360 DCA FLCTM0 ; Save the command 3663 03350 1370 TAD [252] ; Get the 0xAA 3664 03351 3767 DCA @[5252] ; Send to address 0xAAA 3665 03352 1366 TAD [125] ; Get the 0x55 3666 03353 3765 DCA @[2525] ; Send to address 0x555 3667 ; OK, we have the flash chip's attention... 3668 03354 1360 TAD FLCTM0 ; Get the command 3669 03355 3767 FL28CMD: DCA @[5252] ; Send to address AAA 3670 03356 5746 JMP @FLCMD0 ; Return 3671 03357 5355 FLJMP: JMP FL28CMD ; Kludge for FLCMD1 (makes 28F erase work) 3672 03360 0000 FLCTM0: 0 ; The saved flash command 3673 3674 03361 0000 FLCMD: 0 ; Version callable from field 1 3675 03362 4346 JMS FLCMD0 ; Call the field 0 version 3676 03363 6212 CIF 1 ; then return to field 1. 3677 03364 5761 JMP @FLCMD 3678 03365 2525 03366 0125 03367 5252 03370 0252 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 86 Paper Tape Console Input Routine bts6120.plx 03371 7470 03372 1472 03373 0100 03374 0077 03375 0200 03376 7600 03377 7776 3679 03400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 87 RD and DD Commands - Dump Disk (RAM and IDE) Records bts6120.plx 3680 .TITLE RD and DD Commands - Dump Disk (RAM and IDE) Records 3681 3682 3683 ; These commands dump one or more disk records, in octal, to the console. 3684 ; What you get from DP is exactly how the OS/8 device driver sees the disk 3685 ; data. Each command accepts one, two or three parameters. The first is unit 3686 ; number for RAM Disk (RD) commands, or the partition number for IDE Disk (DD) 3687 ; commands. The second parameter is the number of the block to be dumped, in 3688 ; octal. If this number is omitted then the ENTIRE disk will be dumped which, 3689 ; although legal, will take quite a while! The third parameter is the count 3690 ; of pages (for RAM Disk) or blocks (for IDE disk) to be dumped and, if 3691 ; omitted, this defaults to 1. For example: 3692 ; 3693 ; >RD 0 0 - dump only page 0 (the boot block) of RAM disk unit 0 3694 ; >DD 2 100 - dump only page 100 (octal) of IDE partition 2 3695 ; >RD 1 100 77 - dump 64 (77 octal) pages of unit 1 from 100 to 177 3696 ; >DD 0 - dump ALL of IDE partition zero (4095 blocks!) 3697 ; 3698 3699 ; Enter here for the RD command... 3700 03400 1377 RDDUMP: TAD [RAMDRD] ; point to the RAM disk read routine 3701 03401 3267 DCA RDPTR ; modify the code to use that 3702 03402 1141 TAD ZM128 ; get the record size for RAM disk 3703 03403 3073 DCA RECSIZ ; and save that 3704 03404 5213 JMP PARSDX ; fall into the regular code now 3705 3706 ; And here for the DD command... 3707 03405 6205 DDDUMP: .PUSHJ @[NODISK] ; verify that a hard disk exists 03406 5776 3708 03407 1375 TAD [DISKRD] ; point to the IDE disk read routine 3709 03410 3267 DCA RDPTR ; and use that instead 3710 03411 1142 TAD ZM256 ; IDE disk uses 256 word records 3711 03412 3073 DCA RECSIZ ; ... 3712 3713 ; Parse the argument lists for either command... 3714 03413 6205 PARSDX: .PUSHJ @ZOCTNW ; read the unit/partition number (required) 03414 5521 3715 03415 6211 CDF 1 ; all disk data lives in field 1 3716 03416 1067 TAD WORD ; get what we found 3717 03417 3774 DCA @[DKPART] ; save both the partition number 3718 03420 1067 TAD WORD ; ... 3719 03421 3773 DCA @[RDUNIT] ; and the unit number 3720 03422 3534 DCA @ZDKRBN ; set the default starting block/page to zero 3721 03423 3533 DCA @ZRDPAGE ; ... 3722 03424 6201 CDF 0 ; back to the current field 3723 03425 3074 DCA RECCNT ; make the default record count the whole disk 3724 3725 ; See if there's a starting page number on the command line... 3726 03426 6205 .PUSHJ @ZSPACM0 ; are there any more characters in the command? 03427 5514 3727 03430 7650 SNA CLA ; skip if there are 3728 03431 5263 JMP DDUMP1 ; nope - start dumping now 3729 03432 6205 .PUSHJ @ZBACKUP ; yes - re-read the character 03433 5515 3730 03434 6205 .PUSHJ @ZOCTNW ; and read the page/block number 03435 5521 3731 03436 6211 CDF 1 ; back to field 1 3732 03437 1067 TAD WORD ; get the starting block/page number 3733 03440 3534 DCA @ZDKRBN ; and save it for both RAM disk and IDE disk 3734 03441 1067 TAD WORD ; ... 3735 03442 3533 DCA @ZRDPAGE ; ... 3736 03443 6201 CDF 0 ; back to our field 3737 03444 7240 NLM1 ; now the default record count is one 3738 03445 3074 DCA RECCNT ; ... 3739 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 88 RD and DD Commands - Dump Disk (RAM and IDE) Records bts6120.plx 3740 ; See if there's a page/block count too.. 3741 03446 6205 .PUSHJ @ZSPACM0 ; still more characters? 03447 5514 3742 03450 7650 SNA CLA ; skip if there are 3743 03451 5263 JMP DDUMP1 ; nope - start dumping now 3744 03452 6205 .PUSHJ @ZBACKUP ; yes - re-read the character 03453 5515 3745 03454 6205 .PUSHJ @ZOCTNW ; and read the page count 03455 5521 3746 03456 1067 TAD WORD ; ... 3747 03457 7041 CIA ; make it negative for ISZ 3748 03460 3074 DCA RECCNT ; and save the count 3749 03461 6205 .PUSHJ @ZEOLTST ; finally, this has to be the end of the line 03462 5516 3750 3751 ; Read a page from the disk into the panel memory buffer and dump it... 3752 03463 4532 DDUMP1: JMS @ZPUSHJ1 ; (call field 1 routine) 3753 03464 2210 PNLBUF ; set the disk buffer to DSKBUF 3754 03465 1073 TAD RECSIZ ; pass the record size to the I/O routine 3755 03466 4532 JMS @ZPUSHJ1 ; (cross field call) 3756 03467 RDPTR: .BLOCK 1 ; gets overwritten with DISKRD or RAMDRD! 3757 03470 7430 SZL ; were there any errors detected ? 3758 03471 5304 JMP DIOERR ; yes - report it and quit 3759 03472 1073 TAD RECSIZ ; nope - get the size of this record 3760 03473 6205 .PUSHJ @[DDBUF] ; and go dump the DSKBUF 03474 5772 3761 03475 6211 CDF 1 ; disk data lives in field 1 3762 03476 2534 ISZ @ZDKRBN ; increment both the IDE block 3763 03477 2533 ISZ @ZRDPAGE ; and RAM disk page 3764 03500 6201 CDF 0 ; ... 3765 03501 2074 ISZ RECCNT ; have we done all we need to? 3766 03502 5263 JMP DDUMP1 ; nope - go dump another one 3767 03503 6225 .POPJ ; yes - we're done (finally!!) 3768 3769 ; Here if a disk I/O error occurs... 3770 03504 6201 DIOERR: CDF 0 ; just in case 3771 03505 3046 DCA VALUE ; save the error code for a minute 3772 03506 4511 JMS @ZINLMES ; say 3773 03507 3504 ERRDIO ; "?I/O Error " 3774 03510 1046 TAD VALUE ; get the error status 3775 03511 6205 .PUSHJ @ZTOCT4M ; type it and a CRLF 03512 5503 3776 ; and abort this command completely PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 89 RL and DL Commands - Load Disk (RAM and IDE) Records bts6120.plx 3777 .TITLE RL and DL Commands - Load Disk (RAM and IDE) Records 3778 3779 3780 ; The DL and RL commands allow a disk to be downloaded over the console 3781 ; serial port. The format of the data expected is identical that that 3782 ; generated by the RD and DD (dump RAM/IDE disk) commands, which makes it 3783 ; possible to upload a disk image to the PC and then later download the same 3784 ; image back to the SBC6120. Since all the data is simple printing ASCII 3785 ; text, any terminal emulator program can be used to capture and replay the 3786 ; data will suffice. 3787 ; 3788 ; >RL u - download data to RAM disk unit u 3789 ; >DL pppp - download data to IDE disk partition pppp 3790 ; >FL - download data to Flash ROM 3791 3792 ; Enter here for the RL command... 3793 03513 1371 RLLOAD: TAD [RAMDWR] ; point to the RAM disk write routine 3794 03514 3361 DCA WRPTR ; modify the code to use that 3795 03515 1141 TAD ZM128 ; set the record (page) size for RAM disk 3796 03516 3073 DCA RECSIZ ; ... 3797 03517 5326 JMP DLOAD ; fall into the regular code 3798 3799 ; Enter here for the DL command... 3800 03520 6205 DLLOAD: .PUSHJ @[NODISK] ; verify that a hard disk is attached 03521 5776 3801 03522 1370 TAD [DISKWR] ; this time use the IDE disk write routine 3802 03523 3361 DCA WRPTR ; ... 3803 03524 1142 TAD ZM256 ; and the record (block) size is 256 3804 03525 3073 DCA RECSIZ ; ... 3805 3806 ; Parse the argument for the DL and RL commands... 3807 03526 6205 DLOAD: .PUSHJ @ZOCTNW ; read the unit/partition number (required) 03527 5521 3808 03530 6205 .PUSHJ @ZEOLTST ; that has to be followed by the end of line 03531 5516 3809 03532 6211 CDF 1 ; all disk data lives in field 1 3810 03533 1067 TAD WORD ; get the number entered 3811 03534 3773 DCA @[RDUNIT] ; and set the RAM disk unit number 3812 03535 1067 TAD WORD ; ... 3813 03536 3774 DCA @[DKPART] ; and the IDE disk partition number 3814 03537 6201 CDF 0 ; back to our field now 3815 3816 ; Put the FP6120 data LEDs in "program" mode and initially clear them, and 3817 ; we'll use these to display the current block number as data is downloaded. 3818 03540 7201 CLA IAC ; enable FP6120 "program" mode 3819 03541 3063 DCA FPPGMM ; ... 3820 03542 3064 DCA FPPGMD ; and initially clear the display 3821 3822 ; Here to read another disk page of data from the host... 3823 03543 1073 DLOAD1: TAD RECSIZ ; pass the block size in the AC 3824 03544 6205 .PUSHJ @[LDBUF] ; load the disk buffer from the serial port 03545 5767 3825 03546 6211 CDF 1 ; (disk data lives in field 1) 3826 03547 3534 DCA @ZDKRBN ; save the address of the block we read 3827 03550 1534 TAD @ZDKRBN ; ... 3828 03551 3533 DCA @ZRDPAGE ; and the page number too 3829 03552 1534 TAD @ZDKRBN ; ... 3830 03553 3064 DCA FPPGMD ; display the page/block number on the LEDs 3831 03554 6201 CDF 0 ; (back to our field now) 3832 03555 4532 JMS @ZPUSHJ1 ; (call field 1 routine) 3833 03556 2210 PNLBUF ; set the disk buffer to DSKBUF 3834 03557 1073 TAD RECSIZ ; pass the record size to the I/O routine 3835 03560 4532 JMS @ZPUSHJ1 ; (call a field 1 routine) 3836 03561 WRPTR: .BLOCK 1 ; gets modified to DISKWR, RAMDWR or ROMWR 3837 03562 7430 SZL ; were there any I/O errors? PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 90 RL and DL Commands - Load Disk (RAM and IDE) Records bts6120.plx 3838 03563 5304 JMP DIOERR ; yes - go report that and quit 3839 03564 5343 JMP DLOAD1 ; go read another page 3840 03567 3653 03570 1244 03571 0422 03572 3600 03573 0024 03574 0020 03575 1214 03576 2542 03577 0407 3841 03600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 91 Dump Disk Buffer on Console bts6120.plx 3842 .TITLE Dump Disk Buffer on Console 3843 3844 3845 ; This routine will dump the contents of DSKBUF on the console in ASCII. 3846 ; For each block dumped the output format consists of 33 lines of data, where 3847 ; the first 32 lines contain a disk address in the format "." 3848 ; (e.g. "0122.0160" is word 160 (octal) of block 122 (octal)) followed by 8 3849 ; words of data, also in octal. The 33rd line contains just a single octal 3850 ; number, a checksum of all 256 words in the block. 3851 ; 3852 ; This format is exactly the same input that's accepted by the LDBUF, which 3853 ; allows you to capture the output of a disk dump on a PC terminal emulator 3854 ; and then download the same data later to a different disk. This is the 3855 ; primary motivation for the checksum - it isn't too useful to humans, but 3856 ; it will guard against errors in the upload/download procedure. 3857 ; 3858 ; This routine should be called with the number of words to dump in the 3859 ; AC, which will normally be either -256 (to dump an IDE block) or -128 3860 ; (for a RAM disk page). 3861 03600 3252 DDBUF: DCA DDCNT ; save the count of words to dump 3862 03601 3071 DCA COUNT ; and clear the current word count 3863 03602 1377 TAD [DSKBUF-1] ; set up X1 to point to the buffer 3864 03603 3010 DCA X1 ; ... 3865 03604 3050 DCA CHKSUM ; and clear the checksum 3866 3867 ; Start a new line of data... 3868 03605 6211 DDBUF2: CDF 1 ; ... 3869 03606 1534 TAD @ZDKRBN ; get the page/block number we're dumping 3870 03607 6201 CDF 0 ; ... 3871 03610 6205 .PUSHJ @ZTOCT4 ; type it in octal 03611 5501 3872 03612 6205 .PUSHJ @ZTDOT ; then type the separator 03613 5507 3873 03614 1071 TAD COUNT ; then type the offset 3874 03615 6205 .PUSHJ @ZTOCT3 ; ... 03616 5505 3875 03617 6205 .PUSHJ @[TSLASH] ; another separator character 03620 5776 3876 03621 6205 .PUSHJ @ZTSPACE ; ... 03622 5477 3877 3878 ; Dump eight words of data, in octal... 3879 03623 6211 DDBUF3: CDF 1 ; the disk buffer is in field 1 3880 03624 1410 TAD @X1 ; get another word 3881 03625 6201 CDF 0 ; and go back to our field 3882 03626 3046 DCA VALUE ; save it for a minute 3883 03627 1046 TAD VALUE ; get it back 3884 03630 1050 TAD CHKSUM ; and accumulate a checksum 3885 03631 3050 DCA CHKSUM ; ... 3886 03632 1046 TAD VALUE ; now we're ready to type the data 3887 03633 6205 .PUSHJ @ZTOCT4S ; in octal, with a space 03634 5504 3888 03635 2071 ISZ COUNT ; count the number we've done 3889 03636 1071 TAD COUNT ; ... 3890 03637 0137 AND ZK7 ; have we done a complete row of eight? 3891 03640 7640 SZA CLA ; ??? 3892 03641 5223 JMP DDBUF3 ; no - keep going 3893 3894 ; Here after we've finished a line of eight data words... 3895 03642 6205 .PUSHJ @ZCRLF ; start a new line 03643 5510 3896 03644 1071 TAD COUNT ; see if we've done the whole page/block 3897 03645 1252 TAD DDCNT ; compare to the block size 3898 03646 7640 SZA CLA ; ??? 3899 03647 5205 JMP DDBUF2 ; not there yet - keep dumping PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 92 Dump Disk Buffer on Console bts6120.plx 3900 03650 1050 TAD CHKSUM ; type just the checksum 3901 03651 5502 JMP @ZTOCT4C ; in octal, with a CRLF, and we're done 3902 3903 3904 ; Local storage for DDBUF... 3905 03652 DDCNT: .BLOCK 1 ; the number of words in this buffer PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 93 Load Disk Buffer from Console bts6120.plx 3906 .TITLE Load Disk Buffer from Console 3907 3908 3909 ; This routine loads the disk buffer with data from a disk block image 3910 ; transmitted over the console port. The format of the data expected is 3911 ; identical that that generated by the DDBUF routine, which makes it possible 3912 ; to upload a disk image to the PC and then later download the same image back 3913 ; to the SBC6120 with DL. Since all the data is simple printing ASCII text, 3914 ; any terminal emulator program can be used to capture and replay the data. 3915 ; 3916 ; LDBUF prompts for each line of data with a ":", and most terminal emulator 3917 ; programs for the PC can be set to look for this prompting character before 3918 ; transmitting the next line. This eliminates the need to insert fixed delays 3919 ; to avoid overrunning the SBC6120. Since LDBUF reads only printing ASCII 3920 ; characters, a download can be aborted at any time just by typing a control-C 3921 ; and there's no need for a timeout the way there is with loading paper tape 3922 ; images. 3923 ; 3924 ; The expected block size, either -128. for RAM disk or -256. for IDE disk, 3925 ; should be passed in the AC. The data read is left in DSKBUF, and the 3926 ; page/block number, extracted from the data, is left in LDPAGE. Note that 3927 ; in the event a checksum or syntax error is found, LDBUF prints an error 3928 ; message and restarts the command scanner. In that case control never 3929 ; returns to the caller! 3930 03653 3252 LDBUF: DCA DDCNT ; save the expected block size 3931 03654 1377 TAD [DSKBUF-1] ; initialize X1 to point at our buffer 3932 03655 3010 DCA X1 ; ... 3933 03656 3071 DCA COUNT ; count the data words read here 3934 03657 7240 STA ; the current disk page is unknown 3935 03660 3370 DCA LDPAGE ; ... 3936 03661 3050 DCA CHKSUM ; clear the checksum accumulator 3937 3938 ; Read the next line of data... 3939 03662 1375 LDBUF2: TAD [":"] ; prompt for data with a ":" 3940 03663 6205 .PUSHJ @[INCHWL] ; initialize the line input routine 03664 5774 3941 03665 6205 LDBU20: .PUSHJ @[INCHW1] ; read another character into the buffer 03666 5773 3942 03667 7650 SNA CLA ; EOL? 3943 03670 5265 JMP LDBU20 ; nope - keep reading 3944 03671 1071 TAD COUNT ; see how many words we've read so far 3945 03672 1252 TAD DDCNT ; is it time for the checksum? 3946 03673 7650 SNA CLA ; ??? 3947 03674 5352 JMP LDBUF5 ; yes - go parse a checksum record 3948 3949 ; First parse the disk page number and offset. The offset has to match the 3950 ; number of words we've already read, but the disk address is slightly more 3951 ; complicated. For the first data record in a page we allow the address to 3952 ; be anything, and that tells us which disk page is to be written. Each data 3953 ; record after that up to the end of the page has to have the same disk 3954 ; address as the first one. This allows disk pages to be loaded in any random 3955 ; order and, more importantly, it allows unused pages to be skipped. 3956 03675 6205 .PUSHJ @ZOCTNW ; go read an octal number 03676 5521 3957 03677 1067 TAD WORD ; get the value we scanned 3958 03700 7041 CIA ; compare it to LDPAGE 3959 03701 1370 TAD LDPAGE ; ??? 3960 03702 7650 SNA CLA ; do they match ? 3961 03703 5310 JMP LDBUF3 ; yes - all is well 3962 03704 2370 ISZ LDPAGE ; no - is this the first data record? 3963 03705 5530 JMP @ZCOMERR ; not that either - the data is corrupt 3964 03706 1067 TAD WORD ; yes - just use this page number without 3965 03707 3370 DCA LDPAGE ; ... question 3966 03710 1052 LDBUF3: TAD SAVCHR ; get the separator character 3967 03711 1372 TAD [-"."] ; it has to be a "." PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 94 Load Disk Buffer from Console bts6120.plx 3968 03712 7640 SZA CLA ; ??? 3969 03713 5530 JMP @ZCOMERR ; nope - bad load format 3970 03714 6205 .PUSHJ @ZOCTNW ; now read the relative offset within the page 03715 5521 3971 03716 1067 TAD WORD ; ... 3972 03717 7041 CIA ; it has to match our data count 3973 03720 1071 TAD COUNT ; does it? 3974 03721 7640 SZA CLA ; ??? 3975 03722 5530 JMP @ZCOMERR ; nope - more bad data 3976 03723 1052 TAD SAVCHR ; one last test 3977 03724 1371 TAD [-"/"] ; the separator this time has to be a slash 3978 03725 7640 SZA CLA ; ??? 3979 03726 5530 JMP @ZCOMERR ; another corrupted data record 3980 3981 ; Now read the rest of the data record, which should consist of exactly 3982 ; eight data words, in octal... 3983 03727 6205 LDBUF4: .PUSHJ @ZOCTNW ; scan the next data word 03730 5521 3984 03731 1067 TAD WORD ; get the value we read 3985 03732 6211 CDF 1 ; remember that the disk buffer is in field 1 3986 03733 3410 DCA @X1 ; and store the data word 3987 03734 1067 TAD WORD ; accumulate a checksum of the data words 3988 03735 1050 TAD CHKSUM ; ... we read 3989 03736 3050 DCA CHKSUM ; ... 3990 03737 6201 CDF 0 ; back to home ground 3991 03740 2071 ISZ COUNT ; count the number of words we've read 3992 03741 1071 TAD COUNT ; let's have a look at it 3993 03742 0137 AND ZK7 ; have we read exactly eight words? 3994 03743 7640 SZA CLA ; skip if we have 3995 03744 5327 JMP LDBUF4 ; no - go read another data word 3996 03745 6205 .PUSHJ @ZGET ; yes - after eight data words 03746 5520 3997 03747 7640 SZA CLA ; ... the next thing should be the EOL 3998 03750 5530 JMP @ZCOMERR ; not EOL - this data is corrupted somehow 3999 03751 5262 JMP LDBUF2 ; this is the EOL - go read another record 4000 4001 ; We get here when we're read 128 or 256 words of data - the next thing we 4002 ; expect to find is a checksum record, which is a single octal number all by 4003 ; itself. This has to match the checksum we've calculated or the data is 4004 ; corrupted. 4005 03752 6205 LDBUF5: .PUSHJ @ZOCTNW ; scan an octal value 03753 5521 4006 03754 1067 TAD WORD ; and get what we found 4007 03755 7041 CIA ; ... 4008 03756 1050 TAD CHKSUM ; compare it to the checksum we accumulated 4009 03757 7640 SZA CLA ; they have to be the same! 4010 03760 5366 JMP DERCKS ; they aren't - bad checksum for data 4011 03761 1052 TAD SAVCHR ; get the next character 4012 03762 7640 SZA CLA ; it has to be the EOL 4013 03763 5530 JMP @ZCOMERR ; no - the syntax of this record is wrong 4014 4015 ; The checksum matches - all is well! 4016 03764 1370 TAD LDPAGE ; return the page number in the AC 4017 03765 6225 .POPJ ; ... 4018 4019 ; Here if the data checksum doesn't match... 4020 03766 4531 DERCKS: JMS @ZERROR ; print a message and restart 4021 03767 3515 ERRCKS ; ?DATA CHECKSUM MISMATCH 4022 4023 ; Local storage for LDBUF... 4024 03770 LDPAGE: .BLOCK 1 ; page number being read 4025 03771 7721 03772 7722 03773 7210 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 95 Load Disk Buffer from Console bts6120.plx 03774 7200 03775 0072 03776 7074 03777 7377 4026 04000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 96 PC Command - Copy an IDE Disk Partition bts6120.plx 4027 .TITLE PC Command - Copy an IDE Disk Partition 4028 4029 4030 ; The PC command will copy an entire disk partition to another partition. 4031 ; It's a convenient way to create backups of OS/8 partitions, especially since 4032 ; most modern IDE drives have room for thousands of OS/8 partitions! 4033 ; 4034 ; The PE command will compare two partitions, especially useful after a PC. 4035 ; Due to lack of space for another disk buffer the comparison is done by 4036 ; generating a checksum, unfortunately. 4037 ; 4038 ; >PC ssss dddd - copy IDE partition ssss to partition dddd 4039 ; >PE ssss dddd - compare IDE partition ssss to partition dddd 4040 ; 4041 4042 ; common function to get params 4043 04000 6205 GETPP: .PUSHJ @[NODISK] ; be sure a drive is attached! 04001 5777 4044 04002 6205 .PUSHJ @ZOCTNW ; read the source partition number 04003 5521 4045 04004 1067 TAD WORD ; ... 4046 04005 3042 DCA CPYSRC ; ... 4047 04006 6205 .PUSHJ @[SPATST] ; the next character has to be a space 04007 5776 4048 04010 6205 .PUSHJ @ZOCTNW ; then read the destination partition 04011 5521 4049 04012 1067 TAD WORD ; ... 4050 04013 3043 DCA CPYDST ; ... 4051 04014 5516 JMP @ZEOLTST ; that'd better be all there is 4052 4053 04015 6205 PCOMP: .PUSHJ GETPP 04016 5200 4054 04017 4511 JMS @ZINLMES ; say 4055 04020 3774 CE1MSG ; ... "Verifying " 4056 04021 1375 TAD [PCOPYE] ; operation will be compare block 4057 04022 3037 DCA ADDR ; 4058 04023 5243 JMP PCOPY0 4059 4060 04024 6205 PCOPY: .PUSHJ GETPP 04025 5200 4061 4062 ; Ask for confirmation before overwriting the destination partition... 4063 04026 4511 JMS @ZINLMES ; say 4064 04027 4041 CCFMSG ; "Overwrite partition/unit " 4065 04030 1043 TAD CPYDST ; and then type the partition number 4066 04031 6205 .PUSHJ @ZTOCT4S ; ... 04032 5504 4067 04033 6205 .PUSHJ @[CONFRM] ; then wait for a "Y" or "N" 04034 5774 4068 04035 7620 SNL CLA ; did he answer yes??? 4069 04036 5527 JMP @ZRESTA ; nope - just quit now 4070 4071 ; Prepare to begin copying... 4072 04037 4511 JMS @ZINLMES ; say 4073 04040 4060 CP1MSG ; ... "Copying " 4074 04041 1373 TAD [PCOPYW] ; operation will be write block 4075 04042 3037 DCA ADDR ; 4076 4077 04043 6211 PCOPY0: CDF 1 ; reset the current block number 4078 04044 3534 DCA @ZDKRBN ; ... 4079 04045 6201 CDF 0 ; ... 4080 4081 ; Read the next block from the SRC partition... 4082 04046 4532 PCOPY1: JMS @ZPUSHJ1 ; (cross field call) 4083 04047 2210 PNLBUF ; setup a temporary disk buffer in panel memory PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 97 PC Command - Copy an IDE Disk Partition bts6120.plx 4084 04050 1042 TAD CPYSRC ; get the source partition 4085 04051 6211 CDF 1 ; ... 4086 04052 3772 DCA @[DKPART] ; and point DISKRD there 4087 04053 6201 CDF 0 ; ... 4088 04054 1142 TAD ZM256 ; the IDE record size is always 256 words 4089 04055 4532 JMS @ZPUSHJ1 ; (cross field call) 4090 04056 1214 DISKRD ; and go read a block from the disk 4091 04057 7430 SZL ; disk error ?? 4092 04060 5771 JMP @[DIOERR] ; yes - go report it and give up 4093 4094 04061 6205 .PUSHJ @ADDR ; call the operation 04062 5437 4095 4096 ; Print a dot every so often to make a simple "progress bar"... 4097 04063 6211 PCOPY3: CDF 1 ; ... 4098 04064 2534 ISZ @ZDKRBN ; increment the block number 4099 04065 7410 SKP ; still more to go 4100 04066 5300 JMP PCOPY4 ; we've done all 4096 blocks! 4101 04067 1142 TAD ZM256 ; the format command uses the record size as 4102 04070 7040 CMA ; a mask for printing the progress bar 4103 04071 0534 AND @ZDKRBN ; and so we will too 4104 04072 6201 CDF 0 ; ... 4105 04073 7640 SZA CLA ; time for another dot?? 4106 04074 5246 JMP PCOPY1 ; nope - just keep copying 4107 04075 6205 .PUSHJ @ZTDOT ; print a dot to show our progress 04076 5507 4108 04077 5246 JMP PCOPY1 ; and another page or block 4109 4110 ; All done... 4111 04100 6201 PCOPY4: CDF 0 ; ... 4112 04101 4511 JMS @ZINLMES ; say 4113 04102 4005 CP2MSG ; " Done" 4114 04103 5510 JMP @ZCRLF ; and that's all! 4115 4116 ; Operation: write it to the destination... 4117 04104 4532 PCOPYW: JMS @ZPUSHJ1 ; (cross field call) 4118 04105 2210 PNLBUF ; setup the panel memory disk buffer 4119 04106 1043 TAD CPYDST ; change DKPART to the destination partition 4120 04107 6211 CDF 1 ; ... 4121 04110 3772 DCA @[DKPART] ; ... 4122 04111 6201 CDF 0 ; ... 4123 04112 1142 TAD ZM256 ; load the record size for DISKWR 4124 04113 4532 JMS @ZPUSHJ1 ; (cross field call) 4125 04114 1244 DISKWR ; and go write a block to the disk 4126 04115 7430 SZL ; any disk errors? 4127 04116 5771 JMP @[DIOERR] ; yes - give up 4128 04117 6225 .POPJ 4129 4130 ; Operation: compare it to the other partition 4131 ; (1) checksum the disk buffer 4132 04120 6205 PCOPYE: .PUSHJ DBCHKS 04121 5355 4133 04122 3050 DCA CHKSUM 4134 ; (2) read the other partition's block 4135 04123 4532 JMS @ZPUSHJ1 ; (cross field call) 4136 04124 2210 PNLBUF ; setup the panel memory disk buffer 4137 04125 1043 TAD CPYDST ; change DKPART to the destination partition 4138 04126 6211 CDF 1 ; ... 4139 04127 3772 DCA @[DKPART] ; ... 4140 04130 6201 CDF 0 ; ... 4141 04131 1142 TAD ZM256 ; load the record size for DISKWR 4142 04132 4532 JMS @ZPUSHJ1 ; (cross field call) 4143 04133 1214 DISKRD ; and go read a block from the disk 4144 04134 7430 SZL ; any disk errors? 4145 04135 5771 JMP @[DIOERR] ; yes - give up PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 98 PC Command - Copy an IDE Disk Partition bts6120.plx 4146 ; (3) checksum that block 4147 04136 6205 .PUSHJ DBCHKS 04137 5355 4148 ; (4) make sure they're equal 4149 04140 7041 CIA 4150 04141 1050 TAD CHKSUM 4151 04142 7450 SNA 4152 04143 6225 .POPJ ; alles ganz gut 4153 ; (5) if they weren't equal, report that 4154 04144 6205 .PUSHJ @ZCRLF ; we're in the middle of a line now 04145 5510 4155 04146 4511 JMS @ZINLMES ; so start a new one and print 4156 04147 4012 ERRDSK ; "?Verification error, block/page " 4157 04150 6211 CDF 1 ; (disk data is in field 1) 4158 04151 1534 TAD @ZDKRBN ; get the current block/page number 4159 04152 6201 CDF 0 ; ... 4160 04153 6205 .PUSHJ @ZTOCT4C ; and type it (in octal) 04154 5502 4161 4162 04155 1370 DBCHKS: TAD [DSKBUF-1] ; point to the disk buffer 4163 04156 3010 DCA X1 4164 04157 1367 TAD [-256.] ; and it's 256 words long 4165 04160 3071 DCA COUNT 4166 04161 6211 CDF 1 4167 04162 1410 PCCHK1: TAD @X1 4168 04163 2071 ISZ COUNT 4169 04164 5362 JMP PCCHK1 4170 04165 6201 CDF 0 4171 04166 6225 .POPJ 4172 04167 7400 04170 7377 04171 3504 04172 0020 04173 4104 04174 7025 04175 4120 04176 4641 04177 2542 4173 04200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 99 FL Command - Flash download bts6120.plx 4174 .TITLE FL Command - Flash download 4175 4176 ; 4177 ; Flash command codes for 28Fx00 type EEPROMS: 4178 ; Write xxx/FF Read Array 4179 ; Write xxx/90,Read 000 Read Identification (Manufacturer) 4180 ; Write xxx/90,Read 001 Read Identification (Device) 4181 ; Write xxx/50 Clear Status 4182 ; Write xxx/40,Write aaa/dd Write Array 4183 ; Write xxx/20 Erase Setup 4184 ; Write aaa/D0 Erase Confirm 4185 ; 4186 ; Flash command codes for 29Fx00 type EEPROMS are similar, 4187 ; except all of them start with an additional 4188 ; Write AAA/AA,Write 555/55 sequence, followed by: 4189 ; Write xxx/F0 Read Array 4190 ; Write xxx/90,Read 000 Read Identification (Manufacturer) 4191 ; Write xxx/90,Read 001 Read Identification (Device) 4192 ; Write xxx/F0 Clear Status (Read Array) 4193 ; Write AAA/A0,Write aaa/dd Write Array 4194 ; Write AAA/80 Erase Setup 4195 ; Write aaa/30 Erase Confirm 4196 ; The 29Fx00 doesn't require an explicit Clear Status operation. 4197 ; It is done automatically by the Read Array command. 4198 ; Unrecognized commands will return to Read Array mode. 4199 ; For simplicity, just set xxx = AAA during command writes. 4200 ; 4201 0377 FCMDRA=0377 ; FF Read Array (Use 28F value here, just in case) 4202 0220 FCMDRI=0220 ; 90 Read Identification (same for both) 4203 4204 ; Enter here for the FL command... It uses the same download code 4205 ; as DL and RL, but checks for presence of flash and prompts for 4206 ; overwriting it before executing that. 4207 4208 04200 FLLOAD: 4209 4210 ; The RAM disk used by the SBC6120-RC apparently confuses this code enough 4211 ; to make it think that a flash is actually present. That's not going to lead 4212 ; to a happy outcome, so so just prevent this command from ever working on the 4213 ; RC model. You can't attach an IOB6120 to the SBC6120-RC anyway ... 4214 04200 1035 TAD RCFLAG ; is this the SBC6120-RC model? 4215 04201 7640 SZA CLA ; skip if it's the original flavor 4216 04202 5240 JMP BADFLR ; yep - the RC model always says "?No flash" 4217 4218 ; We want to check that a flash ROM is actually there. This is a bit 4219 ; problematic because the Read ID command returns a manufacturer and 4220 ; device code that are basically arbitrary. However, at least the ID 4221 ; commands seem to be the same for all flash devices in this class. 4222 ; What we'll do is try switching between array read and ID read mode a 4223 ; couple of times and see if the results are consistent with a flash ROM 4224 ; being there. 4225 04203 6403 MM3 ; access flash (if it's there) 4226 04204 6211 CDF 1 4227 4228 04205 1377 TAD [FCMDRA] ; reset flash to array read mode 4229 04206 4776 JMS @[FLCMD0] 4230 4231 04207 4303 JMS FLHASH ; array read mode - hash and stash 4232 04210 3043 DCA LOW 4233 4234 04211 1375 TAD [FCMDRI] ; set flash to read ID mode 4235 04212 4776 JMS @[FLCMD0] 4236 4237 04213 4303 JMS FLHASH ; fetch ID hash 4238 04214 3042 DCA HIGH PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 100 FL Command - Flash download bts6120.plx 4239 4240 04215 1377 TAD [FCMDRA] ; reset flash to array read mode 4241 04216 4776 JMS @[FLCMD0] 4242 4243 04217 4303 JMS FLHASH ; array read mode - hash and compare 4244 04220 7041 CIA 4245 04221 1043 TAD LOW 4246 04222 7640 SZA CLA 4247 04223 5240 JMP BADFLR ; didn't match! 4248 4249 04224 1375 TAD [FCMDRI] ; set flash to read ID mode 4250 04225 4776 JMS @[FLCMD0] 4251 4252 04226 4303 JMS FLHASH ; fetch ID hash 4253 4254 04227 7041 CIA ; compare with last result 4255 04230 1042 TAD HIGH 4256 04231 7640 SZA CLA 4257 04232 5240 JMP BADFLR ; didn't match! 4258 4259 04233 1043 TAD LOW ; now make sure that we got distinct 4260 04234 7041 CIA ; values from Read Array and Read ID 4261 04235 1042 TAD HIGH 4262 04236 7640 SZA CLA 4263 04237 5245 JMP OKFLR ; different - everything looks okay! 4264 4265 04240 6402 BADFLR: MM2 ; back to normal memory access mode 4266 04241 6201 CDF 0 4267 04242 4511 JMS @ZINLMES ; display an error 4268 04243 4362 FLMSG1 4269 04244 5527 JMP @ZRESTA ; and back to prompt 4270 4271 ; At this point we have found a flash chip, but don't know 4272 ; which kind it is. HIGH contains the value from Read-ID 4273 ; mode. Issue short commands (which only work on 28F) to 4274 ; see if this is a 28F chip. 4275 4276 04245 1375 OKFLR: TAD [FCMDRI] ; reset flash to Read ID mode 4277 04246 3774 DCA @[5252] ; Send without prelude 4278 04247 4303 JMS FLHASH ; Get the hash 4279 04250 7041 CIA ; compare with ID space result 4280 04251 1042 TAD HIGH 4281 04252 6212 CIF 1 ; For possible JMP below 4282 04253 7450 SNA 4283 04254 5773 JMP @[FL28F] ; Matched, must be 28F! 4284 04255 6202 CIF 0 ; No JMP, so undo CIF 1 4285 4286 04256 1377 FL29F: TAD [FCMDRA] ; reset flash to array read mode 4287 04257 4776 JMS @[FLCMD0] 4288 04260 6402 MM2 ; back to normal memory access mode 4289 04261 6201 CDF 0 4290 4291 04262 4511 JMS @ZINLMES ; prompt to make sure we want to do this... 4292 04263 4371 FLMSG2 4293 04264 6205 .PUSHJ @[CONFRM] ; go wait for a "Y" or "y" 04265 5772 4294 04266 7620 SNL CLA ; did they confirm? 4295 04267 5527 JMP @ZRESTA ; no - just abort now 4296 4297 ; and start the download 4298 4299 04270 1371 TAD [ROMWR] ; use the ROM write routine 4300 04271 3770 DCA @[WRPTR] ; ... 4301 04272 1142 TAD ZM256 ; and the record (block) size is 256 4302 04273 3073 DCA RECSIZ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 101 FL Command - Flash download bts6120.plx 4303 04274 5767 JMP @[DLOAD1] ; and off we go, no arguments please 4304 4305 04275 6402 FL29JF: MM2 4306 04276 1766 TAD @[FLJMP] ; Patch up FLCMD0 to use 28F commands 4307 04277 3765 DCA @[FLCMD0+1] ; (which is needed for erase commands) 4308 04300 6403 MM3 4309 04301 6211 CDF 1 4310 04302 5256 JMP FL29F 4311 4312 ; Read and hash a couple of bytes outof the selected memory. 4313 ; MA11 is connected to A-1 of the flash, which is not used here. 4314 4315 04303 0000 FLHASH: 0 4316 04304 1764 TAD @[0] ; Get Manufacturer ID 4317 04305 7002 BSW 4318 04306 1763 TAD @[2] ; Munge in Device ID 4319 04307 5703 JMP @FLHASH 4320 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 102 Field 0 Vector Table bts6120.plx 4321 .TITLE Field 0 Vector Table 4322 4323 4324 ; variable and functions that we may want to access or hook in this field 4325 ; codes: I=instruction pointer, V=variable, H=hook (CIF n, JMP @.+1, V) 4326 ; Add only to the *end* of this list, please! 4327 ; n.b. JMS linkage functions generally cannot be used here 4328 04310 F0VECTOR: 4329 04310 4402 RET0F3 ; I utility - return to field 0 (must be first) 4330 04311 0000 UPC ; V user program counter (saved by the hardware) 4331 04312 0001 UAC ; V user accumulator 4332 04313 0002 UFLAGS ; V user status (LINK, GT, IF, DF, etc) from GCF 4333 04314 0263 SYSIN9-1 ; H initialization just before monitor entered 4334 04315 7463 CONOUT ; I output a character, no processing 4335 04316 7552 CONIN ; I input a character, no processing, null if none 4336 04317 7400 OUTCHR ; I type a single character 4337 04320 7477 INCHRS ; I input a character, null if none 4338 04321 6322 TOCT4 ; I type an octal number 4339 04322 7104 CRLF ; I type a carriage return/line feed 4340 04323 4617 SPACMP ; I get the next non-blank command character 4341 04324 4621 SPACM0 ; I get a non-blank character starting with the current 4342 04325 4647 BACKUP ; I backup the command line pointer 4343 04326 4632 EOLTST ; I test current character for end of line 4344 04327 4630 EOLNXT ; I test the next character for end of line 4345 04330 0465 GET ; I get the next character from the command line 4346 04331 6720 OCTNW ; I scan an octal number 4347 04332 6460 RANGE ; I scan an address range (e.g. "0-7777") 4348 04333 0377 RESTA-1 ; H monitor restart vector 4349 04334 0453 COMERR ; I report a command syntax error and restart 4350 04335 6277 TDECNW ; I print an unsigned decimal number 4351 04336 2541 NODISK-1 ; H check for disk presence 4352 04337 1262 TYPEIR-1 ; H print the current IR 4353 04340 0007 UIR ; V user IR 4354 04341 0037 ADDR ; V start address returned from RANGE 4355 04342 0040 ADRFLD ; V start field returned from RANGE 4356 04343 0042 HIGH ; V end address returned from RANGE 4357 04344 0044 HGHFLD ; V end field returned from RANGE 4358 04345 7645 BTSTR1-1 ; H CPREQ signaled 4359 04346 0020 PARMAP ; V partition map 4360 04347 0034 RAMBAS ; V base offset - 1 for each RAM disk field 4361 04363 0002 04364 0000 04365 3347 04366 3357 04367 3543 04370 3561 04371 2600 04372 7025 04373 2743 04374 5252 04375 0220 04376 3346 04377 0377 4362 04400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 103 Show Extension ROM Status bts6120.plx 4363 .TITLE Show Extension ROM Status 4364 4365 4366 ; this is a very small stub that allows us to call functions in Field 0 4367 ; from Field 3. This is accomplished by making .POPJ return via here. 4368 4369 04400 6223 RET0F2: CXF 2 ; return to field 2 4370 04401 6225 .POPJ ; the address is already on the stack 4371 4372 04402 6233 RET0F3: CXF 3 ; return to field 3 4373 04403 6225 .POPJ ; the address is already on the stack 4374 ; This routine will display the status of the extension ROM - it will print 4375 ; exactly one of these lines - 4376 ; 4377 ; IOB: not detected 4378 ; IOB: OK 4379 ; IOB: error n 4380 ; 4381 ; as is appropriate. In the case of the "Error n" option, error 2 means 4382 ; that its checksum was invalid and error 3 or greater means that the ROM 4383 ; initialization was called but it returned this error code. 4384 4385 04404 7200 SHOEXT: CLA ; ... 4386 04405 1035 TAD RCFLAG ; is this the RC model? 4387 04406 7640 SZA CLA ; ??? 4388 04407 6225 .POPJ ; Yep - there's never an IOB6120 on this model 4389 04410 4511 JMS @ZINLMES ; say "IOB: " 4390 04411 4345 XRMES1 ; ... 4391 04412 1377 TAD [-2] ; compare the status code to 2 4392 04413 1033 TAD EXTFLG ; ... 4393 04414 7510 SPA ; ... 4394 04415 5224 JMP SHOEX1 ; either there's no extension ROM or it's OK 4395 04416 4511 JMS @ZINLMES ; otherwise say "Error " 4396 04417 4352 XRMES2 ; ... 4397 04420 1033 TAD EXTFLG ; and add the error code 4398 04421 6205 .PUSHJ @ZTDECNW ; ... 04422 5506 4399 04423 5510 JMP @ZCRLF ; finish the line and return 4400 4401 ; Here if there's no extension ROM, or if it's OK ... 4402 04424 7640 SHOEX1: SZA CLA ; which is it? 4403 04425 5231 JMP SHOEX2 ; no ROM 4404 04426 4511 JMS @ZINLMES ; say "OK " 4405 04427 4357 XRMES3 ; ... 4406 04430 5510 JMP @ZCRLF ; and we're done 4407 4408 ; Here if there's no extension ROM ... 4409 04431 4511 SHOEX2: JMS @ZINLMES ; say "Not detected" 4410 04432 4322 NDETMS ; ... 4411 04433 5510 JMP @ZCRLF ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 104 Initialize and Show RAM Disk Status bts6120.plx 4412 .TITLE Initialize and Show RAM Disk Status 4413 4414 ; This routine will initialize the RAM disk array and then show it's status 4415 ; by printing a message like one of these - 4416 ; 4417 ; NVR: Not detected 4418 ; NVR: 1024K 4419 ; 4420 ; In addition, if the battery status is known then it will be appended to 4421 ; the message - 4422 ; 4423 ; NVR: 1024K, battery OK 4424 ; 4425 ; This is normally called only once, by the startup code. It does actually 4426 ; initialize the RAM disk related variables such as RDTYPE and RDSIZE, although 4427 ; it is harmless and this routine could actually be called more than once. 4428 04434 4532 SHONVR: JMS @ZPUSHJ1 ; first determine the type of the RAMDisk 4429 04435 0600 RDCHK1 ; .... and set RDTYPE 4430 04436 4511 JMS @ZINLMES ; say 4431 04437 4250 RAMMS1 ; "NVR: " 4432 04440 4532 JMS @ZPUSHJ1 ; test all eight RAM disk units 4433 04441 1446 RDTEST ; .... and set RDSIZE 4434 04442 7450 SNA ; skip if a RAM disk is present 4435 04443 5273 JMP NONVR ; none detected 4436 04444 6205 .PUSHJ @ZTDECNW ; type out the total RAM size 04445 5506 4437 4438 04446 1035 TAD RCFLAG ; is this the SBC6120-RC model? 4439 04447 7650 SNA CLA ; skip if it's the SBC6120-RC model 4440 04450 5254 JMP SHONV1 ; 4441 04451 4511 JMS @ZINLMES ; on the RC model say "KW" not "KB" 4442 04452 4260 RAMMS4 ; ... 4443 04453 5256 JMP SHONV2 ; ... 4444 04454 4511 SHONV1: JMS @ZINLMES ; say 4445 04455 4255 RAMMS3 ; "KB" 4446 4447 04456 6211 SHONV2: CDF 1 ; the battery OK flag lives in field 1 4448 04457 1776 TAD @[BATTOK] ; get the battery status flag 4449 04460 6201 CDF 0 ; ... 4450 04461 7450 SNA ; if it's zero the battery status is unknown 4451 04462 5272 JMP NORDM ; ... so say nothing 4452 04463 7700 SMA CLA ; -1 means battery OK 4453 04464 5270 JMP RDBFAI ; and +1 is battery fail 4454 04465 4511 JMS @ZINLMES ; say 4455 04466 4263 BOKMSG ; ... "- Battery OK" 4456 04467 5272 JMP NORDM ; and we're done 4457 04470 4511 RDBFAI: JMS @ZINLMES ; say 4458 04471 4275 BFAMSG ; ... "- Battery FAIL" 4459 04472 5510 NORDM: JMP @ZCRLF ; finish the status report and we're done 4460 4461 ; Here if no RAM disk is detected ... 4462 04473 4511 NONVR: JMS @ZINLMES ; say "not detected" ... 4463 04474 4322 NDETMS ; ... 4464 04475 5510 JMP @ZCRLF ; print a new line and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 105 Initialize and Show IDE Disk Status bts6120.plx 4465 .TITLE Initialize and Show IDE Disk Status 4466 4467 ; This routine will probe the IDE bus for any drive that might be attached 4468 ; and, depending on what it finds, it will print out a line like this - 4469 ; 4470 ; IDE: 122MB - SanDisk SDCFJ-128 4471 ; IDE: Not detected 4472 ; IDE: Not supported 4473 ; 4474 ; The information about the drive size and manufacturer comes from an ATA 4475 ; IDENTIFY DEVICE command which we send to the drive. The DISKID routine will 4476 ; extract the drive's capacity, in MB, from that and leave the result at DKSIZE. 4477 ; DISKID also leaves the first 256 bytes of the drive's response in the DSKBUF, 4478 ; and we can use that to type out the drive's make and model, which appears 4479 ; there in plain ASCII. 4480 ; 4481 ; Note that this routine actually does initialize the drive and it is called 4482 ; during the startup procedure for just that purpose. This is mostly harmless, 4483 ; however, and it can actually be done more than once. 4484 ; 4485 ; Also note that under some circumstances if a non-working drive is attached, 4486 ; then we may have to wait for IDEINI to time out before proceeding. This can 4487 ; take upwards of 30 seconds! 4488 04476 7200 SHOIDE: CLA ; ... 4489 04477 1035 TAD RCFLAG ; is this the RC model? 4490 04500 7640 SZA CLA ; ??? 4491 04501 5340 JMP RC1IDE ; yep - it has no IDE option of any kind 4492 04502 4511 JMS @ZINLMES ; say 4493 04503 4310 IDEMS1 ; "IDE: " 4494 04504 4532 JMS @ZPUSHJ1 ; (cross field call) 4495 04505 1013 IDEINI ; initialize the IDE interface 4496 04506 7430 SZL ; is there a drive attached? 4497 04507 5335 JMP NOIDE ; nope - quit now 4498 04510 4532 JMS @ZPUSHJ1 ; (cross field call) 4499 04511 1047 DISKID ; send an IDENTIFY DEVICE command to the drive 4500 04512 7630 SZL CLA ; did it work ? 4501 04513 5335 JMP NOIDE ; nope - there's no disk there after all 4502 04514 6211 CDF 1 ; disk data lives in field 1 4503 04515 3775 DCA @[DSKBUF+135] ; (make the model string ASCIZ) 4504 04516 1774 TAD @[DKSIZE] ; get the total disk size 4505 04517 6201 CDF 0 ; ... 4506 04520 7450 SNA ; is the disk size zero ? 4507 04521 5332 JMP BADIDE ; yes - this disk is "unsupported" ! 4508 04522 6205 .PUSHJ @ZTDECNW ; and type it out in decimal 04523 5506 4509 04524 4511 JMS @ZINLMES ; say 4510 04525 4315 IDEMS2 ; "MB" 4511 04526 1373 TAD [DSKBUF+66-1] ; point to the make/model string 4512 04527 6205 .PUSHJ @[TASZF1] ; and type that out, in ASCII 04530 5772 4513 04531 5510 JMP @ZCRLF ; go type a CRLF and we're done 4514 4515 ; Here if an unsupported (i.e. one which does not support LBA addressing) 4516 ; is detected... 4517 04532 4511 BADIDE: JMS @ZINLMES ; say 4518 04533 4333 NSUPMS ; "not supported" 4519 04534 5510 JMP @ZCRLF ; ... 4520 4521 ; Here if no IDE disk is detected... 4522 04535 4511 NOIDE: JMS @ZINLMES ; and say 4523 04536 4322 NDETMS ; "NONE" 4524 04537 5510 JMP @ZCRLF ; finish the line and we're done 4525 4526 ; Here if we're running on the SBC6120-RC model. This model has no IDE 4527 ; option so we know there's no drive out there, but we have to call IDEINI PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 106 Initialize and Show IDE Disk Status bts6120.plx 4528 ; anyway so that the disk related variables (like DKSIZE) will get initialized 4529 ; to their "no drive attached" state. It we don't do this, then we'll get 4530 ; random results on the RC model if somebody actually tries to access the 4531 ; drive. BTW, the only reason this needs to be a special case at all is so that 4532 ; we can avoid printing "IDE: Not detected" on the RC model. 4533 04540 4532 RC1IDE: JMS @ZPUSHJ1 ; call IDEINI anyway 4534 04541 1013 IDEINI ; initialize the IDE interface 4535 04542 6225 .POPJ ; and ignore the result PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 107 Call Routines in Field 1 bts6120.plx 4536 .TITLE Call Routines in Field 1 4537 4538 ; This routine will allow a routine in field zero to simulate a .PUSHJ 4539 ; to a routine in field one. Even better, when the routine in field one 4540 ; executes a .POPJ, the return will eventually be to field zero! The 4541 ; contents of the AC are preserved both ways across the call. 4542 ; 4543 ;CALL: 4544 ; JMS @ZPUSHJ1 ; cross field call 4545 ; ; address of a routine in field 1 4546 ; ; with the AC preserved across the call 4547 ; 4548 04543 0000 PUSHJ1: 0 ; call here with a JMS instruction 4549 04544 3362 DCA PUSHAC ; save the caller's AC for a minute 4550 04545 1743 TAD @PUSHJ1 ; then get caller's argument 4551 04546 3361 DCA F1ADDR ; that's the address of the routine to call 4552 04547 1343 TAD PUSHJ1 ; now get caller's return address 4553 04550 7001 IAC ; and skip over the argument 4554 04551 6215 .PUSH ; put that on the stack 4555 04552 7200 CLA ; (PUSH doesn't clear the AC!) 4556 04553 1371 TAD [POPJ1] ; the field one routine will return to 4557 04554 6215 .PUSH ; ... POPJ1: in field one 4558 04555 7200 CLA ; ... 4559 04556 1362 TAD PUSHAC ; restore the original AC contents 4560 04557 6213 CXF 1 ; call with IF = DF = 1 4561 04560 5761 JMP @.+1 ; and go to the code in field 1 4562 04561 F1ADDR: .BLOCK 1 ; gets the address of the field 1 routine 4563 04562 PUSHAC: .BLOCK 1 ; a temporary place to save the AC 4564 4565 ; When the routine in field one executes a .POPJ, it will actually return to 4566 ; the code at POPJ1: _in field one_ !! Since we've also stacked our original 4567 ; caller's return address, the code at POPJ1 really only needs to do two 4568 ; things, a "CXF 0" to return to field zero, and then another .POPJ. 4569 ; Unfortunately, this code has to live in field one, so you won't find it 4570 ; here! 4571 04571 0306 04572 6255 04573 7465 04574 0022 04575 7535 04576 0033 04577 7776 4572 04600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 108 SD Command - Spin IDE Drives UP or DOWN bts6120.plx 4573 .TITLE SD Command - Spin IDE Drives UP or DOWN 4574 4575 4576 ; The SD command takes a single argument (interpreted as a decimal number, 4577 ; if it matters). It will spin up the attached IDE disk if the argument is 4578 ; non-zero or spin the drive down if the argument is zero. Note that not all 4579 ; IDE drives support the spin down command, but we'll give it our best try. 4580 4581 04600 6205 SPINCD: .PUSHJ @[DECNW] ; get the 0/1 argument 04601 5777 4582 04602 6205 .PUSHJ @ZEOLTST ; and that should be the end 04603 5516 4583 04604 6205 .PUSHJ @[NODISK] ; be sure an IDE disk is actually attached 04605 5776 4584 04606 1067 TAD WORD ; get the argument 4585 04607 7650 SNA CLA ; non-zero -> SPIN UP, zero -> SPIN DOWN 4586 04610 5214 JMP SDNCMD ; spin down 4587 4588 ; Here to SPIN UP ... 4589 04611 4532 SUPCMD: JMS @ZPUSHJ1 ; call a field 1 routine 4590 04612 1276 SPINUP ; spin up the attached IDE drive 4591 04613 6225 .POPJ ; and we're all done 4592 4593 ; And here for SPIN DOWN ... 4594 04614 4532 SDNCMD: JMS @ZPUSHJ1 ; pretty much the same as the SPIN UP case 4595 04615 1303 SPINDN ; ... 4596 04616 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 109 Simple Lexical Functions bts6120.plx 4597 .TITLE Simple Lexical Functions 4598 4599 4600 ; This routine will skip over any spaces in the command line and return the 4601 ; next non-space character in the AC and SAVCHR... 4602 4603 ; Here to start skipping with the next character... 4604 04617 6205 SPACMP: .PUSHJ @ZGET ; Get the next character 04620 5520 4605 4606 ; Here to consider the current character and then skip... 4607 04621 7200 SPACM0: CLA ; Be sure the AC is safe to use 4608 04622 1052 TAD SAVCHR ; And look at the current character 4609 04623 1140 TAD ZMSPACE ; Compare it to a space 4610 04624 7650 SNA CLA ; ??? 4611 04625 5217 JMP SPACMP ; Keep going until we don't find one 4612 04626 1052 TAD SAVCHR ; Restore the character 4613 04627 6225 .POPJ ; And we're all done 4614 4615 ; This routine will examine the current character (in SAVCHR) or the next 4616 ; character (via GET) for end of line, which is stored as a null byte). If 4617 ; it isn't the EOL, then COMERR is called and the current command is aborted, 4618 ; otherwise this routine just returns... 4619 4620 ; Enter here to examine the next character... 4621 04630 6205 EOLNXT: .PUSHJ @ZGET ; Load the next character 04631 5520 4622 ; Then fall into the current character test 4623 4624 ; Enter here to examine the current character... 4625 04632 6205 EOLTST: .PUSHJ @ZSPACM0 ; Allow blanks at the end of the line 04633 5514 4626 04634 7640 SZA CLA ; Is it the end of the line ?? 4627 04635 5530 JMP @ZCOMERR ; No -- that's bad 4628 04636 6225 .POPJ ; Yes -- that's good 4629 4630 ; This routine will test either the current character (via SAVCHR) or the 4631 ; next character (via GET) to see if it's a space. If it isn't, then it 4632 ; jumps to COMERR and aborts the current command... 4633 4634 ; Enter here to examine the next character... 4635 04637 6205 SPANXT: .PUSHJ @ZGET ; get the next character 04640 5520 4636 ; and fall into SPATST... 4637 4638 ; Enter here to examine the current character 4639 04641 7200 SPATST: CLA ; don't require that the AC be cleared 4640 04642 1052 TAD SAVCHR ; get the current character 4641 04643 1140 TAD ZMSPACE ; and compare it to a space 4642 04644 7640 SZA CLA ; well?? 4643 04645 5530 JMP @ZCOMERR ; not equal - this is a bad command line 4644 04646 6225 .POPJ ; it's a space 4645 4646 4647 ; This routine will backup the command scanner so that the character 4648 ; just read will be read again with the next call to GET... 4649 04647 7240 BACKUP: STA ; Load the AC with -1 4650 04650 1013 TAD L ; Then decrement the line pointer 4651 04651 3013 DCA L ; ... 4652 04652 6225 .POPJ ; That's all it takes 4653 04776 2542 04777 6662 4654 05000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 110 Free Space for Future Expansion! bts6120.plx 4655 .TITLE Free Space for Future Expansion! 4656 4657 4658 ; space to put patch code for this field 4659 05000 F0PATCH: 4660 4661 05600 .PAGE 30-1 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 111 Front Panel Initialization bts6120.plx 4662 .TITLE Front Panel Initialization 4663 4664 4665 ; This routine will determine if a FP6120 front panel is attached and, if 4666 ; one is, will initialize it. If a front panel is present, the FPDTCT word 4667 ; will be set to a non-zero value. This serves as a flag to control the 4668 ; actions of all the other front panel code. 4669 05600 7200 FPINIT: CLA ; clear all the FP variables anyway 4670 05601 3061 DCA FNSTAT ; just in case 4671 05602 3062 DCA BTSWCN ; ... 4672 05603 3063 DCA FPPGMM ; ... 4673 4674 ; If a front panel is installed, then the CCPR IOT will not only clear 4675 ; the CP timer and HALTSW flags, but it will also clear the AC as well. 4676 ; If no front panel is present, then CCPR is a no-op. That's an easy 4677 ; way to determine if a FP6120 is present. 4678 05604 7240 STA ; set the AC to -1 4679 05605 6430 CCPR ; clear the AC if an FP is present 4680 05606 7040 CMA ; 0 if no FP, -1 if an FP 4681 05607 3060 DCA FPDTCT ; and set the flag 4682 05610 1060 TAD FPDTCT ; get it back again 4683 05611 7650 SNA CLA ; if there's no front panel 4684 05612 6225 .POPJ ; then we can quit now 4685 4686 ; Just for fun, we display "6120" (in octal, of course) on the ADDRESS 4687 ; LEDs and our BTS6120 version on the DATA LEDs. Unfortunately this works 4688 ; only if the rotary switch is set to MD - you might think it would be easy 4689 ; to make it work for the other positions by adding a WSR here, but it's 4690 ; not that simple. If the rotary switch is set to PS, AC or MQ anything we 4691 ; write there will be overwritten by the UPDISP routine before you ever see 4692 ; it. Sorry. By the way, this rather causually corrupts a word of memory, 4693 ; but this routine is supposed to be used only during initialization anyway... 4694 05613 6266 CPD ; write to main memory 4695 05614 1377 TAD [VERSION] ; get our version number 4696 05615 3776 DCA @[6120] ; and write it to location 6120 4697 05616 6276 SPD ; back to panel data mode 4698 05617 6435 RLOF ; lastly, turn the RUN LED off 4699 05620 6225 .POPJ ; that'll be enough fun for today PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 112 Scan Front Panel Switches bts6120.plx 4700 .TITLE Scan Front Panel Switches 4701 4702 4703 ; This routine will scan all front panel switches, except for HALT and the 4704 ; rotary switch, and look for work to be done. The HALT switch is ignored 4705 ; until we give a command that will transfer control to main memory (e.g. 4706 ; CONTINUE or BOOT), and the rotary switch is handled by the data display 4707 ; update routine. 4708 ; 4709 ; Note that this routine is called only while we're in panel mode and 4710 ; BTS6120 is active - it's never called by the CP timer. The panel switches 4711 ; (except for HALT and the rotary switch) do nothing while a main memory 4712 ; program is running. 4713 05621 1060 SWSCAN: TAD FPDTCT ; get the front panel flag 4714 05622 7650 SNA CLA ; skip if a panel is attached 4715 05623 6225 .POPJ ; no panel - just quit now 4716 05624 6434 RFNS ; read the state of the function switches 4717 05625 0375 AND [7740] ; isolate the switches we know about 4718 05626 7041 CIA ; has there been any change in switch state 4719 05627 1061 TAD FNSTAT ; ... since we were last here? 4720 05630 6432 SPLK ; ignore everything if PANEL LOCK is on! 4721 05631 7650 SNA CLA ; (switches changed ???) 4722 05632 6225 .POPJ ; no (or PANEL LOCK) - there's nothing to do 4723 4724 ; Now that we've detected a change in the switch state, delay for 4725 ; approximately 10-15 milliseconds to allow the switch to stop bouncing. 4726 ; Remember - this code is used only when we're in panel mode; it's never 4727 ; called by the CP timer, so the delay is inconsequential. 4728 ; 4729 ; Each iteration of the delay loop requires 17 minor cycles, or 4.25us 4730 ; with a 8Mhz clock (6.8us at 5Mhz). A 15 ms delay therefore needs 3529 4731 ; iterations (again, assuming an 8Mhz clock). 4732 05633 1374 TAD [-3529.] ; initialize the timer 4733 05634 7001 SWSCA1: IAC ; [6] increment the AC 4734 05635 7440 SZA ; [7] has it overflowed yet? 4735 05636 5234 JMP SWSCA1 ; [4] nope - keep looping 4736 4737 ; Compute (.NOT. ) .AND. - this function gives a 4738 ; 1 bit for every switch which was not pressed before and is pressed now; 4739 ; those are the ones we want to process! 4740 05637 6434 RFNS ; read the current state 4741 05640 0375 AND [7740] ; mask off the unimportant switches 4742 05641 3301 DCA SWTEMP ; save it for a moment 4743 05642 1061 TAD FNSTAT ; get the old state 4744 05643 7040 CMA ; complement 4745 05644 0301 AND SWTEMP ; not old and new 4746 05645 7421 MQL ; save _that_ too 4747 05646 1301 TAD SWTEMP ; lastly update FNSTAT 4748 05647 3061 DCA FNSTAT ; ... for next time around 4749 05650 7701 ACL ; restore the changed switch map 4750 05651 7450 SNA ; if there are no one bits 4751 05652 6225 .POPJ ; then we've got nothing to do! 4752 4753 ; Now figure out which switch is set. It's not really clear what we should 4754 ; do if more than one switch is depressed at the same time (does a real -8 4755 ; have N key rollover for the front panel?) - in this case we just process 4756 ; the first switch that we detect and ignore the rest. 4757 05653 7004 RAL ; put BOOT in LINK and LA in AC0 4758 05654 7430 SZL ; is BOOT pressed? 4759 05655 5773 JMP @[SWBOOT] ; ... 4760 05656 7421 MQL ; save the bits again 4761 05657 3062 DCA BTSWCN ; clear the BOOT count for any key 4762 05660 7701 ACL ; ... _other_ than BOOT 4763 05661 7510 SPA ; what about LA ? 4764 05662 5302 JMP SWLA ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 113 Scan Front Panel Switches bts6120.plx 4765 05663 7006 RTL ; get the next two bits 4766 05664 7430 SZL ; next up is LXA 4767 05665 5311 JMP SWLXA ; ... 4768 05666 7510 SPA ; and after that is CLEAR 4769 05667 5772 JMP @[SWCLR] ; ... 4770 05670 7006 RTL ; position the next bits 4771 05671 7430 SZL ; this position is CONTINUE 4772 05672 5771 JMP @[CONT] ; (CONTINUE is exactly C command) 4773 05673 7510 SPA ; and then EXAM 4774 05674 5335 JMP SWEXA ; .... 4775 05675 7004 RAL ; only one left! 4776 05676 7710 SPA CLA ; the last one is DEP 4777 05677 5325 JMP SWDEP ; ... 4778 05700 6225 .POPJ ; it should be impossible to get here! 4779 4780 ; Temporary storage... 4781 05701 0000 SWTEMP: 0 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 114 FP LA, LXA, EXAMINE and DEPOSIT Switches bts6120.plx 4782 .TITLE FP LA, LXA, EXAMINE and DEPOSIT Switches 4783 4784 4785 ; The LOAD ADDRess switch loads the switches (data switches, this time) 4786 ; into the PC and then displays (if the rotary switch is set to MD) the 4787 ; contents of the addressed location. 4788 05702 7604 SWLA: LAS ; read the switch register 4789 05703 3000 DCA UPC ; and deposit that in the PC 4790 05704 6205 .PUSHJ EXMEM ; display that location 05705 5351 4791 05706 6205 .PUSHJ @[TYPEPC] ; type the PC too 05707 5770 4792 05710 5510 JMP @ZCRLF ; finish the line and exit 4793 4794 4795 ; The LOAD EXTenDed ADDRess switch loads SR9..11 into the user's data 4796 ; field and SR7..9 into the user's instruction field. This is similar 4797 ; to loading the flags register, however the upper six bits are unchanged. 4798 05711 7604 SWLXA: LAS ; read the switch register 4799 05712 0367 AND [77] ; keep only the lower six bits 4800 05713 7421 MQL ; save that for a moment 4801 05714 1002 TAD UFLAGS ; get the last user mode flags 4802 05715 0366 AND [7700] ; keep the upper six bits of that 4803 05716 7501 MQA ; put the two together 4804 05717 3002 DCA UFLAGS ; and update the IF/DF 4805 05720 6205 .PUSHJ EXMEM ; display that location 05721 5351 4806 05722 6205 .PUSHJ @[TYPEPS] ; and type it on the console too 05723 5765 4807 05724 5510 JMP @ZCRLF ; finish the line and exit 4808 4809 4810 ; The DEPosit switch writes SR0..11 to the memory location addressed by 4811 ; the PC, increments the PC (but not the IF!) and then displays the contents 4812 ; of the next location. 4813 05725 6205 SWDEP: .PUSHJ @[USERDF] ; change DF to the last user mode IF 05726 5764 4814 05727 6266 CPD ; address main memory 4815 05730 7604 LAS ; read the data switch register 4816 05731 3400 DCA @UPC ; deposit them into memory 4817 05732 2000 ISZ UPC ; increment the memory address 4818 05733 7000 NOP ; ... 4819 05734 5341 JMP SWEXA1 ; and fall into the EXMEM routine 4820 4821 4822 ; The EXAMine switch increments the PC and then displays the memory location 4823 ; addressed by {IR,PC}. Note that the EXAM switch always does the same thing, 4824 ; however the data display only shows the memory data if the rotary switch is 4825 ; set to MD! 4826 05735 2000 SWEXA: ISZ UPC ; no - increment the user PC 4827 05736 7000 NOP ; ignore any wrap around 4828 05737 6205 .PUSHJ EXMEM ; display that location on the lights 05740 5351 4829 05741 1000 SWEXA1: TAD UPC ; fix up the PC and IF 4830 05742 3037 DCA ADDR ; ... for TMEM 4831 05743 1002 TAD UFLAGS ; ... 4832 05744 0136 AND ZK70 ; ... 4833 05745 3040 DCA ADRFLD ; ... 4834 05746 6205 .PUSHJ @[TMEM] ; type it on the console too 05747 5763 4835 05750 5510 JMP @ZCRLF ; ... 4836 4837 4838 ; This routine displays the location addressed by {IF,PC}. It's used 4839 ; by all the examine, load address and deposit routines... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 115 FP LA, LXA, EXAMINE and DEPOSIT Switches bts6120.plx 4840 05751 6205 EXMEM: .PUSHJ @[USERDF] ; change DF to the last user mode IF 05752 5764 4841 05753 6266 CPD ; address main memory next 4842 05754 1400 TAD @UPC ; and read the location at {IF,PC} 4843 05755 7200 CLA ; we don't actually care what we read! 4844 05756 6276 SPD ; back to panel memory 4845 05757 6201 CDF 0 ; ... 4846 05760 6225 .POPJ ; and we're done... 4847 05763 1060 05764 6000 05765 1265 05766 7700 05767 0077 05770 1255 05771 2216 05772 6017 05773 6007 05774 1067 05775 7740 05776 6120 05777 0321 4848 06000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 116 Change Current DF to User's IF bts6120.plx 4849 .TITLE Change Current DF to User's IF 4850 4851 4852 ; This routine will change the current data field to the user's instruction 4853 ; field, as determined by the last user mode PS in UFLAGS... 4854 06000 7200 USERDF: CLA ; just in case! 4855 06001 1002 TAD UFLAGS ; get the last user mode flags 4856 06002 0136 AND ZK70 ; isolate just the instruction field 4857 06003 1377 TAD [CDF 0] ; make a CDF instruction out of it 4858 06004 3205 DCA .+1 ; and execute that 4859 06005 7000 NOP ; (gets overwritten with a CDF instruction) 4860 06006 6225 .POPJ ; return and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 117 START, CONTINUE and BOOT Switches bts6120.plx 4861 .TITLE START, CONTINUE and BOOT Switches 4862 4863 4864 ; The BOOT switch (what else?) boots the PDP-8. Because BOOT is a fairly 4865 ; dangerous function, we steal a cue from the PDP-8/A and require it to be 4866 ; pressed _twice_ in succession before anything happens. The flag BTSWCN 4867 ; (BooT SWitch CouNt) keeps track of the number of times BOOT has been 4868 ; pressed. 4869 ; 4870 ; Note that the BOOT switch ignores the state of the RUN/HALT switch (i.e. 4871 ; it doesn't single step if the HALT switch is down). That seems like the 4872 ; most useful behavior. 4873 06007 2062 SWBOOT: ISZ BTSWCN ; have we been here before (recently)? 4874 06010 5214 JMP SWBOO1 ; no - wait for a second toggle 4875 06011 6205 .PUSHJ @ZCRLF ; ... 06012 5510 4876 06013 5776 JMP @[BOOT1] ; yes - go find something to boot! 4877 4878 ; Here for the first toggle of two... 4879 06014 7240 SWBOO1: STA ; set the AC to -1 4880 06015 3062 DCA BTSWCN ; and set the counter for next time 4881 06016 6225 .POPJ ; do nothing else this time 4882 4883 4884 ; The CLEAR key clears the AC and other processor registers and then 4885 ; asserts IOCLR L. It also clears the flag bits in the PS, but it leaves 4886 ; the IF, DF and PC alone. It does _not_ (contrary to what I once thought) 4887 ; actually start execution! 4888 06017 3004 SWCLR: DCA USP1 ; clear both stack pointers 4889 06020 3005 DCA USP2 ; ... 4890 06021 3003 DCA UMQ ; the multiplier quotient 4891 06022 3001 DCA UAC ; and the AC 4892 06023 1002 TAD UFLAGS ; get the current flags 4893 06024 0375 AND [77] ; clear all but the IF and DF 4894 06025 3002 DCA UFLAGS ; ... 4895 06026 3063 DCA FPPGMM ; clear the front panel program mode 4896 06027 6007 CAF ; finally, assert IOCLR L 4897 06030 6225 .POPJ ; all done! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 118 HALT Switch bts6120.plx 4898 .TITLE HALT Switch 4899 4900 4901 ; This routine will test the state of the front panel HALT switch and 4902 ; take the skip return if it is in the RUN (i.e. UP) position. If the 4903 ; switch is in the HALT (DOWN) position, then commands that would normally 4904 ; start a main memory program (e.g. STart, Continue, etc) single step 4905 ; instead. 4906 ; 4907 ; If no front panel is installed, this routine always takes the skip 4908 ; (i.e. RUN) return! 4909 ; 4910 ; NOTE that this routine must be called with a JMS and not the usual 4911 ; PUSHJ/POPJ combination! 4912 06031 0000 CHKHLT: 0 ; call here with a JMS! 4913 06032 7300 CLA CLL ; just in case 4914 06033 1060 TAD FPDTCT ; any front panel installed? 4915 06034 7650 SNA CLA ; skip if a FP6120 is present 4916 06035 5242 JMP CHKHL1 ; nope - take the skip return now 4917 06036 6434 RFNS ; read the function switches 4918 06037 0374 AND [20] ; isolate the halt switch bit 4919 06040 6432 SPLK ; ignore it if PANEL LOCK is on! 4920 06041 7640 SZA CLA ; HALT is 1 for UP, 0 for DOWN 4921 06042 2231 CHKHL1: ISZ CHKHLT ; switch is UP, take the skip return 4922 06043 5631 JMP @CHKHLT ; and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 119 Update the Front Panel Data Display bts6120.plx 4923 .TITLE Update the Front Panel Data Display 4924 4925 4926 ; This routine will read the rotary switch position and display the 4927 ; selected data on the data LEDs. There are a couple of points to 4928 ; keep in mind while you read this: 4929 ; 4930 ; * The display is selected by the 4 least significant bits returned 4931 ; by the RFNS IOT. Exactly _one_ of these bits will be a one! 4932 ; 4933 ; * The MD DISP position is handled by the hardware and requires no 4934 ; action on our part. Actually the CP timer interrupt is disabled 4935 ; when the switch is in the MD DISP position, but that doesn't 4936 ; guarantee that this routine won't be called from somewhere else. 4937 ; 4938 ; * If the FPPGMM (Front Panel Program Mode) flag is non-zero, then the 4939 ; main memory program is controlling the data display and, rather than 4940 ; displaying any of the registers, we display the contents of FPPGMD. 4941 ; Of course, this works only if the rotary switch is NOT set to MD! 4942 ; 4943 ; * Since this routine is also called by the 30Hz timer, we want it 4944 ; to be as fast as possible! 4945 4946 ; This entry point is called by the CONOUT and INCHRS routines to keep the 4947 ; front panel alive while BTS6120 is active. That means that you can turn the 4948 ; knob while you're at the BTS6120 prompt and the LEDs will still update as 4949 ; expected. 4950 ; 4951 ; Why bother synchronizing with the CP timer? After all, it doesn't actually 4952 ; matter if the LEDs are updated more often, does it? The problem is the power 4953 ; LED, which blinks when the backup battery is low. If we don't synchronize 4954 ; the display updates with that, then the blinking gets all screwed up. 4955 06044 6433 UPDISI: SCPT ; has the CP timer ticked? 4956 06045 6225 .POPJ ; nope - do nothing 4957 06046 6430 CCPR ; yep - clear the timer flag 4958 ; and fall into UPDISP... 4959 4960 ; And this entry point is called by BTSTRP when a CP timer interrupt occurs 4961 ; and the main memory program is active... 4962 06047 1060 UPDISP: TAD FPDTCT ; get the front panel flag 4963 06050 7650 SNA CLA ; is a front panel attached? 4964 06051 6225 .POPJ ; nope - just quit now 4965 06052 1063 TAD FPPGMM ; front panel program mode? 4966 06053 7640 SZA CLA ; skip if not 4967 06054 5301 JMP PGMDSP ; yes - display the program data only 4968 06055 6434 RFNS ; read the rotary switch 4969 06056 7010 RAR ; put PS DISP L in the link 4970 06057 7430 SZL ; is it set? 4971 06060 5270 JMP PSDISP ; yes - go display the flags 4972 06061 7010 RAR ; next up is AC DISP 4973 06062 7430 SZL ; ??? 4974 06063 5273 JMP ACDISP ; ... 4975 06064 7010 RAR ; test MQ DISP next 4976 06065 7430 SZL ; ??? 4977 06066 5276 JMP MQDISP ; that's the one - go show the MQ 4978 ; The last bit is MD DISP L which, unless the FP hardware is 4979 ; broken, _MUST_ be set. There's no point in checking - just do it. 4980 ; It gets even better because the memory display is handled by the 4981 ; hardware, so there's nothing we need to do! 4982 06067 5303 JMP UPDIS2 ; no action required 4983 4984 ; Here to display the processor flags... 4985 06070 7200 PSDISP: CLA ; ... 4986 06071 1002 TAD UFLAGS ; get the user mode flags 4987 06072 5302 JMP UPDIS1 ; update the LEDs and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 120 Update the Front Panel Data Display bts6120.plx 4988 4989 ; Here to display the AC on the lights... 4990 06073 7200 ACDISP: CLA ; ... 4991 06074 1001 TAD UAC ; display the last user mode AC 4992 06075 5302 JMP UPDIS1 ; ... 4993 4994 ; And here to display the MQ... 4995 06076 7200 MQDISP: CLA ; ... 4996 06077 1003 TAD UMQ ; display the last user mode MQ 4997 06100 5302 JMP UPDIS1 ; ... 4998 4999 ; Here to display the program data.. 5000 06101 1064 PGMDSP: TAD FPPGMD ; get the program data 5001 ;; JMP UPDIS1 ; display it and return 5002 5003 ; Here to actually update the LEDs with whatever is in the AC ... 5004 06102 6246 UPDIS1: WSR ; display that on the lights 5005 06103 7300 UPDIS2: CLA CLL ; (just in case!) 5006 ; fall into the low battery warning function PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 121 Blink Power LED for Low Battery bts6120.plx 5007 .TITLE Blink Power LED for Low Battery 5008 5009 ; This routine will blink the power LED on the SBC6120-RC model when the 5010 ; memory backup battery is low. It's called via the UPDISP front panel update 5011 ; function and it times the blinking to roughly a 1Hz rate by counting the CP 5012 ; timer interrupts. Sadly, it only works on the RC model - the original FP6120 5013 ; lacks any kind of power LED... 5014 5015 06104 1035 BLOWRN: TAD RCFLAG ; see if this is even the -RC model at all 5016 06105 7650 SNA CLA ; skip if we're running on the SBC6120-RC 5017 06106 6225 .POPJ ; nope - just quit now 5018 06107 6436 SBBLO2 ; SBC6120-RC - is the backup batter low? 5019 06110 5317 JMP BLOWR1 ; nope - turn the power LED on and quit 5020 5021 ; If we get here then we are running on the SBC6120-RC model AND the backup 5022 ; battery is really low. We want to blink the power LED at roughly a 1Hz rate. 5023 ; That's easy enough to do if we increment the BLTIME counter every time we're 5024 ; here (assuming that we're only called once per CP timer event) and then use 5025 ; bit 7 (2**5 == 32) of the count to tell us whether to turn the LED on or off. 5026 06111 2036 ISZ BLTIME ; increment the count 5027 06112 7000 NOP ; ... don't care ... 5028 06113 1036 TAD BLTIME ; get the current count 5029 06114 0374 AND [20] ; check just one bit 5030 06115 7650 SNA CLA ; should we turn the LED on or off ?? 5031 06116 5321 JMP BLOWR2 ; off... 5032 5033 ; Power LED on ... 5034 06117 6417 BLOWR1: PLON ; power LED on ... 5035 06120 6225 .POPJ ; and we're done 5036 5037 ; Power LED off... 5038 06121 6415 BLOWR2: PLOF ; ... 5039 06122 6225 .POPJ ; ... 5040 06174 0020 06175 0077 06176 2452 06177 6201 5041 06200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 122 Type ASCII Strings bts6120.plx 5042 .TITLE Type ASCII Strings 5043 5044 5045 ; This routine will type a ASCIZ string stored in field 1 using the standard 5046 ; OS/8 "3 for 2" packing system. This format is used by the monitor to store 5047 ; help and error messages. On call, the address of the string is passed in the 5048 ; AC and, on return, the AC will always be cleared. 5049 06200 1377 OUTSTR: TAD [-1] ; auto index registers pre-increment 5050 06201 3010 DCA X1 ; ... 5051 06202 7346 NLM3 ; load the AC with -3 5052 06203 3072 DCA DIGITS ; and initialize the character counter 5053 5054 ; Get the next character and output it... 5055 06204 6211 OUTST1: CDF 1 ; strings always live in field 1 5056 06205 2072 ISZ DIGITS ; which character are we on? 5057 06206 5227 JMP OUTST2 ; first or second - they're easy 5058 5059 ; Extract the third character from a triplet... 5060 06207 7346 NLM3 ; re-initialize the character counter 5061 06210 3072 DCA DIGITS ; ... 5062 06211 7344 NLM2 ; then load the AC with -2 5063 06212 1010 TAD X1 ; and backup the string pointer 5064 06213 3010 DCA X1 ; ... 5065 06214 1410 TAD @X1 ; get the first word of the pair 5066 06215 0142 AND ZK7400 ; get the upper four bits of the word 5067 06216 7002 BSW ; position them in the upper bits of the byte 5068 06217 7106 CLL RTL ; ... 5069 06220 7421 MQL ; save it in the MQ for a while 5070 06221 1410 TAD @X1 ; then get the second word again 5071 06222 0142 AND ZK7400 ; the upper four bits again 5072 06223 7002 BSW ; become the lower for bits of the byte 5073 06224 7112 CLL RTR ; ... 5074 06225 7501 MQA ; put the byte together 5075 06226 5230 JMP OUTST3 ; and type it normally 5076 5077 ; Here for the first or second character of a triplet... 5078 06227 1410 OUTST2: TAD @X1 ; get the character 5079 06230 0135 OUTST3: AND ZK177 ; trim it to just seven bits 5080 06231 6201 CDF 0 ; restore the original data field 5081 06232 7450 SNA ; end of string ? 5082 06233 6225 .POPJ ; yes - we can quit now 5083 06234 6205 .PUSHJ @ZOUTCHR ; nope - type this one too 06235 5476 5084 06236 5204 JMP OUTST1 ; and go do the next 5085 5086 ; This routine does exactly the same thing as OUTSTR, except that it allows 5087 ; the message pointer to be passed in line, via a JMS instruction 5088 06237 0000 INLMES: 0 ; call here via a JMS instruction 5089 06240 7200 CLA ; ... 5090 06241 1637 TAD @INLMES ; fetch the string address 5091 06242 6205 .PUSHJ OUTSTR ; type it out 06243 5200 5092 06244 2237 ISZ INLMES ; skip over the address 5093 06245 5637 JMP @INLMES ; and return 5094 5095 ; This routine will type an ASCIZ string, packed one character per word and 5096 ; terminated with a null character, on the terminal. The address of the 5097 ; string, -1, should be loaded into the AC before calling this routine, and 5098 ; the AC will always be cleared on return. 5099 06246 3010 TASCIZ: DCA X1 ; save the pointer to the string 5100 06247 1410 TASCI1: TAD @X1 ; and get the first character 5101 06250 7450 SNA ; is this the end of the string ?? 5102 06251 6225 .POPJ ; yes -- quit now 5103 06252 6205 .PUSHJ @ZOUTCHR ; no -- type this character 06253 5476 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 123 Type ASCII Strings bts6120.plx 5104 06254 5247 JMP TASCI1 ; and then loop until the end 5105 5106 ; This routine is identical to TASCIZ, except that the string is stored in 5107 ; field 1, rather than field 0... 5108 06255 3010 TASZF1: DCA X1 ; save the pointer to the string 5109 06256 6211 CDF 1 ; the string is in field 1 5110 06257 1410 TAD @X1 ; and get the next character 5111 06260 6201 CDF 0 ; back to our field 5112 06261 7450 SNA ; is this the end of the string ?? 5113 06262 6225 .POPJ ; yes -- quit now 5114 06263 6205 .PUSHJ @ZOUTCHR ; no -- type this character 06264 5476 5115 06265 5256 JMP TASZF1+1 ; and then loop until the end PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 124 Type SIXBIT Words, and Characters bts6120.plx 5116 .TITLE Type SIXBIT Words, and Characters 5117 5118 5119 ; This routine will type the two character SIXBIT word contained in the AC. 5120 ; It always types exactly two characters, so if the second character is a null 5121 ; (00), then a trailing blank appears. The AC is cleared on return. 5122 06266 3067 TSIXW: DCA WORD ; Save the 2 characters 5123 06267 1067 TAD WORD ; And get them back 5124 06270 7002 BSW ; Position the first one 5125 06271 6205 .PUSHJ TSIXC ; And type it out 06272 5274 5126 06273 1067 TAD WORD ; No -- get the second character 5127 ; And fall into the TSIXC routine 5128 5129 ; This routine will type a single SIXBIT character from the right 5130 ; byte of the AC. The AC will be cleared on return. 5131 06274 0376 TSIXC: AND [77] ; Trim the character to just 6 bits 5132 06275 1375 TAD [" "] ; No -- convert the character to ASCII 5133 06276 5774 JMP @[THCHAR] ; And type it out PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 125 Type Decimal Numbers bts6120.plx 5134 .TITLE Type Decimal Numbers 5135 5136 5137 ; This routine will type the contents of the AC in decimal. It always 5138 ; treats the AC as an unsigned quantity and will type numbers from 0 to 4095. 5139 ; It uses locations WORD and COUNT and the AC is always cleared on return. 5140 06277 3067 TDECNW: DCA WORD ; remember the number to be typed 5141 06300 3072 DCA DIGITS ; and clear the quotient 5142 06301 1067 TAD WORD ; get the dividend back again 5143 5144 ; Divide by 10 via repeated subtraction... 5145 06302 7100 TDECN1: CLL ; make sure the LINK is clear 5146 06303 1373 TAD [-10.] ; subtract 10 from the dividend 5147 06304 7420 SNL ; did it fit ??? 5148 06305 5310 JMP TDECN2 ; no -- go get the remainder 5149 06306 2072 ISZ DIGITS ; yes -- increment the quotient 5150 06307 5302 JMP TDECN1 ; and keep dividing 5151 5152 ; Now figure the remainder... 5153 06310 1372 TDECN2: TAD [10.] ; correct the remainder 5154 06311 6215 .PUSH ; and save it on the stack 5155 06312 7200 CLA ; get the quotient 5156 06313 1072 TAD DIGITS ; ... 5157 06314 7450 SNA ; is it zero ??? 5158 06315 5320 JMP TDECN3 ; yes -- proceed 5159 06316 6205 .PUSHJ TDECNW ; no type that part first 06317 5277 5160 5161 ; Here to type the digit and return... 5162 06320 6235 TDECN3: .POP ; restore the remainder 5163 06321 5771 JMP @[TDIGIT] ; type it in ASCII and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 126 Type Octal Numbers bts6120.plx 5164 .TITLE Type Octal Numbers 5165 5166 5167 ; This routine will type a 4 digit octal number passed in the AC. It always 5168 ; prints exactly four digits, with leading zeros added as necessary. The AC 5169 ; will be cleared on return. 5170 06322 3067 TOCT4: DCA WORD ; save the number to type 5171 06323 1370 TAD [-4] ; and get the number of iterations 5172 06324 3072 TOCTN: DCA DIGITS ; ... 5173 5174 ; Extract one digit and print it... 5175 06325 1067 TOCTL: TAD WORD ; get the remaining bits 5176 06326 7106 CLL RTL ; shift them left 2 bits 5177 06327 7006 RTL ; and then 2 more (remember the link!) 5178 06330 3052 DCA SAVCHR ; remember that for a later 5179 06331 1052 TAD SAVCHR ; and we also need it now 5180 06332 7010 RAR ; restore the extra bit (in the link) 5181 06333 3067 DCA WORD ; then remember the remaining bits 5182 06334 1052 TAD SAVCHR ; get the digit back 5183 06335 0137 AND ZK7 ; trim it to just 3 bits 5184 06336 6205 .PUSHJ @[TDIGIT] ; type it out 06337 5771 5185 5186 ; Here after we have typed another digit... 5187 06340 2072 ISZ DIGITS ; is this enough ?? 5188 06341 5325 JMP TOCTL ; no -- keep typing 5189 06342 6225 .POPJ ; yes -- quit now 5190 5191 ; This routine is identical to TOCT4, except that it types only three digits 5192 ; with leading zeros. It's useful for printing eight bit quantities... 5193 06343 7014 TOCT3: R3L ; throw away the most significant digit 5194 06344 3067 DCA WORD ; save the value to be typed 5195 06345 7346 NLM3 ; get the number of iterations 5196 06346 5324 JMP TOCTN ; and join the regular code 5197 5198 ; This small routine will type an octal number in the AC followed by a space. 5199 06347 6205 TOCT4S: .PUSHJ TOCT4 ; then type the data in octal 06350 5322 5200 06351 5477 JMP @ZTSPACE ; finally type a space and return 5201 5202 ; This small routine will type an octal number from the AC followed by a CRLF. 5203 06352 6205 TOCT4C: .PUSHJ TOCT4 ; and type that in octal 06353 5322 5204 06354 5510 JMP @ZCRLF ; finish with a CRLF 5205 5206 06355 6205 TOCT4M: .PUSHJ TOCT4 ; and type that in octal 06356 5322 5207 06357 6205 .PUSHJ @ZCRLF ; finish with a CRLF 06360 5510 5208 06361 5527 JMP @ZRESTA 5209 06370 7774 06371 7102 06372 0012 06373 7766 06374 7427 06375 0040 06376 0077 06377 7777 5210 06400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 127 Type Table of Messages bts6120.plx 5211 .TITLE Type Table of Messages 5212 5213 ; This routine will type a "text table" - a whole block of several lines of 5214 ; text. The text is specified by passing a table pointer, where each entry 5215 ; in the table is the address of an ordinary text message. Each message is 5216 ; printed as a single line, and all the lines in the table are printed as a 5217 ; block of text. The text table ends with a zero pointer. 5218 ; 5219 ; It sounds arcane, but it's used to type the help messages and that's about 5220 ; all. BTW, all text tables and text messages are assumed to live in field 1. 5221 ; 5222 ; For example - 5223 ; 5224 ; .FIELD 0 5225 ; ... 5226 ; JMS @[TTEXTT] 5227 ; HLPTBL 5228 ; ... 5229 ; 5230 ; .FIELD 1 5231 ;HLPTBL:MSG1 5232 ; MSG2 5233 ; 0 5234 ; ... 5235 ;MSG1: .TEXT /line 1/ 5236 ;MSG2: .TEXT /line 2/ 5237 ; ... 5238 ; 5239 ; Simple, no? 5240 06400 0000 TTEXTT: 0 ; notice that we're called by a JMS! 5241 06401 7240 STA ; (AI registers pre-increment!) 5242 06402 1600 TAD @TTEXTT ; get the address of the text table -1 5243 06403 3012 DCA X3 ; and save in an auto index register 5244 06404 2200 ISZ TTEXTT ; be sure to skip over the argument on return 5245 06405 6211 TTEXT1: CDF 1 ; the help text and table lives in field 1 5246 06406 1412 TAD @X3 ; get the next help message 5247 06407 6201 CDF 0 ; back to our field 5248 06410 7450 SNA ; end of list? 5249 06411 5600 JMP @TTEXTT ; yep - we can quit now 5250 06412 6205 .PUSHJ @[OUTSTR] ; nope - type this string 06413 5777 5251 06414 6205 .PUSHJ @ZCRLF ; and finish the line 06415 5510 5252 06416 5205 JMP TTEXT1 ; keep typing until we run out of strings PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 128 Type 15 Bit Addresses bts6120.plx 5253 .TITLE Type 15 Bit Addresses 5254 5255 5256 ; This routine will type a 15 bit address, passed in location ADDR, and with 5257 ; the field is in location ADRFLD. The address will be typed as a 5 digit 5258 ; octal number, and then followed by a "/" character and a space. The initial 5259 ; contents of the AC are ignored and the AC is always cleared on return. 5260 06417 7200 TADDR: CLA ; ... 5261 06420 1040 TAD ADRFLD ; get the high 3 bits of the address 5262 06421 6205 .PUSHJ @[TFIELD] ; type that out 06422 5776 5263 06423 1037 TAD ADDR ; then get the address 5264 06424 6205 .PUSHJ @ZTOCT4 ; and type all 12 bits of that 06425 5501 5265 06426 6205 .PUSHJ @[TSLASH] ; type a slash as a separator 06427 5775 5266 06430 5477 JMP @ZTSPACE ; finish with a space 5267 5268 ; This routine will type a single octal digit which represents a memory 5269 ; field. The field should be passed in the AC. 5270 06431 7010 TFIELD: RAR ; right justify the field number 5271 06432 7012 RTR ; ... 5272 06433 0137 AND ZK7 ; trim it to just 3 bits 5273 06434 5774 JMP @[TDIGIT] ; and fall into TDIGIT... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 129 Scan Addresses bts6120.plx 5274 .TITLE Scan Addresses 5275 5276 5277 ; This routine will read a 15 bit address into registers ADDR and ADRFLD. 5278 06435 6205 RDADDR: .PUSHJ @[OCTNF] ; read the 15 bit address 06436 5773 5279 06437 1067 TAD WORD ; get the low order bits 5280 06440 3037 DCA ADDR ; and put them in ADDR 5281 06441 6225 .POPJ ; that's it... 5282 5283 ; This routine will read a 15 bit address into registers HIGH and HGHFLD. 5284 06442 6205 RDHIGH: .PUSHJ RDADDR ; read a 15 bit address 06443 5235 5285 06444 1037 TAD ADDR ; get the low order bits 5286 06445 3042 DCA HIGH ; into HIGH 5287 06446 1040 TAD ADRFLD ; get the field 5288 06447 3044 DCA HGHFLD ; into HGHFLD 5289 06450 6225 .POPJ ; and that's all 5290 5291 ; This routine will read a 15 bit address into registers LOW AND LOWFLD. 5292 06451 6205 RDLOW: .PUSHJ RDADDR ; the same thing as before 06452 5235 5293 06453 1037 TAD ADDR ; ... 5294 06454 3043 DCA LOW ; only the names have changed 5295 06455 1040 TAD ADRFLD ; ... 5296 06456 3045 DCA LOWFLD ; ... 5297 06457 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 130 Scan an Address Range bts6120.plx 5298 .TITLE Scan an Address Range 5299 5300 5301 ; This routine will read either one or two octal numbers which describe a 5302 ; range of memory addresses. A range may be a single number (in which case 5303 ; the starting and ending values are the same) or two numbers with a space 5304 ; character between them (in which case the first number is the starting value 5305 ; and the last is the ending value). The starting value is always returned in 5306 ; locations LOW/LOWFLD and ADDR/ADRFLD, and the ending value is placed in 5307 ; HIGH/HGHFLD. If two addresses were seen, the LINK will be set upon return; 5308 ; it is cleared if only one address was found. 5309 06460 6205 RANGE: .PUSHJ RDLOW ; first read the low part of the range 06461 5251 5310 06462 6205 .PUSHJ @ZSPACM0 ; get the next non-space character 06463 5514 5311 06464 1372 TAD [-"-"] ; is it a range delimiter ?? 5312 06465 7640 SZA CLA ; ??? 5313 06466 5304 JMP RANGE1 ; no -- this must be the single address type 5314 5315 ; Here for a two address range... 5316 06467 6205 .PUSHJ RDHIGH ; go read the high order part of the range 06470 5242 5317 06471 1043 TAD LOW ; make ADDR point to the starting point 5318 06472 3037 DCA ADDR ; ... 5319 06473 1045 TAD LOWFLD ; ... 5320 06474 3040 DCA ADRFLD ; ... 5321 06475 6205 .PUSHJ TSTADR ; then be sure the numbers are in order 06476 5325 5322 06477 7020 CML ; ... 5323 06500 7630 SZL CLA ; ??? 5324 06501 6225 .POPJ ; yes -- return with the link set 5325 06502 4531 JMS @ZERROR ; no -- this isn't legal 5326 06503 3455 ERRRAN ; ?WRONG ORDER 5327 5328 ; Here for a single address range... 5329 06504 1043 RANGE1: TAD LOW ; set the high equal to the low 5330 06505 3042 DCA HIGH ; ... 5331 06506 1045 TAD LOWFLD ; ... 5332 06507 3044 DCA HGHFLD ; ... 5333 06510 7100 CLL ; Then return with the link cleared 5334 06511 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 131 Address Arithmetic bts6120.plx 5335 .TITLE Address Arithmetic 5336 5337 5338 ; This routine will increment the 15 bit address contained in registers 5339 ; ADDR and ADRFLD. If the address increments past 77777, the link will be 5340 ; 1 on return; otherwise it is always 0. 5341 06512 7300 NXTADR: CLA CLL ; ... 5342 06513 2037 ISZ ADDR ; increment the address 5343 06514 6225 .POPJ ; no wrap around -- leave the field alone 5344 06515 1040 TAD ADRFLD ; wrap around -- increment the field too 5345 06516 1371 TAD [-70] ; are we already in field 7 ?? 5346 06517 7510 SPA ; ??? 5347 06520 7020 CML ; no -- make the LINK be cleared on return 5348 06521 1370 TAD [70+10] ; restore and increment the field 5349 06522 0136 AND ZK70 ; only allow these bits in the result 5350 06523 3040 DCA ADRFLD ; and put it back 5351 06524 6225 .POPJ ; ... 5352 5353 ; This routine will compare the 15 bit address in registers ADDR and 5354 ; ADRFLD to the address in registers HIGH and HGHFLD. If ADDR/ADRFLD 5355 ; is less than HIGH/HGHFLD, the link will be zero on return. If ADDR/ADRFLD 5356 ; is greater then or equal to HIGH/HGHFLD, the link will be one. 5357 06525 7300 TSTADR: CLA CLL ; clear the AC and set L = 0 5358 06526 1040 TAD ADRFLD ; get the field 5359 06527 7061 CMA IAC CML ; negate the field and set L = 1 5360 06530 1044 TAD HGHFLD ; compare to the high field 5361 06531 7640 SZA CLA ; are they equal ?? 5362 06532 6225 .POPJ ; no -- the LINK has the correct status 5363 06533 1042 TAD HIGH ; yes -- compare the addresses 5364 06534 7041 CMA CIA ; L = 0 now 5365 06535 1037 TAD ADDR ; ... 5366 06536 7200 CLA ; clear the AC 5367 06537 6225 .POPJ ; but return the status in the LINK 5368 5369 ; This routine will swap the 15 bit address in ADDR/ADRFLD with the the 5370 ; 15 bit address in LOW/LOWFLD. The AC is always cleared. 5371 06540 7200 SWPADR: CLA ; ... 5372 06541 1043 TAD LOW ; get one value 5373 06542 7421 MQL ; and save it in the MQ 5374 06543 1037 TAD ADDR ; then get the other 5375 06544 3043 DCA LOW ; move it to the other place 5376 06545 7501 MQA ; and get the original one back 5377 06546 3037 DCA ADDR ; it goes in the second location 5378 06547 1045 TAD LOWFLD ; now do the same thing for fields 5379 06550 7421 MQL ; ... 5380 06551 1040 TAD ADRFLD ; ... 5381 06552 3045 DCA LOWFLD ; ... 5382 06553 7501 MQA ; ... 5383 06554 3040 DCA ADRFLD ; ... 5384 06555 6225 .POPJ ; that's all there is to it 5385 06570 0100 06571 7710 06572 7723 06573 7004 06574 7102 06575 7074 06576 6431 06577 6200 5386 06600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 132 Scan a Command Name bts6120.plx 5387 .TITLE Scan a Command Name 5388 5389 5390 ; This routine will scan a command or register name for the monitor. Names 5391 ; are always alphabetic, may not contain any digits, and are limited to one or 5392 ; two letters. The result is stored, in SIXBIT, in location NAME. One letter 5393 ; commands are left justified and padded on the right with zeros. If the end 5394 ; of line is the next character, then this routine will return with NAME set 5395 ; to zero and no error. If, however, there is a least one character out there 5396 ; and it is not a letter, then COMERR will be called... 5397 06600 7200 NAMENW: CLA ; be sure the AC is zero 5398 06601 3047 DCA NAME ; and clear the resulting name 5399 06602 6205 .PUSHJ @ZSPACMP ; get the next character, whatever it is 06603 5513 5400 06604 7450 SNA ; is there anything there ?? 5401 06605 6225 .POPJ ; no -- just give up now 5402 06606 6205 .PUSHJ ALPHA ; see if it is a letter 06607 5227 5403 06610 7420 SNL ; was it a letter ?? 5404 06611 5530 JMP @ZCOMERR ; no -- this isn't legal 5405 06612 1140 TAD ZMSPACE ; yes -- convert it to SIXBIT 5406 06613 7002 BSW ; left justify it 5407 06614 3047 DCA NAME ; and store it in word 5408 5409 ; Check for a second letter in the name... 5410 06615 6205 .PUSHJ @ZGET ; get the next character 06616 5520 5411 06617 6205 .PUSHJ ALPHA ; is this a letter ?? 06620 5227 5412 06621 7420 SNL ; ??? 5413 06622 5515 JMP @ZBACKUP ; no -- put it back and return 5414 06623 1140 TAD ZMSPACE ; yes -- convert it to SIXBIT too 5415 06624 1047 TAD NAME ; put both letters together 5416 06625 3047 DCA NAME ; ... 5417 06626 6225 .POPJ ; then that's all 5418 5419 ; This routine will return with the LINK bit set if the AC holds a letter, 5420 ; and with the LINK reset if it does not. In either case the AC is not 5421 ; disturbed... 5422 06627 7120 ALPHA: STL ; be sure the link starts in a known state 5423 06630 1377 TAD [-"A"] ; compare it to the first letter 5424 06631 7500 SMA ; skip if it isn't a letter 5425 06632 5235 JMP ALPHA1 ; it might be -- look further 5426 06633 1376 TAD ["A"] ; it's not a letter -- restore the AC 5427 06634 6225 .POPJ ; and quit (the link is zero now !!) 5428 5429 ; Here if it might be a letter (the link is also zero now)... 5430 06635 1375 ALPHA1: TAD ["A"-"Z"-1] ; now compare it to the other end 5431 06636 7500 SMA ; skip if it is a letter 5432 06637 7020 CML ; it isn't a letter -- set the link to a 0 5433 06640 1374 TAD ["Z"+1] ; restore the character and the link 5434 06641 6225 .POPJ ; then that's all PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 133 Command Lookup and Dispatch bts6120.plx 5435 .TITLE Command Lookup and Dispatch 5436 5437 5438 ; This routine will lookup a command or register name in a table and then 5439 ; dispatch to the corresponding routine. The address of the table, should 5440 ; be passed in the AC. The table is formatted as two word entries - the first 5441 ; word of a pair is the SIXBIT name of the command or register, and the second 5442 ; word is the address of the routine to call. As soon as this routine finds a 5443 ; first word that matches the value currently in NAME, it will jump to the 5444 ; routine indicated by the second word. The table ends with a zero word 5445 ; followed by the address of an error routine - the zero word always matches 5446 ; the current name and the error routine will be called. 5447 ; 5448 ; NOTE: Command tables are always stored in field one, however the addresses 5449 ; of all the routines they reference are always in field zero! 5450 ; 5451 ; NOTE: Auto index registers pre-decrement, so the address -1 of the table 5452 ; must be passed in the AC! 5453 06642 3010 MATCH: DCA X1 ; save the pointer to the table 5454 06643 6211 CDF 1 ; command tables are stored in field 1 5455 5456 ; Search for a name which matches... 5457 06644 1410 MATCH1: TAD @X1 ; pick up the name (from field 1) 5458 06645 7450 SNA ; is this the end of the table ?? 5459 06646 5255 JMP MATCH2 ; yes -- this always matches 5460 06647 7041 CIA ; make the word negative 5461 06650 1047 TAD NAME ; and compare it to the desired value 5462 06651 7650 SNA CLA ; ??? 5463 06652 5255 JMP MATCH2 ; a match !! 5464 06653 2010 ISZ X1 ; no match -- skip over the address 5465 06654 5244 JMP MATCH1 ; and keep looking 5466 5467 ; Here when we find a match... 5468 06655 1410 MATCH2: TAD @X1 ; get the address of the routine 5469 06656 3261 DCA MATCH3 ; put that in a safe place 5470 06657 6201 CDF 0 ; change back to the usual data field 5471 06660 5661 JMP @MATCH3 ; then branch to the right routine 5472 5473 ; Temporary storage for MATCH... 5474 06661 MATCH3: .BLOCK 1 ; address of the matching routine PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 134 Scan Decimal Numbers bts6120.plx 5475 .TITLE Scan Decimal Numbers 5476 5477 5478 ; This routine will read a decimal number from the command line and return 5479 ; its value in location WORD. The value is limited to 12 bits and overflows 5480 ; are not detected. At least one decimal digit must be found on the command 5481 ; line or COMERR will be called, and the first non-digit character found will 5482 ; be returned in location SAVCHR. 5483 06662 7200 DECNW: CLA ; ignore the AC initially 5484 06663 3067 DCA WORD ; clear the total 5485 06664 3072 DCA DIGITS ; and the digit counter 5486 06665 6205 .PUSHJ @ZSPACMP ; ignore any leading blanks 06666 5513 5487 5488 ; Check for a decimal digit... 5489 06667 1373 DECNW1: TAD [-"0"] ; compare it to zero 5490 06670 7510 SPA ; ??? 5491 06671 5313 JMP DECNW2 ; it's not a digit -- quit 5492 06672 1372 TAD [-9.] ; then compare it to the other end 5493 06673 7740 SMA SZA CLA ; ??? 5494 06674 5313 JMP DECNW2 ; still not a digit 5495 5496 ; Accumulate another decimal digit... 5497 06675 1067 TAD WORD ; get the old total 5498 06676 7104 CLL RAL ; multiply it by two 5499 06677 3067 DCA WORD ; and save that 5500 06700 1067 TAD WORD ; ... 5501 06701 7104 CLL RAL ; then multiply it by 4 more 5502 06702 7104 CLL RAL ; (for a total of 8) 5503 06703 1067 TAD WORD ; because 8x + 2x = 10x 5504 06704 1052 TAD SAVCHR ; then add the new digit 5505 06705 1373 TAD [-"0"] ; and correct for ASCII characters 5506 06706 3067 DCA WORD ; remember that for next time 5507 5508 ; Read the next digit and proceed... 5509 06707 2072 ISZ DIGITS ; remember one more digit processed 5510 06710 6205 .PUSHJ @ZGET ; get the next character 06711 5520 5511 06712 5267 JMP DECNW1 ; then keep trying 5512 5513 ; Here when we find something which isn't a digit... 5514 06713 7200 DECNW2: CLA ; ... 5515 06714 1072 TAD DIGITS ; get the digit count 5516 06715 7650 SNA CLA ; it has to be at least one 5517 06716 5530 JMP @ZCOMERR ; that's an error if it isn't 5518 06717 6225 .POPJ ; and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 135 Scan Octal Numbers bts6120.plx 5519 .TITLE Scan Octal Numbers 5520 5521 5522 ; This routine will read an octal number from the command line and return 5523 ; its value in location WORD. The value is usually limited to twelve bits, 5524 ; however any overflow bits will be left in location WORDH. This is intended 5525 ; for use by the OCTNF routine to extract the field from a 15 bit address. 5526 ; At least one octal digit must be found on the command line or COMERR will be 5527 ; called, and the first non-digit character found will be returned in location 5528 ; SAVCHR. 5529 06720 7200 OCTNW: CLA ; remove any junk 5530 06721 3067 DCA WORD ; clear the partial total 5531 06722 3072 DCA DIGITS ; we haven't read any digits yet 5532 06723 6205 .PUSHJ @ZSPACMP ; ignore any leading spaces 06724 5513 5533 5534 ; Check for an octal digit next... 5535 06725 1373 OCTN1: TAD [-"0"] ; compare it to a zero 5536 06726 7510 SPA ; ??? 5537 06727 5350 JMP OCTN2 ; this one isn't a digit 5538 06730 1371 TAD [-7] ; now compare to the high end of the range 5539 06731 7740 SMA SZA CLA ; ??? 5540 06732 5350 JMP OCTN2 ; still not a digit 5541 5542 ; Now accumulate another digit. 5543 06733 1067 TAD WORD ; get the previous total 5544 06734 3070 DCA WORDH ; and remember that for OCTNF 5545 06735 1067 TAD WORD ; then again 5546 06736 7006 RTL ; shift it left 3 bits 5547 06737 7004 RAL ; ... 5548 06740 0370 AND [7770] ; then insure that no junk has wrapped around 5549 06741 1052 TAD SAVCHR ; add the next digit 5550 06742 1373 TAD [-"0"] ; and correct for ASCII values 5551 06743 3067 DCA WORD ; remember the new total 5552 06744 2072 ISZ DIGITS ; also remember how many digits we read 5553 06745 6205 .PUSHJ @ZGET ; read the next character 06746 5520 5554 06747 5325 JMP OCTN1 ; then go look for more 5555 5556 ; Here when we find something which isn't a digit... 5557 06750 7200 OCTN2: CLA ; ... 5558 06751 1072 TAD DIGITS ; see how many digits we've read 5559 06752 7650 SNA CLA ; there must be at least one 5560 06753 5530 JMP @ZCOMERR ; nope -- this isn't legal 5561 06754 6225 .POPJ ; and return that in the AC 5562 06770 7770 06771 7771 06772 7767 06773 7720 06774 0133 06775 7746 06776 0101 06777 7677 5563 07000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 136 Scan 15 Bit Addresses bts6120.plx 5564 .TITLE Scan 15 Bit Addresses 5565 5566 5567 ; This routine will read a 15 bit address from the command. The lower 12 5568 ; bits of the address are always left in location WORD, and the upper 3 bits 5569 ; will be in location ADRFLD, properly justified. If the user types 5 or more 5570 ; digits in the octal address, the lower 12 bits becomes the address, and the 5571 ; next 3 most significant bits are the field. If his octal number has 4 or 5572 ; fewer digits, the field will be the current data field instead. For example, 5573 ; (assume that the current DF is 3): 5574 ; 5575 ; 1234 --> Location 1234, field 3 5576 ; 01234 --> Location 1234, field 0 5577 ; 41234 --> Location 1234, field 4 5578 ; 5641234 --> Location 1234, field 4 5579 ; 5580 ; Like the OCTNW routine, this routine will return the low order 12 bits 5581 ; in location WORD. There is an alternate entry point at location OCTNI; this 5582 ; is identical to OCTNF, except that the instruction field, not the data field, 5583 ; provides the default field number... 5584 5585 ; Here to read an address in the instruction field... 5586 07000 7200 OCTNI: CLA ; ... 5587 07001 1002 TAD UFLAGS ; use the instruction field as default 5588 07002 0136 AND ZK70 ; ... 5589 07003 5210 JMP OCTNF1 ; then proceed normally 5590 5591 ; Here to read an address in the data field... 5592 07004 7200 OCTNF: CLA ; ... 5593 07005 1002 TAD UFLAGS ; use the data field as the default 5594 07006 7014 R3L ; ... 5595 07007 0136 AND ZK70 ; ... 5596 07010 3040 OCTNF1: DCA ADRFLD ; and save the default for later 5597 07011 6205 .PUSHJ @ZOCTNW ; read a normal octal number 07012 5521 5598 07013 7200 CLA ; we don't care about this part 5599 07014 1072 TAD DIGITS ; see how many digits there were 5600 07015 1377 TAD [-5] ; we need at least 5 5601 07016 7710 SPA CLA ; ??? 5602 07017 6225 .POPJ ; there weren't that many -- use the default 5603 5604 ; Extract the upper 3 bits of the address... 5605 07020 1070 TAD WORDH ; get the high order bits 5606 07021 7002 BSW ; then put the upper 3 bits in the right place 5607 07022 0136 AND ZK70 ; trim it to just the important bits 5608 07023 3040 DCA ADRFLD ; then that is the new data field (temporarily) 5609 07024 6225 .POPJ ; that's all folks PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 137 Ask For Confirmation bts6120.plx 5610 .TITLE Ask For Confirmation 5611 5612 5613 ; This routine will type a question mark and then wait for the operator to 5614 ; enter a "Y" (or "y") to confirm. It's used by exceptionally dangerous 5615 ; commands, like FORMAT, and normally the caller will type a short string 5616 ; (e.g. "Format unit 0" before actually calling this function. If the 5617 ; operator does confirm, it will return with the link set. If the operator 5618 ; types anything other than "Y" or "y", it will return with the link clear. 5619 ; Note that it's also acceptable to just type Control-C to abort! 5620 07025 6205 CONFRM: .PUSHJ @[TQUEST] ; type a question mark 07026 5776 5621 07027 6205 CONF1: .PUSHJ @ZINCHRS ; go get a character of input 07030 5512 5622 07031 7450 SNA ; did we get anything ? 5623 07032 5227 JMP CONF1 ; nope - keep waiting 5624 07033 3052 DCA SAVCHR ; we got a real character - save it 5625 07034 1052 TAD SAVCHR ; and echo it back to the terminal 5626 07035 6205 .PUSHJ @ZOUTCHR ; ... 07036 5476 5627 07037 6205 .PUSHJ @ZCRLF ; followed by a CRLF 07040 5510 5628 5629 ; See what his answer was... 5630 07041 1052 TAD SAVCHR ; get the answer once more 5631 07042 1375 TAD [-"Y"] ; is it a "Y" 5632 07043 7450 SNA ; ??? 5633 07044 5252 JMP CONF2 ; yes - return with the link set 5634 07045 1374 TAD ["Y"-"y"] ; or a "y"? 5635 07046 7450 SNA ; ??? 5636 07047 5252 JMP CONF2 ; yes - same thing 5637 07050 7300 CLA CLL ; nope - return FALSE 5638 07051 6225 .POPJ 5639 5640 ; Here if he answered "Y" or "y"... 5641 07052 7320 CONF2: CLA STL ; return TRUE 5642 07053 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 138 Type Special Characters bts6120.plx 5643 .TITLE Type Special Characters 5644 5645 5646 ; This routine will simulate a TAB on the terminal, which it does by typing 5647 ; spaces until the horizontal position reaches a multiple of 8 characters. 5648 ; Note that this routine will always type at least one space. The AC is 5649 ; always cleared by this routine. 5650 07054 6205 TTABC: .PUSHJ TSPACE ; Always type at least one space 07055 5263 5651 07056 1055 TAD HPOS ; Get the current horizontal position 5652 07057 0137 AND ZK7 ; Is it a multiple of 8 ?? 5653 07060 7640 SZA CLA ; ??? 5654 07061 5254 JMP TTABC ; No -- keep typing 5655 07062 6225 .POPJ ; Yes -- we can stop now 5656 5657 ; This routine will type a space on the terminal. 5658 07063 7200 TSPACE: CLA ; Clear the AC 5659 07064 1373 TAD [" "] ; And load a space character 5660 07065 5772 JMP @[THCHAR] ; Then type it and return 5661 5662 ; This routine will type a question mark on the terminal. 5663 07066 7200 TQUEST: CLA ; ... 5664 07067 1371 TAD ["?"] ; ... 5665 07070 5772 JMP @[THCHAR] ; ... 5666 5667 ; This routine will type a BELL character on the terminal. 5668 07071 7200 TBELL: CLA ; ... 5669 07072 1370 TAD [CHBEL] ; Get a bell character 5670 07073 5767 JMP @[TFCHAR] ; Then type it out 5671 5672 ; Type a slash (used as an address separator) on the terminal. 5673 07074 7200 TSLASH: CLA ; ... 5674 07075 1366 TAD ["/"] ; ... 5675 07076 5772 JMP @[THCHAR] ; ... 5676 5677 ; Type a dot (used for decimal numbers and disk addresses) on the terminal. 5678 07077 7200 TDOT: CLA ; ... 5679 07100 1365 TAD ["."] ; ... 5680 07101 5772 JMP @[THCHAR] ; ... 5681 5682 ; Convert the value in the AC to a decimal digit and type it... 5683 07102 1364 TDIGIT: TAD ["0"] ; make it ASCII 5684 07103 5772 JMP @[THCHAR] ; type it and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 139 Type Carriage Return, Line Feed and Backspace bts6120.plx 5685 .TITLE Type Carriage Return, Line Feed and Backspace 5686 5687 5688 ; This routine will type a carriage return, line feed pair on the terminal 5689 ; and it will correctly update HPOS to show that the cursor is now at the left 5690 ; margin. In addition, it will keep count of the number of CRLFs output in 5691 ; location VPOS, and when the terminal's screen is full (as indicated by VPOS 5692 ; equals LENGTH) it will cause an automatic XOFF. The AC is always cleared 5693 ; on return. 5694 07104 7200 CRLF: CLA ; be sure the AC is cleared 5695 07105 1363 TAD [CHCRT] ; get a return character 5696 07106 6205 .PUSHJ @[TFCHAR] ; and type that out 07107 5767 5697 07110 3055 DCA HPOS ; remember that the cursor is in column zero 5698 5699 ; Now check the vertical position of the cursor... 5700 07111 2056 ISZ VPOS ; increment the current position 5701 07112 7000 NOP ; ... 5702 07113 1031 TAD LENGTH ; get the size of the screen 5703 07114 7450 SNA ; is it zero ?? 5704 07115 5327 JMP CRLF1 ; yes -- never stop 5705 07116 7041 CIA ; no -- make it negative 5706 07117 1056 TAD VPOS ; and compare it to the current location 5707 07120 7710 SPA CLA ; is the screen full ?? 5708 07121 5327 JMP CRLF1 ; no -- proceed 5709 07122 3056 DCA VPOS ; yes -- clear the vertical position 5710 07123 6205 .PUSHJ @[TBELL] ; type a bell character 07124 5762 5711 07125 7240 STA ; then load a -1 into the AC 5712 07126 3054 DCA XOFF ; and cause an automatic XOFF 5713 5714 ; Type the line feed next... 5715 07127 1361 CRLF1: TAD [CHLFD] ; now get a line feed 5716 07130 5767 JMP @[TFCHAR] ; type that and return 5717 5718 ; This routine will type a BACKSPACE character on the terminal and update 5719 ; HPOS to show the new cursor position. It will not allow you to backspace 5720 ; beyond the left margin of the temrinal. The AC is always cleared on return. 5721 07131 7240 TBACKS: STA ; load the AC with -1 5722 07132 1055 TAD HPOS ; and decrement HPOS 5723 07133 7510 SPA ; are we going to pass the left margin ?? 5724 07134 5341 JMP BACKS1 ; yes -- don't type anything 5725 07135 3055 DCA HPOS ; no -- update HPOS 5726 07136 1360 TAD [CHBSP] ; then get a backspace character 5727 07137 6205 .PUSHJ @[TFCHAR] ; and type that out 07140 5767 5728 07141 7200 BACKS1: CLA ; clear the AC 5729 07142 6225 .POPJ ; and that's all 5730 07160 0010 07161 0012 07162 7071 07163 0015 07164 0060 07165 0056 07166 0057 07167 7444 07170 0007 07171 0077 07172 7427 07173 0040 07174 7740 07175 7647 07176 7066 07177 7773 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 140 Type Carriage Return, Line Feed and Backspace bts6120.plx 5731 07200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 141 Read Command Lines bts6120.plx 5732 .TITLE Read Command Lines 5733 5734 5735 ; This routine will read a single command line from the user and store the 5736 ; text of the line, one character per word and terminated by a null character, 5737 ; in the array at CMDBUF. The size of CMDBUF, and therefore the maximum 5738 ; length of a command, is given by MAXCMD and is normally a page (128 words). 5739 ; An auto-index register, L, is set aside just for the purpose of indexing the 5740 ; command buffer and when it returns this routine will always leave L set up 5741 ; to point to the beginning of the command. 5742 ; 5743 ; While it is reading the command, this routine will recognize these control 5744 ; characters: 5745 ; 5746 ; Control-C --> Abort the command 5747 ; Control-R --> Retype the current line, including corrections 5748 ; Control-U --> Erase the current line and start over again 5749 ; DELETE --> Erase the last character (echos the last character typed) 5750 ; BACKSPACE --> Erase the last character on a CRT 5751 ; Return --> Terminates the current command 5752 ; Line Feed --> " " " " 5753 ; ESCAPE --> " " " " 5754 ; 5755 ; When this routine is called, the AC should contain the prompting 5756 ; character. 5757 ; 5758 ; The calling sequence for INCHWL goes something like this: 5759 ; 5760 ; TAD ["x"] ; load the prompting character 5761 ; .PUSHJ @[INCHWL] ; and initialize the command scanner 5762 ; NXTCHR: .PUSHJ @[INCHW1] ; read and process the next character 5763 ; SNA CLA ; did we find the EOL? 5764 ; JMP NEXT ; no - keep processing 5765 ; 5766 ; 5767 ; The reason for this rather awkward sequence is that it allows the caller 5768 ; to add background processing to the character input loop (by inserting 5769 ; it at NXTCHR:). The main command scanner, for example, uses this to 5770 ; poll the front panel switches while we're waiting for input. 5771 5772 ; Call here first to initialize the scanner... 5773 07200 3144 INCHWL: DCA PROMPT ; remember the prompt character 5774 07201 1377 TAD [CMDBUF-1] ; point to the line buffer 5775 07202 3013 DCA L ; and initialize the pointer 5776 07203 3143 DCA CMDLEN ; say that this command is zero characters 5777 07204 3054 DCA XOFF ; clear the XOFF and 5778 07205 3053 DCA CTRLO ; control-O flags... 5779 07206 1144 TAD PROMPT ; get the prompting address back again 5780 07207 5476 JMP @ZOUTCHR ; type the prompt and return 5781 5782 ; Then call here to read and process the next character... 5783 07210 6205 INCHW1: .PUSHJ @ZINCHRS ; try to read something from the console 07211 5512 5784 07212 7450 SNA ; did we get anything ?? 5785 07213 6225 .POPJ ; no - return with the AC cleared 5786 07214 3052 DCA SAVCHR ; save this character for a while 5787 07215 3054 DCA XOFF ; then clear the XOFF, 5788 07216 3053 DCA CTRLO ; control-O, and 5789 07217 3056 DCA VPOS ; automatic XOFF flags 5790 07220 1052 TAD SAVCHR ; get the character back 5791 07221 1140 TAD ZMSPACE ; compare this to a space 5792 07222 7510 SPA ; ??? 5793 07223 5242 JMP INCHW3 ; this is a control character 5794 07224 1376 TAD [" "-177] ; is this a DELETE character ? 5795 07225 7650 SNA CLA ; ??? PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 142 Read Command Lines bts6120.plx 5796 07226 5335 JMP INCHW8 ; yes -- go do that 5797 5798 ; Here to process a normal character... 5799 07227 1143 INCHW2: TAD CMDLEN ; get the length of this line 5800 07230 1375 TAD [-MAXCMD] ; and compare to the maximum 5801 07231 7700 SMA CLA ; are we already full ?? 5802 07232 5356 JMP INCH10 ; yes -- don't store this character 5803 07233 1052 TAD SAVCHR ; get the character back 5804 07234 6205 .PUSHJ @ZOUTCHR ; and echo it to the terminal 07235 5476 5805 07236 1052 TAD SAVCHR ; get the character again 5806 07237 3413 DCA @L ; store it in the line 5807 07240 2143 ISZ CMDLEN ; the command is one character longer now 5808 07241 5210 JMP INCHW1 ; and go get the next one 5809 5810 ; Here to handle a control-R command... 5811 07242 1374 INCHW3: TAD [" "-CHCTR] ; is this really a control-R ?? 5812 07243 7440 SZA ; ??? 5813 07244 5264 JMP INCHW4 ; no -- Proceed 5814 07245 3413 DCA @L ; yes -- close the command buffer 5815 07246 1373 TAD [CHCTR] ; get the control-R character back 5816 07247 6205 .PUSHJ @ZOUTCHR ; and echo that to the terminal 07250 5476 5817 07251 6205 .PUSHJ @ZCRLF ; start a new line 07252 5510 5818 07253 1144 TAD PROMPT ; get the prompt character first 5819 07254 6205 .PUSHJ @ZOUTCHR ; and always type that too 07255 5476 5820 07256 1377 TAD [CMDBUF-1] ; point to the current command 5821 07257 6205 .PUSHJ @[TASCIZ] ; and echo the entire line back 07260 5772 5822 07261 6205 .PUSHJ @ZBACKUP ; backup L over the null we put there 07262 5515 5823 07263 5210 JMP INCHW1 ; finally continue typing 5824 5825 ; Here to handle a Control-U character... 5826 07264 1371 INCHW4: TAD [CHCTR-CHCTU] ; is this really a Control-U character ?? 5827 07265 7440 SZA ; ??? 5828 07266 5275 JMP INCHW5 ; no -- keep trying 5829 07267 1370 TAD [CHCTU] ; yes -- get the character back again 5830 07270 6205 .PUSHJ @ZOUTCHR ; and echo that to the operator 07271 5476 5831 07272 6205 .PUSHJ @ZCRLF ; then start on a new line 07273 5510 5832 07274 5201 JMP INCHWL+1 ; and go start all over again 5833 5834 ; Here to handle a BACKSPACE character... 5835 07275 1367 INCHW5: TAD [CHCTU-CHBSP] ; is that what this is ?? 5836 07276 7440 SZA ; ??? 5837 07277 5312 JMP INCHW6 ; nope, not yet 5838 07300 1143 INCHBS: TAD CMDLEN ; yes -- get the length of this command 5839 07301 7650 SNA CLA ; is it a null line ?? 5840 07302 5210 JMP INCHW1 ; yes -- there's nothing to delete 5841 07303 6205 .PUSHJ @ZBACKS ; yes, type a backspace 07304 5500 5842 07305 6205 .PUSHJ @ZTSPACE ; then type a space 07306 5477 5843 07307 6205 .PUSHJ @ZBACKS ; and another backspace 07310 5500 5844 07311 5350 JMP INCHW9 ; finally join with the DELETE code 5845 5846 ; Here to check for line terminators... 5847 07312 1366 INCHW6: TAD [CHBSP-CHCRT] ; is this a return ?? 5848 07313 7450 SNA ; ??? 5849 07314 5326 JMP INCHW7 ; yes -- this line is done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 143 Read Command Lines bts6120.plx 5850 07315 1365 TAD [CHCRT-CHLFD] ; no -- Is it a line feed then ? 5851 07316 7450 SNA ; ??? 5852 07317 5326 JMP INCHW7 ; yes -- That's just as good 5853 07320 1364 TAD [CHLFD-CHESC] ; no -- How about an escape ? 5854 07321 7640 SZA CLA ; ??? 5855 07322 5227 JMP INCHW2 ; no -- just store this control character 5856 5857 ; Here to finish a command... 5858 07323 1363 TAD [CHESC] ; get the ESCAPE code back 5859 07324 6205 .PUSHJ @ZOUTCHR ; and echo that to the terminal 07325 5476 5860 07326 6205 INCHW7: .PUSHJ @ZCRLF ; then close the input line 07327 5510 5861 07330 3413 DCA @L ; end the command with a null byte 5862 07331 1377 TAD [CMDBUF-1] ; and then backup the pointer 5863 07332 3013 DCA L ; to the start of the command 5864 07333 7240 STA ; return with the AC non-zero 5865 07334 6225 .POPJ ; that's all there is to it 5866 5867 ; Here to process a DELETE character... 5868 07335 1032 INCHW8: TAD SCOPE ; is the scope flag set? 5869 07336 7640 SZA CLA 5870 07337 5300 JMP INCHBS ; yes - treat as a backspace 5871 07340 1143 TAD CMDLEN ; get the command length 5872 07341 7650 SNA CLA ; is this a null command ?? 5873 07342 5210 JMP INCHW1 ; yes -- there's nothing to delete 5874 07343 6205 .PUSHJ @ZBACKUP ; decrement the line pointer 07344 5515 5875 07345 1413 TAD @L ; get the last character stored 5876 07346 6205 .PUSHJ @ZOUTCHR ; and echo that for the DELETE 07347 5476 5877 5878 ; Now delete the last character typed... 5879 07350 6205 INCHW9: .PUSHJ @ZBACKUP ; decrement the line pointer 07351 5515 5880 07352 7240 STA ; then fix the command length too 5881 07353 1143 TAD CMDLEN ; ... 5882 07354 3143 DCA CMDLEN ; ... 5883 07355 5210 JMP INCHW1 ; finally go get the next character 5884 5885 ; Here if the command line is full -- echo a bell instead... 5886 07356 6205 INCH10: .PUSHJ @[TBELL] ; go type a bell character 07357 5762 5887 07360 5210 JMP INCHW1 ; then go wait for something to do 5888 07362 7071 07363 0033 07364 7757 07365 0003 07366 7773 07367 0015 07370 0025 07371 7775 07372 6246 07373 0022 07374 0016 07375 7631 07376 7641 07377 0230 5889 07400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 144 Terminal Output Primitives bts6120.plx 5890 .TITLE Terminal Output Primitives 5891 5892 5893 ; This routine will type the character in the AC on on the terminal. If the 5894 ; character is a printing character, it will be typed normally. If this 5895 ; character is happens to be a DELETE or NULL code (ASCII codes 00 and 7F), 5896 ; it will be ignored. If the character is a TAB, it is simulated by calling 5897 ; the TTABC routine. Finally, if it is any other control character, it is 5898 ; converted to the familiar ^x representation (unless it is an ESCAPE code, 5899 ; which, by tradition, is typed as $). This routine cannot be used to type 5900 ; carriage returns, line feeds, bells, or other control characters that are 5901 ; to be output literally. The AC is always cleared on return. 5902 07400 7450 OUTCHR: SNA ; first see if this character is a null 5903 07401 6225 .POPJ ; just drop it if it is 5904 07402 1140 TAD ZMSPACE ; see if this is a control character 5905 07403 7500 SMA ; skip if it is a control code 5906 07404 5226 JMP OUTCH3 ; just type a normal character 5907 5908 ; Here to type a TAB character... 5909 07405 1377 TAD [" "-CHTAB] ; is this really a TAB character at all ?? 5910 07406 7440 SZA ; ??? 5911 07407 5211 JMP OUTCH1 ; no -- check further 5912 07410 5776 JMP @[TTABC] ; yes -- type a TAB and return 5913 5914 ; Here to print an ESCAPE character... 5915 07411 1375 OUTCH1: TAD [CHTAB-CHESC] ; is this an ESCAPE character ?? 5916 07412 7440 SZA ; ??? 5917 07413 5216 JMP OUTCH2 ; no -- go type the ^x form instead 5918 07414 1374 TAD ["$"] ; yes -- type a dollar sign for an ESCAPE 5919 07415 5227 JMP THCHAR ; then type it and return 5920 5921 ; Here to print a control character... 5922 07416 6215 OUTCH2: .PUSH ; save the character for a while 5923 07417 7200 CLA ; and get the flag character 5924 07420 1373 TAD ["^"] ; ... 5925 07421 6205 .PUSHJ TFCHAR ; type that first 07422 5244 5926 07423 6235 .POP ; then get the character back 5927 07424 1372 TAD [CHESC+"@"] ; convert it to a printing character 5928 07425 5227 JMP THCHAR ; type that and return 5929 5930 ; Here to print a normal character... 5931 07426 1371 OUTCH3: TAD [" "] ; restore the original character 5932 ; and fall into THCHAR 5933 5934 5935 ; This routine will type a printing character and, while doing this, it will 5936 ; keep track of the horizontal position of the cursor. If it passes the line 5937 ; length of the terminal, a free carriage return is also typed. The terminal's 5938 ; horizontal position (HPOS) is also used for the tab simulation. The 5939 ; character to be typed should be in the AC, the AC will be cleared on return. 5940 07427 6215 THCHAR: .PUSH ; save the character for a while 5941 07430 2055 ISZ HPOS ; and incrment the horizontal position 5942 07431 7200 CLA ; get the maximum width allowed 5943 07432 1030 TAD WIDTH ; ... 5944 07433 7450 SNA ; is it zero ?? 5945 07434 5243 JMP THCHA1 ; yes -- no automatic carriage returns, then 5946 07435 7041 CMA CIA ; make it negative 5947 07436 1055 TAD HPOS ; and compare to the terminal cursor position 5948 07437 7710 SPA CLA ; have we reached the end of the line ?? 5949 07440 5243 JMP THCHA1 ; no -- proceed normally 5950 07441 6205 .PUSHJ @ZCRLF ; yes -- force a carriage return first 07442 5510 5951 07443 6235 THCHA1: .POP ; then get the character back 5952 ; and fall into TFCHAR PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 145 Terminal Output Primitives bts6120.plx 5953 5954 5955 ; This routine will type a single character from the AC on the terminal. 5956 ; Before it types the character, this routine will check the state of the 5957 ; CNTRLO and XOFF flags. If a Control-O has been typed, the character is 5958 ; discarded and not typed on the terminal. If an XOFF has been typed, the 5959 ; output will be suspended until the user types an XON character (or a 5960 ; Control-O or Control-C). 5961 07444 6215 TFCHAR: .PUSH ; save the character for a while 5962 07445 6205 TFCHA1: .PUSHJ INCHRS ; check the operator for input 07446 5277 5963 07447 7200 CLA ; we don't care if anything was typed 5964 07450 1053 TAD CTRLO ; get the Control-O flag byte 5965 07451 7640 SZA CLA ; is it zero ?? 5966 07452 5260 JMP TFCHA2 ; no -- just throw this character away 5967 07453 1054 TAD XOFF ; now test the XOFF flag 5968 07454 7640 SZA CLA ; is the output suspended ?? 5969 07455 5245 JMP TFCHA1 ; wait for something to happen if we are XOFFed 5970 5971 ; Here when it is OK to type the character... 5972 07456 6235 .POP ; get the character back 5973 07457 5263 JMP CONOUT ; and send it to the UART 5974 5975 ; Here to return without typing anything... 5976 07460 6235 TFCHA2: .POP ; clean up the stack 5977 07461 7200 CLA ; but always return zero 5978 07462 6225 .POPJ ; and just quit 5979 5980 ; This routine will output a character from the AC to the terminal, with no 5981 ; no special processing of any kind. It simply waits for the console flag to 5982 ; set and then send the character. However, If the flag does not set in a 5983 ; reasonable amount of time then this routine will force the character out 5984 ; anyway. This prevents the monitor from hanging if the terminal flag is 5985 ; cleared by the user's program. 5986 ; 5987 ; The timeout loop requires 26 minor cycles which, with a 4.9152Mhz clock, 5988 ; takes 10.5 microseconds. If we simply clear the timeout counter when we 5989 ; start we'll get a timeout after 4096 counts, or about 43 milliseconds. 5990 ; If we assume that 300 baud is the slowest console we'll ever use, then 5991 ; that's just about right (at 300 baud a character takes about 33 milliseconds 5992 ; to transmit!). 5993 ; 5994 07463 3276 CONOUT: DCA CONCHR ; remember the character to send 5995 07464 3057 DCA IRMA ; and clear the timeout timer 5996 5997 ; See if the flag is set and send the character if so... 5998 07465 6041 CONOU1: TSF ; [9] is the flag set ??? 5999 07466 5273 JMP CONOU3 ; [4] no -- go check the timeout 6000 07467 1276 CONOU2: TAD CONCHR ; yes -- get the character 6001 07470 6046 TLS ; and send it to the console 6002 07471 7200 CLA ; a _real_ TLS doesn't clear the AC!! 6003 ;; .POPJ ; ... 6004 07472 5770 JMP @[UPDISI] ; keep the front panel display alive and exit 6005 6006 ; Here if the flag is not yet set... 6007 07473 2057 CONOU3: ISZ IRMA ; [9] have we waited long enough ??? 6008 07474 5265 JMP CONOU1 ; [4] no -- wait a little longer 6009 07475 5267 JMP CONOU2 ; yes -- force the character out anyway 6010 6011 ; Temporary storage for the CONOUT routine... 6012 07476 CONCHR: .BLOCK 1 ; a place to save the console character PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 146 Terminal Input Primitives bts6120.plx 6013 .TITLE Terminal Input Primitives 6014 6015 6016 ; This routine is called to check for operator input. It will test to see 6017 ; if the operator has typed a character. If he has not, this routine returns 6018 ; with the AC cleared and nothing else happens. If he has, this routine checks 6019 ; to see if the character is one of Control-C, Control-O, Control-S or 6020 ; Control-Q because these characters have special meaning and are acted upon 6021 ; immediately. If the input character is anything else, the character is 6022 ; returned in the AC. 6023 07477 6205 INCHRS: .PUSHJ @[UPDISI] ; keep the front panel display alive 07500 5770 6024 07501 6205 .PUSHJ CONIN ; try to read a character from the terminal 07502 5352 6025 07503 0135 AND ZK177 ; ignore the parity bit here 6026 07504 7450 SNA ; is this a null character ?? 6027 07505 6225 .POPJ ; yes -- just ignore it 6028 6029 ; Here process a control-C character -- restart the monitor... 6030 07506 1367 TAD [-CHCTC] ; is this really a control-C ?? 6031 07507 7440 SZA ; ??? 6032 07510 5317 JMP INCHR1 ; no -- proceed 6033 07511 3053 DCA CTRLO ; yes -- clear the control-O 6034 07512 3054 DCA XOFF ; and XOFF flags 6035 07513 1366 TAD [CHCTC] ; get another control-C character 6036 07514 6205 .PUSHJ @ZOUTCHR ; echo it to the terminal 07515 5476 6037 07516 5527 JMP @ZRESTA ; and go restart the monitor 6038 6039 ; Here to check for a control-O character... 6040 07517 1365 INCHR1: TAD [CHCTC-CHCTO] ; compare to a control-O character 6041 07520 7440 SZA ; is this it ?? 6042 07521 5334 JMP INCHR2 ; no -- keep checking 6043 07522 3054 DCA XOFF ; control-O always clears the XOFF flag 6044 07523 1364 TAD [CHCTO] ; get another control-O character 6045 07524 6205 .PUSHJ @ZOUTCHR ; and echo that 07525 5476 6046 07526 6205 .PUSHJ @ZCRLF ; then close the line 07527 5510 6047 07530 1053 TAD CTRLO ; get the current state of the control-O flag 6048 07531 7040 CMA ; and complement it 6049 07532 3053 DCA CTRLO ; that's the new value 6050 07533 6225 .POPJ ; return with the AC cleared 6051 6052 ; Here to check for a control-S character... 6053 07534 1363 INCHR2: TAD [CHCTO-CHXOF] ; is this a control-S ?? 6054 07535 7440 SZA ; ??? 6055 07536 5342 JMP INCHR3 ; nope, try again 6056 07537 7240 STA ; yes -- get a -1 into the AC 6057 07540 3054 DCA XOFF ; and set the XOFF flag 6058 07541 6225 .POPJ ; return with the AC cleared 6059 6060 ; Here to check for a control-Q character... 6061 07542 1362 INCHR3: TAD [CHXOF-CHXON] ; is this a control-Q ?? 6062 07543 7440 SZA ; ??? 6063 07544 5350 JMP INCHR4 ; no -- just give up 6064 07545 3054 DCA XOFF ; yes -- clear the XOFF flag 6065 07546 3056 DCA VPOS ; also clear the automatic XOFF counter 6066 07547 6225 .POPJ ; return with the AC cleared 6067 6068 ; Here if the character is nothing special... 6069 07550 1361 INCHR4: TAD [CHXON] ; restore the state of the AC 6070 07551 6225 .POPJ ; and return the character in the AC 6071 6072 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 147 Terminal Input Primitives bts6120.plx 6073 ; This routine will read a single character from the console UART. If no 6074 ; character is currently ready, it will return a null (zero) byte in the AC, 6075 ; but otherwise the character read is left in the AC... 6076 07552 7200 CONIN: CLA ; be sure the AC is cleared 6077 07553 6031 KSF ; is a character ready ?? 6078 07554 6225 .POPJ ; no -- just return zero 6079 07555 6036 KRB ; yes -- read it into the AC 6080 07556 6225 .POPJ ; then return that in the AC 6081 07561 0021 07562 0002 07563 7774 07564 0017 07565 7764 07566 0003 07567 7775 07570 6044 07571 0040 07572 0133 07573 0136 07574 0044 07575 7756 07576 7054 07577 0027 6082 07600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 148 Control Panel Entry Points bts6120.plx 6083 .TITLE Control Panel Entry Points 6084 6085 07600 .ORG 7600 6086 6087 ; There's a little bit of chicanery that goes on here (when have you seen 6088 ; a PDP-8 program without that???). After a power on clear or a hard reset, 6089 ; the HM6120 starts executing at location 7777 of panel memory which, in 6090 ; the case of the SBC6120, is part of the EPROM. The EPROM code at this 6091 ; location always jumps to the system initialization routine without even 6092 ; trying to figure out why we entered panel mode. 6093 ; 6094 ; The system initialization code copies all of the EPROM contents to panel 6095 ; RAM and then disables the EPROM forever. After that it actually changes 6096 ; the vector at location 7777 to point to the CPSAVE routine, which is the 6097 ; normal panel entry point for traps, halts, etc. 6098 7600 .VECTOR CPBOOT ; set the 6120 start up vector at 7777 6099 07600 6213 CPBOOT: CXF 1 ; the startup code lives in field 1 6100 07601 5776 JMP @[SYSINI] ; and away we go! 6101 6102 6103 ; Excluding a hardware reset, the 6120 will enter control panel mode for any 6104 ; of three other reasons: 6105 ; 6106 ; * any of the PR0..PR3 instructions were executed in main memory 6107 ; * the CPU was halted, either by a HLT instruction or by the RUN/HLT input 6108 ; * a panel interrupt was requested by the CPREQ pin 6109 ; 6110 ; In all the these cases, the 6120 was presumably executing some important 6111 ; program in main memory before it was interrupted, and we need to save the 6112 ; state of that program before doing anything else. When the 6120 enters 6113 ; panel mode it saves the last main memory PC in panel memory location 0 and 6114 ; then starts executing instructions in panel memory at 7777. The remainder of 6115 ; the main memory context (e.g. AC, MQ, flags, etc) we have to save manually. 6116 07602 3001 CPSAVE: DCA UAC ; save the AC 6117 07603 6256 GCF ; and the flags (including LINK, IF and DF) 6118 07604 3002 DCA UFLAGS ; ... 6119 07605 7501 MQA ; the MQ 6120 07606 3003 DCA UMQ ; ... 6121 07607 6207 RSP1 ; 6120 stack pointer #1 6122 07610 3004 DCA USP1 ; ... 6123 07611 6227 RSP2 ; " " " #2 6124 07612 3005 DCA USP2 ; .. 6125 6126 ; Now set up enough context so that this monitor can run. The CONT routine 6127 ; has saved in location STKSAV our last stack pointer before the main memory 6128 ; program was started and, if we're single stepping the main memory program, 6129 ; we're going to need that so that we can continue what we were doing. In 6130 ; the case of other traps the RESTA routine gets called which will reset the 6131 ; stack pointer. 6132 07613 1145 TAD STKSAV ; get the monitor's last known stack pointer 6133 07614 6217 LSP1 ; and restore that 6134 07615 6203 CXF 0 ; set both DF and IF to field zero 6135 07616 5775 JMP @[.+1] ; update the IF and clear the FZ flag 6136 07617 6276 SPD ; make indirect cycles access panel memory 6137 07620 3056 DCA VPOS ; reset the automatic XOFF line counter 6138 07621 6441 POST+1 ; show post code #1 6139 6140 ; Finally, we can determine the exact reason for entry into panel mode by 6141 ; reading the panel status flags with the PRS instruction, and that will tell 6142 ; us where to go next. Be careful, though, because executing PRS clears the 6143 ; flags so we only get to do it once! This code kind of assumes that only one 6144 ; of these flags can be set at any time - I believe that's true for the 6120. 6145 07622 6000 PRS ; get the reason for panel entry 6146 07623 7004 RAL ; BTSTRP -> LINK, PNLTRP -> AC0 6147 07624 7510 SPA ; test PNLTRP first PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 149 Control Panel Entry Points bts6120.plx 6148 07625 5253 JMP PNLTRP ; yes - a PRn instruction was trapped 6149 07626 7430 SZL ; next check BTSTRP 6150 07627 5236 JMP BTSTRP ; yes - an external CPREQ occurred 6151 07630 7004 RAL ; skip the next bit 6152 07631 7006 RTL ; put PWRON -> LINK, and HLTFLG -> AC0 6153 07632 7510 SPA ; test the HLTFLG bit 6154 07633 5311 JMP HALTED ; yes - a HLT instruction was trapped 6155 ; fall thru if PWRON (or none!) is set 6156 6157 ; If we get here, none of the known panel status bits are set. I don't 6158 ; know what this means, but it can't be good! We also jump here if the 6159 ; PWRON status bit is set. Since this bit can only be set by a hardware 6160 ; reset, and since in the SBC6120 this automatically maps EPROM instead 6161 ; of RAM, we should never see this happen. 6162 07634 4320 PWRON: JMS TRAP ; print a generic 6163 07635 3640 TRPMSG ; "% UNKNOWN TRAP AT ..." message 6164 6165 ; The BTSTRP flag indicates a transition of the CPREQ line, which could 6166 ; indicate that a break was typed on the console terminal, or it could 6167 ; indicate that the front panel (if one is installed) requires service. 6168 07636 BTSTRP: 6169 ; We get a CPREQ if the front panel HALT switch is flipped down (i.e. it 6170 ; makes the RUN -> HALT transition). We treat this case just as we would 6171 ; if a HLT instruction were executed - say "%HALTED AT ..." and start the 6172 ; BTS6120 command scanner. Note that if no front panel hardware is 6173 ; installed the SHSW IOT is a NOP and never skips! 6174 07636 6431 SHSW ; skip on halt switch transition 6175 07637 7410 SKP ; nope... 6176 07640 5311 JMP HALTED ; jump to the halt switch code 6177 ; The SCPT IOT will skip if the 30Hz front panel timer has ticked, which 6178 ; would mean that it's time to update the front panel display. Once again, 6179 ; remember that if no front panel is installed the SCPT IOT is a NOP and 6180 ; never skips, which is fine with us. 6181 07641 6433 SCPT ; skip on 30Hz timer 6182 07642 5246 JMP BTSTR1 ; nope - try something else 6183 07643 6205 .PUSHJ @[UPDISP] ; yes - update the display 07644 5774 6184 07645 5773 JMP @[CONT1] ; and then return to the main program 6185 6186 ; Here for an unknown CPREQ. This could be caused by a framing error 6187 ; (i.e. a BREAK) from the console terminal, or it could be caused by 6188 ; some other (optional) piece or hardware... 6189 07646 7000 BTSTR1: NOP ; patch space for a ROM patch 6190 07647 7000 NOP ; ... 6191 07650 7000 NOP ; ... 6192 07651 4320 JMS TRAP ; print 6193 07652 3604 BRKMSG ; "% BREAK AT ..." and restart 6194 6195 ; The PNLTRP flag indicates that one of the PR0 thru PR3 instructions has 6196 ; been executed, but unfortunately the only way to find out which is to 6197 ; use the last main memory PC to fetch the instruction from memory. Remember 6198 ; that the 6120 will have already incremented the PC by the time we get here, 6199 ; so it's actually one _more_ than the location we want. Currently the PR3 6200 ; instruction is used as a breakpoint trap and PR0 is a generic ROM "monitor 6201 ; call". The other two, PR1 and PR2, are unused. 6202 07653 7240 PNLTRP: STA ; decrement the PC 6203 07654 1000 TAD UPC ; so it points at the actual instruction 6204 07655 3000 DCA UPC ; that caused the trap 6205 07656 1002 TAD UFLAGS ; get the IF at the time of the trap 6206 07657 0136 AND ZK70 ; ... 6207 07660 1271 TAD PNLCDF ; make a CDF instruction out of that 6208 07661 3262 DCA .+1 ; and execute it 6209 07662 7000 NOP ; ... gets overwritten with a CDF ... 6210 07663 6266 CPD ; address main memory with indirect cycles 6211 07664 1000 TAD UPC PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 150 Control Panel Entry Points bts6120.plx 6212 07665 3006 DCA UIRPC 6213 07666 1400 TAD @UPC ; get the opcode that caused the trap 6214 07667 3007 DCA UIR ; and save it for later 6215 07670 6276 SPD ; back to panel memory 6216 07671 6201 PNLCDF: CDF 0 ; always field zero 6217 6218 ; See which instruction it was... 6219 07672 1007 TAD UIR ; get the opcode 6220 07673 1372 TAD [-BPT] ; is it PR3 ?? 6221 07674 7450 SNA ; ??? 6222 07675 5305 JMP BPTTRP ; yes - handle a break point trap 6223 07676 1371 TAD [BPT-PR0] ; no - is it PR0? 6224 07677 6213 CXF 1 ; (the ROM call handler lives in field 1) 6225 07700 7450 SNA ; ??? 6226 07701 5770 JMP @[MCALL] ; yes - handle a monitor call 6227 07702 6203 CXF 0 ; ... 6228 07703 4320 JMS TRAP ; for any others just print a generic 6229 07704 3614 PRNMSG ; "% PANEL TRAP AT ..." message 6230 6231 ; Here for a breakpoint trap... 6232 07705 4320 BPTTRP: JMS TRAP ; print 6233 07706 3547 BPTMSG ; "% BREAKPOINT AT ..." and proceed 6234 6235 ; Here (from field 1) for an illegal PR0 call... 6236 07707 4320 ILLPR0: JMS TRAP ; say 6237 07710 3562 PR0MSG ; "? ILLEGAL PR0 FUNCTION AT ..." 6238 6239 ; We get here when the 6120 halts, but unfortunately there are no less than 6240 ; three different reasons why it night have done this. The first is that the 6241 ; main memory program has executed a HLT (7402, or any microcoded combination 6242 ; there of) instruction. Or, it could be that the 6120 was halted externally 6243 ; by a transition on the HLTREQ input pin, however the SBC6120 has no hardware 6244 ; to do this. Lastly, it could be that the HALT flag was already set when 6245 ; we restarted the main memory program - in this case the 6120 will execute 6246 ; one instruction and trap back here. 6247 ; 6248 ; We use this situation intentionally to single step main memory programs, 6249 ; and we can tell when this happens by checking the SIMFLG flag in memory. 6250 ; This flag is normally cleared, but will be set by the SINGLE routine when we 6251 ; want to single step. In that case the monitor's stack is valid (it was 6252 ; saved to STKSAV by the CONT routine before switching context) and all we 6253 ; have to do is execute a .POPJ to return to the routine that originally 6254 ; called SINGLE. Keep your fingers crossed. 6255 07711 6435 HALTED: RLOF ; turn the RUN LED off 6256 07712 7200 CLA ; ... 6257 07713 1051 TAD SIMFLG ; did we execute a single instruction? 6258 07714 7640 SZA CLA ; ??? 6259 07715 6225 .POPJ ; yes - return from the SINGLE routine now! 6260 07716 4320 JMS TRAP ; otherwise just say 6261 07717 3627 HLTMSG ; "% HALTED AT ..." and restart 6262 6263 ; This routine does most of the generic work of handling traps to panel 6264 ; memory. It prints a message, which is passed inline via a JMS instruction, 6265 ; prints the PC, removes any breakpoints from the program and then restarts 6266 ; the monitor... 6267 07720 0000 TRAP: 0 ; call here with a JMS instruction 6268 07721 6435 RLOF ; turn the RUN LED off 6269 07722 6205 .PUSHJ @ZCRLF ; be sure we start on a new line 07723 5510 6270 07724 1720 TAD @TRAP ; get the address of the message 6271 07725 6205 .PUSHJ @[OUTSTR] ; and print that 07726 5767 6272 07727 1002 TAD UFLAGS ; then get the field of the trap 6273 07730 0136 AND ZK70 ; ... 6274 07731 6205 .PUSHJ @[TFIELD] ; and type that PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 151 Control Panel Entry Points bts6120.plx 07732 5766 6275 07733 1000 TAD UPC ; then the PC too 6276 07734 6205 .PUSHJ @ZTOCT4C ; type that and a CRLF 07735 5502 6277 07736 6205 .PUSHJ @[REGLSC] ; type the registers on the next line 07737 5765 6278 07740 6205 .PUSHJ @[BPTRMV] ; remove any breakpoints 07741 5764 6279 07742 6205 .PUSHJ @[EXMEM] ; sync the ADDRESS and DATA displays 07743 5763 6280 07744 5527 JMP @ZRESTA ; and restart the monitor 6281 07763 5751 07764 2123 07765 1240 07766 6431 07767 6200 07770 0201 07771 0030 07772 1542 07773 2227 07774 6047 07775 7617 07776 0001 07777 5200 6282 10200 .FIELD 1 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 152 Field 1 Variables bts6120.plx 6283 .TITLE Field 1 Variables 6284 6285 6286 ; This page defines all the page zero variables used by the code in field 6287 ; one. The system initialization code, part 1, at SYSINI: also lives in page 6288 ; zero of field one, and then is overwritten by these variables after init- 6289 ; ialization is completed. As a consequence, none of these variables can 6290 ; have initial values the way their field zero counter parts do! 6291 6292 10000 .ORG 0000 6293 6294 10000 F1X0: .BLOCK 1 6295 6296 ; Auto index registers... 6297 10010 .ORG 0010 6298 10010 RAMPTR: .BLOCK 1 ; address, within the RAM disk, for I/O 6299 10011 BUFPTR: .BLOCK 1 ; address of the caller's buffer for I/O 6300 10012 XX1: .BLOCK 1 ; generic auto index register for field 1 6301 10013 XX2: .BLOCK 1 ; " " " " " " 6302 10020 .ORG 0020 6303 6304 ; IDE Disk I/O routine storage... 6305 10020 DKPART: .BLOCK 1 ; 12 bit disk partition number 6306 10021 DKRBN: .BLOCK 1 ; 12 bit sector relative block number 6307 10022 DKSIZE: .BLOCK 1 ; size of attached drive, in MB, or 0 if no drive 6308 10023 DKUNIT: .BLOCK 1 ; logical unit (partition) number for OS/8 6309 6310 ; RAM Disk I/O routine storage... 6311 10024 RDUNIT: .BLOCK 1 ; currently selected RAM disk unit for I/O 6312 10025 RDPAGE: .BLOCK 1 ; " " " " " " page number 6313 10026 RCPAGE: .BLOCK 1 ; adjusted RAM disk page number for RC model 6314 10027 RAMBUF: .BLOCK 3 ; a three byte "mini buffer" for 3 <-> 2 packing 6315 10032 RAMDAR: .BLOCK 1 ; RAM disk address register (written to LDAR) 6316 10033 BATTOK: .BLOCK 1 ; -1 -> battery good, 1 -> battery bad, 0 -> unknown 6317 10034 RDSIZE: .BLOCK 10 ; size of each RAM disk unit, in KB, or 0 if none 6318 10044 RAMSIZ: .BLOCK 1 ; total size of all RAM disks, in KB 6319 10045 SIZPTR: .BLOCK 1 ; pointer to the RDSIZE array 6320 10046 RAMUSZ: .BLOCK 1 ; - size of selected RAM disk chip 6321 10047 RDTYPE: .BLOCK 1 ; 0 -> no RAM disk, -1 -> original (DS1221) RAM disk 6322 ; +1 -> new (DS1231) RAM disk, -2 -> IOB6120 RAM disk 6323 ; +2 -> SBC6120-RC model RAM disk 6324 6325 ; ROM call arguments 6326 10050 MUUO: .BLOCK 1 ; ROM MCALL function code 6327 10051 ARGPTR: .BLOCK 1 ; pointer to MCALL (PR0) argument list 6328 10052 XFRCNT: .BLOCK 1 ; word count for I/O 6329 10053 BUFPNL: .BLOCK 1 ; -1 if the user buffer is in panel memory 6330 10054 BUFSIZ: .BLOCK 1 ; actual buffer size for RDIBUF/WRIBUF 6331 10055 RWCNT: .BLOCK 1 ; number of pages to be transferred 6332 6333 10200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 153 ROM Calls (PR0 Instructions) bts6120.plx 6334 .TITLE ROM Calls (PR0 Instructions) 6335 6336 10200 .ORG 0200 6337 6338 ; The PDP2HEX program (which converts BIN files into ROM images in Intel 6339 ; HEX format) stores a checksum of ROM field 1 in location 10200. This is 6340 ; used by the POST and the VE (version) command. 6341 10200 ROMCK1: .BLOCK 1 6342 6343 ; This routine is called by CPSAVE when it detects a panel entry caused by 6344 ; a PR0 instruction. Main memory programs can use this instruction to 6345 ; communicate with the ROM firmware and, in particular, the OS/8 device driver 6346 ; for the RAM disk uses PR0 to transfer data. At this point all of the main 6347 ; memory program's registers have been saved and our original monitor stack 6348 ; has been restored. The data and instruction field are both one and the 6349 ; 6120 panel data flag is set (so indirect references go to panel memory). 6350 ; That's about all we can depend on. 6351 ; 6352 ; There are a couple of subtle points to watch out for here. One simple 6353 ; one is that, to save time, break points are not removed from the caller's 6354 ; program while we interpret a PR0. That means we have to be sure and return 6355 ; to main memory by jumping to CONT1, not CONT, since the latter will attempt 6356 ; to reinstall breakpoints _again_ and forever loose the original contents 6357 ; of those locations. 6358 ; 6359 ; The other thing to remember is that CONT and CPSAVE conspire to preserve 6360 ; the monitor's stack, so that it can return to the correct place while single 6361 ; stepping. That means we want to be sure and JMP to CONT1, not .PUSHJ to it, 6362 ; because otherwise it'll just return back to us the next time we enter panel 6363 ; mode! 6364 ; 6365 ; The convention is that the first word after PR0 is a function code to 6366 ; select the firmware routine. This routine also preserves the contents of 6367 ; the AC both ways - that is, whatever was in the user's AC when the PR0 was 6368 ; executed will be in the AC when our monitor call function is invoked, and 6369 ; whatever our monitor call function returns in the AC will be placed in the 6370 ; user's AC when control returns from the PR0. Anything more than that is up 6371 ; to the specific function invoked. 6372 6373 ; Get the first agument (the function code) and use it to determine the 6374 ; address of a ROM routine to handle it... 6375 10201 6205 MCALL: .PUSHJ GETARG ; CPSAVE leaves the PC pointing at the PR0 10202 5241 6376 ; so do a dummy GETARG to skip it 6377 10203 6205 .PUSHJ GETARG ; then get a real PR0 argument from main memory 10204 5241 6378 10205 3050 DCA MUUO ; this is always the function code 6379 10206 1050 TAD MUUO ; see if it's in range 6380 10207 7100 CLL ; be sure the link is in a known state 6381 10210 1377 TAD [-MAXFUN-1] ; check against the maximum function 6382 10211 7630 SZL CLA ; if it's legal, skip 6383 10212 5237 JMP MCALL2 ; nope - go print an error message... 6384 10213 1050 TAD MUUO ; it's legal - use it 6385 10214 1376 TAD [FUNTBL] ; index into the function dispatch table 6386 10215 3050 DCA MUUO ; ... 6387 10216 1450 TAD @MUUO ; get the address of the function routine 6388 10217 3050 DCA MUUO ; finally - that's what we wanted to know! 6389 6390 ; Invoke the monitor routine, preserving the AC in both directions. In 6391 ; addition, the LINK bit is commonly used as an error flag (i.e. the LINK 6392 ; set on return indicates an error), so it is preserved on return only. 6393 10220 6201 CDF 0 ; the user's context lives in field 0 6394 10221 1775 TAD @[UAC] ; get the user's AC 6395 10222 6211 CDF 1 ; all ROM call routines live in field 1 6396 10223 6205 .PUSHJ @MUUO ; call routine to execute the ROM call PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 154 ROM Calls (PR0 Instructions) bts6120.plx 10224 5450 6397 10225 6201 MCALL1: CDF 0 ; address the user's context again 6398 10226 3775 DCA @[UAC] ; return whatever's in the AC 6399 10227 7010 RAR ; put the link bit in AC0 6400 10230 3050 DCA MUUO ; save it for a minute 6401 10231 7350 NL3777 ; then mask off the LINK bit 6402 10232 0774 AND @[UFLAGS] ; in the user's flags 6403 10233 1050 TAD MUUO ; and put ours in there instead 6404 10234 3774 DCA @[UFLAGS] ; ... 6405 10235 6203 CXF 0 ; CONT2 lives in field 0 6406 10236 5773 JMP @[CONT2] ; and then return to main memory 6407 6408 ; Here when an illegal PR0 function is invoked. 6409 10237 6203 MCALL2: CXF 0 ; say 6410 10240 5772 JMP @[ILLPR0] ; "?Illegal PR0 function at ..." PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 155 Fetch PR0 Arguments bts6120.plx 6411 .TITLE Fetch PR0 Arguments 6412 6413 6414 ; This routine fetches an argument for PR0 from the main memory program. 6415 ; Since arguments are always stored in line after the PR0, the next argument 6416 ; is in the instruction field and pointed to by the last main memory PC. 6417 ; After the argument is fetched the main memory PC is always incremented so 6418 ; that we'll skip over the argument when we return - you have to be careful 6419 ; about this, since it means this routine can only be called ONCE to fetch 6420 ; any given argument! The PR0 argument is returned in the AC. 6421 10241 7200 GETARG: CLA 6422 10242 6201 CDF 0 ; BEWARE - UFLAGS and UPC are both in field 0! 6423 10243 1771 TAD @[UPC] ; get the user's PC from field 0 6424 10244 3051 DCA ARGPTR ; save it in field 1 for a moment 6425 10245 2771 ISZ @[UPC] ; and increment it to skip over the argument 6426 10246 7000 NOP ; this really shouldn't ever happen! 6427 10247 1774 TAD @[UFLAGS] ; get the last known user (main memory) flags 6428 10250 0370 AND [70] ; then get the IF at the time of the trap 6429 10251 1367 TAD [CDF 0] ; make a CDF instruction 6430 10252 3253 DCA .+1 ; change to the correct field 6431 10253 7000 NOP ; ... gets overwritten with a CDF ... 6432 10254 6266 CPD ; always fetch from main memory 6433 10255 1451 TAD @ARGPTR ; get the next word from user program space 6434 10256 6276 SPD ; back to panel memory 6435 10257 6211 CDF 1 ; and back to our field 6436 10260 6225 .POPJ ; return the PR0 argument in the AC PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 156 ROM Call Table bts6120.plx 6437 .TITLE ROM Call Table 6438 6439 6440 ; This is what you've really been waiting for - the table of ROM firmware 6441 ; function codes and routine addresses. 6442 6443 0237 BADFUN=MCALL2 ; illegal function call 6444 6445 10261 0303 FUNTBL: GETVER ; 0 - get ROM version 6446 10262 0310 RAMDRW ; 1 - read/write RAM disk 6447 10263 1000 GETRDS ; 2 - return RAM disk size 6448 10264 0544 GETBAT ; 3 - return RAM disk battery status 6449 10265 2017 DISKRW ; 4 - read/write IDE disk 6450 10266 1136 GETDKS ; 5 - return IDE disk size 6451 10267 1732 SETPMP ; 6 - set disk partition mapping 6452 10270 2000 GETPMP ; 7 - get disk partition mapping 6453 10271 2230 MEMMOV ; 10 - copy memory 6454 10272 2306 MEMMVX ; 11 - copy memory extended 6455 10273 2442 LIGHTS ; 12 - control the DATA LEDs 6456 6457 ; The following six locations are reserved for ROM calls added by the 6458 ; IOB6120 extension ROM. The first three are used by the GETCFS and R/STODC 6459 ; calls, and the remaining four are held for future expansion. If you add 6460 ; more ROM monitor calls the BTS6120, add them _after_ these six! 6461 10274 0237 BADFUN ; 13 - get CompactFlash card size 6462 10275 0237 BADFUN ; 14 - read Time of Day Clock (RTODC) 6463 10276 0237 BADFUN ; 15 - set Time of Day Clock (STODC) 6464 10277 0237 BADFUN ; 16 - (reserved for IOB6120) 6465 10300 0237 BADFUN ; 17 - (reserved for IOB6120) 6466 10301 0237 BADFUN ; 20 - (reserved for IOB6120) 6467 6468 ; Add new BTS6120 calls here... 6469 10302 2456 RDROM ; 21 - read Flash ROM (RDROM) 6470 6471 0021 MAXFUN=.-FUNTBL-1 6472 6473 6474 ; PR0 function zero returns the current firmware version in the AC... 6475 10303 7300 GETVER: CLA CLL ; ... 6476 10304 1366 TAD [VERSION] ; get our version number 6477 10305 6225 .POPJ ; MCALL will store it in the caller's AC 6478 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 157 Return from Routines in Field 1 bts6120.plx 6479 .TITLE Return from Routines in Field 1 6480 6481 6482 ; This routine is the other half of the code at PUSHJ1:, and it allows 6483 ; routines in field one which were called from field zero to return to 6484 ; field zero. It only needs to do two instructions, but those instructions 6485 ; have to be somewhere in field one! 6486 10306 6203 POPJ1: CXF 0 ; return to field zero 6487 10307 6225 .POPJ ; the address is already on the stack PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 158 RAM Disk support bts6120.plx 6488 .TITLE RAM Disk support 6489 6490 6491 ; The SBC6120 contains a DS1321 SRAM controller with Li battery backup and 6492 ; sockets for up to eight byte wide SRAM chips. Each socket can contain either 6493 ; a HM628512 512Kx8 SRAM or a HM628128 128Kx8 SRAM or, of course, nothing. 6494 ; Additionally, the last socket has two jumpers which permit a 512K byte 6495 ; CMOS EPROM to be used if desired. The maximum capacity of the RAM disk 6496 ; array is thus 2Mb - a pretty respectable sized disk (almost as big as a 6497 ; RK05J!) for OS/8. 6498 ; 6499 ; The SBC6120 maps these RAM chips into panel memory via the memory decode 6500 ; GAL and, when memory map 3 (MM3) is enabled, all indirect references to panel 6501 ; memory will access the RAM disk array. Since the RAM disk is only a byte 6502 ; wide, write operations discard the upper four bits of a twelve bit word, and 6503 ; when reading these bits are undefined and should be masked off by the 6504 ; software. 6505 ; 6506 ; Addressing the RAM disk is a little tricky, since a 2Mb memory requires 6507 ; a total of 21 address bits - quite a bit more than a PDP-8 can manage. 6508 ; RAM disk address bits 0..11 (the low order bits, contrary to the PDP-8 6509 ; convention) are supplied by the HM6120 MA11-0. The remaining 7 bits needed 6510 ; by each 512K SRAM come from a special register, the Disk Address Register, 6511 ; which can be loaded via the LDAR IOT. The final two bits needed by the 6512 ; DS1321 to select one of the four SRAM chips come from DF0 and DF1. 6513 ; 6514 ; DF2 is used as a "board select" to allow up to two SRAM boards to be 6515 ; installed. Since DF2 is actually the LSB of the data field, the board 6516 ; select is a little wierd - RAM disk units 0..3 are on the first RAM disk 6517 ; board and map to the even fields, 0, 2, 4 and 6. RAM disk units 4..7 are 6518 ; on the second RAM disk board and map to the odd fields - 1, 3, 5 and 7. 6519 ; 6520 ; Put more simply, the DF selects the SRAM chip used, the DAR selects the 6521 ; 4K byte "bank" within the chip, and the normal memory address selects the 6522 ; individual byte within the bank. 6523 ; 6524 ; For the purposes of writing an OS/8 device handler, each 4K RAM disk bank 6525 ; contains 21 pages of 128 twelve bit words, packed using the standard OS/8 6526 ; "three for two" scheme. A 512K SRAM chip can hold 128 of these banks, 6527 ; corresponding to DAR addresses 0..127, for a total capacity of 2688 PDP-8 6528 ; pages or 1344 OS/8 blocks. A 128K SRAM would contain only 32 banks, for a 6529 ; total of 672 PDP-8 pages or 336 OS/8 blocks. 6530 ; 6531 ; Sixty-four bytes are wasted in each bank by this packing scheme, which 6532 ; works out to about 21 OS/8 blocks lost in a 512K SRAM. More clever software 6533 ; could reclaim these, but it would require that the three-for-two packing 6534 ; algorithm split PDP-8 pages across RAM disk banks. 6535 ; 6536 ; The SRAMs are optional, and this SBC6120 may have all, only some, or even 6537 ; none installed. Since each SRAM chip is treated as a separate OS/8 unit, 6538 ; this makes it easy to handle the situation where some chips are not missing - 6539 ; these units are simply "off line". 6540 6541 ; RAM disk "geometry" constants... 6542 5200 RAM512=2688. ; size of a 512K RAM disk, in pages 6543 1240 RAM128=672. ; " " " 128K " " " " 6544 0025 BANKSZ=21. ; pages per bank of RAM disk memory 6545 6546 ; Special IOTs for the RAM disk hardware... 6547 6410 LDAR=6410 ; Load RAM disk address register 6548 6415 SBBLO=6415 ; Skip on backup battery low (DS1321 only!) 6549 6436 SBBLO2=6436 ; " " " " " " " (SBC6120-RC only!) PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 159 RAM Disk Read/Write ROM Call bts6120.plx 6550 .TITLE RAM Disk Read/Write ROM Call 6551 6552 6553 ; The calling sequence for the PR0 RAM disk R/W function is: 6554 ; 6555 ; PR0 6556 ; 0001 / panel function code for RAMDISK I/O 6557 ; / R/W bit, page count, buffer field and unit 6558 ; / buffer address 6559 ; / starting page number (not block number!) 6560 ; / AC == 0 if success; AC != 0 if error 6561 ; 6562 ; The error codes currently returned by RAMDRW are: 6563 ; 6564 ; 0001 - unit > 3 or SRAM chip not installed 6565 ; 0002 - page number > 2688 6566 ; 6567 ; If this looks a lot like an OS/8 handler call, that's no accident! 6568 10310 6205 RAMDRW: .PUSHJ @[SETBUF] ; set up MUUO, BUFPTR, BUFCDF and RWCNT 10311 5765 6569 10312 6205 .PUSHJ GETARG ; and lastly get the disk page number 10313 5241 6570 10314 3025 DCA RDPAGE ; ... 6571 6572 ; Select (after first ensuring that it exists!) the correct unit... 6573 10315 1050 TAD MUUO ; next get the unit number 6574 10316 0364 AND [7] ; ... 6575 10317 3024 DCA RDUNIT ; ... 6576 10320 6205 .PUSHJ @[RAMSEL] ; setup RAMCDF to select the correct "unit" 10321 5763 6577 10322 7630 SZL CLA ; was the unit number illegal ? 6578 10323 5762 JMP @[RAMER1] ; yes - give the error return 6579 6580 ; This loop reads or writes pages 'till we've done all we're supposed to... 6581 10324 6205 RDRW1: .PUSHJ @[SETDAR] ; calculate the RAM disk address and bank 10325 5761 6582 10326 7630 SZL CLA ; was the page number valid? 6583 10327 5760 JMP @[RAMER2] ; nope - give the bad page error return 6584 10330 1050 TAD MUUO ; get the function code again 6585 10331 7700 SMA CLA ; should we read (0) or write (1) ? 6586 10332 5336 JMP RDRW2 ; ... read 6587 10333 6205 .PUSHJ @[RAMDW1] ; transfer a page from memory to RAM disk 10334 5757 6588 10335 5340 JMP RDRW3 ; and continue 6589 10336 6205 RDRW2: .PUSHJ @[RAMDR1] ; transfer a page from RAM disk to memory 10337 5756 6590 10340 2025 RDRW3: ISZ RDPAGE ; if we need more, continue on the next page 6591 10341 2055 ISZ RWCNT ; have we done enough pages? 6592 10342 5324 JMP RDRW1 ; nope - keep going 6593 10343 7200 CLA ; all done with the RAMDRW call 6594 10344 6225 .POPJ ; return status code zero (no error) 6595 10356 0417 10357 0432 10360 0437 10361 0661 10362 0435 10363 0722 10364 0007 10365 2123 10366 0321 10367 6201 10370 0070 10371 0000 10372 7707 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 160 RAM Disk Read/Write ROM Call bts6120.plx 10373 2225 10374 0002 10375 0001 10376 0261 10377 7756 6596 10400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 161 RAM Disk Primary Bootstrap bts6120.plx 6597 .TITLE RAM Disk Primary Bootstrap 6598 6599 ; This routine will read page zero from RAM disk unit zero into page 6600 ; zero of field zero of main memory. The next step in the usual boot 6601 ; sequence would be to start the secondary bootstrap, but that's up to 6602 ; the caller... 6603 10400 7240 RDBOOT: STA ; point the buffer to page 0 6604 10401 3011 DCA BUFPTR ; ... 6605 10402 1377 TAD [CDF 0] ; of field zero 6606 10403 3776 DCA @[BUFCDF+1] ; ... 6607 10404 3053 DCA BUFPNL ; of main memory 6608 10405 3024 DCA RDUNIT ; read RAM disk unit zero 6609 10406 3025 DCA RDPAGE ; page zero 6610 ; JMP RAMDRD ; ... 6611 ; ** fall through into RAMDRD *** 6612 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 162 Read and Write RAM Disk Pages bts6120.plx 6613 .TITLE Read and Write RAM Disk Pages 6614 6615 6616 ; This routine will read a single page from RAM disk to a buffer in memory. 6617 ; The caller must set up RDUNIT and RDPAGE with the desired RAM disk unit 6618 ; and page, and BUFPTR, BUFCDF and BUFPNL with the address of a 128 word 6619 ; buffer in 6120 memory. If any errors are encountered, this routine will 6620 ; return with the LINK set and an error status in the AC. 6621 10407 6205 RAMDRD: .PUSHJ @[RAMSEL] ; select the unit in RDUNIT 10410 5775 6622 10411 7430 SZL ; was it invalid?? 6623 10412 5235 JMP RAMER1 ; yes - return error code 1 6624 10413 6205 .PUSHJ @[SETDAR] ; calculate the necessary disk address 10414 5774 6625 10415 7430 SZL ; is the page number invalid? 6626 10416 5237 JMP RAMER2 ; yes - return error code 2 6627 10417 4773 RAMDR1: JMS @[CHKRC] ; test for the SBC6120-RC model 6628 10420 5772 JMP @[RCRDRD] ; yes - call the RC model read routine 6629 10421 5771 JMP @[UNPACK] ; unpack RAM disk data to the buffer and return 6630 6631 6632 ; This routine will write a single page from 6120 memory to RAM disk. Except 6633 ; for the direction of data flow, it's identical to RAMDRD, including all the 6634 ; parameters and error returns. 6635 10422 6205 RAMDWR: .PUSHJ @[RAMSEL] ; select the unit 10423 5775 6636 10424 7430 SZL ; was it invalid?? 6637 10425 5235 JMP RAMER1 ; yes - return error code 1 6638 10426 6205 .PUSHJ @[SETDAR] ; calculate the disk address 10427 5774 6639 10430 7430 SZL ; invalid page number?? 6640 10431 5237 JMP RAMER2 ; yes - return error code 2 6641 10432 4773 RAMDW1: JMS @[CHKRC] ; test for the SBC6120-RC model 6642 10433 5770 JMP @[RCRDWR] ; yes - call the RC model write routine 6643 10434 5767 JMP @[PACK] ; pack buffer data into the RAM disk and return 6644 6645 6646 ; Here if the unit number is invalid... 6647 10435 7321 RAMER1: CLA CLL CML IAC ; return LINK = 1 and AC = 1 6648 10436 6225 .POPJ ; ... 6649 6650 ; Here if the page number is invalid... 6651 10437 7326 RAMER2: NL0002 ; return AC = 2 6652 10440 7120 STL ; and LINK = 1 6653 10441 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 163 Unpack RAM Disk Pages bts6120.plx 6654 .TITLE Unpack RAM Disk Pages 6655 6656 6657 ; This routine will read one page (aka a sector) of 128 PDP-8 words from 6658 ; the RAM disk to a buffer anywhere in main memory or panel memory. The 6659 ; address of the disk page read is selected by the RAMCDF and RAMPTR locations 6660 ; and the DAR register, which should be set up by prior calls to the RAMUNIT 6661 ; and SETDAR routines. The address of the buffer written is selected by the 6662 ; BUFPTR, BUFCDF and BUFPNL locations, which must be set up by the caller 6663 ; before invoking this routine. Exactly 128 words are always transferred, 6664 ; without fail! 6665 10442 7200 UNPACK: CLA ; ... 6666 10443 1366 TAD [-64.] ; one page is 128 words, or 64 word pairs 6667 10444 3052 DCA XFRCNT ; ... 6668 6669 ; Fetch the next three bytes (two words) from the SRAM chip. Note that 6670 ; the SRAMs are only eight bits wide, so we'll read indeterminate garbage for 6671 ; the upper four bits of each word. Those have to be masked off on the first 6672 ; two bytes, but for the third one it doesn't matter - it gets masked to two 6673 ; four bit pieces later anyway... 6674 10445 4765 UNPAC1: JMS @[RAMCDF] ; change the DF to the RAM disk unit 6675 10446 6403 MM3 ; and enable the RAM disk chips 6676 10447 1410 TAD @RAMPTR ; fetch three bytes from RAM disk 6677 10450 0364 AND [377] ; eight bits only, please 6678 10451 3027 DCA RAMBUF ; ... 6679 10452 1410 TAD @RAMPTR ; ... 6680 10453 0364 AND [377] ; ... 6681 10454 3030 DCA RAMBUF+1 ; ... 6682 10455 1410 TAD @RAMPTR ; ... 6683 10456 3031 DCA RAMBUF+2 ; ... 6684 10457 6402 MM2 ; restore the default memory map 6685 10460 6211 CDF 1 ; and field 6686 6687 ; Pack the three bytes into two words and store them in main/panel memory... 6688 10461 4763 JMS @[BUFCDF] ; change DF to the buffer field 6689 10462 1031 TAD RAMBUF+2 ; the upper 4 bits of the first word are here 6690 10463 7002 BSW ; shift them left six 6691 10464 7106 CLL RTL ; ... then eight bits 6692 10465 0362 AND [7400] ; and isolate just those four bits 6693 10466 1027 TAD RAMBUF ; assemble the first word 6694 10467 3411 DCA @BUFPTR ; and store it in main memory 6695 10470 1031 TAD RAMBUF+2 ; now do the upper 4 bits of the second word 6696 10471 7106 CLL RTL ; shift them left two 6697 10472 7106 CLL RTL ; ... then four bits 6698 10473 0362 AND [7400] ; and isolate just those four bits 6699 10474 1030 TAD RAMBUF+1 ; reassemble the second word 6700 10475 3411 DCA @BUFPTR ; store that in main memory too 6701 10476 6276 SPD ; return to panel memory 6702 10477 6211 CDF 1 ; and our own memory field 6703 10500 2052 ISZ XFRCNT ; have we done a full page? 6704 10501 5245 JMP UNPAC1 ; nope - keep copying 6705 10502 7100 CLL ; be sure the LINK is cleared for success 6706 10503 6225 .POPJ ; yes - we're outta here! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 164 Pack RAM Disk Pages bts6120.plx 6707 .TITLE Pack RAM Disk Pages 6708 6709 6710 ; This routine will write one page of 128 PDP-8 words from a buffer anywhere 6711 ; in either panel or main memory to RAM disk. It's the exact complement of 6712 ; UNPACK, and expects exactly the same things to be set up. 6713 10504 7200 PACK: CLA ; don't assume anything! 6714 10505 1366 TAD [-64.] ; do 64 word pairs, or 128 words 6715 10506 3052 DCA XFRCNT ; ... 6716 6717 ; Grab the next two twelve bit words from the buffer... 6718 10507 4763 PACK1: JMS @[BUFCDF] ; change DF to the buffer's field 6719 10510 1411 TAD @BUFPTR ; get a word from the buffer 6720 10511 3027 DCA RAMBUF ; save it for the computation of byte 3 6721 10512 1411 TAD @BUFPTR ; do the same with the second word 6722 10513 3030 DCA RAMBUF+1 ; ... 6723 10514 6276 SPD ; back to panel memory addressing 6724 6725 ; Store bytes 1 and 2 (they're easy) and calculate byte three. Note that 6726 ; the SRAM will ignore the upper four bits when writing (there's no hardware 6727 ; there!) so there's no need to worry about masking them out first... 6728 10515 4765 JMS @[RAMCDF] ; select the correct SRAM "unit" 6729 10516 6403 MM3 ; and enable the SRAM chips 6730 10517 1027 TAD RAMBUF ; store byte 1 6731 10520 3410 DCA @RAMPTR ; ... 6732 10521 1030 TAD RAMBUF+1 ; and byte 2 6733 10522 3410 DCA @RAMPTR ; ... 6734 10523 1027 TAD RAMBUF ; byte 3 has the top four bits of word 1 6735 10524 0362 AND [7400] ; ... 6736 10525 7002 BSW ; ... in bits 8..11 of the byte 6737 10526 7112 CLL RTR ; ... 6738 10527 3027 DCA RAMBUF ; save that for a moment 6739 10530 1030 TAD RAMBUF+1 ; and the top four bits of word 2 6740 10531 0362 AND [7400] ; ... 6741 10532 7112 CLL RTR ; in bits 4..7 6742 10533 7112 CLL RTR ; ... 6743 10534 1027 TAD RAMBUF ; ... 6744 10535 3410 DCA @RAMPTR ; ... 6745 10536 6402 MM2 ; return to the default memory map 6746 10537 6211 CDF 1 ; and field 6747 10540 2052 ISZ XFRCNT ; have we done a whole page? 6748 10541 5307 JMP PACK1 ; nope - keep going 6749 10542 7100 CLL ; be sure the LINK is cleared for success 6750 10543 6225 .POPJ ; all done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 165 Get Battery Status ROM Call bts6120.plx 6751 .TITLE Get Battery Status ROM Call 6752 6753 6754 ; The Get Battery Status ROM call will return the status of the RAM disk 6755 ; lithium backup batteries. As long as either battery has sufficient 6756 ; voltage, -1 will be return in the AC. If both batteries have failed, then 6757 ; zero is returned. 6758 ; 6759 ; PR0 / call the SBC6120 ROM firmware 6760 ; 0003 / get backup battery status function code 6761 ; / return with AC == -1 if batteries are OK 6762 ; / AC == +1 if batteries are bad 6763 ; / AC == 0 if battery status unknown 6764 ; 6765 ; NOTE: Because of the way the DS1221 works, the battery status can only 6766 ; be tested after power up. It isn't possible to monitor the battery status 6767 ; in real time! 6768 10544 7300 GETBAT: CLA CLL ; ... 6769 10545 1033 TAD BATTOK ; return the battery status in the AC 6770 10546 6225 .POPJ ; and that's it 6771 10562 7400 10563 2221 10564 0377 10565 0753 10566 7700 10567 0504 10570 3110 10571 0442 10572 3067 10573 2534 10574 0661 10575 0722 10576 2222 10577 6201 6772 10600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 166 Determine RAM Disk Model bts6120.plx 6773 .TITLE Determine RAM Disk Model 6774 6775 ; This routine will determine the type of the RAM disk installed and sets 6776 ; the RDTYPE variable accordingly: 6777 ; 6778 ; -2 -> IOB6120 RAM disk 6779 ; -1 -> original (DS1221) RAM disk 6780 ; 0 -> no RAM disk 6781 ; +1 -> new (DS1231) RAM disk 6782 ; +2 -> new SBC6120-RC model RAM disk 6783 ; 6784 ; Each of these implementations has slightly different characteristics (sigh!) 6785 ; and so it's important to know which one we've got. Note that this routine 6786 ; is called only once, during phase 2 of system initialization. 6787 10600 7200 RDCHK1: CLA 6788 10601 4777 JMS @[CHKRC] ; is this the SBC6120-RC model? 6789 10602 5253 JMP RDCH20 ; yep - go handle that case 6790 6791 ; If the IOB6120 is in use, then we've obviously got the IOB6120 style 6792 ; RAM disk. Also, since the IOB6120 doesn't support any low battery detection 6793 ; for the RAM disk backup battery, we'll take this chance to set BATTOK to 6794 ; zero (unknown battery status). 6795 10603 6201 CDF 0 ; the EXTFLG lives in field 0 6796 10604 1776 TAD @[EXTFLG] ; get the IOB6120 status 6797 10605 6211 CDF 1 ; ... 6798 10606 7650 SNA CLA ; is there one? 6799 10607 5213 JMP RDCH10 ; no - go check for a DS1221 RAMdisk card 6800 10610 3033 DCA BATTOK ; yes - set the battery status to unknown 6801 10611 7344 NLM2 ; and set RDTYPE to -2 (IOB6120 RAM disk) 6802 10612 5250 JMP RDCH12 ; .... 6803 6804 ; The original RAMdisk card (the one with the DS1221 chip) didn't decode 6805 ; EMA2 and so the even and odd fields select the same SRAM chip. This code 6806 ; does a very simple test to detect that case (remember that we aren't even 6807 ; sure _any_ RAMdisk exists at this point!) and sets the maximum unit to 4 6808 ; if it detects this duplication. Note that this assumes that if any 6809 ; RAMdisk chip is installed, the first one is! 6810 10613 1375 RDCH10: TAD [32.] ; test bank 32 so A17 will be set 6811 10614 6410 LDAR ; ... 6812 10615 6403 MM3 ; address the RAMdisk map 6813 10616 6201 CDF 0 ; select the first chip 6814 10617 1374 TAD [252] ; put a test pattern in one location 6815 10620 3773 DCA @[7776] ; ... 6816 10621 1372 TAD [125] ; and a different one in the next 6817 10622 3771 DCA @[7777] ; ... 6818 10623 1773 TAD @[7776] ; add them up 6819 10624 1771 TAD @[7777] ; ... 6820 10625 7040 CMA ; the result should be 377 6821 10626 0370 AND [377] ; remember that only 8 bits exist 6822 10627 7640 SZA CLA ; skip if any RAM disk exists? 6823 10630 5250 JMP RDCH12 ; none - set RDTYPE to zero and exit 6824 10631 6211 CDF 1 ; address an odd numbered chip 6825 10632 3773 DCA @[7776] ; clear this location in chip #1 6826 10633 6201 CDF 0 ; read the original chip again 6827 10634 1773 TAD @[7776] ; ... 6828 10635 0370 AND [377] ; the RAMdisk array is only 8 bits 6829 10636 1367 TAD [-252] ; if this is now zero 6830 10637 7650 SNA CLA ; ... we can be pretty sure it's an old card 6831 10640 5243 JMP RDCH11 ; nope - modern DS1231 card 6832 6833 ; Here for the old stype (DS1221) card... 6834 10641 7240 NLM1 ; set RDTYPE to -1 6835 10642 5250 JMP RDCH12 ; store it and return... 6836 6837 ; Here for a modern (DS1231) card... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 167 Determine RAM Disk Model bts6120.plx 6838 10643 7201 RDCH11: NL0001 ; set the AC to +1 6839 10644 6415 SBBLO ; skip of the DS1231 battery is low 6840 10645 7240 NLM1 ; not low - set BATTOK to -1 6841 10646 3033 DCA BATTOK ; update the battery status flag 6842 10647 7201 NL0001 ; and finally set RDTYPE to 1 6843 10650 3047 RDCH12: DCA RDTYPE ; ... 6844 10651 6402 MM2 ; return to the normal memory map 6845 10652 6225 .POPJ ; and we're all done 6846 6847 ; Here for a SBC6120-RC model ... 6848 10653 6436 RDCH20: SBBLO2 ; skip if the backup battery is low 6849 10654 7344 NLM2 ; set AC = -2 if battery is OK 6850 10655 7001 IAC ; +1 -> battery bad, -1 -> battery good 6851 10656 3033 DCA BATTOK ; set the battery flag 6852 10657 7326 NL0002 ; set RDTYPE = 2 6853 10660 5250 JMP RDCH12 ; and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 168 Calculate RAM Disk Addresses bts6120.plx 6854 .TITLE Calculate RAM Disk Addresses 6855 6856 6857 ; This routine will calculate the RAM disk bank number and the relative 6858 ; offset within that bank, corresponding to a disk page number passed in 6859 ; location RDPAGE. The resulting bank number is simply loaded directly into 6860 ; the DAR via the LDAR IOT, and the offset is left in auto index location 6861 ; RAMPTR, where it can be used by the UNPACK and PACK routines. If the page 6862 ; number passed is illegal (i.e. greater than the size of the selected RAM 6863 ; disk unit) then the link will be set when this routine returns. 6864 10661 7300 SETDAR: CLA CLL ; make sure the link is in a known state 6865 10662 1025 TAD RDPAGE ; get the desired page 6866 10663 1046 TAD RAMUSZ ; compare it to the size of this unit 6867 10664 7630 SZL CLA ; is the page number legal? 6868 10665 6225 .POPJ ; no - return with the LINK set 6869 6870 ; If this is the RC model, then we'll need a different algorithm ... 6871 10666 4777 JMS @[CHKRC] ; test for the SBC6120-RC model 6872 10667 5766 JMP @[RCSDAR] ; yep - go handle that case instead 6873 6874 ; Divide the page number by 21, the number of pages per bank, by repeated 6875 ; subtraction. This is kind of crude, but it only has to iterate 127 times, 6876 ; worst case, so the performance hit isn't that bad. We do have to be careful, 6877 ; though, because the largest legal page number is 2688, which is bigger than 6878 ; 2048. That means we have to treat the whole AC as a 12 bit UNSIGNED value! 6879 10670 3032 DCA RAMDAR ; clear the disk address (quotient) 6880 10671 1025 TAD RDPAGE ; get the selected RAM disk page number 6881 10672 7100 SETDA1: CLL ; make sure the link is clear before starting 6882 10673 1365 TAD [-BANKSZ] ; try to subtract another 21 6883 10674 7420 SNL ; did it fit? 6884 10675 5300 JMP SETDA2 ; nope - we can stop now 6885 10676 2032 ISZ RAMDAR ; yes - increment the disk address 6886 10677 5272 JMP SETDA1 ; and keep subtracting 6887 6888 ; We get here when we're done dividing, with the quotient in RAMDAR and the 6889 ; remainder in the AC. To calculate the byte offset within a bank, we need 6890 ; to multiply the remainder by 192 (the number of bytes per 128 word page). 6891 10700 1364 SETDA2: TAD [BANKSZ] ; restore the remainder 6892 10701 7002 BSW ; then multiply by 64 6893 10702 3010 DCA RAMPTR ; save offset*64 for a moment 6894 10703 1010 TAD RAMPTR ; ... 6895 10704 7104 CLL RAL ; then multiply by two again 6896 10705 1010 TAD RAMPTR ; 192*x = 128*x + 64*x 6897 10706 6201 CDF 0 ; adjust by base offset, default 0 - 1 6898 10707 1763 TAD @[RAMBAS] ; (auto index registers pre-increment) 6899 10710 6211 CDF 1 6900 10711 3010 DCA RAMPTR ; that's the final offset 6901 6902 ; Set up the DAR with the bank number, from RAMDAR. Remember that for the 6903 ; 128K chips, we must always set A17 to enable the alternate chip select! 6904 10712 1046 TAD RAMUSZ ; get the size of the selected unit 6905 10713 1362 TAD [RAM128] ; ... 6906 10714 7650 SNA CLA ; is this a 128K ram chip ? 6907 10715 1375 TAD [32.] ; yes - always set A17 6908 10716 1032 TAD RAMDAR ; get the quotient from the division 6909 10717 6410 LDAR ; and load the disk address register 6910 10720 7100 CLL ; indicate success 6911 10721 6225 .POPJ ; and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 169 Select RAM Disk Unit bts6120.plx 6912 .TITLE Select RAM Disk Unit 6913 6914 6915 ; This routine will set up the RAMCDF routine to select the desired RAM 6916 ; disk "unit". The unit number, 0..7, should be passed in RDUNIT. If the 6917 ; unit number given is illegal (i.e. greater than seven) OR if there is no 6918 ; SRAM chip installed in the selected position, this routine will return 6919 ; with the link set. 6920 ; 6921 ; Note that this routine works, more or less, with the SBC6120-RC RAM disk 6922 ; as is. "More or less" because the CDF value that's computed here is useless 6923 ; for the RC RAM disk, but there's no harm in that. Besides, this routine will 6924 ; still correctly range check the unit number and check for an installed SRAM 6925 ; chip correctly, and those functions are still useful. In the case of the RC 6926 ; RAM disk, the CDF instruction we leave in RAMCDF is later overwritten with a 6927 ; correct one by the SETDAR function. 6928 10722 7300 RAMSEL: CLL CLA ; make sure the link is in a known state 6929 10723 1024 TAD RDUNIT ; get the desired unit number 6930 10724 1361 TAD [-10] ; see if the unit is legal 6931 10725 7630 SZL CLA ; it must be less than 8 6932 10726 6225 .POPJ ; no - return with the link set 6933 ; The mapping of RAMdisk units to data fields is a little obscure - units 6934 ; 0..3 map to fields 0, 2, 4, and 6 (i.e. the even fields). RAMdisk units 6935 ; 4..7 map to the odd fields (1, 3, 5, 7)... 6936 10727 1024 TAD RDUNIT ; restore the original unit 6937 10730 7104 CLL RAL ; shift the unit number left once 6938 10731 1361 TAD [7770] ; if the unit is 4..7 then set the link 6939 10732 7430 SZL ; skip if the unit is 0..3 6940 10733 7001 IAC ; make the field odd for units 4..7 6941 10734 7114 CLL R3L ; and position it for a CDF instruction 6942 10735 0360 AND [70] ; ... 6943 10736 1357 TAD [CDF 0] ; make a CDF to the corresponding field 6944 10737 3354 DCA RAMCDF+1 ; and store that in the unit select routine 6945 6946 ; Now that we know the unit number is valid, verify that this chip is really 6947 ; installed by checking the RDSIZE array for a non-zero value. As a side 6948 ; effect of this, we always leave the size of the currently selected unit in 6949 ; location RAMUSZ, where it's used by SETDAR to determine whether the page 6950 ; addressed is actually legal. We always want to update RAMUSZ, even if the 6951 ; chip is not installed, because this will also cause SETDAR to fail if the 6952 ; caller ignores the our error return and attempts a read or write anyway. 6953 10740 1024 TAD RDUNIT ; get the unit number again 6954 10741 1363 TAD [RDSIZE] ; index into the RDSIZE array 6955 10742 3045 DCA SIZPTR ; ... 6956 10743 1445 TAD @SIZPTR ; to get the size of this chip 6957 10744 7041 CIA ; make it negative 6958 10745 3046 DCA RAMUSZ ; and save that for SETDAR 6959 10746 1046 TAD RAMUSZ ; ... 6960 10747 7100 CLL ; make sure the link is in a known state 6961 10750 7650 SNA CLA ; is this chip installed ? 6962 10751 7020 CML ; nope - give the error return 6963 10752 6225 .POPJ ; ... 6964 6965 ; This little routine can be called, via a JMS instruction (not a .PUSHJ!) 6966 ; to change the DF and select the last RAM disk unit set by a call to RAMSEL. 6967 10753 0000 RAMCDF: 0 ; call here via a JMS! 6968 10754 7000 NOP ; gets overwritten with a CDF instruction 6969 10755 5753 JMP @RAMCDF ; return... 6970 10757 6201 10760 0070 10761 7770 10762 1240 10763 0034 10764 0025 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 170 Select RAM Disk Unit bts6120.plx 10765 7753 10766 3033 10767 7526 10770 0377 10771 7777 10772 0125 10773 7776 10774 0252 10775 0040 10776 0033 10777 2534 6971 11000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 171 Get RAM Disk Size ROM Call bts6120.plx 6972 .TITLE Get RAM Disk Size ROM Call 6973 6974 6975 ; PR0 function 2 will return the size of a RAM disk chip, in 128 word pages, 6976 ; in the AC. The AC should be loaded with the desired unit number, 0..7, 6977 ; before invoking PD0. If no chip is installed in the selected unit, zero 6978 ; will be returned in the AC. If the unit number is not in the range 0..7, 6979 ; then on return the LINK will be set to indicate an error. 6980 ; 6981 ; For example: 6982 ; TAD (unit / load the desired RAM disk unit, 0..7 6983 ; PR0 / call the ROM software 6984 ; 0002 / function code for Get RAM Disk Status 6985 ; / return the RAM disk size in the AC 6986 6987 ; It's tempting to use the RAMSEL routine here to save some steps, but be 6988 ; careful - RAMSEL will return with the LINK set (an error condition) if a 6989 ; valid unit number is selected but there is no SRAM chip installed there. 6990 ; That's not what we want for this ROM call, which should return an error only 6991 ; if the selected unit is > 7! 6992 11000 3024 GETRDS: DCA RDUNIT ; save the unit number 6993 11001 1024 TAD RDUNIT ; and get it back 6994 11002 7100 CLL ; be sure the link is in a known state 6995 11003 1377 TAD [-10] ; is it a legal unit number ? 6996 11004 7630 SZL CLA ; skip if so 6997 11005 6225 .POPJ ; no - return with the LINK set and AC clear 6998 11006 1024 TAD RDUNIT ; one more time 6999 11007 1376 TAD [RDSIZE] ; index the RDSIZE array 7000 11010 3045 DCA SIZPTR ; ... 7001 11011 1445 TAD @SIZPTR ; get the size of this disk 7002 11012 6225 .POPJ ; and return it with the LINK cleared PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 172 ATA Disk Support bts6120.plx 7003 .TITLE ATA Disk Support 7004 7005 7006 ; BTS6120 supports any standard ATA hard disk connected to the SBC6120 IDE 7007 ; interface. Nearly all hard disks with IDE interfaces are ATA; conversely, 7008 ; nearly all non-hard disk devices (e.g. CDROMs, ZIP drives, LS-120s, etc) 7009 ; with IDE interfaces are actually ATAPI and not ATA. ATAPI requires a 7010 ; completely different protocol, which BTS6120 does not support, and BTS6120 7011 ; will simply ignore any ATAPI devices connected to the IDE interface. 7012 ; BTS6120 supports only a single physical drive, which must be set up as the 7013 ; IDE master, and any IDE slave device will be ignored. 7014 ; 7015 ; Since BTS6120 does not support cylinder/head/sector (C/H/S) addressing, 7016 ; the hard disk used must support logical block addressing (LBA) instead. 7017 ; All modern IDE/ATA drives support LBA, as do most drives manufactured in the 7018 ; last five or six years, however some very old drives may not. If BTS6120 7019 ; detects an ATA drive that does not support LBA it will display the message 7020 ; "IDE: Not supported" during startup and there after ignore the drive. 7021 ; 7022 ; All IDE devices, regardless of vintage, transfer data in sixteen bit words 7023 ; and each sector on an ATA disk contains 512 bytes, or 256 sixteen bit words. 7024 ; When writing to the disk, BTS6120 converts twelve bit PDP-8 words to sixteen 7025 ; bits by adding four extra zero bits to the left and, when reading from the 7026 ; disk, BTS6120 converts sixteen bit words to twelve bits by simply discarding 7027 ; the most significant four bits. No packing is done. This conveniently 7028 ; means that each ATA sector holds 256 PDP-8 words, or exactly one OS/8 block. 7029 ; It also means that one quarter of the disk space is wasted, in this era of 7030 ; multi-gigabyte disks that hardly seems like an issue. 7031 ; 7032 ; OS/8 handlers and the OS/8 file system use a single twelve bit word to hold 7033 ; block numbers, which means that OS/8 mass storage devices are limited to a 7034 ; maximum of 4096 blocks . Using the BTS6120 non-packing scheme for storing 7035 ; data, 4096 PDP-8 blocks are exactly 2Mb. Clearly, if a single OS/8 device 7036 ; corresponds to an entire hard disk then nearly all of the disk space would 7037 ; be wasted. The normal solution is to partition the hard disk into many OS/8 7038 ; units, with each unit representing only a part of the entire disk. Since 7039 ; OS/8 cannot support a single unit larger than 2Mb there isn't any point in 7040 ; allowing partitions to be larger than that, and since the smallest drives 7041 ; available today can hold hundreds if not thousands of 2Mb partitions, there 7042 ; isn't much point in allowing a partition to be smaller than that, either. 7043 ; 7044 ; Because of this, BTS6120 supports only fixed size partitions of 2Mb each. 7045 ; This greatly simplifies the software since a twenty four bit disk sector 7046 ; number can now be calculated simply by concatenating a twelve bit partition 7047 ; number with the twelve bit OS/8 relative block number (RBN). No "super 7048 ; block" with a partition table is needed to keep track of the sizes and 7049 ; positions of each partition, and the OS/8 handler is simplified since each 7050 ; disk partition is always the same size. A twenty four bit sector address 7051 ; permits disks of up to 8Gb to be fully used, which seems more than enough 7052 ; for a PDP-8. 7053 ; 7054 ; Once again, in BTS6120 the partition number simply refers to the most 7055 ; significant twelve bits of a twenty-four bit disk address, and the OS/8 7056 ; block number is the least significant twelve bits. It's no more complicated 7057 ; than that! 7058 ; 7059 ; The ID01 is the OS/8 handler for the SBC6120 IDE/ATA disk. It supports 7060 ; eight units, IDA0 through IDA7, in a single page and may be assembled as 7061 ; either a system (IDSY) or non-system (IDNS) handler. The system handler 7062 ; version of the ID01 contains a secondary bootstrap that can be booted by 7063 ; the BTS6120 Boot command. The ID01 is a simple handler that uses HD-6120 7064 ; PR0 instruction to invoke BTS6120 functions for low level IDE disk access 7065 ; and data transfer. 7066 ; 7067 ; BTS6120 implements a partition map which defines the partition number PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 173 ATA Disk Support bts6120.plx 7068 ; corresponding to each OS/8 ID01 unit, and when an OS/8 program accesses an 7069 ; ID01 unit BTS6120 uses this table to determine the upper twelve bits of the 7070 ; LBA. At power on or after a MR command, BTS6120 initializes this partition 7071 ; map so that unit 0 accesses partition 0, unit 1 accesses partition 1, and 7072 ; so on up through unit 7 and partition 7. This mapping remains in effect 7073 ; until it is changed by either the PM command, or the Set IDE Disk Partition 7074 ; Mapping PR0 function. 7075 ; 7076 ; The largest mass storage device supported by OS/8 is actually only 4095 7077 ; blocks, not 4096, and so the last block of every 2Mb partition is never 7078 ; used by OS/8. This block can, however, be accessed via the Read/Write IDE 7079 ; disk PR0 function (section 6.5), and it can be used to store the name, 7080 ; creation date, and other information about that partition. The OS/8 PART 7081 ; program uses this to allow partitions to be mounted on ID01 logical units 7082 ; by name rather than partition number. Named partitions are strictly a 7083 ; function of the OS/8 PART program and BTS6120 knows nothing about them. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 174 IDE Disk Interface bts6120.plx 7084 .TITLE IDE Disk Interface 7085 7086 7087 ; In the SBC6120, the IDE interface is implemented via a standard 8255 PPI, 7088 ; which gives us 24 bits of general purpose parallel I/O. Port A is connected 7089 ; the high byte (DD8..DD15) of the IDE data bus and port B is connected to 7090 ; the low byte (DD0..DD7). Port C supplies the IDE control signals as follow: 7091 ; 7092 ; C0..C2 -> DA0 .. 2 (i.e. device address select) 7093 ; C.3* -> DIOR L (I/O read) 7094 ; C.4* -> DIOW L (I/O write) 7095 ; C.5* -> RESET L 7096 ; C.6* -> CS1Fx L (chip select for the 1Fx register space) 7097 ; C.7* -> CS3Fx L ( " " " " 3Fx " " ) 7098 ; 7099 ; * These active low signals (CS1Fx, CS3Fx, DIOR, and DIOW) are inverted in 7100 ; the hardware so that writing a 1 bit to the register asserts the signal. 7101 ; 7102 ; One nice feature of the 8255 is that it allows bits in port C to be 7103 ; individually set or reset simply by writing the correct command word to the 7104 ; control register - it's not necessary to read the port, do an AND or OR, 7105 ; and write it back. We can use this feature to easily toggle the DIOR and 7106 ; DIOW lines with a single PWCR IOT. 7107 0222 IDEINP=222 ; set ports A and B as inputs, C as output 7108 0200 IDEOUT=200 ; set ports A and B (and C too) as outputs 7109 0007 SETDRD=007 ; assert DIOR L (PC.3) in the IDE interface 7110 0006 CLRDRD=006 ; clear " " " " " " " " 7111 0011 SETDWR=011 ; assert DIOW L (PC.4) in the IDE interface 7112 0010 CLRDWR=010 ; clear " " " " " " " " 7113 0013 SETDRE=013 ; assert DRESET L (PC.5) in the IDE interface 7114 0012 CLRDRE=012 ; clear " " " " " " " " 7115 7116 ; Standard IDE registers... 7117 ; (Note that these are five bit addresses that include the two IDE CS bits, 7118 ; CS3Fx (AC4) and CS1Fx (AC5). The three IDE register address bits, DA2..DA0 7119 ; correspond to AC9..AC11. 7120 0100 CS1FX=100 ; PC.6 selects the 1Fx register space 7121 0200 CS3FX=200 ; PC.7 " " 3Fx " " " 7122 0100 REGDAT=CS1FX+0 ; data (R/W) 7123 0101 REGERR=CS1FX+1 ; error (R/O) 7124 0102 REGCNT=CS1FX+2 ; sector count (R;W) 7125 0103 REGLB0=CS1FX+3 ; LBA byte 0 (or sector number) R/W 7126 0104 REGLB1=CS1FX+4 ; LBA byte 1 (or cylinder low) R/W 7127 0105 REGLB2=CS1FX+5 ; LBA byte 2 (or cylinder high) R/W 7128 0106 REGLB3=CS1FX+6 ; LBA byte 3 (or device/head) R/W 7129 0107 REGSTS=CS1FX+7 ; status (R/O) 7130 0107 REGCMD=CS1FX+7 ; command (W/O) 7131 7132 ; IDE status register (REGSTS) bits... 7133 0200 STSBSY=0200 ; busy 7134 0100 STSRDY=0100 ; device ready 7135 0040 STSDF= 0040 ; device fault 7136 0020 STSDSC=0020 ; device seek complete 7137 0010 STSDRQ=0010 ; data request 7138 0004 STSCOR=0004 ; corrected data flag 7139 0001 STSERR=0001 ; error detected 7140 7141 ; IDE command codes (or at least the ones we use!)... 7142 0220 CMDEDD=220 ; execute device diagnostic 7143 0354 CMDIDD=354 ; identify device 7144 0040 CMDRDS=040 ; read sectors with retry 7145 0060 CMDWRS=060 ; write sectors with retry 7146 0341 CMDSUP=341 ; spin up 7147 0340 CMDSDN=340 ; spin down PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 175 Initialize IDE Drive and Interface bts6120.plx 7148 .TITLE Initialize IDE Drive and Interface 7149 7150 7151 ; This routine will initialize the IDE interface by configuring the 8255 7152 ; PPI and then asserting the IDE RESET signal to the drive. It then selects 7153 ; the master drive and waits for it to become ready, after which it returns. 7154 ; If there is no drive attached, or if the hardware is broken, then we'll time 7155 ; out after approximately 30 seconds of waiting for the drive to signal a 7156 ; ready status. 7157 ; 7158 ; Normally this routine will return with the AC and LINK both cleared, but 7159 ; if the drive reports an error then on return the LINK will be set and the 7160 ; drive's error status will be in the AC. In the case of a timeout, the 7161 ; LINK will be set and the AC will be -1 on return. 7162 11013 7200 IDEINI: CLA ; ... 7163 11014 3022 DCA DKSIZE ; zero means no disk is installed 7164 11015 6201 CDF 0 ; are we running on the SBC6120-RC model 7165 11016 1775 TAD @[RCFLAG] ; (get the flag that will tell us) 7166 11017 6211 CDF 1 ; ... 7167 11020 7640 SZA CLA ; ??? 7168 11021 5245 JMP IDEIN1: ; yep - the RC model never has an IDE drive 7169 11022 1374 TAD [IDEINP] ; PPI ports A and B are input and C is output 7170 11023 6477 PWCR ; ... 7171 11024 6476 PWPC ; clear all port C control lines 7172 11025 1373 TAD [SETDRE] ; set RESET L 7173 11026 6477 PWCR ; ... 7174 11027 1377 TAD [-10] ; according to the ATA specification, 7175 11030 7001 IAC ; ... we must leave RESET asserted for at 7176 11031 7440 SZA ; ... least 25 microseconds 7177 11032 5230 JMP .-2 ; 7178 11033 1372 TAD [CLRDRE] ; deassert RESET L 7179 11034 6477 PWCR ; ... 7180 7181 11035 1371 TAD [345] ; select the master drive, 512 byte sectors, 7182 11036 4770 JMS @[IDEWRR] ; ... and logical block addressing (LBA) mode 7183 11037 0106 REGLB3 ; ... 7184 7185 11040 4767 JMS @[IDERDR] ; quick check: read status reg 7186 11041 0107 REGSTS ; ... 7187 11042 1366 TAD [-345] ; if it's the same value as the last write, 7188 11043 7440 SZA ; there is almost certainly nothing there 7189 11044 5765 JMP @[WREADY] ; something... do a more complete check 7190 7191 11045 7360 IDEIN1: CLA CLL CML CMA ; return with AC = -1 and the LINK set 7192 11046 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 176 Identify IDE/ATA Device bts6120.plx 7193 .TITLE Identify IDE/ATA Device 7194 7195 7196 ; This routine will execute the ATA IDENTIFY DEVICE command and store the 7197 ; first 256 bytes of the result, in byte mode, in the panel memory buffer at 7198 ; DSKBUF. One thing to keep in mind is that ATAPI devices (e.g. CDROMs, ZIP 7199 ; disks, etc) ignore this command completely and respond to the ATAPI IDENTIFY 7200 ; PACKET DEVICE command instead. This means that if there are any ATAPI 7201 ; devices attached we'll never see them, which is fine since we don't 7202 ; understand how to talk to ATAPI devices anyway! 7203 ; 7204 ; The drive's response to IDENTIFY DEVICE will be 256 words of sixteen bit 7205 ; data full of device specific data - model number, manufacturer, serial 7206 ; number, drive geometry, maximum size, access time, and tons of other cool 7207 ; stuff. The RDIBUF routine would pack this sixteen bit data into twelve bit 7208 ; words by throwing away the upper four bits of each word, but that doesn't 7209 ; make sense in this case since we'd be destroying most of the useful 7210 ; information. Instead, this routine reads the data in an unpacked format and 7211 ; stores one eight bit byte per PDP-8 word. 7212 ; 7213 ; Unfortunately this would mean that we need a 512 word buffer to store the 7214 ; response, which is too big for our DSKBUF in panel memory. We're in luck, 7215 ; however, because of the 256 words (512 bytes) returned by this command the 7216 ; ATA specification only defines the first 128 - the remaining half of the 7217 ; data is "vendor specific" and undefined. This routine simply throws this 7218 ; part away, and only the first 128 words (256 bytes) of the drive's response 7219 ; are actually returned in the buffer. 7220 ; 7221 ; Like all the disk I/O routines, in the case of an error the LINK will 7222 ; be set and the contents of the drive's error register returned in the AC. 7223 11047 6205 DISKID: .PUSHJ @[WREADY] ; (just in case the drive is busy now) 11050 5765 7224 11051 7430 SZL ; any errors? 7225 11052 6225 .POPJ ; yes - we can go home early! 7226 11053 1364 TAD [CMDIDD] ; send the ATA identify device command 7227 11054 4770 JMS @[IDEWRR] ; by writing it to the command register 7228 11055 0107 REGCMD ; ... 7229 11056 6205 .PUSHJ @[WDRQ] ; the drive should ask to transfer data next 11057 5763 7230 11060 7430 SZL ; any errors? 7231 11061 6225 .POPJ ; yes - just give up 7232 7233 ; Get ready to ready to transfer data from the drive to our buffer... 7234 11062 1362 TAD [DSKBUF-1] ; setup BUFPTR to point to DSKBUF 7235 11063 3011 DCA BUFPTR ; ... 7236 11064 1361 TAD [-128.] ; transfer 128 words this time 7237 11065 3052 DCA XFRCNT ; ... 7238 11066 1374 TAD [IDEINP] ; set PPI ports A and B to input mode 7239 11067 6477 PWCR ; ... 7240 11070 1360 TAD [REGDAT] ; make sure the IDE data register is selected 7241 11071 6476 PWPC ; ... 7242 7243 ; Read 256 bytes into the caller's buffer, one byte per word. Big endian 7244 ; ordering (i.e. high byte first) is defined by the ATA specification to give 7245 ; the correct character order for ASCII strings in the device data (e.g. model 7246 ; number, serial number, manufacturer, etc). 7247 11072 1357 IDDEV1: TAD [SETDRD] ; assert DIOR 7248 11073 6477 PWCR ; ... 7249 11074 6470 PRPA ; read port A (the high byte) first 7250 11075 0356 AND [377] ; only eight bits are valid 7251 11076 3411 DCA @BUFPTR ; and store it in the buffer 7252 11077 6471 PRPB ; then read port B (the low byte) 7253 11100 0356 AND [377] ; ... 7254 11101 3411 DCA @BUFPTR ; ... 7255 11102 1355 TAD [CLRDRD] ; deassert DIOR PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 177 Identify IDE/ATA Device bts6120.plx 7256 11103 6477 PWCR ; ... 7257 11104 2052 ISZ XFRCNT ; have we done all 256 bytes? 7258 11105 5272 JMP IDDEV1 ; nope - keep reading 7259 7260 ; We've read our 256 bytes, but the drive still has another 256 more waiting 7261 ; in the buffer. We need to read those and throw them away... 7262 11106 1361 TAD [-128.] ; we still need to read 128 more words 7263 11107 3052 DCA XFRCNT ; ... 7264 11110 1357 IDDEV2: TAD [SETDRD] ; assert DIOR 7265 11111 6477 PWCR ; ... 7266 11112 7000 NOP ; make sure the DIOR pulse is wide enough 7267 11113 7000 NOP ; ... 7268 11114 1355 TAD [CLRDRD] ; and then clear DIOR 7269 11115 6477 PWCR ; ... 7270 11116 2052 ISZ XFRCNT ; have we done all 128? 7271 11117 5310 JMP IDDEV2 ; nope - keep reading 7272 7273 ; Drives report the total number of LBA addressable sectors in words 7274 ; 60 and 61. Sectors are 512 bytes, so simply dividing this value by 2048 7275 ; gives us the total drive size in Mb. This code patches together twelve 7276 ; bits out of the middle of this doubleword, after throwing away the least 7277 ; significant 11 bits to divide by 2048. This allows us to determine the 7278 ; size of drives up to 4Gb in a single 12 bit word. 7279 11120 1754 TAD @[DSKBUF+170] ; get the high byte of the low word 7280 11121 7010 RAR ; throw away the 3 least significant 7281 11122 7012 RTR ; ... 7282 11123 0353 AND [37] ; keep just 5 bits from this byte 7283 11124 3022 DCA DKSIZE ; save it for a minute 7284 11125 1752 TAD @[DSKBUF+173] ; get the low byte of the high word 7285 11126 7006 RTL ; left justify the seven MSBs of it 7286 11127 7006 RTL ; ... 7287 11130 7004 RAL ; ... 7288 11131 0351 AND [7740] ; ... 7289 11132 1022 TAD DKSIZE ; put together all twelve bits 7290 11133 3022 DCA DKSIZE ; ... 7291 7292 ; All done - return success... 7293 11134 7300 CLA CLL ; return with the AC and LINK clear 7294 11135 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 178 Get IDE Disk Size ROM Call bts6120.plx 7295 .TITLE Get IDE Disk Size ROM Call 7296 7297 7298 ; The get IDE disk size call will return the size of the attached IDE/ATA 7299 ; disk, in megabytes. This call never fails - if no disk is attached it 7300 ; simply returns zero... 7301 ; 7302 ;CALL: 7303 ; PR0 / call SBC6120 ROM firmware 7304 ; 5 / subfunction for get disk size 7305 ; 7306 ; 7307 11136 7300 GETDKS: CLA CLL ; ignore anything in the AC 7308 11137 1022 TAD DKSIZE ; and return the disk size 7309 11140 6225 .POPJ ; that's all there is to it! 7310 11151 7740 11152 7573 11153 0037 11154 7570 11155 0006 11156 0377 11157 0007 11160 0100 11161 7600 11162 7377 11163 1426 11164 0354 11165 1400 11166 7433 11167 2101 11170 2061 11171 0345 11172 0012 11173 0013 11174 0222 11175 0035 11176 0034 11177 7770 7311 11200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 179 IDE Disk Primary Bootstrap bts6120.plx 7312 .TITLE IDE Disk Primary Bootstrap 7313 7314 ; This routine will read block zero from IDE disk unit zero into page 7315 ; zero of field zero of main memory. The next step in the usual boot sequence 7316 ; would be to start the secondary bootstrap, but that's up to the caller... 7317 11200 7240 IDBOOT: STA ; point the buffer to page 0 7318 11201 3011 DCA BUFPTR ; ... 7319 11202 1377 TAD [CDF 0] ; of field zero 7320 11203 3776 DCA @[BUFCDF+1] ; ... 7321 11204 3053 DCA BUFPNL ; of main memory 7322 11205 6201 CDF 0 ; PARMAP lives in field 0 7323 11206 1775 TAD @[PARMAP] ; get partition number of unit 0 7324 11207 6211 CDF 1 7325 11210 3020 DCA DKPART ; ... 7326 11211 3021 DCA DKRBN ; block zero 7327 11212 1374 TAD [-128.] ; we only need the first 1/2 of the block 7328 11213 5773 JMP @[DISKRD] ; ... 7329 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 180 Read and Write IDE Sectors bts6120.plx 7330 .TITLE Read and Write IDE Sectors 7331 7332 ; This routine will read a single sector from the attached IDE drive. 7333 ; The caller should set up DKPART and DKRBN with the disk partition and 7334 ; sector number, and BUFPTR, BUFCDF and BUFPNL with the address of a 7335 ; buffer in 6120 memory. If any errors are encountered, this routine will 7336 ; return with the LINK set and the drive's error status in the AC... 7337 ; side effect: BUFPTR is advanced by the read size 7338 ; HOOK: this function can be intercepted in order to connect a different 7339 ; device interface to all the commands and functions that use the disk 7340 11214 7000 DISKRD: NOP ; HOOK: disk read 7341 11215 7000 NOP 7342 11216 7000 NOP 7343 11217 3054 DCA BUFSIZ ; save the buffer size 7344 7345 ; See if there really is a hard disk attached. If not, then immediately 7346 ; take the error return with the AC set to -1. 7347 11220 1022 TAD DKSIZE ; if there is a disk attached 7348 11221 7640 SZA CLA ; then DKSIZE will be non-zero 7349 11222 5225 JMP DRD1 ; it is - it's safe to proceed 7350 11223 7360 CLA CLL CML CMA ; no disk - return LINK = 1 and AC = -1 7351 11224 6225 .POPJ ; and quit now 7352 7353 11225 6205 DRD1: .PUSHJ @[WREADY] ; wait for the drive to become ready 11226 5772 7354 11227 7430 SZL ; any errors detected?? 7355 11230 6225 .POPJ ; yes - quit now 7356 11231 6205 .PUSHJ SETLBA ; set up the disk's LBA registers 11232 5310 7357 11233 1371 TAD [CMDRDS] ; read sector with retry command 7358 11234 4770 JMS @[IDEWRR] ; write that to the command register 7359 11235 0107 REGCMD ; ... 7360 11236 6205 .PUSHJ @[WDRQ] ; now wait for the drive to finish 11237 5767 7361 11240 7430 SZL ; any errors detected? 7362 11241 6225 .POPJ ; yes - quit now 7363 11242 1054 TAD BUFSIZ ; no - transfer data 7364 11243 5766 JMP @[RDIBUF] ; ... from the sector buffer to memory 7365 7366 7367 ; This routine will write a single sector to the attached IDE drive. Except 7368 ; for the direction of data transfer, it's basically the same as DISKRD, 7369 ; including all parameters and error returns. 7370 ; HOOK: this function can be intercepted in order to connect a different 7371 ; device interface to all the commands and functions that use the disk 7372 11244 7000 DISKWR: NOP ; HOOK: disk write 7373 11245 7000 NOP 7374 11246 7000 NOP 7375 11247 3054 DCA BUFSIZ ; save the caller's record size 7376 7377 ; See if there really is a hard disk attached. If not, then immediately 7378 ; take the error return with the AC set to -1. 7379 11250 1022 TAD DKSIZE ; if there is a disk attached 7380 11251 7640 SZA CLA ; then DKSIZE will be non-zero 7381 11252 5255 JMP DWR1 ; it is - it's safe to proceed 7382 11253 7360 CLA CLL CML CMA ; no disk - return LINK = 1 and AC = -1 7383 11254 6225 .POPJ ; and quit now 7384 7385 11255 6205 DWR1: .PUSHJ @[WREADY] ; wait for the drive to become ready 11256 5772 7386 11257 7430 SZL ; did we encounter an error ? 7387 11260 6225 .POPJ ; yes - just give up now 7388 11261 6205 .PUSHJ SETLBA ; set up the disk address registers 11262 5310 7389 11263 1365 TAD [CMDWRS] ; write sector with retry command PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 181 Read and Write IDE Sectors bts6120.plx 7390 11264 4770 JMS @[IDEWRR] ; write that to the command register 7391 11265 0107 REGCMD ; ... 7392 11266 6205 .PUSHJ @[WDRQ] ; wait for the drive to request data 11267 5767 7393 11270 7430 SZL ; did the drive detect an error instead? 7394 11271 6225 .POPJ ; yes - just give up 7395 11272 1054 TAD BUFSIZ ; nope - transfer the data 7396 11273 6205 .PUSHJ @[WRIBUF] ; ... to the sector buffer from memory 11274 5764 7397 7398 ; There's a subtle difference in the order of operations between reading and 7399 ; writing. In the case of writing, we send the WRITE SECTOR command to the 7400 ; drive, transfer our data to the sector buffer, and only then does the 7401 ; drive actually go out and access the disk. This means we have to wait 7402 ; one more time for the drive to actually finish writing, because only then 7403 ; can we know whether it actually worked or not! 7404 11275 5772 JMP @[WREADY] ; wait for the drive to finish writing PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 182 Spin Up and Spin Down IDE Drive bts6120.plx 7405 .TITLE Spin Up and Spin Down IDE Drive 7406 7407 7408 ; This routine will send a spin up command to the IDE drive and then wait 7409 ; for it to finish. This command will take a fairly long time under normal 7410 ; conditions. Worse, since this is frequently the first command we send to 7411 ; a drive, if there's no drive attached at all we'll have to wait for it 7412 ; to time out. If any errors are encountered then the LINK will be set on 7413 ; return and the contents of the drive's error register will be in the AC. 7414 11276 7200 SPINUP: CLA ; ... 7415 11277 1363 TAD [CMDSUP] ; send the spin up command to the drive 7416 11300 4770 JMS @[IDEWRR] ; by writing it to the command register 7417 11301 0107 REGCMD ; ... 7418 11302 5772 JMP @[WREADY] ; wait for the drive to become ready 7419 7420 7421 ; This routine will send a spin down command. Drives are not required by 7422 ; the standard to implement this command, so there's no guarantee that any 7423 ; thing will actually happen! 7424 11303 7200 SPINDN: CLA ; ... 7425 11304 1362 TAD [CMDSDN] ; send the spin down command to the drive 7426 11305 4770 JMS @[IDEWRR] ; ... 7427 11306 0107 REGCMD ; ... 7428 11307 5772 JMP @[WREADY] ; and wait for it to finish PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 183 Setup IDE Unit, LBA and Sector Count Registers bts6120.plx 7429 .TITLE Setup IDE Unit, LBA and Sector Count Registers 7430 7431 7432 ; This routine will set up the IDE logical block address (LBA) registers 7433 ; according to the current disk address in locations DKPART and DKRBN. On IDE 7434 ; drives the sector number is selected via the cylinder and sector registers in 7435 ; the register file, but in the case of LBA mode these registers simply form a 7436 ; 24 bit linear sector number. In this software the disk partition number, in 7437 ; DKPART, gives the upper twelve bits of the address and the current sector 7438 ; number, in DKRBN, gives the lower twelve bits. 7439 ; 7440 ; This routine does not detect any error conditions... 7441 11310 7200 SETLBA: CLA ; just in case! 7442 11311 1021 TAD DKRBN ; get the lower 12 bits of of the LBA 7443 11312 4770 JMS @[IDEWRR] ; and write the lowest 8 bits to LBA0 7444 11313 0103 REGLB0 ; (the upper 4 bits are ignored) 7445 11314 1021 TAD DKRBN ; now get the upper 4 bits of the sector number 7446 11315 7002 BSW ; shift right eight bits 7447 11316 7012 RTR ; ... 7448 11317 0361 AND [17] ; get rid of the extra junk 7449 11320 3344 DCA LBATMP ; ... 7450 11321 1020 TAD DKPART ; get the disk partition number 7451 11322 7006 RTL ; shift them left four bits 7452 11323 7006 RTL ; ... 7453 11324 0360 AND [360] ; and isolate just four bits of that 7454 11325 1344 TAD LBATMP ; and build the middle byte of the LBA 7455 11326 4770 JMS @[IDEWRR] ; set that register next 7456 11327 0104 REGLB1 ; ... 7457 11330 1020 TAD DKPART ; get the partition one more time 7458 11331 7012 RTR ; shift it right four more bits 7459 11332 7012 RTR ; ... 7460 11333 4770 JMS @[IDEWRR] ; to make the upper byte of the 24 bit LBA 7461 11334 0105 REGLB2 ; ... 7462 7463 ; Note that the final four bits of the LBA are in LBA3 (the head and drive 7464 ; select register). Since we can only support 24 bit LBAs, these are unused. 7465 ; The IDEINI routine initializes them to zero at the same time it selects the 7466 ; master drive, and we never change 'em after that. At the same time, IDEINI 7467 ; also selects LBA addressing mode (which is obviously very important to us!) 7468 ; and 512 byte sectors. 7469 11335 1362 TAD [340] ; select the master drive, 512 byte sectors, 7470 11336 4770 JMS @[IDEWRR] ; ... and logical block addressing (LBA) mode 7471 11337 0106 REGLB3 ; ... 7472 7473 ; Always load the sector count register with one... 7474 11340 7201 NL0001 ; write 1 7475 11341 4770 JMS @[IDEWRR] ; ... 7476 11342 0102 REGCNT ; to the sector count register 7477 11343 6225 .POPJ ; that's all we have to do 7478 7479 ; Temporary storage for SETLBA... 7480 11344 LBATMP: .BLOCK 1 7481 11360 0360 11361 0017 11362 0340 11363 0341 11364 1600 11365 0060 11366 1646 11367 1426 11370 2061 11371 0040 11372 1400 11373 1214 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 184 Setup IDE Unit, LBA and Sector Count Registers bts6120.plx 11374 7600 11375 0020 11376 2222 11377 6201 7482 11400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 185 Wait for IDE Drive Ready bts6120.plx 7483 .TITLE Wait for IDE Drive Ready 7484 7485 7486 ; This routine tests for the DRIVE READY bit set in the status register and 7487 ; at the same time for the DRIVE BUSY bit to be clear. READY set means that 7488 ; the drive has power and is spinning, and BUSY clear means that it isn't 7489 ; currently executing a command. The combination of these two conditions means 7490 ; that the drive is ready to accept another command. Normally this routine 7491 ; will return with both the AC and the LINK cleared, however if the drive sets 7492 ; the ERROR bit in its status register then it will return with the LINK set 7493 ; and the contents of the drive's error register in the AC. 7494 ; 7495 ; If there is no drive connected, or if the drive fails for some reason, 7496 ; then there is the danger that this routine will hang forever. To avoid 7497 ; that it also implements a simple timeout, and if the drive doesn't become 7498 ; ready within a certain period of time it will return with the LINK set and 7499 ; the AC equal to -1. If the system has just been powered up, then we'll 7500 ; have to wait for the drive to spin up before it becomes ready, and that can 7501 ; take a fairly long time. To be safe, the timeout currently stands at a 7502 ; full 30 seconds! 7503 11400 1377 WREADY: TAD [7550] ; initialize the outer timeout counter 7504 11401 3225 DCA RDYTMO+1 ; ... 7505 11402 3224 DCA RDYTMO ; and the inner counter is always cleared 7506 11403 4776 WREAD1: JMS @[IDERDR] ; go read the status register 7507 11404 0107 REGSTS ; (register to read) 7508 11405 7110 CLL RAR ; test the error bit first (AC11) 7509 11406 7430 SZL ; ??? 7510 11407 5775 JMP @[DRVERR] ; give up now if the drive reports an error 7511 11410 7004 RAL ; restore the original status 7512 11411 0374 AND [STSBSY+STSRDY] ; test both the READY and BUSY bits 7513 11412 1373 TAD [-STSRDY] ; is READY set and BUSY clear? 7514 11413 7020 CML ; (the last TAD will have set the link!) 7515 11414 7650 SNA CLA ; ??? 7516 11415 6225 .POPJ ; yes - return now with the AC and LINK clear 7517 11416 2224 ISZ RDYTMO ; increment the inner timeout counter 7518 11417 5203 JMP WREAD1 ; no overflow yet 7519 11420 2225 ISZ RDYTMO+1 ; when the inner counter overflows, increment 7520 11421 5203 JMP WREAD1 ; ... the outer counter too 7521 7522 ; Here in the case of a drive time out... 7523 11422 7360 CLA CLL CML CMA ; return with AC = -1 and the LINK set 7524 11423 6225 .POPJ ; ... 7525 7526 ; Temporary storage for WREADY... 7527 11424 RDYTMO: .BLOCK 2 ; a double word time out counter 7528 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 186 Wait for IDE Data Request bts6120.plx 7529 .TITLE Wait for IDE Data Request 7530 7531 ; This routine will wait for the DRQ bit to set in the drive status register. 7532 ; This bit true when the drive is ready to load or unload its sector buffer, 7533 ; and normally a call to this routine will be immediately followed by a call 7534 ; to ether RDIBUF or WRIBUF. Normally this routine will return with both the 7535 ; LINK and the AC cleared, however if the drive sets its error bit then the 7536 ; LINK will be 1 on return and the drive's error status will be in the AC. 7537 ; 7538 ; WARNING - unlike WREADY, this routine does not have a timeout! 7539 11426 4776 WDRQ: JMS @[IDERDR] ; read the drive status register 7540 11427 0107 REGSTS ; ... 7541 11430 7110 CLL RAR ; test the error bit (AC11) 7542 11431 7430 SZL ; is it set? 7543 11432 5242 JMP DRVERR ; yes - give the error return 7544 11433 7004 RAL ; no - restore the original status value 7545 11434 0372 AND [STSBSY+STSDRQ] ; and test the BUSY and DRQ flags 7546 11435 1371 TAD [-STSDRQ] ; wait for BUSY clear and DRQ set 7547 11436 7020 CML ; (the last TAD will have set the link!) 7548 11437 7640 SZA CLA ; well? 7549 11440 5226 JMP WDRQ ; nope - keep waiting 7550 11441 6225 .POPJ ; yes - return with AC and LINK cleared! 7551 7552 ; We get here if the drive sets the error flag in the status register. In 7553 ; this case we return with the link bit set and the contents of the drive 7554 ; error register in the AC. 7555 11442 4776 DRVERR: JMS @[IDERDR] ; read the drive error register 7556 11443 0101 REGERR ; ... 7557 11444 7120 STL ; and be sure the link is set 7558 11445 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 187 RAM Disk Diagnostics bts6120.plx 7559 .TITLE RAM Disk Diagnostics 7560 7561 ; This routine will do a simple test of the RAM disk array to determine 7562 ; whether each SRAM chip, from 0 to 7, is installed. If a given chip is 7563 ; installed, then we do another simple test to determine whether it is a 7564 ; 512K or 128K device, and then update the RDSIZE array accordingly. 7565 ; Because of the way disk sectors are laid out, only the first 4032 bytes 7566 ; (21 * 192) of every 4Kb bank are actually used. The last 64 bytes of each 7567 ; bank are available to us to use any way we like, including as a RAM test. 7568 ; 7569 ; There's one nasty complication here - the pin that corresponds to A17 on 7570 ; the 512K SRAM chips is actually an alternate chip enable on the 128K chips. 7571 ; Worse, this alternate enable is active HIGH, which means that A17 must be 7572 ; one or 128K chips won't talk at all. Fortunately, the pin that corresponds 7573 ; to A18 is a no connect on the 128K chips, so we can safely leave it zero. 7574 ; This explains the strange bank numbers selected in this test! 7575 ; 7576 11446 3044 RDTEST: DCA RAMSIZ ; clear the total RAM size 7577 7578 ; Clear the entire RDSIZE array, even if we have fewer than 8 SRAMs... 7579 11447 1371 TAD [-10] ; RDZISE always holds 8 units 7580 11450 3024 DCA RDUNIT ; count them here 7581 11451 1370 TAD [RDSIZE-1] ; and point to the RDSIZE array 7582 11452 3012 DCA XX1 ; (an auto-index register) 7583 11453 3412 DCA @XX1 ; clear another entry 7584 11454 2024 ISZ RDUNIT ; have we done them all 7585 11455 5253 JMP .-2 ; no - keep clearing 7586 ; yes - start testing with RDUNIT = 0 ! 7587 7588 ; If this is the RC model, then we'll need a different algorithm ... 7589 11456 4767 JMS @[CHKRC] ; test for the SBC6120-RC model 7590 11457 5766 JMP @[RCTEST] ; yep - go handle that case instead 7591 ; this is the original model 7592 7593 ; First test to see if this chip is even installed by writing alternating 7594 ; bit patterns to the last two locations and reading them back. If that works, 7595 ; then there must be something there! 7596 11460 6205 RDTES0: .PUSHJ @[RAMSEL] ; and set up RAMCDF and SIZPTR 11461 5765 7597 11462 1364 TAD [32.] ; test bank 32 so that A17 will be set 7598 11463 6410 LDAR ; ... 7599 11464 4763 JMS @[RAMCDF] ; change the DF to select the unit 7600 11465 6403 MM3 ; and enable the SRAM array 7601 11466 1362 TAD [252] ; write alternating bits to the last two bytes 7602 11467 3761 DCA @[7776] ; ... 7603 11470 1360 TAD [125] ; ... 7604 11471 3757 DCA @[7777] ; ... 7605 11472 1761 TAD @[7776] ; now read 'em back 7606 11473 1757 TAD @[7777] ; and add them up 7607 11474 7001 IAC ; the sum should be 377, so make it 400 7608 11475 0356 AND [377] ; and remember RAM disk is only 8 bits wide 7609 11476 7640 SZA CLA ; did it work?? 7610 11477 5312 JMP RDTES1 ; no - this chip doesn't exist 7611 7612 ; Some kind of SRAM chip is installed, and now we need to decide whether its 7613 ; 128K or 512K. The 128K chips ignore A18, so one easy test is to select 7614 ; bank 96 (which, to a 128K chip is the same as bank 32), zero out a location 7615 ; that we just tested, and then go back to bank 32 to see if it changed. 7616 11500 1355 TAD [96.] ; select bank 96 7617 11501 6410 LDAR ; which doesn't exist in a 128K chip 7618 11502 3757 DCA @[7777] ; this location in bank 0 used to hold 125 7619 11503 1364 TAD [32.] ; back to bank 32 7620 11504 6410 LDAR ; ... 7621 11505 1757 TAD @[7777] ; and see what we've got 7622 11506 0356 AND [377] ; remember RAM disk is only 8 bits wide PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 188 RAM Disk Diagnostics bts6120.plx 7623 11507 7640 SZA CLA ; if it's zero, then we have a 128K chip 7624 11510 1354 TAD [RAM512-RAM128]; nope - this must be a full 512K SRAM! 7625 11511 1353 TAD [RAM128] ; only 128K, but better than nothing 7626 7627 ; Store the chip size in RDSIZE and accumulate the total size... 7628 11512 6402 RDTES1: MM2 ; return to the default memory map 7629 11513 6211 CDF 1 ; and field 7630 11514 3445 DCA @SIZPTR ; store the size in RDSIZE[unit] 7631 11515 1445 TAD @SIZPTR ; ... 7632 11516 7450 SNA ; was there any chip here at all? 7633 11517 5327 JMP RDTES2 ; no - we can skip this part 7634 11520 7710 SPA CLA ; KLUDGE - skip if this was a 128K chip 7635 11521 1352 TAD [512.-128.] ; add 512K to the total RAM size 7636 11522 1351 TAD [128.] ; add 128K " " " " " 7637 ; Now it's time for a major hack. If we have a full eight 512K SRAM chips 7638 ; installed, then RAMSIZ will be 4096KB, or zero in the twelve bit world! 7639 ; If we ever find that, after adding the size of this chip, RAMSIZ is zero 7640 ; then we know that situation has occurred. The only thing we can to is to 7641 ; set RAMSIZ to 4095 instead of 4096 - that way, at least, it doesn't look 7642 ; like we have nothing... 7643 11523 1044 TAD RAMSIZ ; ... 7644 11524 7450 SNA ; did we reach 4096K ??? 7645 11525 7240 STA ; yes - set it to 4095 instead 7646 11526 3044 DCA RAMSIZ ; ... 7647 7648 ; On to the next unit, if there are any more left... 7649 11527 2024 RDTES2: ISZ RDUNIT ; go on to the next unit 7650 11530 1047 TAD RDTYPE ; get the RAM disk type 7651 11531 7700 SMA CLA ; skip if it's a DS1221 or IOB6120 card 7652 11532 1350 TAD [-4] ; no - the DS1231 card supports 8 units 7653 11533 1350 TAD [-4] ; and the others only 4 7654 11534 1024 TAD RDUNIT ; have we done all eight ? 7655 11535 7640 SZA CLA ; ??? 7656 11536 5260 JMP RDTES0 ; no - keep checking 7657 11537 1044 TAD RAMSIZ ; yes - return the total RAM disk size 7658 11540 6225 .POPJ ; and that's it 7659 11550 7774 11551 0200 11552 0600 11553 1240 11554 3740 11555 0140 11556 0377 11557 7777 11560 0125 11561 7776 11562 0252 11563 0753 11564 0040 11565 0722 11566 3000 11567 2534 11570 0033 11571 7770 11572 0210 11573 7700 11574 0300 11575 1442 11576 2101 11577 7550 7660 11600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 189 Write IDE Sector Buffer bts6120.plx 7661 .TITLE Write IDE Sector Buffer 7662 7663 7664 ; This routine will write PDP-8 twelve bit words to the IDE drive's sixteen 7665 ; bit data (sector) buffer. IDE drives naturally transfer data in sixteen bit 7666 ; words, and we simply store each twelve bit word zero extended. This wastes 7667 ; 25% of the drive's capacity, but in these days of multiple gigabyte disks, 7668 ; that hardly seems important. This also means that 256 PDP-8 words exactly 7669 ; fill one IDE sector, which is very convenient for OS/8! 7670 ; 7671 ; The caller is expected to set up BUFPTR, BUFCDF and BUFPNL to point to the 7672 ; buffer in 6120 memory. The negative of the buffer size should be passed in 7673 ; the AC, however we must always write exactly 256 words to the drive regard- 7674 ; less of the buffer size. If the buffer is smaller than that, then the last 7675 ; word is simply repeated until we've filled the entire sector. This is 7676 ; necessary for OS/8 handler "half block" writes. 7677 ; 7678 ; This routine does not wait for the drive to set DRQ, nor does it check the 7679 ; drive's status for errors. Those are both up to the caller. 7680 11600 3054 WRIBUF: DCA BUFSIZ ; save the actual buffer size 7681 11601 1377 TAD [-256.] ; but always transfer 256 words, regardless 7682 11602 3052 DCA XFRCNT ; ... 7683 11603 1376 TAD [IDEOUT] ; and set ports A and B to output mode 7684 11604 6477 PWCR ; ... 7685 11605 1375 TAD [REGDAT] ; make sure the IDE data register is addressed 7686 11606 6476 PWPC ; ... 7687 11607 4774 JMS @[BUFCDF] ; change to the buffer's field 7688 7689 ; Transfer 256 twelve bit words into 256 sixteen bit words... 7690 11610 1411 WRIBU1: TAD @BUFPTR ; and get the next data word 7691 11611 3312 DCA BUFTMP ; save it temporarily 7692 11612 1312 TAD BUFTMP ; ... 7693 11613 6475 PWPB ; write the lowest 8 bits to port B 7694 11614 1312 TAD BUFTMP ; then get the upper four bits 7695 11615 7002 BSW ; ... 7696 11616 7012 RTR ; ... 7697 11617 0373 AND [17] ; ensure that the extra bits are zero 7698 11620 6474 PWPA ; and write the upper four bits to port A 7699 11621 1372 TAD [SETDWR] ; assert DIOW 7700 11622 6477 PWCR ; ... 7701 11623 1371 TAD [CLRDWR] ; and then clear it 7702 11624 6477 PWCR ; ... 7703 11625 2052 ISZ XFRCNT ; have we done 256 words?? 7704 11626 7410 SKP ; no - keep going 7705 11627 5240 JMP WRIBU3 ; yes - always stop now 7706 11630 2054 ISZ BUFSIZ ; have we filled the buffer ? 7707 11631 5210 JMP WRIBU1 ; nope - keep copying 7708 7709 ; Here when we've emptied the 6120 buffer, but if we haven't done 256 words 7710 ; we have to keep going until we've filled the drive's sector buffer. All we 7711 ; need to do is to keep asserting DIOW, which simply repeats the last word 7712 ; written! 7713 11632 1372 WRIBU2: TAD [SETDWR] ; assert DIOW 7714 11633 6477 PWCR ; ... 7715 11634 1371 TAD [CLRDWR] ; and deassert DIOW 7716 11635 6477 PWCR ; ... 7717 11636 2052 ISZ XFRCNT ; have we finished the sector? 7718 11637 5232 JMP WRIBU2 ; nope 7719 7720 ; Restore the PPI ports to input mode and return. Note that some disk 7721 ; I/O routines JMP to WRIBUF as the last step, so it's important that we 7722 ; always return with the AC and LINK cleared to indicate success. 7723 11640 6211 WRIBU3: CDF 1 ; return to our field 7724 11641 6276 SPD ; and to panel memory 7725 11642 1370 TAD [IDEINP] ; reset ports A and B to input PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 190 Write IDE Sector Buffer bts6120.plx 7726 11643 6477 PWCR ; ... 7727 11644 7300 CLA CLL ; return success 7728 11645 6225 .POPJ ; all done here PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 191 Read IDE Sector Buffer bts6120.plx 7729 .TITLE Read IDE Sector Buffer 7730 7731 7732 ; This routine will read sixteen bit words from the IDE drive's sector 7733 ; buffer and store them in twelve bit PDP-8 memory words. Data is converted 7734 ; from sixteen to twelve bits by the simple expedient of discarding the upper 7735 ; four bits of each word - it can't get much easier than that! 7736 ; 7737 ; The caller is expected to set up BUFPTR, BUFCDF and BUFPNL to point to the 7738 ; buffer in 6120 memory. The negative of the buffer size should be passed in 7739 ; the AC. This is the number of words that will be stored in the buffer, 7740 ; however we'll always read exactly 256 words from the drive regardless of 7741 ; the buffer size. If the buffer is smaller than this then the extra words 7742 ; are simply discarded. This is necessary for OS/8 handler "half block" reads. 7743 ; 7744 ; Like WRIBUF, this routine does not wait for the drive to set DRQ, nor does 7745 ; it check the drive's status for errors. Those are both up to the caller. 7746 11646 3054 RDIBUF: DCA BUFSIZ ; save the actual buffer size 7747 11647 1377 TAD [-256.] ; but always transfer 256 words, regardless 7748 11650 3052 DCA XFRCNT ; ... 7749 11651 1370 TAD [IDEINP] ; and set ports A and B to input mode 7750 11652 6477 PWCR ; ... 7751 11653 1375 TAD [REGDAT] ; make sure the IDE data register is addressed 7752 11654 6476 PWPC ; ... 7753 11655 4774 JMS @[BUFCDF] ; change to the buffer's field 7754 7755 ; Transfer 256 twelve bit words... 7756 11656 1367 RDIBU1: TAD [SETDRD] ; assert DIOR 7757 11657 6477 PWCR ; ... 7758 11660 6471 PRPB ; capture the lower order byte 7759 11661 0366 AND [377] ; remove any junk bits, just in case 7760 11662 3312 DCA BUFTMP ; and save that for a minute 7761 11663 6470 PRPA ; then capture the high byte 7762 11664 0373 AND [17] ; we only want four bits from that 7763 11665 7002 BSW ; shift it left eight bits 7764 11666 7106 CLL RTL ; ... 7765 11667 1312 TAD BUFTMP ; assemble a complete twelve bit word 7766 11670 3411 DCA @BUFPTR ; and store it in the buffer 7767 11671 1365 TAD [CLRDRD] ; finally we can deassert DIOR 7768 11672 6477 PWCR ; ... 7769 11673 2052 ISZ XFRCNT ; have we done 256 words?? 7770 11674 7410 SKP ; no - keep going 7771 11675 5306 JMP RDIBU3 ; yes - always stop now 7772 11676 2054 ISZ BUFSIZ ; have we filled the buffer ? 7773 11677 5256 JMP RDIBU1 ; nope - keep copying 7774 7775 ; Here when we've filled the 6120 buffer, but if we haven't done 256 words 7776 ; we have to keep going until we've emptied the drive's sector buffer too. 7777 ; All we need to do is to keep asserting DIOR - there's no need to actually 7778 ; capture the data! 7779 11700 1367 RDIBU2: TAD [SETDRD] ; assert DIOR 7780 11701 6477 PWCR ; ... 7781 11702 1365 TAD [CLRDRD] ; and deassert DIOR 7782 11703 6477 PWCR ; ... 7783 11704 2052 ISZ XFRCNT ; have we finished the sector? 7784 11705 5300 JMP RDIBU2 ; nope 7785 7786 ; Restore the ROM field and memory space and return. Note that some disk 7787 ; I/O routines JMP to RDIBUF as the last step, so it's important that we 7788 ; always return with the AC and LINK cleared to indicate success. 7789 11706 6211 RDIBU3: CDF 1 ; ... 7790 11707 6276 SPD ; ... 7791 11710 7300 CLA CLL ; always return success 7792 11711 6225 .POPJ ; all done here 7793 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 192 Read IDE Sector Buffer bts6120.plx 7794 ; Temporary storage for RDIBUF and WRIBUF... 7795 11712 BUFTMP: .BLOCK 1 ; temporary for packing and unpacking 7796 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 193 Initialize Disk Partition Map bts6120.plx 7797 .TITLE Initialize Disk Partition Map 7798 7799 7800 ; This routine will initialize the disk partition map so that unit 0 7801 ; maps to partition 0, unit 1 maps to partition 1, etc... This is the 7802 ; default partition mapping used after a power on and remains in effect 7803 ; until changed by an OS/8 program with the "Set Partition Mapping" PR0 7804 ; subfunction. 7805 7806 11713 7200 INIPMP: CLA ; just in case... 7807 11714 1364 TAD [-8.] ; we are going to init 8 units 7808 11715 3020 DCA DKPART 7809 11716 1373 TAD [PARMAP-1] ; set up an auto index register 7810 11717 3012 DCA XX1 ; ... to address the partition map 7811 11720 6402 MM2 7812 11721 7215 INIPM1: NL0010 7813 11722 1020 TAD DKPART ; get the current partition/unit 7814 11723 6201 CDF 0 7815 11724 3412 DCA @XX1 ; and set the next entry in the map 7816 11725 6211 CDF 1 7817 11726 2020 ISZ DKPART 7818 11727 5321 JMP INIPM1 ; ... 7819 11730 7300 CLA CLL 7820 11731 6225 .POPJ 7821 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 194 Set Disk Partition Map ROM Call bts6120.plx 7822 .TITLE Set Disk Partition Map ROM Call 7823 7824 7825 ; This routine handles the "Set Disk Partition Mapping" (6) PR0 subfunction, 7826 ; which simply sets the partition number for the specified OS/8 unit. This 7827 ; change takes effect immediately, so if you've booted from the IDE disk 7828 ; you'll want to be a little careful about remapping the system partition! 7829 ; This function returns with the LINK set if an error occurs, currently the 7830 ; only failure that can happen is if the unit number is .GT. 7. Note that 7831 ; no range checking is done on the partition number to ensure that it fits 7832 ; within the disk size - if it doesn't we'll simply get I/O errors when OS/8 7833 ; attempts to access that partition. 7834 ; 7835 ;CALL: 7836 ; TAD (part / load the partition number into the AC 7837 ; PR0 / invoke the ROM monitor 7838 ; 6 / subfunction for Set disk partition 7839 ; / OS/8 unit to be changed, 0..7 7840 ; / LINK set if unit .GT. 7 7841 ; 7842 11732 3020 SETPMP: DCA DKPART ; save the partition number for a minute 7843 11733 6205 .PUSHJ @[GETARG] ; and get the unit number 11734 5763 7844 11735 3023 DCA DKUNIT ; ... 7845 11736 1023 TAD DKUNIT ; ... 7846 11737 7100 CLL ; be sure the link is in a known state 7847 11740 1364 TAD [-10] ; see if the unit number is legal 7848 11741 7630 SZL CLA ; the link will be set if it isn't 7849 11742 6225 .POPJ ; take the error return w/o changing anything 7850 11743 1023 TAD DKUNIT ; construct an index to the partition map 7851 11744 1373 TAD [PARMAP-1] ; ... 7852 11745 3012 DCA XX1 ; ... 7853 11746 1020 TAD DKPART ; then get the desired partition number 7854 11747 6201 CDF 0 ; PARAM lives in field 0 7855 11750 3412 DCA @XX1 ; and change it 7856 11751 6211 CDF 1 ; WRPSS requires DF = our IF! 7857 11752 6222 CIF 2 7858 11753 6205 .PUSHJ @[WRPSS] ; update NVRAM 11754 5762 7859 11755 7300 CLL CLA 7860 11756 6225 .POPJ ; return with the LINK and AC both clear 7861 11762 0243 11763 0241 11764 7770 11765 0006 11766 0377 11767 0007 11770 0222 11771 0010 11772 0011 11773 0017 11774 2221 11775 0100 11776 0200 11777 7400 7862 12000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 195 Get Disk Partition Map ROM Call bts6120.plx 7863 .TITLE Get Disk Partition Map ROM Call 7864 7865 7866 ; This routine handles the "Get Disk Partition Mapping" (7) PR0 subfunction, 7867 ; which simply returns the partition number currently associated with a 7868 ; specific OS/8 unit. The only way it can fail is if the unit number is 7869 ; greater than 7! 7870 ; 7871 ;CALL: 7872 ; PR0 / invoke the ROM monitor 7873 ; 7 / subfunction for get disk partition 7874 ; / OS/8 unit to be changed, 0..7 7875 ; / with partition number in the AC 7876 ; 7877 12000 6205 GETPMP: .PUSHJ @[GETARG] ; and get the unit number 12001 5777 7878 12002 3023 DCA DKUNIT ; ... 7879 12003 7100 CLL ; be sure the link is in a known state 7880 12004 1376 TAD [-10] ; see if the unit number is legal 7881 12005 1023 TAD DKUNIT ; ... 7882 12006 7630 SZL CLA ; the link will be set if it isn't 7883 12007 6225 .POPJ ; take the error return 7884 12010 1023 TAD DKUNIT ; construct an index to the partition map 7885 12011 1375 TAD [PARMAP-1] ; ... 7886 12012 3012 DCA XX1 ; ... 7887 12013 6201 CDF 0 ; PARMAP lives in field 0 7888 12014 1412 TAD @XX1 ; and get the current partition 7889 12015 6211 CDF 1 7890 12016 6225 .POPJ ; return with partition in the AC and LINK=0 7891 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 196 IDE Disk Read/Write ROM Call bts6120.plx 7892 .TITLE IDE Disk Read/Write ROM Call 7893 7894 7895 ; The calling sequence for the PR0 IDE disk R/W function is: 7896 ; 7897 ; PR0 7898 ; 0004 / panel function code for IDE disk I/O 7899 ; / R/W bit, page count, buffer field and unit 7900 ; / buffer address 7901 ; / starting block number 7902 ; / if any errors occur, the LINK will be set and the 7903 ; / the drive's error register are in the AC 7904 ; 7905 ; Except for the function code, the use of block numbers instead of page 7906 ; numbers, and the error codes, this calling sequence is identical to the 7907 ; RAM disk I/O PR0 subfunction! 7908 ; 7909 12017 6205 DISKRW: .PUSHJ @[SETBUF] ; set up MUUO, BUFPTR, BUFCDF and RWCNT 12020 5774 7910 12021 6205 .PUSHJ @[GETARG] ; and lastly get the disk block 12022 5777 7911 12023 3021 DCA DKRBN ; ... 7912 7913 ; The unit number is really just an index into the partition table and, 7914 ; since it's limited to three bits and eight units are supported, there's 7915 ; no need to range check it! 7916 12024 1050 DKRW0: TAD MUUO ; get the unit number 7917 12025 0373 AND [7] ; ... 7918 12026 1375 TAD [PARMAP-1] ; create an index to the partition table 7919 12027 3012 DCA XX1 ; ... 7920 12030 6201 CDF 0 ; PARMAP lives in field 0 7921 12031 1412 TAD @XX1 ; get the actual partition number 7922 12032 6211 CDF 1 7923 12033 3020 DCA DKPART ; ... that's mapped to this unit 7924 7925 ; Set up a pointer to the I/O routine. All of the rest of this code is 7926 ; independent of the direction of data flow... 7927 12034 1050 TAD MUUO ; get the function code 7928 12035 7700 SMA CLA ; should we read (0) or write (1) ? 7929 12036 1372 TAD [DISKRD-DISKWR]; ... read 7930 12037 1371 TAD [DISKWR] ; ... write 7931 12040 3260 DCA DISKIO ; save the address of the routine 7932 7933 ; We must take a minute out to share a word about pages vs blocks. An OS/8 7934 ; handler call specifies the size of the data to be read or written in pages, 7935 ; which are 128 words or exactly 1/2 of a 256 word disk block. This raises 7936 ; the unfortunate possibility that a program could ask to transfer an odd 7937 ; number of pages, which would mean that we'd need to read or write half a 7938 ; block! We can't ignore this problem because it really does happen and there 7939 ; really are OS/8 programs that attempt to transfer an odd number of pages. 7940 ; 7941 ; This is primarily an issue for reading, because if an odd number of pages 7942 ; are to be read we must be very careful to stop copying data to memory after 7943 ; 128 words. If we don't, a page of memory will be corrupted by being over 7944 ; written with the second half of the last disk block! It's also permitted in 7945 ; OS/8 to write an odd number of pages, but since many OS/8 mass storage 7946 ; devices have 256 word sectors it isn't always possible to write half a 7947 ; block. In this case it's undefined what gets written to the last half of 7948 ; the final block - it could be zeros, random garbage, or anything else. 7949 7950 ; This loop reads or writes pages 'till we've done all we're supposed to... 7951 12041 2055 DKRW1: ISZ RWCNT ; is there an odd page left over? 7952 12042 7410 SKP ; nope - it's safe to do a full block 7953 12043 5256 JMP DKRW2 ; yes - go transfer a half block and quit 7954 12044 1370 TAD [-256.] ; transfer two pages this time PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 197 IDE Disk Read/Write ROM Call bts6120.plx 7955 12045 6205 .PUSHJ @DISKIO ; either read or write 12046 5660 7956 12047 7430 SZL ; were there any errors? 7957 12050 6225 .POPJ ; yes - just abort the transfer now 7958 12051 2021 ISZ DKRBN ; increment the block number for next time 7959 12052 7000 NOP ; (this should never happen, but...) 7960 12053 2055 ISZ RWCNT ; are there more pages left to do ? 7961 12054 5241 JMP DKRW1 ; yup - keep going 7962 12055 6225 .POPJ ; all done - return AC = LINK = 0 7963 7964 ; Here to transfer one, final, half block... 7965 12056 1367 DKRW2: TAD [-128.] ; only do a single page this time 7966 12057 5660 JMP @DISKIO ; transfer it and we're done 7967 7968 ; Local storage for DISKRW... 7969 12060 DISKIO: .BLOCK 1 ; gets a pointer to either DISKRD or DISKWR 7970 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 198 Write IDE Register bts6120.plx 7971 .TITLE Write IDE Register 7972 7973 7974 ; This routine will write an eight bit value to any IDE drive register, 7975 ; except the data regsister, by toggling all the appropriate PPI port lines. 7976 ; The address of the register, which should include the CS1Fx and CS3Fx bits, 7977 ; is passed in line and the byte to be written is passed in the AC. Note that 7978 ; all IDE registers, with the exception of the data register, are eight bits 7979 ; wide so there's never a need to worry about the upper byte! 7980 ; 7981 ;CALL: 7982 ; TAD [value] ; eight bit value to write to the IDE register 7983 ; JMS IDEWRR 7984 ; xxxx ; IDE register number, plus CS1Fx and CS3Fx bits 7985 ; 7986 ; 7987 12061 0000 IDEWRR: 0 ; CALL HERE WITH A JMS!!! 7988 12062 3322 DCA IDETMP ; save the value to write for a minute 7989 12063 1366 TAD [IDEOUT] ; set ports A and B to output mode 7990 12064 6477 PWCR ; write the PPI control register 7991 12065 1661 TAD @IDEWRR ; get the IDE register address 7992 12066 2261 ISZ IDEWRR ; (skip it when we return) 7993 12067 6476 PWPC ; send the address to the drive via port C 7994 7995 ; Note that we don'e bother to drive the upper data byte (D8..D15) with any 7996 ; particular value. The PPI will have set these bits to zero when we changed 7997 ; the mode to output, but the drive will ignore them anyway. 7998 12070 1322 TAD IDETMP ; get the original data back 7999 12071 6475 PWPB ; (port B drives DD0..DD7) 8000 12072 1365 TAD [SETDWR] ; assert DIOW 8001 12073 6477 PWCR ; ... 8002 12074 1364 TAD [CLRDWR] ; and then clear it 8003 12075 6477 PWCR ; ... 8004 8005 ; We always leave our side of the PPI data bus (e.g. ports A and B) in 8006 ; input mode to avoid any accidental contention should the drive decide it 8007 ; wants to output data for some unknown reason. 8008 12076 1363 TAD [IDEINP] ; set ports A and B to input mode 8009 12077 6477 PWCR ; ... (but C is still an output) 8010 12100 5661 JMP @IDEWRR ; that's it! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 199 Read IDE Register bts6120.plx 8011 .TITLE Read IDE Register 8012 8013 8014 ; This routine will read one IDE drive register and return the value in the 8015 ; AC. all IDE registers, with the exception of the data register, are always 8016 ; eight bits wide so there's no need to worry about the upper byte here. We 8017 ; simply ignore it. The address of the register to be read should be passed 8018 ; inline, following the call to this procedure. 8019 ; 8020 ;CALL 8021 ; JMS IDERDR 8022 ; xxxx ; IDE register number, including CS1Fx and CS3Fx bits 8023 ; 8024 ; 8025 12101 0000 IDERDR: 0 ; CALL HERE WITH A JMS!! 8026 12102 7200 CLA ; just in case... 8027 12103 1363 TAD [IDEINP] ; set ports A and B to input 8028 12104 6477 PWCR ; ... (this should be unnecessary, 8029 12105 1701 TAD @IDERDR ; get the IDE register address 8030 12106 2301 ISZ IDERDR ; (and don't forget to skip it!) 8031 12107 6476 PWPC ; send it to the drive via port C 8032 12110 1373 TAD [SETDRD] ; assert DIOR 8033 12111 6477 PWCR ; ... 8034 12112 7000 NOP ; give the drive and 8255 time to settle 8035 12113 6471 PRPB ; capture D0..D7 8036 12114 0362 AND [377] ; make sure we don't get noise in DX0..DX3 8037 12115 3322 DCA IDETMP ; and save that for a minute 8038 12116 1361 TAD [CLRDRD] ; now deassert DIOR 8039 12117 6477 PWCR ; ... 8040 12120 1322 TAD IDETMP ; get the data back 8041 12121 5701 JMP @IDERDR ; and return it in the AC 8042 8043 ; Local storage for RD/IDEWRR... 8044 12122 IDETMP: .BLOCK 1 ; a temporary for saving the AC 8045 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 200 Setup Disk I/O Buffer bts6120.plx 8046 .TITLE Setup Disk I/O Buffer 8047 8048 8049 ; This routine is used parse the argument list for ROM calls that take OS/8 8050 ; handler like argument lists, primarily the RAM disk and IDE disk I/O calls. 8051 ; It will do a GETARG and store the first argument, which contains the R/W 8052 ; bit, page count, buffer field and unit number, in MUUO. It extracts the 8053 ; buffer field from this argument, builds a CDF instruction, and stores that 8054 ; at BUFCDF for later use. It also extracts the page count from this 8055 ; argument, converts it to a negative number, and stores the result at RWCNT. 8056 ; Finally, it does another GETARG to fetch the address of the caller's buffer 8057 ; and stores that at BUFPTR. 8058 12123 6205 SETBUF: .PUSHJ @[GETARG] ; get the first argument 12124 5777 8059 12125 3050 DCA MUUO ; save that - it's got lots of useful bits! 8060 12126 1050 TAD MUUO ; get the field bits from MUUO 8061 12127 0360 AND [70] ; ... 8062 12130 1357 TAD [CDF 0] ; make a CDF instruction out of them 8063 12131 3756 DCA @[BUFCDF+1] ; and save them for later 8064 12132 1050 TAD MUUO ; get the page count from the call 8065 12133 0355 AND [3700] ; ... 8066 12134 7450 SNA ; is it zero ? 8067 12135 7330 NL4000 ; yes - that means to transfer a full 32 pages 8068 12136 7002 BSW ; right justify the page count 8069 12137 7041 CIA ; make it negative for an ISZ 8070 12140 3055 DCA RWCNT ; ... 8071 12141 6205 .PUSHJ @[GETARG] ; get the buffer pointer from the argument list 12142 5777 8072 12143 1354 TAD [-1] ; correct for pre-incrementing auto-index 8073 12144 3011 DCA BUFPTR ; and save that 8074 12145 3053 DCA BUFPNL ; this buffer is always in main memory 8075 12146 6225 .POPJ ; all done for now 8076 12154 7777 12155 3700 12156 2222 12157 6201 12160 0070 12161 0006 12162 0377 12163 0222 12164 0010 12165 0011 12166 0200 12167 7600 12170 7400 12171 1244 12172 7750 12173 0007 12174 2123 12175 0017 12176 7770 12177 0241 8077 12200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 201 Test for IOB6120 CompactFlash Card bts6120.plx 8078 .TITLE Test for IOB6120 CompactFlash Card 8079 8080 ; This routine will see if a CompactFlash card is plugged into the IOB6120 8081 ; socket and, if it finds one, will return the size of that card in the AC. 8082 ; If no card or no IOB6120 is present, then zero is returned instead. 8083 ; 8084 ; Unfortunately this little kludge is necessary because Jim's IOB6120 firmware 8085 ; does NOT update DKSIZE to account for the compact flash card, if any. A CF 8086 ; card does, however, respond to pretty much all the same commands and functions 8087 ; as an IDE drive. 8088 12200 7200 CHKCFC: CLA ; ... 8089 12201 1777 TAD @[FUNTBL+13] ; see if the IOB6120 has hooked this mcall 8090 12202 1376 TAD [-BADFUN] ; well ??? 8091 12203 7650 SNA CLA ; skip if it has been changed 8092 12204 6225 .POPJ ; nope - no IOB6120, so return zero 8093 12205 1777 TAD @[FUNTBL+13] ; yes - it's the address of the GETCFS routine 8094 12206 3050 DCA MUUO ; ... 8095 12207 5450 JMP @MUUO ; call GETCFS in the extension ROM and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 202 Setup Disk I/O Buffer Field and Space bts6120.plx 8096 .TITLE Setup Disk I/O Buffer Field and Space 8097 8098 8099 ; This routine will set up BUFPTR, BUFCDF, RWCNT and BUFPNL to point to 8100 ; our own internal buffer in panel memory at DSKBUF. This is used by the 8101 ; disk dump, disk load, format and boot commands when they need to read or 8102 ; write disk blocks without distrubing main memory. 8103 12210 1375 PNLBUF: TAD [DSKBUF-1] ; point to the disk buffer 8104 12211 3011 DCA BUFPTR ; set the buffer address for DISKRD/DISKWR 8105 12212 1374 TAD [CDF 1] ; this buffer lives in our field 1 8106 12213 3222 DCA BUFCDF+1 ; ... 8107 12214 7344 NLM2 ; the buffer size is always 2 pages 8108 12215 3055 DCA RWCNT ; ... 8109 12216 7240 NL7777 ; write this data to PANEL memory! 8110 12217 3053 DCA BUFPNL ; ... 8111 12220 6225 .POPJ ; and we're done 8112 8113 8114 ; This little routine is called, via a JMS instruction (not a .PUSHJ!) to 8115 ; change the DF to the field of the user's buffer. In addition, if the 8116 ; BUFPNL flag is not set, it will execute a CPD instruction so that buffer 8117 ; data is stored in main memory. This is the usual case. 8118 12221 0000 BUFCDF: 0 ; call here with a JMS 8119 12222 7000 NOP ; gets over written with a CDF instruction 8120 12223 7200 CLA ; just in case 8121 12224 1053 TAD BUFPNL ; is the panel buffer flag set? 8122 12225 7650 SNA CLA ; ??? 8123 12226 6266 CPD ; no - address main memory now 8124 12227 5621 JMP @BUFCDF ; ... 8125 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 203 Copy Memory ROM Calls bts6120.plx 8126 .TITLE Copy Memory ROM Calls 8127 8128 8129 ; This ROM function can copy up to 4096 words from any field in either main 8130 ; or panel memory to any other address and field in either main or panel 8131 ; memory. It can be used to move data and/or code into panel memory and 8132 ; back again, or simply to move one part of main memory to another. 8133 ; 8134 ;CALL: 8135 ; PR0 8136 ; 0010 / copy memory subfunction 8137 ; p0n0 / source field and memory space 8138 ;
/ source address 8139 ; p0n0 / destination field and memory space 8140 ;
/ destination address 8141 ; / number of words to be transferred 8142 ; 8143 ; The source and destination field words each contain the field number in 8144 ; bits 6..8, and a flag in bit 0 which is one for panel memory and zero for 8145 ; main memory. The last word of the argument list is the number of words 8146 ; to be copied - a value of zero copies 4096 words. 8147 8148 ; Set up the source address... 8149 12230 6205 MEMMOV: .PUSHJ @[GETARG] ; get the source field 12231 5773 8150 12232 7100 CLL ; make sure the link is in a known state 8151 12233 1372 TAD [4000] ; put the panel/main memory flag in the LINK 8152 12234 0371 AND [70] ; make a CDF instruction 8153 12235 1370 TAD [CDF 0] ; ... 8154 12236 3272 DCA SRCCDF ; ... 8155 12237 1367 TAD [CPD] ; assume the source is in main memory 8156 12240 7430 SZL ; but is it really ? 8157 12241 1366 TAD [SPD-CPD] ; no - use panel memory 8158 12242 3273 DCA SRCSPD ; ... 8159 12243 6205 .PUSHJ @[GETARG] ; get the buffer address 12244 5773 8160 12245 1365 TAD [-1] ; correct for pre-increment auto index 8161 12246 3012 DCA XX1 ; ... 8162 8163 ; Set up the destination address... 8164 12247 6205 .PUSHJ @[GETARG] ; get the destination field 12250 5773 8165 12251 7100 CLL ; make sure the link is in a known state 8166 12252 1372 TAD [4000] ; put the panel/main memory flag in the LINK 8167 12253 0371 AND [70] ; make a CDF instruction 8168 12254 1370 TAD [CDF 0] ; ... 8169 12255 3275 DCA DSTCDF ; ... 8170 12256 1367 TAD [CPD] ; assume the destination is in main memory 8171 12257 7430 SZL ; but is it really ? 8172 12260 1366 TAD [SPD-CPD] ; no - use panel memory 8173 12261 3276 DCA DSTSPD ; ... 8174 12262 6205 .PUSHJ @[GETARG] ; get the buffer address 12263 5773 8175 12264 1365 TAD [-1] ; correct for pre-increment auto index 8176 12265 3013 DCA XX2 ; ... 8177 8178 ; And finally the word count... 8179 12266 6205 .PUSHJ @[GETARG] ; ... 12267 5773 8180 12270 7041 CIA ; make it negative for ISZ 8181 12271 3052 DCA XFRCNT ; ... 8182 8183 ; This loop does the actual work of copying data! 8184 12272 7000 SRCCDF: NOP ; over written with a CDF instruction 8185 12273 7000 SRCSPD: NOP ; over written with a SPD/CPD IOT PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 204 Copy Memory ROM Calls bts6120.plx 8186 12274 1412 TAD @XX1 ; get a word of source data 8187 12275 7000 DSTCDF: NOP ; over written with a CDF instruction 8188 12276 7000 DSTSPD: NOP ; overwritten with a SPD/CPD IOT 8189 12277 3413 DCA @XX2 ; and store the word 8190 12300 2052 ISZ XFRCNT ; have we done them all ? 8191 12301 5272 JMP SRCCDF ; no - keep copying 8192 8193 ; All done! 8194 12302 6276 SPD ; be sure the field and memory space are safe 8195 12303 6211 CDF 1 ; ... 8196 12304 7300 CLL CLA ; and always return success 8197 12305 6225 .POPJ ; ... 8198 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 205 Copy Memory Extended ROM Call bts6120.plx 8199 .TITLE Copy Memory Extended ROM Call 8200 8201 8202 ; This ROM function can copy up to 4096 words from any field in main, panel 8203 ; or ramdisk memory to any other field in main, panel or ramdisk memory. 8204 ; 8205 ;CALL: 8206 ; PR0 8207 ; 0011 / copy memory subfunction 8208 ; pddf / source DAR, field and memory space 8209 ; pddf / destination DAR, field and memory space 8210 ;
/ source address 8211 ;
/ destination address 8212 ; / number of words to be transferred 8213 ; 8214 ; The source and destination field words (pddf) each contain a flag 8215 ; in bit 0, the ramdisk Disk Address in bits 1..8 (or a flag in bit 1), 8216 ; and the field number in bits 9..11 8217 ; 8218 ; The flags are interpreted as 8219 ; bit 0 = 1 when the address is in the ramdisk, otherwise 8220 ; bit 1 = 1 when the address is in panel memory, otherwise 8221 ; the address is in main memory 8222 ; The last word of the argument list is the number of words 8223 ; to be copied - a value of zero copies 4096 words. 8224 8225 0024 SRCDAR=RDUNIT 8226 0025 DSTDAR=RDPAGE 8227 8228 12306 7200 MEMMVX: CLA ; set up source addressing 8229 12307 1364 TAD [XSRCDF-1] 8230 12310 4763 JMS @[MVXARG] 8231 12311 3024 DCA SRCDAR 8232 8233 12312 1362 TAD [XDSCDF-1] ; set up destination addressing 8234 12313 4763 JMS @[MVXARG] 8235 12314 3025 DCA DSTDAR 8236 8237 12315 6205 .PUSHJ @[GETARG] ; get the source address 12316 5773 8238 12317 1365 TAD [-1] ; correct for pre-increment auto index 8239 12320 3012 DCA XX1 ; ... 8240 8241 12321 6205 .PUSHJ @[GETARG] ; get the destination address 12322 5773 8242 12323 1365 TAD [-1] ; correct for pre-increment auto index 8243 12324 3013 DCA XX2 ; ... 8244 8245 12325 6205 .PUSHJ @[GETARG] ; get the word count 12326 5773 8246 12327 7041 CIA ; make it negative for ISZ 8247 12330 3052 DCA XFRCNT ; ... 8248 8249 12331 7000 XSRCDF: NOP ; overwritten with a CDF instruction 8250 12332 7000 NOP ; overwritten with a SPD/CPD IOT 8251 12333 7000 NOP ; overwritten with a memory map IOT 8252 12334 1024 TAD SRCDAR ; set DAR to source DAR 8253 12335 6410 LDAR ; (leaves AC clr) 8254 12336 1412 TAD @XX1 ; get a word of source data 8255 12337 7421 MQL ; save in MQ 8256 12340 7000 XDSCDF: NOP ; overwritten with a CDF instruction 8257 12341 7000 NOP ; overwritten with a SPD/CPD IOT 8258 12342 7000 NOP ; overwritten by a memory map IOT 8259 12343 1025 TAD DSTDAR ; set DAR to destination DAR 8260 12344 6410 LDAR PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 206 Copy Memory Extended ROM Call bts6120.plx 8261 12345 7521 SWP ; get back source value 8262 12346 3413 DCA @XX2 ; and store the word 8263 12347 2052 ISZ XFRCNT ; have we done them all ? 8264 12350 5331 JMP XSRCDF ; no - keep copying 8265 8266 ; All done! 8267 12351 6402 MM2 ; back to standard map 8268 12352 6276 SPD ; be sure the field and memory space are safe 8269 12353 6211 CDF 1 ; ... 8270 12354 7300 CLL CLA ; and always return success 8271 12355 6225 .POPJ ; ... 8272 12362 2337 12363 2400 12364 2330 12365 7777 12366 0010 12367 6266 12370 6201 12371 0070 12372 4000 12373 0241 12374 6211 12375 7377 12376 7541 12377 0274 8273 12400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 207 Get Arguments for MEMMOV Calls bts6120.plx 8274 .TITLE Get Arguments for MEMMOV Calls 8275 8276 8277 ; MVXARG: 8278 ; call: JMS MVXARG 8279 ; entry: AC points to CDF x, yPD, MMz sequence location 8280 ; function: get and interpret an addressing control argument, filling out @XX1 8281 ; exit: AC contains DAR value 8282 12400 0000 MVXARG: 0 8283 12401 3012 DCA XX1 ; Save pointer to modified code in auto-incr 8284 12402 6205 .PUSHJ @[GETARG] ; get the source field 12403 5777 8285 12404 7100 CLL ; make sure the link is in a known state 8286 12405 1376 TAD [4000] ; put the ramdisk/RAM flag in the LINK 8287 12406 7420 SNL 8288 12407 5226 JMP ADRPMM ; if b0=0, do panel/main memory addressing 8289 ; address is in ramdisk 8290 8291 12410 7014 ADRRMD: R3L ; rotate first two bits of DAR around to lsbs 8292 12411 7421 MQL ; save it; it has the field in the right position 8293 12412 7701 ACL ; get it back (AC was cleared by MQL) 8294 12413 7002 BSW ; rotate another 6 bits, AC now has DAR in b4..b11 8295 12414 7521 SWP ; save it, get back field 8296 12415 0375 AND [70] ; make a CDF instruction 8297 12416 1374 TAD [CDF 0] ; ... 8298 12417 3412 DCA @XX1 ; ... 8299 12420 1373 TAD [SPD] ; ramdisk DF must be panel 8300 12421 3412 DCA @XX1 8301 12422 1372 TAD [MM3] ; use memory map 3 (indirect panel access -> ramdisk) 8302 12423 3412 DCA @XX1 8303 12424 7521 SWP ; and return with DAR in AC 8304 12425 5600 JMP @MVXARG 8305 8306 ; address is in panel or main memory 8307 8308 12426 1371 ADRPMM: TAD [6000] ; know that b0=0, link=1; 8309 ; now link=0 if b1=1 8310 12427 7014 R3L ; bring field into position 8311 12430 0375 AND [70] ; make a CDF instruction 8312 12431 1374 TAD [CDF 0] ; ... 8313 12432 3412 DCA @XX1 ; ... 8314 12433 1370 TAD [CPD] ; assume the source is in main memory 8315 12434 7420 SNL ; but is it really ? 8316 12435 1367 TAD [SPD-CPD] ; no - use panel memory 8317 12436 3412 DCA @XX1 ; ... 8318 12437 1366 TAD [MM2] ; use memory map 2 (indirect access -> RAM) 8319 12440 3412 DCA @XX1 8320 12441 5600 JMP @MVXARG PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 208 LIGHTS Monitor Call bts6120.plx 8321 .TITLE LIGHTS Monitor Call 8322 8323 8324 ; The LIGHTS MUUO allows a program explicit control over the front panel 8325 ; DATA LEDs (providing a front panel is installed, of course!). It only 8326 ; works for the DATA LEDs - the ADDRESS LEDs always track the current memory 8327 ; address, and it only works _if_ the rotary switch is _not_ set to the MD 8328 ; position. 8329 ; 8330 ; The calling sequence for the LIGHTS MUUO is: 8331 ; 8332 ; TAD (data / desired data for the display 8333 ; PR0 / trap to panel memory 8334 ; 0012 / LIGHTS function code 8335 ; / 1 to put the DATA display under program control 8336 ; / 0 to return the display to normal use 8337 ; / if no display is present or is not 0 or 1, 8338 ; / then the LINK will be set on return. 8339 ; 8340 ; Note that a program can determine whether an FP6120 is present without 8341 ; changing anything simply by invoking the LIGHTS function with set 8342 ; to 0. If no display is present, the LINK will be set on return. 8343 ; 8344 12442 6205 LIGHTS: .PUSHJ @[GETARG] ; get the argument 12443 5777 8345 12444 6201 CDF 0 ; FP data lives in field zero 8346 12445 3765 DCA @[FPPGMM] ; set the FP program mode flag 8347 12446 1764 TAD @[UAC] ; and get the user's display data 8348 12447 3763 DCA @[FPPGMD] ; store that too 8349 8350 ; Note that we went ahead and set FPPGMM/FPPGMD even though we don't yet 8351 ; know whether the front panel is isntalled or not. That's harmless enough - 8352 ; these values are never used if the front panel is not present! 8353 12450 1762 TAD @[FPDTCT] ; is a front panel installed?? 8354 12451 6211 CDF 1 ; (back to our field) 8355 12452 7100 CLL ; assume the FP is present 8356 12453 7650 SNA CLA ; and skip if we're right 8357 12454 7020 CML ; nope - return with the link set 8358 12455 6225 .POPJ ; and that's all! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 209 Read Flash ROM Call bts6120.plx 8359 .TITLE Read Flash ROM Call 8360 8361 8362 ; The Read Flash ROM call reads the last 384K bytes of the IOB6120 8363 ; flash ROM in twelve bit word mode. It's essentially the same as the 8364 ; RAM disk read function and for practical purposes treats the flash ROM 8365 ; as a read only RAM disk. 8366 ; 8367 ; The calling sequence for the PR0 Read Flash ROM call is: 8368 ; 8369 ; PR0 8370 ; 0016 / panel function code for read flash ROM 8371 ; / page count, buffer field 8372 ; / buffer address 8373 ; / starting page number (not block number!) 8374 ; / AC == 0 if success; AC != 0 if error 8375 ; 8376 ; The error return is taken if a) the Write bit is set in the function 8377 ; word (arg 1), or if b) the unit number in the unction word is not zero, 8378 ; or c) the page number is greater than 2016. 8379 ; 8380 ; One might reasonably question whether this code belongs here or in 8381 ; IOB6120 - after all, it's completely useless unless an IOB is installed. 8382 ; The answer is that of course it belongs in the IOB6120 code, but it 8383 ; shares so many routines with RAMDRW that it would have required another 8384 ; dozen or so vectors to make it work. It's easier just to give up a few 8385 ; more words of BTS6120 code space to handle it. 8386 12456 6205 RDROM: .PUSHJ @[SETBUF] ; set up MUUO, BUFPTR, BUFCDF and RWCNT 12457 5761 8387 12460 6205 .PUSHJ @[GETARG] ; and lastly get the disk page number 12461 5777 8388 8389 ; The first 128K bytes of the flash are used to hold the IOB6120 code and 8390 ; the FPGA bitstream, and actual ROM disk data doesn't start until bank 32. 8391 ; There are a couple of ways to handle this, but the easiest is to offset 8392 ; the starting page number by 32*21=672 pages. 8393 12462 1360 TAD [672.] ; offset the ROM disk addresses 8394 12463 3025 DCA RDPAGE ; ... 8395 8396 ; Make sure that an IOB6120 is installed in the first place... 8397 12464 6201 CDF 0 ; the EXTFLG lives in field 0 8398 12465 1757 TAD @[EXTFLG] ; get the IOB6120 status 8399 12466 6211 CDF 1 ; ... 8400 12467 7650 SNA CLA ; is there one? 8401 12470 5756 JMP @[RAMER1] ; no - give the "bad unit" return 8402 8403 ; Make sure that the unit number is zero and that the R/W bit is clear 8404 ; (for reading). Take the error return if not. 8405 12471 1050 TAD MUUO ; get the function word 8406 12472 0355 AND [4007] ; these bits must be zero! 8407 12473 7640 SZA CLA ; skip if error 8408 12474 5756 JMP @[RAMER1] ; no - take the "bad unit" return 8409 8410 ; Note that we never call RAMSEL here to select the RAM disk unit, so we 8411 ; must ensure that a) the RAMCDF gets set up correctly (CDF 1 for the flash), 8412 ; and b) the RAMUSZ parameter gets set to the size of this RAM disk unit. 8413 ; The size would be 384K / 4K = 96 banks * 21 pages per bank = 2016 pages, 8414 ; EXCEPT that we've already offset the starting page by 672 and so the 8415 ; size has to be offset too, giving 2688 pages. Not coincidentally, that's 8416 ; exactly the same size as a regular 512K SRAM RAM disk unit! 8417 12475 1354 TAD [CDF 1] ; flash is always selected by field 1 8418 12476 3753 DCA @[RAMCDF+1] ; initialize the RAMcdf routine 8419 12477 1352 TAD [-2688.] ; and set the size of this unit 8420 12500 3046 DCA RAMUSZ ; ... 8421 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 210 Read Flash ROM Call bts6120.plx 8422 ; Read pages until we're done... 8423 12501 6205 ROMR1: .PUSHJ @[SETDAR] ; calculate the RAM disk address and bank 12502 5751 8424 12503 7630 SZL CLA ; was the page number valid? 8425 12504 5750 JMP @[RAMER2] ; nope - give the bad page error return 8426 12505 6205 .PUSHJ @[UNPACK] ; transfer a page from RAM disk to memory 12506 5747 8427 12507 2025 ISZ RDPAGE ; if we need more, continue on the next page 8428 12510 2055 ISZ RWCNT ; have we done enough pages? 8429 12511 5301 JMP ROMR1 ; nope - keep going 8430 12512 7300 CLA CLL ; all done - return status code 0 (no errors) 8431 12513 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 211 Field 1 Vector Table bts6120.plx 8432 .TITLE Field 1 Vector Table 8433 8434 8435 12514 6223 RET1F2: CXF 2 ; return to field 2 8436 12515 6225 .POPJ ; the address is already on the stack 8437 8438 12516 6233 RET1F3: CXF 3 ; return to field 3 8439 12517 6225 .POPJ ; the address is already on the stack 8440 8441 8442 ; variable and functions that we may want to access or hook in this field 8443 ; codes: I=instruction pointer, V=variable, H=hook (CIF n, JMP @.+1, V) 8444 ; Add only to the *end* of this list, please! 8445 ; n.b. JMS linkage functions generally cannot be used here 8446 12520 F1VECTOR: 8447 12520 2516 RET1F3 ; I utility - return to field 2 (must be first) 8448 12521 0261 FUNTBL ; V table of ROM functions 8449 12522 3200 CMDTBL ; V table of monitor commands 8450 12523 1213 DISKRD-1 ; H read IDE 8451 12524 1243 DISKWR-1 ; H write IDE 8452 12525 0000 0 8453 12526 0020 DKPART ; V partition number for DISKRD/WR 8454 12527 0021 DKRBN ; V block number for DISKRD/WR 8455 12530 0011 BUFPTR ; V offset for DISKRD/WR 8456 12531 2222 BUFCDF+1 ; V field for DISKRD/WR 8457 12532 0053 BUFPNL ; V memory space for DISKRD/WR 8458 12533 0022 DKSIZE ; V size of IDE attached drive, or 0 if none 8459 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 212 Test for SBC6120-RC bts6120.plx 8460 .TITLE Test for SBC6120-RC 8461 8462 ; This routine will take the skip return if this is the original SBC6120 8463 ; model. If, however, we're running on the SBC6120-RC model it will take the 8464 ; non-skip return instead. Note that it works by testing RC flag stored in 8465 ; field 0 by the SYSINI startup code and NOT by actually testing the hardware 8466 ; right now. It'd be easy enough to just test the hardware directly, but we 8467 ; do it this way to ensure that the actual RC/not RC determination is made in 8468 ; one place and at one time only. 8469 ; 8470 ; BTW, this routine is called by a JMS rather than the usual PUSHJ/POPJ 8471 ; mechanism. And it's really only callable from field 1! 8472 12534 0000 CHKRC: 0 ; JMS entry point 8473 12535 7200 CLA ; ... 8474 12536 6201 CDF 0 ; RCFLAG lives in field zero 8475 12537 1746 TAD @[RCFLAG] ; get the flag 8476 12540 6213 CXF 1 ; and return to field 1 8477 12541 7650 SNA CLA ; skip on the RC model 8478 12542 2334 ISZ CHKRC ; original SBC6120 - take the skip return 8479 12543 5734 JMP @CHKRC ; we're outta here 8480 12546 0035 12547 0442 12550 0437 12551 0661 12552 2600 12553 0754 12554 6211 12555 4007 12556 0435 12557 0033 12560 1240 12561 2123 12562 0060 12563 0064 12564 0001 12565 0063 12566 6402 12567 0010 12570 6266 12571 6000 12572 6403 12573 6276 12574 6201 12575 0070 12576 4000 12577 0241 8481 12600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 213 Flash ROM erasure and writing bts6120.plx 8482 .TITLE Flash ROM erasure and writing 8483 8484 8485 ; write block to Flash ROM. Since Flash requires an erasure step, and we 8486 ; don't know how big the file will be, a slightly risky heuristic is used 8487 ; to determine when to issue an erase command. What it does is, whenever the 8488 ; current address is on a 4KB boundary, the next 4KB is scanned. If any bytes 8489 ; there are not 377, an erase command is issued. 4KB is convenient not just 8490 ; because of the PDP-8 pointer size, but because most if not all flash ROMs 8491 ; allocate blocks in multiples of this size (note that in a device blocks 8492 ; may vary in size). 8493 ; 8494 ; There are simple cases that will confuse this, but we will just have to 8495 ; specify that no 4KB block should be filled with 377s in a download image. 8496 ; 8497 ; The incoming data file must be in the Flash download format: 8498 ; byte data 8499 ; 256 words per block (therefore 256 bytes) 8500 ; starting at 0000 with monotonically increasing block numbers 8501 ; 8502 8503 ; N.b. there're a number of places in this routine where the fact that 8504 ; the ROM is in field 1 of the ramdisk memory while this code is in 8505 ; field 1 of the RAM is taken advantage of. 8506 8507 12600 3054 ROMWR: DCA BUFSIZ ; save the passed size (= -256) 8508 8509 12601 1021 TAD DKRBN ; DAR is set to the upper 8 bits of the 8510 12602 7012 RTR ; block number 8511 12603 7012 RTR 8512 12604 6410 LDAR 8513 8514 12605 6403 MM3 ; access the ramdisk area 8515 8516 ; On the 28F, a "Clear Status" is needed because status bits 8517 ; are sticky, and may have been set by some previous operation. 8518 12606 1337 TAD FCMDCS ; issue "clear status register" command 8519 12607 4357 JMS FLCMD1 8520 12610 1377 TAD [FCMDRA] ; issue "read array" command 8521 12611 4357 JMS FLCMD1 8522 8523 12612 1021 TAD DKRBN 8524 12613 0376 AND [17] ; check for multiple of 4KB (16*256) 8525 12614 7640 SZA CLA 8526 12615 5227 JMP NOERA 8527 8528 ; We're on a 4KB boundary, check the next 4KB for non-377 bytes 8529 8530 12616 7240 CLA CMA ; -1 8531 12617 3012 DCA XX1 ; Pre-erase check 8532 12620 3363 DCA NX1 ; starting at 0 8533 12621 1763 CHKERA: TAD @NX1 8534 12622 1375 TAD [-377] 8535 12623 7640 SZA CLA 8536 12624 5257 JMP ERABLK ; need to erase 8537 12625 2363 ISZ NX1 8538 12626 5221 JMP CHKERA 8539 8540 ; The block is erased, now program the block 8541 8542 12627 1021 NOERA: TAD DKRBN ; form the offset by taking the lower 4 8543 12630 0376 AND [17] 8544 12631 7002 BSW ; bits of the block number and using that 8545 12632 7106 CLL RTL ; to address a 256-byte sector 8546 12633 3363 DCA NX1 ; destination address PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 214 Flash ROM erasure and writing bts6120.plx 8547 8548 12634 1374 TAD [DSKBUF-1] ; source buffer (field 1) 8549 12635 3012 DCA XX1 ; save in autoincr 8550 8551 12636 1340 PROGLP: TAD FCMDPROG ; issue the write byte command 8552 12637 4357 JMS FLCMD1 8553 12640 6402 MM2 8554 12641 1412 TAD @XX1 8555 12642 3335 DCA WFDQ7 ; Remember compare value 8556 12643 1335 TAD WFDQ7 8557 12644 6403 MM3 8558 12645 3763 DCA @NX1 ; and write it 8559 8560 12646 4303 JMS WFRDY ; Wait for ready 8561 12647 5272 JMP ERF3K ; Error on write (status in AC) 8562 8563 12650 2363 ISZ NX1 ; increment write address 8564 12651 7000 NOP ; may be at end of field 8565 8566 12652 2054 ISZ BUFSIZ ; done with block? 8567 12653 5236 JMP PROGLP ; no, write another byte 8568 8569 12654 7300 CLA CLL 8570 12655 6402 FLDONE: MM2 ; Return to caller 8571 12656 6225 .POPJ 8572 8573 ; Erase block. We don't know how far this erase will extend, but we will 8574 ; only erase again when we reach some unerased ROM, so it's not an issue. 8575 ; The only real requirement is that we write each block in increasing 8576 ; address order, ; and that the flash block size is a multiple of 4K. 8577 8578 ; BUGBUG: Once a flash erase block has been written out of order, this 8579 ; algorithm can't fix it -- the blank space at the front will be programmed, 8580 ; then erased when the later data is over-written. To unstick such a 8581 ; situation, you'll have to create an image to fill in the blank sections 8582 ; (or at least the first one in the flash erase block). Then you can 8583 ; reload the flash block, as the erase will restore the requirement. 8584 ; The nasty part of all this is that there is no error message -- just 8585 ; incorrect results, over and over. 8586 8587 12657 2012 ERABLK: ISZ XX1 ; First check? 8588 12660 5274 JMP ERF1K ; No, failed post-erase check 8589 8590 12661 1341 TAD FCMDERA1 ; issue "erase block 1" command 8591 12662 4357 JMS FLCMD1 8592 12663 1342 TAD FCMDERA2 ; issue "erase block 2" command 8593 12664 4357 JMS FLCMD1 8594 12665 1377 TAD [0377] ; Erase writes 377 8595 12666 3335 DCA WFDQ7 ; means ready 8596 12667 4303 JMS WFRDY ; Wait for ready 8597 12670 5221 JMP CHKERA ; Status for erase is lame, so 8598 12671 5221 JMP CHKERA ; go check our work 8599 8600 12672 1373 ERF3K: TAD [1000] ; Error 3xxx - compare mismatch; xxx is offset 8601 12673 1373 TAD [1000] ; Error 2xxx - bad write; no longer used 8602 12674 1373 ERF1K: TAD [1000] ; Error 1xxx - bad erase; xxx is offset 8603 12675 3012 DCA XX1 8604 12676 1363 TAD NX1 8605 12677 0377 AND [377] 8606 12700 1012 TAD XX1 8607 12701 7120 STL 8608 12702 5255 JMP FLDONE 8609 8610 ; 8611 ; Wait for flash ready PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 215 Flash ROM erasure and writing bts6120.plx 8612 ; There are two cases -- an erase, or a write. Either 8613 ; way, we start out in "Read Status" mode. 8614 ; For erase, NX1 points to offset 0000 of the current 4K chunk. 8615 ; For write, NX1 points to the location that was written. 8616 ; On the 28F, we stay in Status mode until we send a new command. 8617 ; On the 29F, the chip will switch back to read mode when the 8618 ; operation completes. 8619 8620 12703 0000 WFRDY: 0 8621 12704 1763 TAD @NX1 ; Get the new status 8622 12705 3336 DCA WFNST ; Remember it 8623 12706 1335 TAD WFDQ7 ; Get DQ7 ready value for 29F 8624 12707 7040 CMA ; Make "not ready" DQ7 value 8625 12710 0341 AND FCMDERA1 ; Mask to clobber if 28F 8626 12711 0372 AND [0200] ; DQ7\ value, or zero for 28F 8627 12712 1336 TAD WFNST ; Form the XNOR (29F), done (28F) 8628 12713 0372 AND [0200] ; Mask crud 8629 12714 7640 SZA CLA ; Finished? 8630 12715 5322 JMP WFRET ; Yes, go return 8631 ; This only happens on 29F -- on the 28F, error implies done. 8632 12716 1336 TAD WFNST ; No, check for possible error 8633 12717 0333 AND WFERRM 8634 ; It is possible to skip here even if there is no error, 8635 ; because we might have read while switching into read mode, 8636 ; which seems to give a blend of data and status. 8637 12720 7650 SNA CLA 8638 12721 5304 JMP WFRDY+1 ; no error, just not ready yet 8639 ; At this point we are either done, or we have failed. 8640 ; If we are done, the 29F has already switched to read mode. 8641 ; We wimp out here, and just force the 28F into read mode, too. 8642 ; Thus we ignore the 28F error bits and treat it like a 29F. 8643 ; This code checks the byte at NX1 for the correct value, and 8644 ; uses that to detect an error. 8645 ; That is lame for erase, so erase ignores our reported status 8646 ; and rescans the block to see if it was really erased (ugh). 8647 8648 ; BUGBUG: It is conceivable that there could be an erase failure that 8649 ; is not in this 4K chunk. If that happens, we'll load the data for 8650 ; this 4K, but will destroy it (and possibly other 4K chunks) when/if 8651 ; we attempt to program that 4K. That won't be so bad, unless the 8652 ; second erase attempt (and the subsequent write) succeeds, in which 8653 ; case we lost data and reported no error! (If this happens to you, 8654 ; your flash chip has gone flaky and needs to be replaced.) 8655 8656 12722 1377 WFRET: TAD [FCMDRA] ; flash back into read mode 8657 12723 4357 JMS FLCMD1 8658 12724 1763 TAD @NX1 ; Get the data written 8659 12725 7041 CIA ; Does it match the intended? 8660 12726 1335 TAD WFDQ7 8661 12727 0377 AND [0377] ; Caller expects byte wide error codes 8662 12730 7650 SNA CLA 8663 12731 2303 ISZ WFRDY ; No error, take skip return 8664 12732 5703 JMP @WFRDY 8665 12733 0040 WFERRM: 0040 ; Error mask (29F unless replaced) 8666 12734 0070 WF28FM: 0070 ; 28F Error mask 8667 12735 0000 WFDQ7: 0 ; Store byte here for DQ7 compare 8668 12736 0000 WFNST: 0 ; "Done" status 8669 8670 ; The following values are 29F specific, and are only used 8671 ; to erase/write the flash. They may be over-written with 8672 ; the 28F values if a 28Fxxx flash is detected. 8673 8674 12737 0360 FCMDCS: 0360 ; F0 Clear Status 8675 12740 0240 FCMDPROG: 0240 ; A0 Write Array 8676 12741 0200 FCMDERA1: 0200 ; 80 Erase Setup PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 216 Flash ROM erasure and writing bts6120.plx 8677 12742 0060 FCMDERA2: 0060 ; 30 Erase Confirm 8678 8679 ; 8680 ; These are the corresponding 28F values. 8681 0120 F28FCS=0120 ; 50 Clear Status 8682 0100 F28FPROG=0100 ; 40 Write Array 8683 0040 F28FERA1=0040 ; 20 Erase Setup 8684 0320 F28FERA2=0320 ; D0 Erase Confirm 8685 8686 ; Here's the code to patch up for a 28F chip. It is located here 8687 ; for easy addressability to the above variables. 8688 8689 12743 1334 FL28F: TAD WF28FM ; Use 28F error bits 8690 12744 3333 DCA WFERRM 8691 12745 1371 TAD [F28FCS] ; Use 28F commands 8692 12746 3337 DCA FCMDCS 8693 12747 1370 TAD [F28FPROG] 8694 12750 3340 DCA FCMDPROG 8695 12751 1367 TAD [F28FERA1] 8696 12752 3341 DCA FCMDERA1 8697 12753 1366 TAD [F28FERA2] 8698 12754 3342 DCA FCMDERA2 8699 12755 6203 CXF 0 ; Now back to field 0 8700 12756 5765 JMP @[FL29JF] 8701 8702 ; Write commands to the flash 8703 8704 12757 0000 FLCMD1: 0 8705 12760 6202 CIF 0 ; Dispatch to field 0 8706 12761 4764 JMS @[FLCMD] 8707 12762 5757 JMP @FLCMD1 ; Return 8708 8709 ; Flash ROM routine storage.. 8710 12763 NX1: .BLOCK 1 8711 12764 3361 12765 4275 12766 0320 12767 0040 12770 0100 12771 0120 12772 0200 12773 1000 12774 7377 12775 7401 12776 0017 12777 0377 8712 13000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 217 SBC6120-RC RAM Disk support bts6120.plx 8713 .TITLE SBC6120-RC RAM Disk support 8714 8715 8716 ; Remember all that stuff you read a few pages back about the SBC6120 RAM 8717 ; disk ? What, you didn't read that?? It's back there, so go look - I'll 8718 ; wait ... 8719 ; 8720 ; Did you read it? Good... Now forget all that because the RAM disk 8721 ; implementation in the RC model is completely different from the original 8722 ; SBC6120. The main difference is that in the RC model the RAM used for main 8723 ; and panel memory is actually 512KW or 1024KW, rather than the 64KW that's 8724 ; used in the original SBC6120. Bytewide SRAM chips of 512KB are easy to come 8725 ; by where as the 4 bit wide SRAMs used in the original SBC6120 are nearly 8726 ; impossible to find so this was an obvious change to make. 8727 ; 8728 ; Panel memory and main memory still only need 64KW total, so the remaining 8729 ; part of RC memory is used as the RAM disk. If one bank of 512K byte SRAMs 8730 ; are installed, then the SBC6120-RC has 512K words of twelve bit wide memory 8731 ; (four bits being wasted, just as with the two EPROMs) and if two banks of 8732 ; SRAM chips are installed then 1024K words are available. In either case, 8733 ; the first 32K words of bank 0 are used for main memory and the second 32K 8734 ; words for panel memory. The remainder, either 448K or 960K words, is used 8735 ; as the RAM disk. 8736 ; 8737 ; Right away this means that the RC model RAM disk is twelve bits wide, not 8738 ; eight bits as it is in the original SBC6120. This means that none of that 8739 ; fancy 8 to 12 bit packing and unpacking is required for the RC RAM disk - 8740 ; we can just copy entire words directly between RAM disk and main memory. 8741 ; This alone is a huge change from the original RAM disk implementations. 8742 ; 8743 ; The DAR ("disk address register") still exists in the SBC6120-RC, and it 8744 ; is still loaded via the LDAR IOT. 1024K of memory requires 20 address bits 8745 ; and the HD6120 supplies only 15, so the DAR contains 5 more bits, DAR7..11, 8746 ; which are loaded from AC7..11 by LDAR. DAR7 is the "bank select" bit which 8747 ; selects between the two banks of SRAM chips, bank 1 being optional, and the 8748 ; other four bits of the DAR supply the upper address bits to each SRAM chip. 8749 ; This is unlike the original SBC6120 RAM disk, which used the EMA bits as a 8750 ; chip select for up to 8 SRAM chips - in the case of the RC RAM disk the EMA 8751 ; bits (you know, the data field from the CDF instruction) are simply three 8752 ; more address bits to each SRAM. Since the RC model uses the same SRAM chips 8753 ; for both main/panel memory and the RAM disk, we were pretty much forced to do 8754 ; it this way. 8755 ; 8756 ; Memory map 3 still exists in the SBC6120-RC, and it's used for pretty much 8757 ; the same purpose. If you access memory in any map other than 3 then the DAR 8758 ; contents will be ignored by the hardware and you'll be accessing either the 8759 ; first 32K (for main memory) or the second 32K (for panel memory) of SRAM bank 8760 ; zero. In map 3, however, indirect references to panel memory allow the DAR 8761 ; to pass thru and you'll be accessing whatever memory the DAR selects. Map 3 8762 ; only applies to indirect references to panel memory, however - main memory 8763 ; is never affected by the memory map in use. 8764 ; 8765 ; And it's worth pointing out again that accessing RAM disk with DAR=0 will 8766 ; access the same physical chunk of SRAM that's actually being used for main 8767 ; memory. Likewise, DAR=1 would access the same physical memory that's being 8768 ; used for panel memory. Nothing in the hardware prevents this, and it's up 8769 ; to the firmware to prevent Bad Things from happening this way. 8770 ; 8771 ; Since the second bank of SRAM chips is optional on the SBC6120-RC, the 8772 ; firmware treats this RAM disk as if it has two units. The first unit is the 8773 ; remainder of the first bank of SRAM after main and panel memory is subtracted. 8774 ; This works out to 448KW, 1792 OS/8 disk blocks or 3584 pages of 128 words. 8775 ; The second RAM disk unit, which is present only if the second bank of SRAMs 8776 ; is installed, is slightly larger at 512KW, 2048 blocks or 4096 pages. 8777 ; Unfortunately, the latter is a problem for us because 4096 pages looks like PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 218 SBC6120-RC RAM Disk support bts6120.plx 8778 ; zero (which means no RAM disk installed!) so we're forced to lie and say that 8779 ; the second bank is only 4094 pages instead. We can't even use 4095 because 8780 ; we have to have an even number of pages for mapping exactly onto OS/8 disk 8781 ; blocks. This means that two pages (256 words) of the second RAM bank are 8782 ; wasted... 8783 ; 8784 ; Oh - and I almost forgot - the backup battery low detection for the RC RAM 8785 ; disk is different, too. In the case of the SBC6120-RC we need to use the 8786 ; SBBLO2 IOT (6436) to test the backup battery - this is an IOT in the panel 8787 ; memory space which is unused on the original SBC6120. 8788 8789 ; SBC6120-RC RAM disk "geometry" constants... 8790 7000 RC0PAG=3584. ; size of the first RAM disk unit, in pages 8791 7776 RC1PAG=4094. ; " " " second " " " " " 8792 0700 RC0KW=448. ; size of the first RAM disk unit, in KW 8793 1000 RC1KW=512. ; " " " second " " " " " 8794 1000 RC0OFF=512. ; main and panel memory offset for unit 0 8795 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 219 SBC6120-RC RAM Disk Diagnostic bts6120.plx 8796 .TITLE SBC6120-RC RAM Disk Diagnostic 8797 8798 ; WARNING!!! MAJOR KLUDGE ALERT!!!!! 8799 ; The IOB6120 ROM requires a free page in field 1 that it can use as patch 8800 ; space. Fine, but after adding the code to support the SBC6120-RC RAM disk 8801 ; there is no longer a free page anywhere in field 1. Nope, not even one, not 8802 ; anywhere! 8803 ; 8804 ; So, lacking any better plan, we continue to let the IOB1260 extension ROM 8805 ; use this same page, which now contains the SBC6120-RC RAM disk code, as patch 8806 ; space. This is probably OK because the SBC6120-RC and IOB6120 are mutually 8807 ; exclusive, so it's not possible that both could ever be used at the same time. 8808 ; "Probably ...." It's not the best plan, I'll admit, but it's all we've got. 8809 13000 F1PATCH: 8810 8811 8812 ; This routine will do a simple test of the SBC6120-RC RAM disk and determine 8813 ; whether one or two banks of RAM are installed. The RDSIZE array is updated 8814 ; accordingly and the total size of the RAM disk will be returned in the AC and 8815 ; in RAMSIZ. There is one subtle difference here, though - in the case of the 8816 ; original SBC120, RAMSIZ and the value returned in the AC is in KB (_bytes!_) 8817 ; but in the case of the RC model the value is in KW (_words_!) As it turns 8818 ; out this value isn't really used for anything except to tell the user, so it's 8819 ; not a problem. The RDSIZE array is always kept in 12 bit equivalent pages 8820 ; regardless of the RAM disk type, so there's no problem there. 8821 ; 8822 ; Note that we get here via RDTEST, and we can assume that the RDSIZE array 8823 ; and RAMSIZ have already been zeroed. 8824 ; 8825 ; And remember that RAM bank 0 is always present on the SBC6120-RC, so RAM 8826 ; disk unit 0 always exists - that's a done deal and there's no need to even 8827 ; check. The only question is whether the second bank of SRAMs is installed 8828 ; and whether RAM disk unit 1 should exist too. 8829 13000 1377 RCTEST: TAD [RC0PAG] ; set the size of unit 0 8830 13001 3034 DCA RDSIZE+0 ; ... 8831 13002 1376 TAD [RC0KW] ; ... 8832 13003 3044 DCA RAMSIZ ; ... 8833 8834 ; Figure out if the second bank of SRAMs is installed. This is fairly easy - 8835 ; if DAR7 is a 1 and there is no second bank, then nothing is selected and 8836 ; writes are ignored and reads return random garbage. Better yet, the upper 8837 ; 256 words of the second bank are never used by OS/8, so we're free to trash 8838 ; these in testing RAM. It doesn't get much easier than that! 8839 13004 7240 STA ; load the DAR with 11111 8840 13005 6410 LDAR ; ... 8841 13006 6271 CDF 7 ; more ones for the address bits 8842 13007 6403 MM3 ; and enable the RAM disk 8843 13010 6276 SPD 8844 13011 1375 TAD [2525] ; write alternating 1s and 0s to the last 8845 13012 3774 DCA @[7776] ; ... two words 8846 13013 1373 TAD [5252] ; ... 8847 13014 3772 DCA @[7777] ; ... 8848 13015 1774 TAD @[7776] ; now add 'em up 8849 13016 1772 TAD @[7777] ; ... 8850 13017 6402 MM2 ; back to normal addressing 8851 13020 6211 CDF 1 ; ... 8852 13021 7040 CMA ; if memory is working the result should 8853 13022 7640 SZA CLA ; be exactly 7777 8854 13023 5231 JMP RCTES1 ; no memory there 8855 8856 ; The second bank exists, so adjust RDSIZE+1 and RAMSIZ ... 8857 13024 1374 TAD [RC1PAG] ; set the size of unit 1 8858 13025 3035 DCA RDSIZE+1 ; ... 8859 13026 1371 TAD [RC1KW] ; and adjust RAMSIZ 8860 13027 1044 TAD RAMSIZ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 220 SBC6120-RC RAM Disk Diagnostic bts6120.plx 8861 13030 3044 DCA RAMSIZ ; ... 8862 8863 ; Return the total RAM disk size and we're done... 8864 13031 1044 RCTES1: TAD RAMSIZ ; return the total size of RAM disk 8865 13032 6225 .POPJ ; and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 221 Set SBC6120-RC RAM Disk Address Register bts6120.plx 8866 .TITLE Set SBC6120-RC RAM Disk Address Register 8867 8868 ; This is the version of the SETDAR routine for the SBC6120-RC RAM disk. 8869 ; Like SETDAR, it assumes that the desired RAM disk page number is passed in 8870 ; location RDPAGE, and it will load the resulting bank number directly into 8871 ; the DAR via the LDAR IOT. The offset of the desired page within the 4K 8872 ; field will be left in RAMPTR where it is used by the RCRDRD and RCRDWR 8873 ; routines. 8874 ; 8875 ; This routine should never be called directly but instead is always called 8876 ; via SETDAR, which will figure out that we're running on the SBC6120-RC model 8877 ; and then jump here. This is because it depends on the SETDAR code to range 8878 ; check the page number against the size of the selected RAM disk unit first. 8879 ; If the page number passed is illegal then the link will be set when this 8880 ; routine returns. 8881 ; 8882 ; In the original RAM disk implementations, the data field selects the RAM 8883 ; disk chip (aka unit) and the remainder of the extended address comes from the 8884 ; DAR. In the RC implementation, bit 7 of the DAR selects the unit (there are 8885 ; only two RAM disk units possible on the SBC6120-RC), the remainder of the DAR 8886 ; is the high order extended address. In the RC model, the data field is just 8887 ; part of the disk address and has nothing to do with selecting the unit. 8888 ; 8889 ; Because of that, this routine also uses RDUNIT to DAR7 and IT OVERWRITES 8890 ; THE CDF INSTRUCTION AT RAMCDF! That means that in the case of the RC model 8891 ; SETDAR can only be called AFTER RAMSEL is called - that's the usual case 8892 ; anyway, though, and shouldn't be a problem for anybody. The end result of 8893 ; all this is that when we're done here, RAMCDF, RAMPTR and the DAR all contain 8894 ; the values needed to access the right RAM disk page. 8895 13033 RCSDAR: 8896 8897 ; First problem - the first 64KW of RAM disk unit 0 are actually used for main 8898 ; and panel memory. This means that any RAM disk addresses for unit 0 have to 8899 ; be offset by 512 pages (64KW * 8 pages/KW)... 8900 13033 1024 TAD RDUNIT ; get the unit number 8901 13034 7650 SNA CLA ; skip on unit #1 8902 13035 1371 TAD [RC0OFF] ; nope - offset unit zero addresses 8903 13036 1025 TAD RDPAGE ; adjust the page number 8904 13037 3026 DCA RCPAGE ; and save it temporarily 8905 8906 ; The upper for bits of the RAM disk page number get loaded into DAR8..11 8907 ; and DAR7 is set or cleared according to the unit number... 8908 13040 1026 TAD RCPAGE ; get the desired RAM disk page number 8909 13041 7002 BSW ; right justify the upper four bits 8910 13042 7012 RTR ; ... 8911 13043 0370 AND [17] ; ... 8912 13044 7421 MQL ; save that for a minute 8913 13045 1024 TAD RDUNIT ; get the unit number again 8914 13046 7640 SZA CLA ; skip if unit 0 is selected 8915 13047 1367 TAD [20] ; nope - set DAR7 to select unit 1 8916 13050 7501 MQA ; combine the upper address with the unit select 8917 13051 6410 LDAR ; and load that into the DAR 8918 8919 ; Next, bits 4..6 of the RAM disk page number get made into a CDF instruction 8920 ; and stored at RAMCDF ... 8921 13052 1026 TAD RCPAGE ; get the page number back again 8922 13053 7012 RTR ; put bits 4..6 in into bits 6..8 8923 13054 0366 AND [70] ; clear out the junk 8924 13055 1365 TAD [CDF 0] ; and make a CDF instruction 8925 13056 3764 DCA @[RAMCDF+1] ; store that in the RAMCDF routine for later 8926 8927 ; And finally, bits 7..11 (the lower five bits) of the RAM disk page number 8928 ; become the upper bits of RAMPTR. That leaves the lower seven bits of RAMPTR 8929 ; to select one of 128 words within this RAM disk page - whew! It works out... 8930 13057 1026 TAD RCPAGE ; one more time PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 222 Set SBC6120-RC RAM Disk Address Register bts6120.plx 8931 13060 7002 BSW ; and shift it left by a total of 8932 13061 7004 RAL ; .... seven bits 8933 13062 0363 AND [7600] ; make sure the low seven bits are zeros 8934 13063 1372 TAD [-1] ; adjust for PRE-incrementing auto index ... 8935 13064 3010 DCA RAMPTR ; and set RAMPTR 8936 13065 7100 CLL ; link clear for no errors 8937 13066 6225 .POPJ ; Bingo - we're ready to go! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 223 Read or Write SBC6120-RC RAM Disk bts6120.plx 8938 .TITLE Read or Write SBC6120-RC RAM Disk 8939 8940 ; This routine will read one page (128 words) from the SBC6120-RC RAM disk 8941 ; and transfer them to a buffer in main or panel memory. It assumes that 8942 ; RAMCDF, RAMPTR and the DAR have been set up to point to the correct physical 8943 ; RAM disk page by first calling the RAMSEL and SETDAR routines, and that the 8944 ; BUFPTR, BUFCDF and BUFPNL locations point to the correct destination for 8945 ; the data. By the time we get here we assume that all error checking has 8946 ; already been done and this routine never "fails" ! 8947 13067 7200 RCRDRD: CLA ; just in case 8948 13070 1363 TAD [-128.] ; always transfer exactly 1 page 8949 13071 3052 DCA XFRCNT ; ... 8950 13072 4762 RCRDR1: JMS @[RAMCDF] ; CDF to the correct RAM disk field 8951 13073 6403 MM3 ; and address RAM disk memory 8952 13074 1410 TAD @RAMPTR ; get a word from extended memory 8953 13075 3027 DCA RAMBUF ; and save it temporarily 8954 13076 6402 MM2 ; back to normal addressing 8955 13077 4761 JMS @[BUFCDF] ; now address the destination field 8956 13100 1027 TAD RAMBUF ; get the data word back again 8957 13101 3411 DCA @BUFPTR ; and store that in the buffer 8958 13102 6276 SPD ; back to normal addressing 8959 13103 6211 CDF 1 ; ... 8960 13104 2052 ISZ XFRCNT ; have we done all 128 words ? 8961 13105 5272 JMP RCRDR1 ; nope - keep going 8962 13106 7100 CLL ; always return "success" 8963 13107 6225 .POPJ ; and we're done! 8964 8965 8966 ; And this routine will write one page from a buffer in either main or panel 8967 ; memory to the SBC6120-RC RAM disk. It's pretty much the complement of the 8968 ; previous routine, and makes all the same assumptions! 8969 13110 7200 RCRDWR: CLA ; just in case 8970 13111 1363 TAD [-128.] ; always transfer exactly 1 page 8971 13112 3052 DCA XFRCNT ; ... 8972 13113 4761 RCRDW1: JMS @[BUFCDF] ; get a word from the buffer 8973 13114 1411 TAD @BUFPTR ; ... 8974 13115 3027 DCA RAMBUF ; and save it for a moment 8975 13116 6276 SPD ; back to panel memory addressing 8976 13117 4762 JMS @[RAMCDF] ; now select the RAM disk field 8977 13120 6403 MM3 ; and enable RAM disk addressing 8978 13121 1027 TAD RAMBUF ; get the data word 8979 13122 3410 DCA @RAMPTR ; and store it in the RAM disk 8980 13123 6402 MM2 ; back to normal addressing 8981 13124 6211 CDF 1 ; and restore the data field 8982 13125 2052 ISZ XFRCNT ; have we done enough? 8983 13126 5313 JMP RCRDW1 ; nope - keep going 8984 13127 7100 CLL ; always return "success" 8985 13130 6225 .POPJ ; and we're done! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 224 Test DS1221 Batteries bts6120.plx 8986 .TITLE Test DS1221 Batteries 8987 8988 8989 ; This routine will test the status of the RAM disk backup batteries on the 8990 ; original, DS1221, RAM disk card. This routine will return incorrect, but 8991 ; harmless, information if the system really has the newer DS1231 RAM disk or 8992 ; the IOB6120 RAM disk, or no RAM disk at all. 8993 ; 8994 ; The DS1221 doesn't have a status bit to give us the battery state directly, 8995 ; but it does have a clever hack to allow us to infer what we want to know. If 8996 ; the batteries have failed, then the DS1221 will inhibit all chip select 8997 ; outputs on the _second_ memory cycle (but not the first!). We can use this 8998 ; by 1) reading any location and saving its value, 2) writing any different 8999 ; value to the same location, and 3) reading it back again. If the batteries 9000 ; are dead, the second cycle will be inhibited, and the value read in step 3 9001 ; will be the same as 1. Of course, this presupposes that there's functional 9002 ; memory installed in the first place, if there isn't then this algorithm will 9003 ; erroneously report that the batteries are dead. 9004 ; 9005 ; Because of the way this works, this routine has to be called before ANY 9006 ; other access is made to MM3, including the extension ROM initialization. 9007 ; That's why the DS1221 battery test is in a routine all by itself - the 9008 ; battery test for the other two styles (DS1231 and IOB6120) is done by the 9009 ; RDCHK1 routine. 9010 ; 9011 13131 0000 CK1221: 0 9012 13132 1360 TAD [32.] ; test bank 32 to avoid A17 problem 9013 13133 6410 LDAR ; select the RAM bank for testing 9014 13134 6403 MM3 ; enable RAM disk access 9015 13135 6201 CDF 0 ; use 1st RAMdisk RAM for test 9016 13136 1772 TAD @[7777] ; (1) read the last byte of this bank 9017 13137 7421 MQL ; save it for a minute 9018 13140 7701 ACL ; .... 9019 13141 7041 CIA ; make it negative 9020 13142 3772 DCA @[7777] ; (2) and write it back 9021 13143 7701 ACL ; get the original data 9022 13144 1772 TAD @[7777] ; (3) add what should be the complement 9023 13145 0357 AND [377] ; ignore all but the bottom eight bits 9024 13146 7650 SNA CLA ; if it's not zero then the second cycle was 9025 13147 7344 NLM2 ; ... inhibited because the batteries are dead 9026 13150 7001 IAC ; AC=-1 if battery good, AC=+1 if battery bad 9027 13151 3033 DCA BATTOK ; ..... 9028 13152 6211 CDF 1 ; back to current field 9029 13153 6402 MM2 ; back to the default memory map 9030 13154 5731 JMP @CK1221 ; ... 9031 13157 0377 13160 0040 13161 2221 13162 0753 13163 7600 13164 0754 13165 6201 13166 0070 13167 0020 13170 0017 13171 1000 13172 7777 13173 5252 13174 7776 13175 2525 13176 0700 13177 7000 9032 13200 .PAGE 15 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 225 Command Names Table bts6120.plx 9033 .TITLE Command Names Table 9034 9035 9036 ; This table gives the names of all the commands known to the monitor. Each 9037 ; entry consists of a one or two letter command name, in SIXBIT, followed by 9038 ; the address of a routine to execute it. Although this table is stored in 9039 ; field 1, all the command routines are implicitly in field zero! The zero 9040 ; entry at the end is a "catch all" that is called if none of the previous 9041 ; names match, and points to an error routine. With the exception of this last 9042 ; entry, the order of the table is not significant. 9043 13200 CMDTBL: 9044 13200 .SIXBIT /H / ; Help 9045 13201 0514 HELP ; ... 9046 13202 .SIXBIT /RP/ ; RePeat 9047 13203 0610 REPEAT ; ... 9048 13204 .SIXBIT /E / ; Examine 9049 13205 1002 EMEM ; ... 9050 13206 .SIXBIT /EP/ ; Examine Panel memory 9051 13207 1000 EPMEM ; ... 9052 13210 .SIXBIT /D / ; Deposit 9053 13211 1067 DMEM ; ... 9054 13212 .SIXBIT /DP/ ; Deposit Panel memory 9055 13213 1065 DPMEM ; ... 9056 13214 .SIXBIT /ER/ ; Examine Register 9057 13215 1114 EREG ; ... 9058 13216 .SIXBIT /DR/ ; Deposit Register 9059 13217 1132 DREG ; ... 9060 13220 .SIXBIT /BM/ ; Block Move 9061 13221 1400 BMOVE ; ... 9062 13222 .SIXBIT /CK/ ; ChecKsum 9063 13223 1442 CKMEM ; ... 9064 13224 .SIXBIT /WS/ ; Word Search 9065 13225 1600 SEARCH ; ... 9066 13226 .SIXBIT /CM/ ; Clear Memory 9067 13227 1507 CMEM ; ... 9068 13230 .SIXBIT /FM/ ; Fill Memory 9069 13231 1503 FLMEM ; ... 9070 13232 .SIXBIT /BL/ ; Breakpoint List 9071 13233 1674 BLIST ; ... 9072 13234 .SIXBIT /BP/ ; BreakPoint 9073 13235 2036 BPTCOM ; ... 9074 13236 .SIXBIT /BR/ ; Breakpoint Remove 9075 13237 2000 BREMOV ; ... 9076 13240 .SIXBIT /C / ; Continue 9077 13241 2214 CONTCM ; ... 9078 13242 .SIXBIT /SI/ ; Single Instruction with no trace 9079 13243 2200 SNCOM ; ... 9080 13244 .SIXBIT /ST/ ; STart 9081 13245 2251 START ; ... 9082 13246 .SIXBIT /P / ; Proceed 9083 13247 2207 PROCEE ; ... 9084 13250 .SIXBIT /TR/ ; single instruction with TRace 9085 13251 2144 SICOM ; ... 9086 13252 .SIXBIT /VE/ ; VErsion (of monitor) 9087 13253 0707 VECOM ; ... 9088 13254 .SIXBIT /TW/ ; Terminal Width 9089 13255 0635 TWCOM ; ... 9090 13256 .SIXBIT /TP/ ; Terminal Page 9091 13257 0660 TPCOM ; ... 9092 13260 .SIXBIT /EX/ ; EXECUTE (IOT instruction) 9093 13261 2324 XCTCOM ; ... 9094 13262 .SIXBIT /MR/ ; MASTER RESET 9095 13263 2300 CLRCOM ; ... 9096 13264 .SIXBIT /LP/ ; LOAD PAPER (tape from console) 9097 13265 3200 CONLOD ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 226 Command Names Table bts6120.plx 9098 13266 .SIXBIT /DD/ ; Disk (IDE) Dump 9099 13267 3405 DDDUMP ; ... 9100 13270 .SIXBIT /RD/ ; Disk (RAM) Dump 9101 13271 3400 RDDUMP ; ... 9102 13272 .SIXBIT /DL/ ; Disk (IDE) Load 9103 13273 3520 DLLOAD ; ... 9104 13274 .SIXBIT /RL/ ; Disk (RAM) Load 9105 13275 3513 RLLOAD ; ... 9106 13276 .SIXBIT /DF/ ; Disk (IDE) Format 9107 13277 3076 DFRMAT ; ... 9108 13300 .SIXBIT /RF/ ; Disk (RAM) Format 9109 13301 3124 RFRMAT 9110 13302 .SIXBIT /B / ; Bootstrap ram disk 9111 13303 2426 BOOT 9112 13304 .SIXBIT /PM/ ; Partition Map 9113 13305 2622 PMEDIT ; ... 9114 13306 .SIXBIT /PC/ ; Partition Copy 9115 13307 4024 PCOPY ; ... 9116 13310 .SIXBIT /FL/ ; Flash Load 9117 13311 4200 FLLOAD 9118 13312 .SIXBIT /PE/ ; Partition Compare 9119 13313 4015 PCOMP ; ... 9120 13314 .SIXBIT /X / ; Disassemble Main Memory 9121 13315 1546 DISASM ; ... 9122 13316 .SIXBIT /XP/ ; Disassemble Panel Memory 9123 13317 1550 DISASMP ; ... 9124 13320 .SIXBIT /SC/ ; SCope 9125 13321 0700 SCCOM 9126 13322 .SIXBIT /SD/ ; Spin IDE disk drive UP or DOWN 9127 13323 4600 SPINCD ; ... 9128 9129 ; there are 9 copies of the end-of-command list sentinel here so that 9130 ; up to 8 commands may be added by an extension ROM 9131 13324 0000 0000 ; This must always be the last entry 9132 13325 0453 COMERR ; Where to go if none of the above matches 9133 13326 0000 0000 ; This must always be the last entry 9134 13327 0453 COMERR ; Where to go if none of the above matches 9135 13330 0000 0000 ; This must always be the last entry 9136 13331 0453 COMERR ; Where to go if none of the above matches 9137 13332 0000 0000 ; This must always be the last entry 9138 13333 0453 COMERR ; Where to go if none of the above matches 9139 13334 0000 0000 ; This must always be the last entry 9140 13335 0453 COMERR ; Where to go if none of the above matches 9141 13336 0000 0000 ; This must always be the last entry 9142 13337 0453 COMERR ; Where to go if none of the above matches 9143 13340 0000 0000 ; This must always be the last entry 9144 13341 0453 COMERR ; Where to go if none of the above matches 9145 13342 0000 0000 ; This must always be the last entry 9146 13343 0453 COMERR ; Where to go if none of the above matches 9147 13344 0000 0000 ; This must always be the last entry 9148 13345 0453 COMERR ; Where to go if none of the above matches PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 227 Argument Tables for Various Commands bts6120.plx 9149 .TITLE Argument Tables for Various Commands 9150 9151 9152 ; This table gives a list of the legal register names for the ER (Examine 9153 ; Register) command... 9154 13346 ENAMES: .SIXBIT /AC/ ; The AC 9155 13347 1252 TYPEAC 9156 13350 .SIXBIT /PC/ ; The PC 9157 13351 1255 TYPEPC 9158 13352 .SIXBIT /MQ/ ; The MQ 9159 13353 1260 TYPEMQ 9160 13354 .SIXBIT /PS/ ; The processor status 9161 13355 1265 TYPEPS 9162 13356 .SIXBIT /SR/ ; The switch register 9163 13357 1276 TYPESR 9164 13360 0000 0000 ; None of the above 9165 13361 0453 COMERR 9166 9167 ; This table gives a list of the legal register names for the DR (deposit 9168 ; register) command... 9169 13362 DNAMES: .SIXBIT /AC/ ; The AC 9170 13363 1200 DAC 9171 13364 .SIXBIT /PC/ ; The PC 9172 13365 1203 DPC 9173 13366 .SIXBIT /MQ/ ; The MQ 9174 13367 1206 DMQ 9175 13370 .SIXBIT /PS/ ; The flags 9176 13371 1211 DPS 9177 13372 .SIXBIT /SR/ ; The switch register 9178 13373 1221 DSR 9179 13374 0000 0000 ; None of the above 9180 13375 0453 COMERR 9181 9182 ; This table is a list of the arguments to the B (BOOT) command... 9183 13376 BNAMES: .SIXBIT /VM/ ; VMA0 9184 13377 2464 BTVMA0 9185 13400 .SIXBIT /ID/ ; IDA0 9186 13401 2500 BTIDA0 9187 13402 0000 0000 ; end of list 9188 13403 0453 COMERR PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 228 Messages bts6120.plx 9189 .TITLE Messages 9190 9191 ; General purpose messages... 9192 13404 CKSMSG: .TEXT /Checksum = / 9193 13415 MEMMSG: .TEXT /?Memory error at / 9194 13432 ERRILV: .TEXT /Illegal value/ 9195 13444 ERRSRF: .TEXT /Search fails/ 9196 13455 ERRRAN: .TEXT /Wrong order/ 9197 13466 ERRWRP: .TEXT /Wrap around/ 9198 13477 SKPMSG: .TEXT /Skip / 9199 13504 ERRDIO: .TEXT \?I/O Error \ 9200 13515 ERRCKS: .TEXT /Checksum error/ 9201 13530 ERRNBT: .TEXT /No bootstrap/ 9202 13541 ERRNDK: .TEXT /No disk/ 9203 9204 ; Program trap messages... 9205 13547 BPTMSG: .TEXT /%Breakpoint at / 9206 13562 PR0MSG: .TEXT /?Illegal PR0 function at / 9207 13604 BRKMSG: .TEXT /%Break at / 9208 13614 PRNMSG: .TEXT /?Panel trap at / 9209 13627 HLTMSG: .TEXT /?Halted at / 9210 13640 TRPMSG: .TEXT /?Unknown trap at / 9211 9212 ; Breakpoint messages... 9213 13655 ERRNBP: .TEXT /None set/ 9214 13664 ERRNST: .TEXT /Not set/ 9215 13672 ERRAST: .TEXT /Already set/ 9216 13703 ERRBTF: .TEXT /Table full/ 9217 9218 ; Register names... 9219 13713 ACNAME: .TEXT /AC>/ 9220 13716 PCNAME: .TEXT /PC>/ 9221 13721 MQNAME: .TEXT /MQ>/ 9222 13724 IRNAME: .TEXT /IR>/ 9223 13727 SRNAME: .TEXT /SR>/ 9224 13732 PSNAME: .TEXT /PS>/ 9225 13735 SP1NAM: .TEXT /SP1>/ 9226 13741 SP2NAM: .TEXT /SP2>/ 9227 9228 ; Disk formatting status messages... 9229 13745 FCFMSG: .TEXT \Format unit/partition \ 9230 13765 FM1MSG: .TEXT /Writing / 9231 13774 FM2MSG: .TEXT / Verifying / 9232 14005 FM3MSG: .TEXT / Done/ 9233 14012 ERRDSK: .TEXT \?Verification error, block/page \ 9234 9235 ; Partition copy messages.... 9236 14041 CCFMSG: .TEXT \Overwrite partition \ 9237 14060 CP1MSG: .TEXT /Copying / 9238 4005 CP2MSG=FM3MSG 9239 9240 ; Partition compare messages.... 9241 3774 CE1MSG=FM2MSG 9242 4012 CEEMSG=ERRDSK 9243 9244 ; Partition map messages... 9245 14067 PM1MSG: .TEXT /Unit / 9246 14074 PM2MSG: .TEXT / -> Partition / 9247 9248 ; Device names that get printed by the boot sniffer... 9249 14107 VMAMSG: .TEXT /-VMA0/ 9250 14114 IDAMSG: .TEXT /-IDA0/ 9251 9252 ; System name message... 9253 14121 SYSNM0: .TEXT /SBC6120/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 229 Messages bts6120.plx 9254 14127 SYSNM1: .TEXT / ROM Monitor V/ 9255 14142 SYSNM2: .TEXT / Checksum / 9256 14152 SYSNM3: .TEXT /\d \h/ 9257 14167 SYSNM4: .TEXT /-RC/ 9258 14172 SYSCRN: .TEXT /Copyright (C) 1983-2010 by Spare Time Gizmos. All rights reserved./ 9259 9260 ; RAM disk status message... 9261 14250 RAMMS1: .TEXT /NVR: / 9262 14255 RAMMS3: .TEXT /KB/ 9263 14260 RAMMS4: .TEXT /KW/ 9264 14263 BOKMSG: .TEXT / - Battery OK/ 9265 14275 BFAMSG: .TEXT / - Battery FAIL/ 9266 9267 ; IDE disk status message... 9268 14310 IDEMS1: .TEXT /IDE: / 9269 14315 IDEMS2: .TEXT /MB - / 9270 14322 NDETMS: .TEXT /Not detected/ 9271 14333 NSUPMS: .TEXT /Not supported/ 9272 9273 ; Extension ROM messages 9274 14345 XRMES1: .TEXT /IOB: / 9275 14352 XRMES2: .TEXT /Error / 9276 14357 XRMES3: .TEXT /OK/ 9277 9278 ; Flash messages 9279 14362 FLMSG1: .TEXT /?No Flash/ 9280 14371 FLMSG2: .TEXT /Overwrite flash/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 230 Help Text bts6120.plx 9281 .TITLE Help Text 9282 9283 9284 ; These tables are used by the HELP command to generate a page of text 9285 ; describing the monitor commands. Each word is a pointer to a text string, 9286 ; also in field 1, which contains a single line of text, usually a description 9287 ; of one command. Each table ends with a zero word. The first and last 9288 ; tables are generic and appear on all models of SBC6120, but the middle tables 9289 ; are specific to the RAM disk, IDE disk and IOB6120 options. These middle 9290 ; tables appear only if the corresponding option is present. 9291 14404 HLPP1: ; Generic help part 1 - for all models ... 9292 ; Examine/Deposit commands... 9293 .DATA HLPEDC 14404 4516 9294 .DATA HLPE, HLPEP, HLPER, HLPX, HLPXP 14405 4542 14406 4604 14407 4647 14410 4674 14411 4733 9295 .DATA HLPD, HLPDP, HLPDR 14412 4772 14413 5036 14414 5103 9296 ; Memory commands... 9297 .DATA HLPNUL, HLPMEM 14415 4442 14416 5134 9298 .DATA HLPBM, HLPCK, HLPWS, HLPFM, HLPCM 14417 5147 14420 5204 14421 5241 14422 5300 14423 5332 9299 ; Breakpoint commands... 9300 .DATA HLPNUL, HLPBPC 14424 4442 14425 5361 9301 .DATA HLPBP, HLPBR, HLPBL, HLPP 14426 5377 14427 5423 14430 5452 14431 5474 9302 ; Program control commands... 9303 .DATA HLPNUL, HLPPCC 14432 4442 14433 5522 9304 .DATA HLPST, HLPC, HLPSI, HLPTR, HLPEX, HLPMR 14434 5543 14435 5600 14436 5623 14437 5646 14440 5673 14441 5727 9305 HLPNUL: .DATA 0 14442 0000 9306 9307 14443 HLPRAM: ; Help for RAM disk commands only ... 9308 .DATA HLPNUL, HLPRDS, HLPRD, HLPRL, HLPRF, HLPB 14443 4442 14444 5746 14445 6025 14446 6062 14447 6106 14450 6421 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 231 Help Text bts6120.plx 9309 .DATA 0 14451 0000 9310 9311 14452 HLPIDE: ; Help for IDE disk commands only ... 9312 .DATA HLPNUL, HLPIDS, HLPDD, HLPDL, HLPDF 14452 4442 14453 5763 14454 6131 14455 6170 14456 6216 9313 .DATA HLPPC, HLPPE, HLPPM, HLPSD, HLPB 14457 6275 14460 6334 14461 6243 14462 6370 14463 6421 9314 .DATA 0 14464 0000 9315 9316 14465 HLPIOB: ; Help for IOB6120 commands only ... 9317 .DATA HLPNUL, HLPJDK, HLPFL 14465 4442 14466 6450 14467 6464 9318 .DATA 0 14470 0000 9319 9320 14471 HLPP2: ; Generic help part 2 - for all models ... 9321 ; Other (miscellaneous) commands... 9322 .DATA HLPNUL, HLPMSC 14471 4442 14472 6507 9323 .DATA HLPLP, HLPTW, HLPTP, HLPSC, HLPVE, HLPSEM, HLPRP, HLPDOL 14473 6000 14474 6527 14475 6556 14476 6611 14477 6640 14500 6665 14501 6720 14502 6756 9324 ; Special control characters... 9325 .DATA HLPNUL, HLPCTL 14503 4442 14504 7003 9326 .DATA HLPCTS, HLPCTQ, HLPCTO, HLPCTC, HLPCTH, HLPRUB, HLPCTR, HLPCTU 14505 7020 14506 7057 14507 7115 14510 7150 14511 7203 14512 7237 14513 7277 14514 7332 9327 .DATA 0 14515 0000 9328 9329 ; Examine/Deposit commands... 9330 14516 HLPEDC: .TEXT /EXAMINE AND DEPOSIT COMMANDS/ 9331 14542 HLPE: .TEXT /E aaaaa[-bbbbb] [, ccccc]\t-> Examine main memory/ 9332 14604 HLPEP: .TEXT /EP aaaaa[-bbbbb] [, ccccc]\t-> Examine panel memory/ 9333 14647 HLPER: .TEXT /ER [rr]\t\t\t\t-> Examine register/ 9334 14674 HLPX: .TEXT /X aaaaa[-bbbbb]\t\t-> Disassemble main memory/ 9335 14733 HLPXP: .TEXT /XP aaaaa[-bbbbb]\t\t-> Disassemble panel memory/ 9336 14772 HLPD: .TEXT /D aaaaa bbbb, [cccc, ...]\t-> Deposit in main memory/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 232 Help Text bts6120.plx 9337 15036 HLPDP: .TEXT /DP aaaaa bbbb, [cccc, ...]\t-> Deposit in panel memory/ 9338 15103 HLPDR: .TEXT /DR xx yyyy\t\t\t-> Deposit in register/ 9339 9340 ; Memory commands... 9341 15134 HLPMEM: .TEXT /MEMORY COMMANDS/ 9342 15147 HLPBM: .TEXT /BM aaaaa-bbbbb ddddd\t\t-> Move memory block/ 9343 15204 HLPCK: .TEXT /CK aaaaa-bbbbb\t\t\t-> Checksum memory block/ 9344 15241 HLPWS: .TEXT /WS vvvv [aaaaa-bbbbb [mmmm]]\t-> Search memory/ 9345 15300 HLPFM: .TEXT /FM vvvv [aaaaa-bbbbb]\t\t-> Fill memory/ 9346 15332 HLPCM: .TEXT /CM [aaaaa-bbbbb]\t\t-> Clear memory/ 9347 9348 ; Breakpoint commands... 9349 15361 HLPBPC: .TEXT /BREAKPOINT COMMANDS/ 9350 15377 HLPBP: .TEXT /BP aaaaa\t\t\t-> Set breakpoint/ 9351 15423 HLPBR: .TEXT /BR [aaaaa]\t\t\t-> Remove breakpoint/ 9352 15452 HLPBL: .TEXT /BL\t\t\t\t-> List breakpoints/ 9353 15474 HLPP: .TEXT /P\t\t\t\t-> Proceed past breakpoint/ 9354 9355 ; Program control commands... 9356 15522 HLPPCC: .TEXT /PROGRAM CONTROL COMMANDS/ 9357 15543 HLPST: .TEXT /ST [aaaaa]\t\t\t-> Start main memory program/ 9358 15600 HLPC: .TEXT /C\t\t\t\t-> Continue execution/ 9359 15623 HLPSI: .TEXT /SI\t\t\t\t-> Single instruction/ 9360 15646 HLPTR: .TEXT /TR\t\t\t\t-> Trace one instruction/ 9361 15673 HLPEX: .TEXT /EX 6xxx\t\t\t\t-> Execute an IOT instruction/ 9362 15727 HLPMR: .TEXT /MR\t\t\t\t-> Master reset/ 9363 9364 ; Disk commands... 9365 15746 HLPRDS: .TEXT /RAM DISK COMMANDS/ 9366 15763 HLPIDS: .TEXT /IDE DISK COMMANDS/ 9367 16000 HLPLP: .TEXT /LP\t\t\t\t-> Load a BIN paper tape/ 9368 16025 HLPRD: .TEXT /RD u [pppp [cccc]]\t\t-> Dump RAM disk page/ 9369 16062 HLPRL: .TEXT /RL u\t\t\t\t-> Download RAM disk/ 9370 16106 HLPRF: .TEXT /RF u\t\t\t\t-> Format RAM disk/ 9371 16131 HLPDD: .TEXT /DD pppp [bbbb [cccc]]\t\t-> Dump IDE disk block/ 9372 16170 HLPDL: .TEXT /DL pppp\t\t\t\t-> Download IDE disk/ 9373 16216 HLPDF: .TEXT /DF pppp\t\t\t\t-> Format IDE disk/ 9374 16243 HLPPM: .TEXT /PM [u] [pppp]\t\t\t-> Edit partition map/ 9375 16275 HLPPC: .TEXT /PC ssss dddd\t\t\t-> Copy partition ssss to dddd/ 9376 16334 HLPPE: .TEXT /PE aaaa bbbb\t\t\t-> Compare two partitions/ 9377 16370 HLPSD: .TEXT /SD n\t\t\t\t-> Spin IDE disk UP or DOWN/ 9378 16421 HLPB: .TEXT /B [dd]\t\t\t\t-> Boot RAM or IDE disk/ 9379 9380 ; IOB6120 specific commands ... 9381 16450 HLPJDK: .TEXT /IOB6120 COMMANDS/ 9382 16464 HLPFL: .TEXT /FL\t\t\t\t-> Download Flash ROM/ 9383 9384 ; Other (miscellaneous) commands... 9385 16507 HLPMSC: .TEXT /MISCELLANEOUS COMMANDS/ 9386 16527 HLPTW: .TEXT /TW nn\t\t\t\t-> Set the console width/ 9387 16556 HLPTP: .TEXT /TP nn\t\t\t\t-> Set the console page length/ 9388 16611 HLPSC: .TEXT /SC n\t\t\t\t-> Set console scope mode/ 9389 16640 HLPVE: .TEXT /VE\t\t\t\t-> Show firmware version/ 9390 16665 HLPSEM: .TEXT /aa; bb; cc; dd ...\t\t-> Combine commands/ 9391 16720 HLPRP: .TEXT /RP [nn]; aa; bb; cc; ...\t-> Repeat commands/ 9392 16756 HLPDOL: .TEXT /!any text...\t\t\t-> Comment text/ 9393 9394 ; Special control characters... 9395 17003 HLPCTL: .TEXT /SPECIAL CHARACTERS/ 9396 17020 HLPCTS: .TEXT /Control-S (XOFF)\t\t-> Suspend terminal output/ 9397 17057 HLPCTQ: .TEXT /Control-Q (XON)\t\t\t-> Resume terminal output/ 9398 17115 HLPCTO: .TEXT /Control-O\t\t\t-> Suppress terminal output/ 9399 17150 HLPCTC: .TEXT /Control-C\t\t\t-> Abort current operation/ 9400 17203 HLPCTH: .TEXT /Control-H\t\t\t-> Delete the last character/ 9401 17237 HLPRUB: .TEXT /RUBOUT (DELETE)\t\t\t-> Delete the last character/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 233 Help Text bts6120.plx 9402 17277 HLPCTR: .TEXT /Control-R\t\t\t-> Retype the current line/ 9403 17332 HLPCTU: .TEXT /Control-U\t\t\t-> Erase current line/ 9404 17361 HLPEND: PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 234 Temporary Disk Buffer bts6120.plx 9405 .TITLE Temporary Disk Buffer 9406 9407 9408 ; The last two pages of field 1, addresses 17400 thru 17777, are used as a 9409 ; temporary disk buffer by the disk load, disk dump, disk format and boot 9410 ; commands. 9411 17400 .PAGE 36 9412 17400 DSKBUF: .BLOCK 128. 9413 17600 .PAGE 37 9414 17600 .BLOCK 128. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 235 Field 2 Variables bts6120.plx 9415 .TITLE Field 2 Variables 9416 9417 9418 20200 .FIELD 2 9419 20000 .PAGE 0 9420 9421 20000 MNEMP: .BLOCK 1 ; address of last mnemonic output 9422 20001 MEA: .BLOCK 1 ; effective address 9423 20002 MIA: .BLOCK 1 ; indirect address 9424 20003 XPC: .BLOCK 1 ; Program Counter 9425 20004 XIR: .BLOCK 1 ; Instruction Register 9426 20005 IFDF: .BLOCK 1 9427 20006 DPNL: .BLOCK 1 9428 9429 20010 .ORG 10 9430 20010 SCAN: .BLOCK 1 ; auto-incr ptr to OPJMP table 9431 20011 ASCAN: .BLOCK 1 ; auto-incr ptr to mnemonic table 9432 20012 MPTR: .BLOCK 1 ; auto-incr ptr for TASZF2 9433 20013 AX1: .BLOCK 1 9434 20014 AX2: .BLOCK 1 9435 9436 20020 .ORG 20 9437 9438 20020 PUSHAC2: .BLOCK 1 9439 20021 DESTA: .BLOCK 1 9440 9441 20100 .ORG 100 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 236 Field 2 Cross Field Linkages bts6120.plx 9442 .TITLE Field 2 Cross Field Linkages 9443 9444 9445 ; This two routines will allow a routine in field 2 to simulate a .PUSHJ 9446 ; to a routines in field 0 or 1. The contents of the AC are preserved both 9447 ; ways across the call. 9448 ; 9449 ;CALL: 9450 ; JMS PJ0F2 or PJ1F2 ; cross field call "PUSHJ to 0 From 2" 9451 ; ; address of a routine in field 1 9452 ; ; with the AC preserved across the call 9453 ; 9454 20100 0000 PJ0F2: 0 ; call here with a JMS instruction 9455 20101 3020 DCA PUSHAC2 ; save the caller's AC for a minute 9456 20102 6221 CDF 2 9457 20103 1500 TAD @PJ0F2 ; then get caller's argument 9458 20104 3021 DCA DESTA ; that's the address of the routine to call 9459 20105 1100 TAD PJ0F2 ; now get caller's return address 9460 20106 7001 IAC ; and skip over the argument 9461 20107 6215 .PUSH ; put that on the stack 9462 20110 7200 CLA ; (PUSH doesn't clear the AC!) 9463 20111 1177 TAD [RET0F2] ; the field 0 routine will return to 9464 20112 6215 .PUSH ; ... 9465 20113 7200 CLA ; ... 9466 20114 1020 TAD PUSHAC2 ; restore the original AC contents 9467 20115 6203 CXF 0 ; call with IF = DF = 0 9468 20116 5421 JMP @DESTA ; and go to the code in field 0 9469 9470 20117 0000 PJ1F2: 0 ; call here with a JMS instruction 9471 20120 3020 DCA PUSHAC2 ; save the caller's AC for a minute 9472 20121 6221 CDF 2 9473 20122 1517 TAD @PJ1F2 ; then get caller's argument 9474 20123 3021 DCA DESTA ; that's the address of the routine to call 9475 20124 1117 TAD PJ1F2 ; now get caller's return address 9476 20125 7001 IAC ; and skip over the argument 9477 20126 6215 .PUSH ; put that on the stack 9478 20127 7200 CLA ; (PUSH doesn't clear the AC!) 9479 20130 1176 TAD [RET1F2] ; the field 1 routine will return to 9480 20131 6215 .PUSH ; ... 9481 20132 7200 CLA ; ... 9482 20133 1020 TAD PUSHAC2 ; restore the original AC contents 9483 20134 6213 CXF 1 ; call with IF = DF = 1 9484 20135 5421 JMP @DESTA ; and go to the code in field 1 9485 9486 ; This routine is identical to TASCIZ, except that the string is stored in 9487 ; field 2, rather than field 0... 9488 20136 3012 TASZF2: DCA MPTR ; save the pointer to the string 9489 20137 1412 TAD @MPTR ; and get the next character 9490 20140 7450 SNA ; is this the end of the string ?? 9491 20141 6225 .POPJ ; yes -- quit now 9492 20142 4100 JMS PJ0F2 9493 20143 7400 OUTCHR 9494 20144 5137 JMP TASZF2+1 ; and then loop until the end 9495 9496 20176 2514 20177 4400 9497 20200 .ORG 0200 9498 9499 ; The PDP2HEX program (which converts BIN files into ROM images in Intel 9500 ; HEX format) stores a checksum of ROM field 2 in location 20200. This is 9501 ; used by the POST and the VE (version) command. 9502 20200 ROMCK2: .BLOCK 1 9503 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 237 Persistent setting support (NVRAM) bts6120.plx 9504 .TITLE Persistent setting support (NVRAM) 9505 9506 9507 7700 RDPMLOC = 4032. ; 21*128*1.5 = first free byte in ramdisk 0 DAR 0 9508 ; note: maximum storage is (4096.-4032.-2)/2 words = 31. 9509 0136 RDPMS1 = 0136 ; signature 1 (byte) 9510 0266 RDPMS2 = 0266 ; signature 2 (byte) 9511 9512 20201 7200 RDPSS: CLA 9513 20202 6214 RDF 9514 20203 1377 TAD [CXF 0] 9515 20204 3240 DCA RDPSX 9516 9517 20205 1376 TAD [FIRSTPSS-1] ; set up an auto index register 9518 20206 3013 DCA AX1 ; ... to address the persistent vars 9519 9520 20207 6201 CDF 0 9521 20210 1775 TAD @[RAMBAS] 9522 20211 1374 TAD [RDPMLOC] ; 21*128*1.5 = first free byte in ramdisk field 9523 20212 3014 DCA AX2 ; auto-incr to address NVRAM 9524 9525 20213 6410 LDAR ; set DAR to 0 9526 9527 20214 6403 MM3 ; address the ramdisk memory 9528 ;CDF 0 ; 1st NVRAM 9529 20215 1414 TAD @AX2 ; are the two signature bytes there? 9530 20216 1373 TAD [-RDPMS1] 9531 20217 7640 SZA CLA 9532 20220 5240 JMP RDPSX ; no - exit 9533 20221 1414 TAD @AX2 9534 20222 1372 TAD [-RDPMS2] 9535 20223 7640 SZA CLA 9536 20224 5240 JMP RDPSX ; no - exit 9537 9538 20225 1414 TAD @AX2 ; get the number of words 9539 20226 7041 CIA ; make neg. counter for ISZ 9540 20227 3001 DCA MEA 9541 9542 20230 6403 RDPS0: MM3 9543 ;CDF 0 ; source field 9544 20231 1414 TAD @AX2 ; get the next byte 9545 20232 7002 BSW ; take it as the upper 6 bits 9546 20233 1414 TAD @AX2 ; add in the lower 6 bits 9547 20234 6402 MM2 9548 ;CDF 0 ; destination field 9549 20235 3413 DCA @AX1 ; and store it 9550 20236 2001 ISZ MEA 9551 20237 5230 JMP RDPS0 ; next 9552 9553 20240 0000 RDPSX: 0 9554 20241 6402 MM2 9555 20242 6225 .POPJ 9556 9557 20243 6214 WRPSS: RDF 9558 20244 1377 TAD [CXF 0] 9559 20245 3303 DCA WRPSX 9560 9561 20246 6201 CDF 0 9562 20247 1775 TAD @[RAMBAS] ; starting just after 1st RAM disk page 9563 20250 1374 TAD [RDPMLOC] ; 21*128*1.5 = first free byte in ramdisk field 9564 20251 3014 DCA AX2 ; auto-incr to address NVRAM 9565 9566 20252 1376 TAD [FIRSTPSS-1] ; set up an auto index register 9567 20253 3013 DCA AX1 ; ... to address the persistent vars 9568 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 238 Persistent setting support (NVRAM) bts6120.plx 9569 20254 6410 LDAR ; set DAR to 0 9570 9571 20255 6403 MM3 ; address the ramdisk memory 9572 ;CDF 0 9573 9574 20256 1371 TAD [RDPMS1] ; store the signature 9575 20257 3414 DCA @AX2 9576 20260 1370 TAD [RDPMS2] 9577 20261 3414 DCA @AX2 9578 9579 20262 1367 TAD [LASTPSS-FIRSTPSS] ; store the number of words written 9580 20263 3414 DCA @AX2 9581 9582 20264 1366 TAD [FIRSTPSS-LASTPSS] ; -number of words to write 9583 20265 3001 DCA MEA 9584 9585 20266 6402 WRPS0: MM2 9586 ;CDF 0 ; source field 9587 20267 1413 TAD @AX1 ; get a word 9588 20270 6403 MM3 9589 ;CDF 0 ; destination field 9590 20271 6215 .PUSH ; save it for splitting 9591 20272 7002 BSW 9592 20273 0365 AND [77] ; get the upper 6 bits in a byte 9593 20274 3414 DCA @AX2 ; save it 9594 20275 6235 .POP 9595 20276 0365 AND [77] ; get the lower 6 bits in a byte 9596 20277 3414 DCA @AX2 ; save it 9597 9598 20300 2001 ISZ MEA 9599 20301 5266 JMP WRPS0 ; next 9600 9601 20302 6402 MM2 9602 9603 20303 0000 WRPSX: 0 9604 20304 6225 .POPJ 9605 20365 0077 20366 7765 20367 0013 20370 0266 20371 0136 20372 7512 20373 7642 20374 7700 20375 0034 20376 0017 20377 6203 9606 20400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 239 Extension ROM management bts6120.plx 9607 .TITLE Extension ROM management 9608 9609 9610 ; check for an extension ROM in ramdisk memory at 100000000. 9611 ; The check looks for a signature of 'SB' 'C6' at the start, and a valid 9612 ; checksum. 9613 9614 20400 7200 EXTROM: CLA 9615 20401 6201 CDF 0 9616 20402 3777 DCA @[EXTFLG] ; initialize status to "no extension ROM" 9617 9618 ; Reset the console to the serial port just in case, before 9619 ; the extension ROM is loaded 9620 9621 20403 6412 PRISLU 9622 9623 ; If the extension ROM contains code that prevents the SBC from starting up, 9624 ; there needs to be a way to prevent from being called. So a check is made 9625 ; for an ESC character coming in the serial port, and loading is cancelled 9626 ; if it's found. 9627 9628 20404 6031 KSF ; is there a key in the UART buffer? 9629 20405 5212 JMP EXTRO2 ; no, skip check 9630 20406 6036 KRB ; fetch it 9631 20407 1376 TAD [-33] ; compare to ESC 9632 20410 7450 SNA 9633 20411 5277 JMP NOXROM ; was ESC - abort ROM check 9634 9635 ;*** This section of code downloads the first 4KB of the extension ROM 9636 ;*** into field 3 of RAM. For debugging purposes (using an EPROM emulator), 9637 ;*** or if no extension ROM is installed, this may be commented out so 9638 ;*** that what's currently in field 3 is left alone. Since the initial 9639 ;*** EPROM-to-RAM copy copied field 3, the effect is that field 3 of the 9640 ;*** EPROM is used as the extension ROM code. 9641 ;*** !!! important: also disable the memory check of field 3 !!! 9642 20412 7240 EXTRO2: NL7777 ; point the buffer to offset 0 9643 20413 6211 CDF 1 9644 20414 3775 DCA @[BUFPTR] ; ... 9645 20415 1374 TAD [CDF 3] ; of field 3 9646 20416 3773 DCA @[BUFCDF+1] ; ... 9647 20417 7240 NL7777 9648 20420 3772 DCA @[BUFPNL] ; of panel memory 9649 20421 1371 TAD [CDF 1] 9650 20422 3770 DCA @[RAMCDF+1] ; of RAM disk unit 1 (hopefully a ROM) 9651 20423 7240 NL7777 9652 20424 3767 DCA @[RAMPTR] ; beginning of the memory space 9653 20425 6410 LDAR ; and in the first chunk (DAR=0) 9654 20426 1366 TAD [-21.] ; and we'll do it 21 times, for a full 9655 20427 3002 DCA MIA ; field of 2688 words 9656 20430 4117 UNPLP: JMS PJ1F2 9657 20431 0442 UNPACK ; unpack RAM disk data to the buffer 9658 20432 2002 ISZ MIA 9659 20433 5230 JMP UNPLP 9660 ;*** to here 9661 9662 20434 7240 NL7777 9663 20435 3010 DCA SCAN ; check for the two word signature 9664 20436 6231 CDF 3 9665 20437 1410 TAD @SCAN 9666 20440 1365 TAD [-6342] ; 'SB' 9667 20441 7440 SZA 9668 20442 5277 JMP NOXROM ; nope, not there 9669 20443 1410 TAD @SCAN 9670 20444 1364 TAD [-4326] ; 'C6' 9671 20445 7440 SZA PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 240 Extension ROM management bts6120.plx 9672 20446 5277 JMP NOXROM ; nope, not there 9673 9674 ; so far so good... checksum it 9675 9676 20447 7240 NL7777 ; starting at beginning of field 9677 20450 3011 DCA ASCAN 9678 20451 1363 TAD [-2688.] ; check the whole downloaded code area 9679 20452 3002 DCA MIA 9680 20453 1411 XRCHECK: TAD @ASCAN ; accumulate checksum 9681 20454 2002 ISZ MIA ; done yet? 9682 20455 5253 JMP XRCHECK ; nope 9683 9684 20456 7450 SNA ; is the checksum 0000? 9685 20457 5262 JMP STARTXROM ; yes, continue the process 9686 9687 20460 7326 NL0002 9688 20461 5275 JMP XROMERR ; no, return error code 0002 9689 9690 ; the extension ROM is present, copied into field 3 and its checksum is valid. 9691 ; Let's call it! 9692 9693 0007 NUMXRARGS=7 ; number of parameters following 9694 9695 20462 STARTXROM: 9696 20462 1362 TAD [NUMXRARGS] 9697 20463 6221 CDF 2 9698 20464 6232 CIF 3 9699 20465 4410 JMS @SCAN 9700 ; parameters passed to Extension ROM entry 9701 20466 0321 VERSION ; BTS6120 ROM version 9702 20467 4310 F0VECTOR ; table of pointers in field 0 9703 20470 4777 F0PATCH-1 ; page that we can use in f0 if needed 9704 20471 2520 F1VECTOR ; table of pointers in field 1 9705 20472 2777 F1PATCH-1 ; page that we can use in f1 if needed 9706 20473 0503 F2VECTOR ; table of pointers in field 1 9707 20474 2577 F2PATCH-1 ; page that we can use in f1 if needed 9708 9709 ; and it returns here with AC=0 for no error, otherwise a code from 0003 up 9710 9711 20475 XROMERR: 9712 20475 6201 CDF 0 9713 20476 3777 DCA @[EXTFLG] ; save AC as status 9714 20477 6203 NOXROM: CXF 0 9715 20500 6225 .POPJ ; continue initialization process PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 241 Field 2 Vector Table bts6120.plx 9716 .TITLE Field 2 Vector Table 9717 9718 9719 20501 6233 RET2F3: CXF 3 ; return to field 3 9720 20502 6225 .POPJ ; the address is already on the stack 9721 9722 9723 ; variable and functions that we may want to access or hook in this field 9724 ; codes: I=instruction pointer, V=variable, H=hook (CIF n, JMP @.+1, V) 9725 ; Add only to the *end* of this list, please! 9726 ; n.b. JMS linkage functions generally cannot be used here 9727 20503 F2VECTOR: 9728 20503 0501 RET2F3 ; I utility - return to field 2 (must be first) 9729 20562 0007 20563 2600 20564 3452 20565 1436 20566 7753 20567 0010 20570 0754 20571 6211 20572 0053 20573 2222 20574 6231 20575 0011 20576 7745 20577 0033 9730 20600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 242 X / XP Commands -- Disassemble memory bts6120.plx 9731 .TITLE X / XP Commands -- Disassemble memory 9732 9733 9734 ; CMDX / CMDXP: the disassembler commands. They share an implementation, 9735 ; since the only difference between them is whether main or panel memory is 9736 ; read. 9737 9738 20600 7200 CMDX: CLA 9739 20601 1377 TAD [CPD] ; access main memory 9740 20602 5205 JMP XCOMM 9741 9742 20603 7200 CMDXP: CLA 9743 20604 1376 TAD [SPD] ; access panel memory 9744 20605 3006 XCOMM: DCA DPNL 9745 9746 20606 4100 JMS PJ0F2 ; get the next command character 9747 20607 4617 SPACMP 9748 9749 20610 7450 SNA ; is it an eol? 9750 20611 5270 JMP DFLTX ; yes, goto special handling 9751 9752 20612 4100 JMS PJ0F2 ; no, throw it back in 9753 20613 4647 BACKUP 9754 9755 20614 4100 JMS PJ0F2 9756 20615 6460 RANGE ; and try getting range from input buffer 9757 9758 20616 6201 DA1L: CDF 0 9759 20617 7300 CLA CLL ; for L/LP commands, assume DF=IF 9760 20620 1775 TAD @[ADRFLD] 9761 20621 7012 RTR 9762 20622 7010 RAR 9763 20623 6215 .PUSH ; save the field for later printing 9764 20624 1775 TAD @[ADRFLD] 9765 20625 3005 DCA IFDF ; the two lower digits of IFDF are the same 9766 9767 20626 1774 TAD @[ADDR] ; get the address from RANGE 9768 20627 3003 DCA XPC 9769 9770 20630 1775 TAD @[ADRFLD] ; get the field from RANGE and make a CDF 9771 20631 1373 TAD [CDF 0] 9772 20632 3235 DCA DAF ; self-modify for memory space and field 9773 20633 1006 TAD DPNL 9774 20634 3236 DCA DAP 9775 20635 0000 DAF: 0 9776 20636 0000 DAP: 0 9777 20637 1403 TAD @XPC ; get the code word at the current address 9778 20640 3004 DCA XIR 9779 20641 6201 CDF 0 9780 20642 6276 SPD 9781 9782 20643 6235 .POP ; get back the field number 9783 20644 6205 .PUSHJ DISA2 ; and disassemble the instruction 20645 5331 9784 9785 20646 6201 CDF 0 9786 20647 7200 CLA ; are we at the end of the range? 9787 20650 1775 TAD @[ADRFLD] ; get the field 9788 20651 7041 CIA ; negate the field 9789 20652 1772 TAD @[HGHFLD] ; compare to the high field 9790 20653 7640 SZA CLA 9791 20654 5262 JMP INCR ; no -- continue 9792 20655 1771 TAD @[HIGH] ; yes -- compare the addresses 9793 20656 7041 CIA ; 9794 20657 1774 TAD @[ADDR] ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 243 X / XP Commands -- Disassemble memory bts6120.plx 9795 20660 7650 SNA CLA ; are they equal ?? 9796 20661 5310 JMP XCMDDN ; yes -- stop 9797 9798 20662 2774 INCR: ISZ @[ADDR] ; increment address/field 9799 20663 7410 SKP 9800 20664 1370 TAD [10] 9801 20665 1775 TAD @[ADRFLD] 9802 20666 3775 DCA @[ADRFLD] 9803 20667 5216 JMP DA1L 9804 9805 20670 6201 DFLTX: CDF 0 9806 20671 7301 CLL CLA IAC ; AC=0001 L=0 9807 20672 1771 TAD @[HIGH] 9808 20673 3774 DCA @[ADDR] 9809 20674 7430 SZL 9810 20675 1370 TAD [10] 9811 20676 1772 TAD @[HGHFLD] 9812 20677 3775 DCA @[ADRFLD] 9813 20700 7315 CLL CLA IAC R3L ; AC=0010 L=0 9814 20701 1774 TAD @[ADDR] 9815 20702 3771 DCA @[HIGH] 9816 20703 7430 SZL 9817 20704 1370 TAD [10] 9818 20705 1775 TAD @[ADRFLD] 9819 20706 3772 DCA @[HGHFLD] 9820 20707 5216 JMP DA1L 9821 9822 20710 6203 XCMDDN: CXF 0 ; done, 9823 20711 6225 .POPJ ; return to monitor 9824 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 244 Disassemble Current Trace Location bts6120.plx 9825 .TITLE Disassemble Current Trace Location 9826 9827 9828 ; XTYPIR: prints a disassembly of the current trace location 9829 9830 20712 1767 XTYPIR: TAD @[UIRPC] ; get the current user environment 9831 20713 3003 DCA XPC ; into our local copies 9832 20714 1766 TAD @[UFLAGS] ; [RLA] UFLAGS is in field zero! 9833 20715 3005 DCA IFDF 9834 20716 1765 TAD @[UIR] 9835 20717 3004 DCA XIR 9836 20720 1377 TAD [CPD] ; a TR always happens in main memory (?) 9837 20721 3006 DCA DPNL 9838 9839 20722 1005 TAD IFDF ; get the IF for printing 9840 20723 7012 RTR 9841 20724 7010 RAR 9842 20725 6205 .PUSHJ DISA2 ; and print the line 20726 5331 9843 9844 20727 6203 CXF 0 ; return to TR 9845 20730 6225 .POPJ 9846 9847 ; DISA2: disassemble a line with all the trimmin's. Displays code address, 9848 ; instruction value, and decoded instruction. Enter with AC=field number. 9849 9850 20731 0365 DISA2: AND [7] ; turn field into ASCII 9851 20732 1364 TAD ["0"] 9852 20733 4100 JMS PJ0F2 ; and print it 9853 20734 7400 OUTCHR 9854 20735 1003 TAD XPC ; print the PC 9855 20736 4100 JMS PJ0F2 9856 20737 6322 TOCT4 9857 20740 1363 TAD [DS4MSG-1] ; say "/ " 9858 20741 6205 .PUSHJ TASZF2 20742 5136 9859 20743 1004 TAD XIR ; print the IR (instruction) 9860 20744 4100 JMS PJ0F2 9861 20745 6322 TOCT4 9862 20746 1362 TAD [DS5MSG-1] ; say "\t" 9863 20747 6205 .PUSHJ TASZF2 20750 5136 9864 20751 6221 CDF 2 9865 20752 5761 JMP @[DISA1] ; and print the disassembled line 9866 20761 1000 20762 2466 20763 2463 20764 0060 20765 0007 20766 0002 20767 0006 20770 0010 20771 0042 20772 0044 20773 6201 20774 0037 20775 0040 20776 6276 20777 6266 9867 21000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 245 Disassembler Top Level bts6120.plx 9868 .TITLE Disassembler Top Level 9869 9870 21000 7200 DISA1: CLA 9871 21001 3000 DCA MNEMP ; no mnemonics output yet 9872 9873 21002 1004 TAD XIR ; get instruction 9874 21003 7002 BSW 9875 21004 7012 RTR ; extract upper digit 9876 21005 0377 AND [16] 9877 21006 1376 TAD [OPJMP-1] ; and make into table ptr 9878 21007 3010 DCA SCAN 9879 9880 21010 1410 TAD @SCAN ; get pointer to mnemonic list for this group 9881 21011 3011 DCA ASCAN ; SCAN now points to post-mnemonic routine (-1) 9882 9883 21012 1004 TAD XIR ; do 1st mnemonic without sentinel check 9884 21013 0411 AND @ASCAN ; so that opcode 0000 works 9885 21014 5221 JMP MAT0B 9886 9887 21015 1004 AMTCH0: TAD XIR ; get instruction 9888 21016 0411 AND @ASCAN ; AND with mask 9889 21017 7450 SNA ; 0 mask at end of list 9890 21020 5252 JMP AMTCH8 ; no more possible matches 9891 21021 7041 MAT0B: CIA 9892 21022 1411 TAD @ASCAN ; compare masked IR with value 9893 21023 7450 SNA 9894 21024 5232 JMP AMTCH2 ; matched! 9895 9896 ; didn't match, skip over variable-length text to next entry 9897 21025 1411 AMTCH1: TAD @ASCAN ; because all strings are odd length 9898 21026 0375 AND [77] ; just look at the even character 9899 21027 7650 SNA CLA ; for termination symbol (00) 9900 21030 5215 JMP AMTCH0 ; yes, end of text, continue searching 9901 21031 5225 JMP AMTCH1 ; no, skip another word 9902 9903 ; did match, output the mnemonic and go back for more (for case of Operate) 9904 21032 1011 AMTCH2: TAD ASCAN ; save the location for later use in OPRGRP 9905 21033 3000 DCA MNEMP 9906 21034 1411 AMTCH3: TAD @ASCAN ; get the packed 6-bit 9907 21035 6215 .PUSH ; save a couple of copies for later use 9908 21036 6215 .PUSH 9909 21037 7002 BSW ; print the first char 9910 21040 6205 .PUSHJ TSIXB 21041 5262 9911 21042 6235 .POP ; print the second char 9912 21043 6205 .PUSHJ TSIXB 21044 5262 9913 21045 6235 .POP 9914 21046 0375 AND [77] ; was it a space? (n.b. space will have printed) 9915 21047 7640 SZA CLA 9916 21050 5234 JMP AMTCH3 ; no, print next two 9917 21051 5215 JMP AMTCH0 ; look for another mnemonic on this line 9918 9919 ; done with mnemonic part of line 9920 21052 1410 AMTCH8: TAD @SCAN ; call post-mnemonic routine for this group 9921 21053 3001 DCA MEA ; (Bad Things seem to happen when you .PUSHJ 9922 21054 6205 .PUSHJ @MEA ; indirect through an auto-increment location) 21055 5401 9923 21056 7200 CLA 9924 21057 4100 JMS PJ0F2 ; print newline 9925 21060 7104 CRLF 9926 21061 6225 .POPJ 9927 9928 21062 0375 TSIXB: AND [77] ; print a single 6bit character 9929 21063 1374 TAD [" "] PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 246 Disassembler Top Level bts6120.plx 9930 21064 4100 JMS PJ0F2 9931 21065 7400 OUTCHR 9932 21066 6225 .POPJ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 247 Disassemble EA For MRIs bts6120.plx 9933 .TITLE Disassemble EA For MRIs 9934 9935 9936 ; EAIGRP / EADGRP: post-mnemonic routines for memory reference instructions. 9937 ; prints the effective address (EA) and indirect data values. 9938 9939 21067 1005 EAIGRP: TAD IFDF ; for JMS/JMP, the final destination is in IF 9940 21070 5273 JMP EA2 9941 9942 21071 1005 EADGRP: TAD IFDF ; for AND/TAD/ISZ/DCA, the final value in DF 9943 21072 7114 CLL R3L 9944 21073 0373 EA2: AND [0070] 9945 21074 1372 TAD [CDF 0] ; make into a CDF 9946 21075 3771 DCA @[EA3D] 9947 9948 21076 1005 TAD IFDF ; The initial fetch is always from the IF field 9949 21077 0373 AND [0070] 9950 21100 1372 TAD [CDF 0] ; make into a CDF 9951 21101 3770 DCA @[EA3I] ; and modify the fetch code 9952 9953 21102 1006 TAD DPNL ; get the CPD/SPD and modify the fetch code 9954 21103 3767 DCA @[EA4] 9955 9956 21104 1004 TAD XIR ; get in-page offset from the instruction 9957 21105 0366 AND [177] 9958 21106 7421 MQL ; save it 9959 9960 21107 1004 TAD XIR ; get ZP bit from instruction into Link 9961 21110 7014 R3L 9962 21111 7006 RTL 9963 9964 21112 7200 CLA 9965 21113 1003 TAD XPC ; get current instruction page 9966 21114 0365 AND [7600] 9967 9968 21115 7420 SNL ; test ZP bit in instruction 9969 21116 7200 CLA ; if ZP=0, clear page, otherwise keep PC page 9970 21117 7501 MQA ; combine with offset from instruction 9971 9972 21120 3001 DCA MEA ; now have effective addr 9973 9974 21121 6205 .PUSHJ @[EA3I] ; get value at that address in IF field 21122 5770 9975 21123 3002 DCA MIA 9976 9977 21124 1004 TAD XIR ; get IA bit 9978 21125 7014 R3L 9979 21126 7004 RAL 9980 21127 7620 SNL CLA ; check if IA=0 (not indirect) 9981 21130 5344 JMP EA6 ; yes, do direct directly 9982 9983 21131 1364 TAD [DS2MSG-1] ; Say "@" 9984 21132 6205 .PUSHJ TASZF2 21133 5136 9985 21134 6205 .PUSHJ EA6 ; print " [value]" 21135 5344 9986 21136 1002 TAD MIA ; get double indirect value 9987 21137 3001 DCA MEA 9988 21140 6205 .PUSHJ @[EA3D] ; in correct field (IF if JMP/JMS, else DF) 21141 5771 9989 21142 3002 DCA MIA 9990 21143 5347 JMP EA7 ; print " [value]" and return 9991 9992 21144 1001 EA6: TAD MEA ; print the memory address 9993 21145 4100 JMS PJ0F2 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 248 Disassemble EA For MRIs bts6120.plx 9994 21146 6322 TOCT4 9995 21147 1363 EA7: TAD [DS1MSG-1] ; print the indirect (or double-indirect) 9996 21150 6205 .PUSHJ TASZF2 ; value, in format "\t[xxxx]" 21151 5136 9997 21152 1002 TAD MIA 9998 21153 4100 JMS PJ0F2 9999 21154 6322 TOCT4 10000 21155 1362 TAD [DS6MSG-1] 10001 21156 5136 JMP TASZF2 10002 21162 2470 21163 2454 21164 2457 21165 7600 21166 0177 21167 1227 21170 1224 21171 1226 21172 6201 21173 0070 21174 0040 21175 0077 21176 1377 21177 0016 10003 21200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 249 Disassemble OPR and IOT instructions bts6120.plx 10004 .TITLE Disassemble OPR and IOT instructions 10005 10006 10007 ; OPRGRP: called to finish up a mnemonic Operate instruction. 10008 ; It checks for instructions that have a parameter and also for unknown 10009 ; opcodes. 10010 10011 21200 7300 OPRGRP: CLA CLL 10012 21201 1000 TAD MNEMP ; get last mnemonic output 10013 21202 7450 SNA ; was there one? 10014 21203 5222 JMP NOMNEM ; no - print "?" and return 10015 21204 1377 TAD [-OP6NOCF] ; was it a CDF/CIF/CXF/PR? 10016 21205 7630 SZL CLA 10017 21206 6225 .POPJ ; no - return w/o printing anything 10018 21207 1004 TAD XIR ; get instruction 10019 21210 7012 RTR ; and extract and print field number 10020 21211 7010 RAR 10021 21212 0376 AND [7] 10022 21213 1375 TAD ["0"] 10023 21214 4100 JMS PJ0F2 10024 21215 7400 OUTCHR 10025 21216 6225 .POPJ 10026 10027 ; IOTGRP: called to finish up a mnemonic IOT instruction 10028 ; Since IOTs are hardware defined, we have only a small standard set 10029 ; of them in the tables; so we see if anything useful was printed and, 10030 ; if not, print a '?' 10031 10032 21217 1000 IOTGRP: TAD MNEMP ; any mnemonics output? 10033 21220 7640 SZA CLA 10034 21221 6225 .POPJ ; yes - return w/o printing anything 10035 21222 1374 NOMNEM: TAD [DS3MSG-1] ; Say "?" 10036 21223 5136 JMP TASZF2 10037 10038 ; EA3: fetch word @MEA in correct memory space and field 10039 ; part of EAxGRP, and modifiied by that code 10040 10041 21224 6201 EA3I: CDF 0 ; in field IF (modifed) 10042 21225 7410 SKP 10043 21226 6201 EA3D: CDF 0 ; in field DF (modified) 10044 21227 6266 EA4: CPD ; main or panel memory (modified) 10045 21230 1401 TAD @MEA ; get value at that address 10046 21231 6221 CDF 2 10047 21232 6276 SPD 10048 21233 6225 .POPJ 10049 10050 21374 2461 21375 0060 21376 0007 21377 6310 10051 21400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 250 Disassembler Tables (MRIs) bts6120.plx 10052 .TITLE Disassembler Tables (MRIs) 10053 10054 ; Opcode group tables. For each group (upper digit), this 10055 ; table has a mnemonic table pointer and a pointer to a function 10056 ; that prints the parameters (e.g. effective address for AND) 10057 10058 OPJMP: .DATA OP0-1, EADGRP, OP1-1, EADGRP 21400 1417 21401 1071 21402 1423 21403 1071 10059 .DATA OP2-1, EADGRP, OP3-1, EADGRP 21404 1427 21405 1071 21406 1433 21407 1071 10060 .DATA OP4-1, EAIGRP, OP5-1, EAIGRP 21410 1437 21411 1067 21412 1443 21413 1067 10061 .DATA OP6-1, OPRGRP, OP7-1, IOTGRP 21414 1447 21415 1200 21416 2147 21417 1217 10062 10063 ; Mnemonic table. Each entry consists of a mask, a match value, 10064 ; and a text string in sixbit. In order to detect the end of the 10065 ; string, it must be an odd number of characters long so that the 10066 ; last word is xx00. .TEXT could have been used, but 10067 ; it always emits a full word of 0000 and so would have taken more space. 10068 10069 ; the first 6 groups will always match, so no sentinels are necessary 10070 ; The Effective Address will be displayed for these 10071 OP0: .DATA 7000, 0000 21420 7000 21421 0000 10072 21422 .SIXBIT /AND/ 10073 OP1: .DATA 7000, 1000 21424 7000 21425 1000 10074 21426 .SIXBIT /TAD/ 10075 OP2: .DATA 7000, 2000 21430 7000 21431 2000 10076 21432 .SIXBIT /ISZ/ 10077 OP3: .DATA 7000, 3000 21434 7000 21435 3000 10078 21436 .SIXBIT /DCA/ 10079 OP4: .DATA 7000, 4000 21440 7000 21441 4000 10080 21442 .SIXBIT /JMS/ 10081 OP5: .DATA 7000, 5000 21444 7000 21445 5000 10082 21446 .SIXBIT /JMP/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 251 Disassembler Tables (IOTs) bts6120.plx 10083 .TITLE Disassembler Tables (IOTs) 10084 10085 21450 OP6: ; mnemonics from here to OP6NOCF will have their 3rd digit 10086 .DATA 7707, 6201 ; printed as the parameter 21450 7707 21451 6201 10087 21452 .SIXBIT /CDF/ 10088 .DATA 7707, 6202 21454 7707 21455 6202 10089 21456 .SIXBIT /CIF/ 10090 .DATA 7707, 6203 21460 7707 21461 6203 10091 21462 .SIXBIT /CXF/ 10092 .DATA 7747, 6206 21464 7747 21465 6206 10093 21466 .SIXBIT /PR / 10094 21470 OP6NOCF: 10095 .DATA 7777, 6214 21470 7777 21471 6214 10096 21472 .SIXBIT /RDF/ 10097 .DATA 7777, 6224 21474 7777 21475 6224 10098 21476 .SIXBIT /RIF/ 10099 .DATA 7777, 6234 21500 7777 21501 6234 10100 21502 .SIXBIT /RIB/ 10101 .DATA 7777, 6244 21504 7777 21505 6244 10102 21506 .SIXBIT /RMF/ 10103 .DATA 7777, 6246 21510 7777 21511 6246 10104 21512 .SIXBIT /WSR/ 10105 .DATA 7777, 6256 21514 7777 21515 6256 10106 21516 .SIXBIT /GCF/ 10107 .DATA 7777, 6266 21520 7777 21521 6266 10108 21522 .SIXBIT /CPD/ 10109 .DATA 7777, 6276 21524 7777 21525 6276 10110 21526 .SIXBIT /SPD/ 10111 .DATA 7777, 6205 21530 7777 21531 6205 10112 21532 .SIXBIT /PPC1 / 10113 .DATA 7777, 6245 21535 7777 21536 6245 10114 21537 .SIXBIT /PPC2 / 10115 .DATA 7777, 6215 21542 7777 21543 6215 10116 21544 .SIXBIT /PAC1 / 10117 .DATA 7777, 6255 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 252 Disassembler Tables (IOTs) bts6120.plx 21547 7777 21550 6255 10118 21551 .SIXBIT /PAC2 / 10119 .DATA 7777, 6225 21554 7777 21555 6225 10120 21556 .SIXBIT /RTN1 / 10121 .DATA 7777, 6265 21561 7777 21562 6265 10122 21563 .SIXBIT /RTN2 / 10123 .DATA 7777, 6235 21566 7777 21567 6235 10124 21570 .SIXBIT /POP1 / 10125 .DATA 7777, 6275 21573 7777 21574 6275 10126 21575 .SIXBIT /POP2 / 10127 .DATA 7777, 6207 21600 7777 21601 6207 10128 21602 .SIXBIT /RSP1 / 10129 .DATA 7777, 6227 21605 7777 21606 6227 10130 21607 .SIXBIT /RSP2 / 10131 .DATA 7777, 6217 21612 7777 21613 6217 10132 21614 .SIXBIT /LSP1 / 10133 .DATA 7777, 6237 21617 7777 21620 6237 10134 21621 .SIXBIT /LSP2 / 10135 ;;RLA .DATA 7777, 6207 10136 ;;RLA .SIXBIT /RSP1 / 10137 10138 .DATA 7777, 6000 21624 7777 21625 6000 10139 21626 .SIXBIT "SKON/PRS " 10140 .DATA 7777, 6001 21633 7777 21634 6001 10141 21635 .SIXBIT /ION/ 10142 .DATA 7777, 6002 21637 7777 21640 6002 10143 21641 .SIXBIT /IOF/ 10144 .DATA 7777, 6003 21643 7777 21644 6003 10145 21645 .SIXBIT "SRQ/PGO" 10146 .DATA 7777, 6004 21651 7777 21652 6004 10147 21653 .SIXBIT "GTF/PEX" 10148 .DATA 7777, 6005 21657 7777 21660 6005 10149 21661 .SIXBIT /RTF/ 10150 .DATA 7777, 6006 21663 7777 21664 6006 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 253 Disassembler Tables (IOTs) bts6120.plx 10151 21665 .SIXBIT /SGT/ 10152 .DATA 7777, 6007 21667 7777 21670 6007 10153 21671 .SIXBIT /CAF/ 10154 10155 ; console IOTs 10156 .DATA 7777, 6030 21673 7777 21674 6030 10157 21675 .SIXBIT /KCF/ 10158 .DATA 7777, 6031 21677 7777 21700 6031 10159 21701 .SIXBIT /KSF/ 10160 .DATA 7777, 6032 21703 7777 21704 6032 10161 21705 .SIXBIT /KCC/ 10162 .DATA 7777, 6034 21707 7777 21710 6034 10163 21711 .SIXBIT /KRS/ 10164 .DATA 7777, 6035 21713 7777 21714 6035 10165 21715 .SIXBIT /KIE/ 10166 .DATA 7777, 6036 21717 7777 21720 6036 10167 21721 .SIXBIT /KRB/ 10168 .DATA 7777, 6040 21723 7777 21724 6040 10169 21725 .SIXBIT /SPF/ 10170 .DATA 7777, 6041 21727 7777 21730 6041 10171 21731 .SIXBIT /TSF/ 10172 .DATA 7777, 6042 21733 7777 21734 6042 10173 21735 .SIXBIT /TCF/ 10174 .DATA 7777, 6044 21737 7777 21740 6044 10175 21741 .SIXBIT /TPC/ 10176 .DATA 7777, 6045 21743 7777 21744 6045 10177 21745 .SIXBIT /TSK/ 10178 .DATA 7777, 6046 21747 7777 21750 6046 10179 21751 .SIXBIT /TLS/ 10180 10181 ; SBC6120 IOTs (model 2 and model RC) .... 10182 .DATA 7777, PRPA 21753 7777 21754 6470 10183 21755 .SIXBIT /PRPA / 10184 .DATA 7777, PRPB 21760 7777 21761 6471 10185 21762 .SIXBIT /PRPB / PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 254 Disassembler Tables (IOTs) bts6120.plx 10186 .DATA 7777, PRPC 21765 7777 21766 6472 10187 21767 .SIXBIT /PRPC / 10188 .DATA 7777, PWPA 21772 7777 21773 6474 10189 21774 .SIXBIT /PWPA / 10190 .DATA 7777, PWPB 21777 7777 22000 6475 10191 22001 .SIXBIT /PWPB / 10192 .DATA 7777, PWPC 22004 7777 22005 6476 10193 22006 .SIXBIT /PWPV / 10194 .DATA 7777, PWCR 22011 7777 22012 6477 10195 22013 .SIXBIT /PWCR / 10196 .DATA 7777, MM0 22016 7777 22017 6400 10197 22020 .SIXBIT /MM0/ 10198 .DATA 7777, MM1 22022 7777 22023 6401 10199 22024 .SIXBIT /MM1/ 10200 .DATA 7777, MM2 22026 7777 22027 6402 10201 22030 .SIXBIT /MM2/ 10202 .DATA 7777, MM3 22032 7777 22033 6403 10203 22034 .SIXBIT /MM3/ 10204 .DATA 7777, LDAR 22036 7777 22037 6410 10205 22040 .SIXBIT /LDAR / 10206 .DATA 7777, 6411 22043 7777 22044 6411 10207 22045 .SIXBIT /SDASP/ 10208 .DATA 7777, PRISLU 22050 7777 22051 6412 10209 22052 .SIXBIT /PRISLU / 10210 .DATA 7777, 6413 22056 7777 22057 6413 10211 22060 .SIXBIT /SECSLU / 10212 .DATA 7777, SBBLO 22064 7777 22065 6415 10213 22066 .SIXBIT /SBBLO/ 10214 .DATA 7777, SBBLO2 22071 7777 22072 6436 10215 22073 .SIXBIT /SBBLO2 / 10216 .DATA 7777, CCPR 22077 7777 22100 6430 10217 22101 .SIXBIT /CCPR / 10218 .DATA 7777, SHSW PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 255 Disassembler Tables (IOTs) bts6120.plx 22104 7777 22105 6431 10219 22106 .SIXBIT /SHSW / 10220 .DATA 7777, SPLK 22111 7777 22112 6432 10221 22113 .SIXBIT /SPLK / 10222 .DATA 7777, SCPT 22116 7777 22117 6433 10223 22120 .SIXBIT /SCPT / 10224 .DATA 7777, RFNS 22123 7777 22124 6434 10225 22125 .SIXBIT /RFNS / 10226 .DATA 7777, RLOF 22130 7777 22131 6435 10227 22132 .SIXBIT /RLOF / 10228 .DATA 7777, RLON 22135 7777 22136 6437 10229 22137 .SIXBIT /RLON / 10230 .DATA 7770, POST 22142 7770 22143 6440 10231 22144 .SIXBIT /POST / 10232 10233 22147 0000 0 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 256 Disassembler Tables (OPRs) bts6120.plx 10234 .TITLE Disassembler Tables (OPRs) 10235 10236 22150 OP7: 10237 ; Group 1 10238 GRP1: .DATA 7600, 7200 22150 7600 22151 7200 10239 22152 .SIXBIT /CLA/ 10240 .DATA 7500, 7100 22154 7500 22155 7100 10241 22156 .SIXBIT /CLL/ 10242 .DATA 7440, 7040 22160 7440 22161 7040 10243 22162 .SIXBIT /CMA/ 10244 .DATA 7420, 7020 22164 7420 22165 7020 10245 22166 .SIXBIT /CML/ 10246 .DATA 7401, 7001 22170 7401 22171 7001 10247 22172 .SIXBIT /IAC/ 10248 .DATA 7416, 7002 22174 7416 22175 7002 10249 22176 .SIXBIT /BSW/ 10250 .DATA 7416, 7004 22200 7416 22201 7004 10251 22202 .SIXBIT /RAL/ 10252 .DATA 7416, 7006 22204 7416 22205 7006 10253 22206 .SIXBIT /RTL/ 10254 .DATA 7416, 7010 22210 7416 22211 7010 10255 22212 .SIXBIT /RAR/ 10256 .DATA 7416, 7012 22214 7416 22215 7012 10257 22216 .SIXBIT /RTR/ 10258 .DATA 7416, 7014 22220 7416 22221 7014 10259 22222 .SIXBIT /R3L/ 10260 .DATA 7777, 7000 22224 7777 22225 7000 10261 22226 .SIXBIT /NOP/ 10262 ; Group 1 composite 10263 .DATA 7777, 7240 22230 7777 22231 7240 10264 22232 .SIXBIT /(STA)/ 10265 .DATA 7777, 7041 22235 7777 22236 7041 10266 22237 .SIXBIT /(CIA)/ 10267 .DATA 7777, 7120 22242 7777 22243 7120 10268 22244 .SIXBIT /(STL)/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 257 Disassembler Tables (OPRs) bts6120.plx 10269 .DATA 7777, 7204 22247 7777 22250 7204 10270 22251 .SIXBIT /(GLK)/ 10271 .DATA 7777, 7300 22254 7777 22255 7300 10272 22256 .SIXBIT /(NL0000) / 10273 .DATA 7777, 7301 22263 7777 22264 7301 10274 22265 .SIXBIT /(NL0001) / 10275 .DATA 7777, 7326 22272 7777 22273 7326 10276 22274 .SIXBIT /(NL0002) / 10277 .DATA 7777, 7325 22301 7777 22302 7325 10278 22303 .SIXBIT /(NL0003) / 10279 .DATA 7777, 7307 22310 7777 22311 7307 10280 22312 .SIXBIT /(NL0004) / 10281 .DATA 7777, 7327 22317 7777 22320 7327 10282 22321 .SIXBIT /(NL0006) / 10283 .DATA 7777, 7340 22326 7777 22327 7340 10284 22330 .SIXBIT /(NLM1) / 10285 .DATA 7777, 7344 22334 7777 22335 7344 10286 22336 .SIXBIT /(NLM2) / 10287 .DATA 7777, 7346 22342 7777 22343 7346 10288 22344 .SIXBIT /(NLM3) / 10289 22350 GRP2: 10290 .DATA 7511, 7500 22350 7511 22351 7500 10291 22352 .SIXBIT /SMA/ 10292 .DATA 7451, 7440 22354 7451 22355 7440 10293 22356 .SIXBIT /SZA/ 10294 .DATA 7431, 7420 22360 7431 22361 7420 10295 22362 .SIXBIT /SNL/ 10296 .DATA 7511, 7510 22364 7511 22365 7510 10297 22366 .SIXBIT /SPA/ 10298 .DATA 7451, 7450 22370 7451 22371 7450 10299 22372 .SIXBIT /SNA/ 10300 .DATA 7431, 7430 22374 7431 22375 7430 10301 22376 .SIXBIT /SZL/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 258 Disassembler Tables (OPRs) bts6120.plx 10302 .DATA 7601, 7600 22400 7601 22401 7600 10303 22402 .SIXBIT /CLA/ 10304 .DATA 7405, 7404 22404 7405 22405 7404 10305 22406 .SIXBIT /OSR/ 10306 .DATA 7403, 7402 22410 7403 22411 7402 10307 22412 .SIXBIT /HLT/ 10308 .DATA 7777, 7400 22414 7777 22415 7400 10309 22416 .SIXBIT /NOP/ 10310 .DATA 7777, 7410 22420 7777 22421 7410 10311 22422 .SIXBIT /SKP/ 10312 22424 GRP3: 10313 .DATA 7601, 7601 22424 7601 22425 7601 10314 22426 .SIXBIT /CLA/ 10315 .DATA 7501, 7501 22430 7501 22431 7501 10316 22432 .SIXBIT /MQA/ 10317 .DATA 7421, 7421 22434 7421 22435 7421 10318 22436 .SIXBIT /MQL/ 10319 .DATA 7777, 7521 22440 7777 22441 7521 10320 22442 .SIXBIT /SWP/ 10321 .DATA 7777, 7621 22444 7777 22445 7621 10322 22446 .SIXBIT /CAM/ 10323 .DATA 7777, 7701 22450 7777 22451 7701 10324 22452 .SIXBIT /ACL/ 10325 10326 22454 0000 0 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 259 Disassembler Messages bts6120.plx 10327 .TITLE Disassembler Messages 10328 10329 ; Disassembler messages 10330 10331 22455 DS1MSG: .ASCIZ "\t[" 10332 22460 DS2MSG: .ASCIZ "@" 10333 22462 DS3MSG: .ASCIZ "?" 10334 22464 DS4MSG: .ASCIZ "/ " 10335 22467 DS5MSG: .ASCIZ "\t" 10336 22471 DS6MSG: .ASCIZ "]" 10337 10338 22600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 260 Free Space for Future Expansion! bts6120.plx 10339 .TITLE Free Space for Future Expansion! 10340 10341 ; space to put any patch code for this field 10342 22600 F2PATCH: 10343 10344 .END PALX - Program break is 22600 PALX - No errors detected PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 261 Memory Map bts6120.plx 00000/ 11111111 11110000 11111111 11111111 11111111 11111111 11111111 11111111 00100/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111110 00200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00300/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00500/ 11111111 11111111 11111111 11111111 00000001 11111111 11111111 11111111 00600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00700/ 11111111 11111111 11111111 11111111 11111111 11111000 00000111 11111111 01000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01100/ 11111111 11111111 11111111 11111111 11111111 11111110 11111111 11111111 01200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01300/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01111111 01400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01500/ 11111111 11111111 11111111 11111111 11111111 11000000 00000000 00011111 01600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01700/ 11111111 11111111 11111111 11111111 11111111 11111111 11110000 00011111 02000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 02100/ 11111111 11111111 11111111 11111111 11111111 11111111 11111100 01111111 02200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 02300/ 11111111 11111111 11111111 11111111 11111111 11111111 11110000 01111111 02400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 02500/ 11111111 11111111 11111111 11111111 11111111 11000000 00000001 11111111 02600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 02700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03100/ 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 03200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03300/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03500/ 11111111 11111111 11111111 11111111 11111111 11111111 11111001 11111111 03600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 262 Memory Map bts6120.plx 04000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 04100/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 04200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 04300/ 11111111 11111111 11111111 11111111 11111111 00000000 00011111 11111111 04400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 04500/ 11111111 11111111 11111111 11111111 11111111 11111111 11100000 01111111 04600/ 11111111 11111111 11111111 11111111 11111111 11100000 00000000 00000000 04700/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000011 05000/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 05100/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 05200/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 05300/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 05400/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 05500/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 05600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 05700/ 11111111 11111111 11111111 11111111 11111111 11111111 10011111 11111111 06000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 06100/ 11111111 11111111 11100000 00000000 00000000 00000000 00000000 00001111 06200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 06300/ 11111111 11111111 11111111 11111111 11111111 11111111 11000000 11111111 06400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 06500/ 11111111 11111111 11111111 11111111 11111111 11111100 00000000 11111111 06600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 06700/ 11111111 11111111 11111111 11111111 11111111 11111000 00000000 11111111 07000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 07100/ 11111111 11111111 11111111 11111111 11100000 00000000 11111111 11111111 07200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 07300/ 11111111 11111111 11111111 11111111 11111111 11111111 10111111 11111111 07400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 07500/ 11111111 11111111 11111111 11111111 11111111 11111110 01111111 11111111 07600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 07700/ 11111111 11111111 11111111 11111111 11111000 00000000 00011111 11111111 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 263 Memory Map bts6120.plx 10000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 10100/ 11111111 11111111 11111111 11111111 11111111 10001111 11111111 11111111 10200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 10300/ 11111111 11111111 11111111 11111111 11111000 00000011 11111111 11111111 10400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 10500/ 11111111 11111111 11111111 11111111 11111110 00000000 00111111 11111111 10600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 10700/ 11111111 11111111 11111111 11111111 11111111 11111101 11111111 11111111 11000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11100/ 11111111 11111111 11111111 11111111 10000000 01111111 11111111 11111111 11200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11300/ 11111111 11111111 11111111 11111111 11111000 00000000 11111111 11111111 11400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11500/ 11111111 11111111 11111111 11111111 10000000 11111111 11111111 11111111 11600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11700/ 11111111 11111111 11111111 11111111 11111111 11111110 00111111 11111111 12000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 12100/ 11111111 11111111 11111111 11111111 11111110 00001111 11111111 11111111 12200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 12300/ 11111111 11111111 11111111 11111111 11111111 11111100 00111111 11111111 12400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 12500/ 11111111 11111111 11111111 11111111 11110011 11111111 11111111 11111111 12600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 12700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 13000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 13100/ 11111111 11111111 11111111 11111111 11111111 11111001 11111111 11111111 13200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 13300/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 13400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 13500/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 13600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 13700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 264 Memory Map bts6120.plx 14000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 14100/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 14200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 14300/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 14400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 14500/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 14600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 14700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15100/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15300/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15500/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16100/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16300/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16500/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17100/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17300/ 11111111 11111111 11111111 11111111 11111111 11111111 10000000 00000000 17400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17500/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 265 Memory Map bts6120.plx 20000/ 11111110 11111000 11000000 00000000 00000000 00000000 00000000 00000000 20100/ 11111111 11111111 11111111 11111111 11111000 00000000 00000000 00000011 20200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 20300/ 11111000 00000000 00000000 00000000 00000000 00000000 00000111 11111111 20400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 20500/ 11110000 00000000 00000000 00000000 00000000 00000000 00111111 11111111 20600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 20700/ 11111111 11111111 11111111 11111111 11111111 11100000 01111111 11111111 21000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 21100/ 11111111 11111111 11111111 11111111 11111111 11111110 00111111 11111111 21200/ 11111111 11111111 11111111 11110000 00000000 00000000 00000000 00000000 21300/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00001111 21400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 21500/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 21600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 21700/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 22000/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 22100/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 22200/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 22300/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 22400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11100000 22500/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 22600/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 22700/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 23000/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 23100/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 23200/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 23300/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 23400/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 23500/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 23600/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 23700/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 266 Memory Map bts6120.plx 24000/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 24100/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 24200/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 24300/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 24400/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 24500/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 24600/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 24700/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 25000/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 25100/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 25200/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 25300/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 25400/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 25500/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 25600/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 25700/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 26000/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 26100/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 26200/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 26300/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 26400/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 26500/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 26600/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 26700/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 27000/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 27100/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 27200/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 27300/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 27400/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 27500/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 27600/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 27700/ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 267 Symbol Table bts6120.plx .ASCIZ -POP- 3037 10331 10332 10333 10334 10335 10336 .BLOCK -POP- 1291 1431 1432 1433 1434 1435 1436 1437 1438 1442 1443 1444 1445 1451 1452 1453 1454 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1481 1482 1483 1484 1485 1488 1489 1490 1491 1492 1495 1496 1499 1500 1501 1502 1505 1506 1507 1555 1556 1559 1562 1573 1577 1578 1579 1584 2193 2429 2430 3313 3361 3617 3618 3756 3836 3905 4024 4562 4563 5474 6012 6294 6298 6299 6300 6301 6305 6306 6307 6308 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6326 6327 6328 6329 6330 6331 6341 7480 7527 7795 7969 8044 8710 9412 9414 9421 9422 9423 9424 9425 9426 9427 9430 9431 9432 9433 9434 9438 9439 9502 .DATA -POP- 1459 1460 1463 1464 9293 9294 9295 9297 9298 9300 9301 9303 9304 9305 9308 9309 9312 9313 9314 9317 9318 9322 9323 9325 9326 9327 10058 10059 10060 10061 10071 10073 10075 10077 10079 10081 10086 10088 10090 10092 10095 10097 10099 10101 10103 10105 10107 10109 10111 10113 10115 10117 10119 10121 10123 10125 10127 10129 10131 10133 10138 10140 10142 10144 10146 10148 10150 10152 10156 10158 10160 10162 10164 10166 10168 10170 10172 10174 10176 10178 10182 10184 10186 10188 10190 10192 10194 10196 10198 10200 10202 10204 10206 10208 10210 10212 10214 10216 10218 10220 10222 10224 10226 10228 10230 10238 10240 10242 10244 10246 10248 10250 10252 10254 10256 10258 10260 10263 10265 10267 10269 10271 10273 10275 10277 10279 10281 10283 10285 10287 10290 10292 10294 10296 10298 10300 10302 10304 10306 10308 10310 10313 10315 10317 10319 10321 10323 .END -POP- 10344 .FIELD -POP- 1044 1285 6282 9418 .HM6120 -POP- 56 .NOWARN -POP- 58 .ORG -POP- 1430 1441 1447 1568 6085 6292 6297 6302 6336 9429 9436 9441 9497 .PAGE -POP- 1045 1268 1286 1415 1587 1721 1858 2019 2194 2352 2516 2690 2937 3163 3339 3494 3679 3841 4026 4173 4362 4572 4654 4661 4848 5041 5210 5386 5563 5731 5889 6082 6333 6596 6772 6971 7311 7482 7660 7862 8077 8273 8481 8712 9032 9411 9413 9419 9606 9730 9867 10003 10051 10338 .POP -POP- 5162 5926 5951 5972 5976 9594 9782 9911 9913 .POPJ -POP- 1688 1719 1768 1921 1966 2026 2036 2051 2132 2144 2157 2168 2181 2236 2340 2424 2461 2482 2507 2514 2543 2556 2607 2636 2662 2884 3025 3033 3096 3101 3109 3114 3143 3159 3253 3321 3389 3642 3767 4017 4128 4152 4171 4370 4373 4388 4535 4591 4596 4613 4628 4644 4652 4684 4699 4715 4722 4751 4778 4846 4860 4881 4897 4956 4964 5017 5035 5039 5082 5102 5113 5189 5281 5289 5297 5324 5334 5343 5351 5362 5367 5384 5401 5417 5427 5434 5518 5561 5602 5609 5638 5642 5655 5729 5785 5865 5903 5978 6027 6050 6058 6066 6070 6078 6080 6259 6436 6477 6487 6594 6648 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 268 Symbol Table bts6120.plx 6653 6706 6750 6770 6845 6868 6911 6932 6963 6997 7002 7192 7225 7231 7294 7309 7351 7355 7362 7383 7387 7394 7477 7516 7524 7550 7558 7658 7728 7792 7820 7849 7860 7883 7890 7957 7962 8075 8092 8111 8197 8271 8358 8431 8436 8439 8571 8865 8937 8963 8985 9491 9555 9604 9715 9720 9823 9845 9926 9932 10017 10025 10034 10048 .PUSH -POP- 4554 4557 5154 5922 5940 5961 9461 9464 9477 9480 9590 9763 9907 9908 .PUSHJ -POP- 1324 1365 1368 1371 1372 1375 1378 1396 1601 1606 1607 1608 1614 1619 1647 1649 1650 1701 1735 1737 1748 1751 1752 1753 1774 1775 1798 1799 1816 1817 1826 1837 1841 1845 1849 1852 1855 1884 1898 1899 1900 1901 1904 1909 1913 1917 1918 1919 1929 1930 1956 1957 1960 1962 1963 1964 1982 1985 1986 1987 1989 1998 1999 2000 2001 2011 2012 2060 2061 2062 2063 2064 2068 2076 2150 2151 2162 2163 2176 2177 2186 2188 2189 2190 2213 2216 2217 2221 2222 2223 2227 2228 2230 2231 2255 2258 2268 2271 2274 2283 2304 2316 2328 2331 2332 2333 2337 2338 2341 2371 2388 2392 2395 2405 2406 2411 2412 2415 2418 2440 2441 2452 2453 2491 2526 2529 2530 2537 2550 2573 2578 2581 2588 2616 2625 2628 2644 2654 2669 2680 2684 2687 2699 2721 2722 2739 2749 2815 2820 2821 2822 2823 2834 2846 2849 2901 2908 2909 3059 3062 3063 3064 3068 3073 3079 3082 3094 3099 3107 3112 3128 3129 3138 3139 3210 3213 3214 3223 3226 3227 3228 3247 3259 3328 3336 3396 3404 3409 3415 3430 3431 3442 3448 3462 3480 3489 3520 3526 3534 3557 3569 3586 3604 3613 3653 3707 3714 3726 3729 3730 3741 3744 3745 3749 3760 3775 3800 3807 3808 3824 3871 3872 3874 3875 3876 3887 3895 3940 3941 3956 3970 3983 3996 4005 4043 4044 4047 4048 4053 4060 4066 4067 4094 4107 4132 4147 4154 4160 4293 4398 4436 4508 4512 4581 4582 4583 4604 4621 4625 4635 4790 4791 4805 4806 4813 4828 4834 4840 4875 5083 5091 5103 5114 5125 5159 5184 5199 5203 5206 5207 5250 5251 5262 5264 5265 5278 5284 5292 5309 5310 5316 5321 5399 5402 5410 5411 5486 5510 5532 5553 5597 5620 5621 5626 5627 5650 5696 5710 5727 5783 5804 5816 5817 5819 5821 5822 5830 5831 5841 5842 5843 5859 5860 5874 5876 5879 5886 5925 5950 5962 6023 6024 6036 6045 6046 6183 6269 6271 6274 6276 6277 6278 6279 6375 6377 6396 6568 6569 6576 6581 6587 6589 6621 6624 6635 6638 7223 7229 7353 7356 7360 7385 7388 7392 7396 7596 7843 7858 7877 7909 7910 7955 8058 8071 8149 8159 8164 8174 8179 8237 8241 8245 8284 8344 8386 8387 8423 8426 9783 9842 9858 9863 9910 9912 9922 9974 9984 9985 9988 9996 .SIXBIT -POP- 9044 9046 9048 9050 9052 9054 9056 9058 9060 9062 9064 9066 9068 9070 9072 9074 9076 9078 9080 9082 9084 9086 9088 9090 9092 9094 9096 9098 9100 9102 9104 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 269 Symbol Table bts6120.plx 9106 9108 9110 9112 9114 9116 9118 9120 9122 9124 9126 9154 9156 9158 9160 9162 9169 9171 9173 9175 9177 9183 9185 10072 10074 10076 10078 10080 10082 10087 10089 10091 10093 10096 10098 10100 10102 10104 10106 10108 10110 10112 10114 10116 10118 10120 10122 10124 10126 10128 10130 10132 10134 10139 10141 10143 10145 10147 10149 10151 10153 10157 10159 10161 10163 10165 10167 10169 10171 10173 10175 10177 10179 10183 10185 10187 10189 10191 10193 10195 10197 10199 10201 10203 10205 10207 10209 10211 10213 10215 10217 10219 10221 10223 10225 10227 10229 10231 10239 10241 10243 10245 10247 10249 10251 10253 10255 10257 10259 10261 10264 10266 10268 10270 10272 10274 10276 10278 10280 10282 10284 10286 10288 10291 10293 10295 10297 10299 10301 10303 10305 10307 10309 10311 10314 10316 10318 10320 10322 10324 .STACK -POP- 57 .TEXT -POP- 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9205 9206 9207 9208 9209 9210 9213 9214 9215 9216 9219 9220 9221 9222 9223 9224 9225 9226 9229 9230 9231 9232 9233 9236 9237 9245 9246 9249 9250 9253 9254 9255 9256 9257 9258 9261 9262 9263 9264 9265 9268 9269 9270 9271 9274 9275 9276 9279 9280 9330 9331 9332 9333 9334 9335 9336 9337 9338 9341 9342 9343 9344 9345 9346 9349 9350 9351 9352 9353 9356 9357 9358 9359 9360 9361 9362 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9381 9382 9385 9386 9387 9388 9389 9390 9391 9392 9395 9396 9397 9398 9399 9400 9401 9402 9403 .TITLE -POP- 1 59 140 852 936 985 1022 1269 1416 1585 1638 1652 1689 1722 1739 1769 1821 1859 1932 1971 2005 2020 2053 2118 2195 2241 2290 2343 2353 2432 2483 2517 2557 2608 2637 2663 2691 2724 2801 2836 2885 2938 3009 3038 3115 3164 3195 3267 3340 3417 3454 3495 3619 3680 3777 3842 3906 4027 4174 4321 4363 4412 4465 4536 4573 4597 4655 4662 4700 4782 4849 4861 4898 4923 5007 5042 5116 5134 5164 5211 5253 5274 5298 5335 5387 5435 5475 5519 5564 5610 5643 5685 5732 5890 6013 6083 6283 6334 6411 6437 6479 6488 6550 6597 6613 6654 6707 6751 6773 6854 6912 6972 7003 7084 7148 7193 7295 7312 7330 7405 7429 7483 7529 7559 7661 7729 7797 7822 7863 7892 7971 8011 8046 8078 8096 8126 8199 8274 8321 8359 8432 8460 8482 8713 8796 8866 8938 8986 9033 9149 9189 9281 9405 9415 9442 9504 9607 9716 9731 9825 9868 9933 10004 10052 10083 10234 10327 10339 .VECTOR -POP- 6098 ACDISP 06073 4974 4990* ACL 7701 4749 4762 8293 9018 9021 ACNAME 13713 2083 2933 9219* ADDR 00037 1467* 1891 1905 2152 2165 2319 2374 2446 2449 2498 2534 2541 2542 2577 2601 2622 2650 2676 3544 3587 3593 4057 4075 4094 4354 4830 5263 5280 5285 5293 5318 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 270 Symbol Table bts6120.plx 5342 5365 5374 5377 9767 9794 9798 9808 9814 ADRFLD 00040 1468* 2127 2320 2375 2448 2503 2605 2624 2652 2674 2826 2829 3545 3603 4355 4833 5261 5287 5295 5320 5344 5350 5358 5380 5383 5596 5608 9760 9764 9770 9787 9801 9802 9812 9818 ADRPMM 12426 8288 8308* ADRRMD 12410 8291* ALPHA 06627 5402 5411 5422* ALPHA1 06635 5425 5430* AMTCH0 21015 9887* 9900 9917 AMTCH1 21025 9897* 9901 AMTCH2 21032 9894 9904* AMTCH3 21034 9906* 9916 AMTCH8 21052 9890 9920* AND 0000 1134 1259 1890 1893 1906 2040 2043 2128 2400 2407 2673 3029 3216 3333 3401 3550 3560 3564 3580 3598 3602 3890 3993 4103 4717 4741 4745 4799 4802 4832 4856 4893 4918 5029 5066 5071 5079 5131 5183 5272 5349 5548 5588 5595 5607 5652 6025 6206 6273 6402 6428 6574 6677 6680 6692 6698 6735 6740 6821 6828 6942 7250 7253 7282 7288 7448 7453 7512 7545 7608 7622 7697 7759 7762 7917 8036 8061 8065 8152 8167 8296 8311 8406 8524 8543 8605 8625 8626 8628 8633 8661 8911 8923 8933 9023 9592 9595 9850 9876 9884 9888 9898 9914 9928 9944 9949 9957 9966 10021 ARGPTR 10051 6327* 6424 6433 ASCAN 20011 9431* 9677 9680 9881 9884 9888 9892 9897 9904 9906 AX1 20013 9433* 9518 9549 9567 9587 AX2 20014 9434* 9523 9529 9533 9538 9544 9546 9564 9575 9577 9580 9593 9596 BACKS1 07141 5724 5728* BACKUP 04647 1527 4342 4649* 9753 BADFLR 04240 4216 4247 4257 4265* BADFUN 0237 6443* 6461 6462 6463 6464 6465 6466 8090 BADIDE 04532 4507 4517* BANKSZ 0025 6544* 6882 6891 BATTOK 10033 4448 6316* 6769 6800 6841 6851 9027 BFAMSG 14275 4458 9265* BINCH1 03323 3556 3559 3576 3579 3617* BINCH2 03324 3558 3563 3577 3618* BINLO1 03203 3524* 3529 3614 BINLO2 03205 3526* 3531 BINLO3 03214 3534* 3537 BINLO5 03227 3548* 3589 3594 3606 BINLO6 03276 3582 3592* BINLO7 03301 3552 3597* BINLO8 03314 3574 3600 3609* BLIST 01674 2440* 9071 BLIST1 01701 2445* 2456 BLIST2 01715 2451 2455* BLOWR1 06117 5019 5034* BLOWR2 06121 5031 5038* BLOWRN 06104 5015* BLTIME 00036 1464* 5026 5028 BMOVE 01400 2213* 9061 BNAMES 13376 3067 9183* BOKMSG 14263 4455 9264* BOOKEY 02421 3018 3037* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 271 Symbol Table bts6120.plx BOOT 02426 3059* 9111 BOOT1 02452 3061 3079* 4876 BOOTGO 02445 3073* 3081 3084 BOOTS 00412 1604* 1633 BOOTS0 00416 1607* 1610 BOOTS1 00425 1614* 1627 1637 BOOTS2 00435 1617 1622* BPT 6236 898* 2627 6220 6223 BPTADR 00201 1577* 1580 2473 BPTCL2 02030 2551* 2555 BPTCLR 02026 2012 2528 2550* BPTCO1 02054 2583 2588* BPTCO2 02056 2589* 2594 BPTCO3 02066 2592 2599* BPTCOM 02036 2573* 9073 BPTDAT 00221 1579* 2477 BPTEND 0210 1580* BPTFLD 00211 1578* 2475 BPTFN1 01741 2494* 2512 BPTFN2 01757 2496 2500 2510* BPTFN3 01760 2505 2511* BPTFND 01737 2491* 2537 2581 BPTIN1 02101 2619* 2635 BPTIN2 02116 2621 2632* BPTIN3 02120 2629 2634* BPTINS 02077 2616* 2749 BPTMSG 13547 6233 9205* BPTRM1 02125 2647* 2661 BPTRM2 02137 2649 2658* BPTRM3 02141 2655 2660* BPTRMV 02123 2644* 6278 BPTTRP 07705 6222 6232* BREMO1 02024 2539 2546* BREMOV 02000 2526* 9075 BRKMSG 13604 6193 9207* BSETUP 01724 2441 2472* 2491 2550 2588 2616 2644 BSW 7002 934 3561 4317 5067 5072 5124 5406 5606 6690 6736 6892 7446 7695 7763 8068 8294 8544 8909 8931 9545 9591 9874 9909 BTIDA0 02500 3082 3105* 9186 BTSTR1 07646 4358 6182 6189* BTSTRP 07636 6150 6168* BTSWCN 00062 1490* 4671 4761 4873 4880 BTVMA0 02464 3079 3092* 9184 BUFCDF 12221 6606 6688 6718 7320 7687 7753 8063 8106 8118* 8124 8456 8955 8972 9646 BUFPNL 10053 6329* 6607 7321 8074 8110 8121 8457 9648 BUFPTR 10011 6299* 6604 6694 6700 6719 6721 7235 7251 7254 7318 7690 7766 8073 8104 8455 8957 8973 9644 BUFSIZ 10054 6330* 7343 7363 7375 7395 7680 7706 7746 7772 8507 8566 BUFTMP 11712 7691 7692 7694 7760 7765 7795* CAF 6007 2863 4896 CAM 7621 3548 CCFMSG 14041 4064 9236* CCPR 6430 883* 2781 4679 4957 10216 CDF 6201 1133 1136 1169 1182 1241 1842 1844 1846 1848 2129 2156 2167 3170 3189 3288 3298 3306 3322 3326 3351 3354 3371 3384 3390 3394 3408 3412 3414 3432 3434 3463 3465 3474 3477 3483 3486 3715 3722 3731 3736 3761 3764 3770 3809 3814 3825 3831 3868 3870 3879 3881 3985 3990 4077 4079 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 272 Symbol Table bts6120.plx 4085 4087 4097 4104 4111 4120 4122 4138 4140 4157 4159 4166 4170 4226 4266 4289 4309 4447 4449 4502 4505 4845 4857 5055 5080 5109 5111 5245 5247 5454 5470 6216 6393 6395 6397 6422 6429 6435 6605 6685 6702 6746 6795 6797 6813 6824 6826 6897 6899 6943 7164 7166 7319 7322 7324 7629 7723 7789 7814 7816 7854 7856 7887 7889 7920 7922 8062 8105 8153 8168 8195 8269 8297 8312 8345 8354 8397 8399 8417 8474 8841 8851 8924 8959 8981 9015 9028 9456 9472 9520 9561 9615 9643 9645 9649 9664 9697 9712 9758 9771 9779 9785 9805 9864 9945 9950 10041 10043 10046 CE1MSG 3774 4055 9241* CEEMSG 4012 9242* CFIELD 01301 2126* 2150 2162 CHBEL 0007 903* 5669 CHBSP 0010 904* 5726 5835 5847 CHCRT 0015 907* 5695 5847 5850 CHCTC 0003 902* 6030 6035 6040 CHCTO 0017 908* 6040 6044 6053 CHCTR 0022 910* 5811 5815 5826 CHCTU 0025 912* 5826 5829 5835 CHDEL 0177 914* CHESC 0033 913* 5853 5858 5915 5927 CHKCFC 12200 3186 8088* CHKERA 12621 8533* 8538 8597 8598 CHKHL1 06042 4916 4921* CHKHLT 06031 2744 2761 4912* 4921 4922 CHKID1 02620 3188 3193* CHKIDE 02607 1708 3157 3184* 3193 3194 CHKRAM 02600 1704 3169* 3174 3175 CHKRC 12534 6627 6641 6788 6871 7589 8472* 8478 8479 CHKSUM 00050 1476* 2260 2263 2267 2269 2270 2280 2288 3542 3575 3578 3611 3612 3865 3884 3885 3900 3936 3988 3989 4008 4133 4150 CHLFD 0012 906* 5715 5850 5853 CHNUL 0000 901* CHTAB 0011 905* 1667 1669 1670 5909 5915 CHXOF 0023 911* 6053 6061 CHXON 0021 909* 6061 6069 CIA 7041 1251 2178 2401 2497 2502 3026 3373 3610 3747 3958 3972 4007 4149 4244 4254 4260 4279 4718 5364 5460 5705 5946 6957 8069 8180 8246 8659 9019 9539 9788 9793 9891 CIF 6202 1323 1787 2015 2096 3236 3676 4281 4284 7857 8705 9698 CK1221 13131 1228 9011* 9030 CKBOO1 02404 3022* 3034 CKBOOT 02400 3018* 3094 3107 CKMEM 01442 2255* 9063 CKMEM1 01452 2263* 2275 CKSMSG 13404 2287 9192* CLA 7200 917 918 919 920 921 922 923 924 926 928 930 931 932 933 934 935 1054 1065 1122 1170 1175 1297 1313 1332 1598 1604 1609 1616 1626 1645 1660 1713 1734 1749 1766 1830 1880 1907 1923 1952 1968 1983 2059 2126 2139 2142 2180 2224 2281 2317 2329 2386 2390 2409 2423 2450 2460 2472 2499 2504 2527 2582 2591 2783 2816 2875 2906 2914 2928 3032 3060 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 273 Symbol Table bts6120.plx 3131 3140 3173 3187 3192 3211 3217 3224 3251 3286 3318 3334 3375 3380 3402 3468 3528 3551 3573 3581 3599 3633 3640 3727 3742 3818 3891 3898 3942 3946 3960 3968 3974 3978 3994 3997 4009 4012 4068 4105 4215 4246 4256 4262 4294 4385 4387 4402 4439 4452 4488 4490 4500 4555 4558 4585 4607 4610 4626 4639 4642 4669 4683 4714 4721 4776 4843 4854 4913 4915 4920 4963 4966 4985 4990 4995 5005 5016 5030 5089 5155 5260 5312 5323 5341 5357 5361 5366 5371 5397 5462 5483 5493 5514 5516 5529 5539 5557 5559 5586 5592 5598 5601 5637 5641 5653 5658 5663 5668 5673 5678 5694 5707 5728 5795 5801 5839 5854 5869 5872 5923 5942 5948 5963 5965 5968 5977 6002 6076 6256 6258 6382 6421 6475 6577 6582 6585 6593 6647 6665 6713 6768 6787 6798 6822 6830 6864 6867 6906 6928 6931 6961 6996 7162 7167 7191 7293 7307 7348 7350 7380 7382 7414 7424 7441 7515 7523 7548 7609 7623 7634 7651 7655 7727 7791 7806 7819 7848 7859 7882 7928 8026 8088 8091 8120 8122 8196 8228 8270 8356 8400 8407 8424 8430 8473 8477 8525 8530 8535 8569 8629 8637 8662 8853 8901 8914 8947 8969 9024 9462 9465 9478 9481 9512 9531 9535 9614 9738 9742 9759 9786 9790 9795 9806 9813 9870 9899 9915 9923 9964 9969 9980 10011 10016 10033 CLL 7100 919 920 921 922 923 924 926 931 2264 2513 2827 2828 3022 3100 3113 3294 3367 4913 5005 5068 5073 5145 5176 5333 5341 5357 5498 5501 5502 5637 6380 6475 6647 6691 6696 6697 6705 6737 6741 6742 6749 6768 6864 6881 6895 6910 6928 6937 6941 6960 6994 7191 7293 7307 7350 7382 7508 7523 7541 7727 7764 7791 7819 7846 7859 7879 8150 8165 8196 8270 8285 8355 8430 8545 8569 8936 8962 8984 9759 9806 9813 9943 10011 CLRCOM 02300 2846* 9095 CLRCPU 02312 2011 2823 2834 2849 2875* 3073 CLRDRD 0006 7110* 7255 7268 7767 7781 8038 CLRDRE 0012 7114* 7178 CLRDWR 0010 7112* 7701 7715 8002 CMA 7040 921 923 924 926 928 1072 1315 3302 3332 3400 4102 4680 4744 5359 5364 5946 6048 6820 7191 7350 7382 7523 8530 8624 8852 CMDBUF 00231 1584* 1648 5774 5820 5862 CMDEDD 0220 7142* CMDIDD 0354 7143* 7226 CMDLEN 00143 1555* 5776 5799 5807 5838 5871 5881 5882 CMDRDS 0040 7144* 7357 CMDSDN 0340 7147* 7425 CMDSUP 0341 7146* 7415 CMDTBL 13200 1618 8449 9043* CMDWRS 0060 7145* 7389 CMDX 20600 2347 9738* CMDXP 20603 2350 9742* CMEM 01507 2316* 9067 CMEM0 01512 2306 2318* CMEM1 01534 2330 2336* 2342 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 274 Symbol Table bts6120.plx CML 7020 919 920 922 3294 3367 5322 5347 5359 5432 6647 6962 7191 7350 7382 7514 7523 7547 8357 COMERR 00453 1538 1645* 4349 9132 9134 9136 9138 9140 9142 9144 9146 9148 9165 9180 9188 CONCHR 07476 5994 6000 6012* CONF1 07027 5621* 5623 CONF2 07052 5633 5636 5641* CONFRM 07025 3139 4067 4293 5620* CONGE1 03330 3638* 3649 3651 CONGE2 03335 3639 3647* CONGET 03325 3526 3534 3557 3569 3604 3633* CONIN 07552 4335 6024 6076* CONLOD 03200 3520* 9097 CONOU1 07465 5998* 6008 CONOU2 07467 6000* 6009 CONOU3 07473 5999 6007* CONOUT 07463 4334 5973 5994* CONT 02216 2723 2744* 2831 2835 3076 4772 CONT1 02227 2714 2752 2777* 6184 CONT2 02225 2761* 6406 CONTCM 02214 2739* 9077 COUNT 00071 1501* 2226 2234 2398 2414 2422 2455 2480 2511 2554 2593 2634 2660 2920 2923 2927 3220 3231 3246 3248 3249 3258 3262 3295 3304 3368 3382 3525 3530 3862 3873 3888 3889 3896 3933 3944 3973 3991 3992 4165 4168 CP1MSG 14060 4073 9237* CP2MSG 4005 4113 9238* CPANEL 01310 2139* 2151 2163 CPBOOT 07600 6098 6099* CPD 6266 1200 1208 2143 3027 4694 4814 4841 6210 6432 8123 8155 8157 8170 8172 8314 8316 9739 9836 10044 CPSAVE 07602 1361 6116* CPYDST 0043 1509* 4050 4065 4119 4137 CPYSRC 0042 1508* 4046 4084 CRLF 07104 1522 4339 5694* 9925 CRLF1 07127 5704 5708 5715* CS1FX 0100 7120* 7122 7123 7124 7125 7126 7127 7128 7129 7130 CS3FX 0200 7121* CTRLO 00053 1481* 5778 5788 5964 6033 6047 6049 CXF 6203 1233 1265 1295 2346 2349 3172 3191 4369 4372 4560 6099 6134 6224 6227 6405 6409 6486 8435 8438 8476 8699 9467 9483 9514 9558 9714 9719 9822 9844 DA1L 20616 9758* 9803 9820 DAC 01200 2024* 9170 DAF 20635 9772 9775* DANDV 01342 1536 2174* DAP 20636 9774 9776* DBCHKS 04155 4132 4147 4162* DCA 3000 1067 1069 1081 1083 1085 1087 1089 1091 1123 1127 1135 1171 1181 1199 1201 1242 1244 1246 1249 1316 1362 1611 1623 1634 1636 1646 1686 1760 1764 1767 1786 1810 1819 1881 1891 1895 1953 2009 2010 2025 2030 2035 2045 2074 2130 2153 2161 2165 2174 2218 2226 2259 2260 2267 2270 2318 2319 2320 2322 2324 2325 2373 2374 2375 2377 2379 2381 2382 2394 2398 2402 2414 2442 2446 2448 2474 2476 2478 2480 2481 2534 2541 2542 2551 2552 2553 2577 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 275 Symbol Table bts6120.plx 2600 2602 2604 2606 2622 2624 2626 2650 2652 2674 2676 2678 2679 2681 2713 2750 2778 2825 2830 2876 2877 2878 2879 2880 2881 2883 2903 2904 2920 2924 3019 3021 3075 3136 3220 3233 3235 3246 3264 3287 3289 3290 3295 3297 3300 3303 3327 3352 3353 3368 3370 3395 3433 3436 3439 3441 3445 3447 3464 3471 3476 3479 3485 3488 3521 3525 3539 3542 3544 3545 3556 3558 3566 3570 3578 3593 3603 3605 3612 3635 3662 3664 3666 3669 3701 3703 3709 3711 3717 3719 3720 3721 3723 3733 3735 3738 3748 3771 3794 3796 3802 3804 3811 3813 3819 3820 3826 3828 3830 3861 3862 3864 3865 3882 3885 3930 3932 3933 3935 3936 3965 3986 3989 4046 4050 4057 4075 4078 4086 4121 4133 4139 4163 4165 4232 4238 4277 4300 4302 4307 4503 4549 4551 4651 4670 4671 4672 4681 4696 4742 4748 4761 4789 4804 4816 4830 4833 4858 4880 4888 4889 4890 4891 4894 4895 5050 5052 5061 5064 5099 5108 5122 5140 5141 5170 5172 5178 5181 5194 5243 5280 5286 5288 5294 5296 5318 5320 5330 5332 5350 5375 5377 5381 5383 5398 5407 5416 5453 5469 5484 5485 5499 5506 5530 5531 5544 5551 5596 5608 5624 5697 5709 5712 5725 5773 5775 5776 5777 5778 5786 5787 5788 5789 5806 5814 5861 5863 5882 5994 5995 6033 6034 6043 6049 6057 6064 6065 6116 6118 6120 6122 6124 6137 6204 6208 6212 6214 6378 6386 6388 6398 6400 6404 6424 6430 6570 6575 6604 6606 6607 6608 6609 6667 6678 6681 6683 6694 6700 6715 6720 6722 6731 6733 6738 6744 6800 6815 6817 6825 6841 6843 6851 6879 6893 6900 6944 6955 6958 6992 7000 7163 7235 7237 7251 7254 7263 7283 7290 7318 7320 7321 7325 7326 7343 7375 7449 7504 7505 7576 7580 7582 7583 7602 7604 7618 7630 7646 7680 7682 7691 7746 7748 7760 7766 7808 7810 7815 7842 7844 7852 7855 7878 7886 7911 7919 7923 7931 7988 8037 8059 8063 8070 8073 8074 8094 8104 8106 8108 8110 8154 8158 8161 8169 8173 8176 8181 8189 8231 8235 8239 8243 8247 8262 8283 8298 8300 8302 8313 8317 8319 8346 8348 8394 8418 8420 8507 8531 8532 8546 8549 8555 8558 8595 8603 8622 8690 8692 8694 8696 8698 8830 8832 8845 8847 8858 8861 8904 8925 8935 8949 8953 8957 8971 8974 8979 9020 9027 9455 9458 9471 9474 9488 9515 9518 9523 9540 9549 9559 9564 9567 9575 9577 9580 9583 9593 9596 9616 9644 9646 9648 9650 9652 9655 9663 9677 9679 9713 9744 9765 9768 9772 9774 9778 9802 9808 9812 9815 9819 9831 9833 9835 9837 9871 9878 9881 9905 9921 9946 9951 9954 9972 9975 9987 9989 DDBUF 03600 3760 3861* DDBUF2 03605 3868* 3899 DDBUF3 03623 3879* 3892 DDCNT 03652 3861 3897 3905* 3930 3945 DDDUMP 03405 3707* 9099 DDUMP1 03463 3728 3743 3752* 3766 DECNW 06662 1752 1774 1798 1816 4581 5483* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 276 Symbol Table bts6120.plx DECNW1 06667 5489* 5511 DECNW2 06713 5491 5494 5514* DERCKS 03766 4010 4020* DESTA 20021 9439* 9458 9468 9474 9484 DFLTX 20670 9750 9805* DFRMAT 03076 3430* 9107 DIGITS 00072 1502* 5052 5056 5061 5141 5149 5156 5172 5187 5485 5509 5515 5531 5552 5558 5599 DIOERR 03504 3315 3363 3758 3770* 3838 4092 4127 4145 DISA1 21000 9865 9870* DISA2 20731 9783 9842 9850* DISASM 01546 2346* 9121 DISASMP 01550 2349* 9123 DISKID 11047 4499 7223* DISKIO 12060 7931 7955 7966 7969* DISKRD 11214 3446 3708 4090 4143 7328 7340* 7929 8450 DISKRW 12017 6449 7909* DISKWR 11244 3440 3801 4125 7372* 7929 7930 8451 DKPART 10020 3433 3717 3813 4086 4121 4139 6305* 7325 7450 7457 7808 7813 7817 7842 7853 7923 8453 DKRBN 10021 1542 6306* 7326 7442 7445 7911 7958 8454 8509 8523 8542 DKRW0 12024 7916* DKRW1 12041 7951* 7961 DKRW2 12056 7953 7965* DKSIZE 10022 3190 4504 6307* 7163 7283 7289 7290 7308 7347 7379 8458 DKUNIT 10023 6308* 7844 7845 7850 7878 7881 7884 DLLOAD 03520 3800* 9103 DLOAD 03526 3797 3807* DLOAD1 03543 3823* 3839 4303 DMEM 01067 1952* 9053 DMEM1 01075 1960* 1970 DMQ 01206 2034* 9174 DNAMES 13362 2002 9169* DPC 01203 2029* 9172 DPMEM 01065 1949* 9055 DPNL 20006 9427* 9744 9773 9837 9953 DPS 01211 2039* 9176 DRD1 11225 7349 7353* DREG 01132 1998* 9059 DRVERR 11442 7510 7543 7555* DS1MSG 22455 9995 10331* DS2MSG 22460 9983 10332* DS3MSG 22462 10035 10333* DS4MSG 22464 9857 10334* DS5MSG 22467 9862 10335* DS6MSG 22471 10000 10336* DSKBUF 17400 3296 3369 3863 3931 4162 4503 4511 7234 7279 7284 8103 8548 9412* DSR 01221 2049* 9178 DSTCDF 12275 8169 8187* DSTDAR 0025 8226* 8235 8259 DSTSPD 12276 8173 8188* DWR1 11255 7381 7385* EA2 21073 9940 9944* EA3D 21226 9946 9988 10043* EA3I 21224 9951 9974 10041* EA4 21227 9954 10044* EA6 21144 9981 9985 9992* EA7 21147 9990 9995* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 277 Symbol Table bts6120.plx EADGRP 21071 9942* 10058 10059 EAIGRP 21067 9939* 10060 EMEM 01002 1880* 9049 EMEM0 01004 1884* 1925 EMEM1 01017 1898* 1910 EMEM2 01021 1899* 1908 EMEM3 01044 1903 1917* ENAMES 13346 1988 9154* EOLNXT 04630 1529 4344 4621* EOLTST 04632 1528 4343 4625* EONE 01042 1886 1913* EPMEM 01000 1877* 9051 ERABLK 12657 8536 8587* EREG 01114 1982* 9057 ERF1K 12674 8588 8602* ERF3K 12672 8561 8600* ERRAST 13672 2585 9215* ERRBTF 13703 2596 9216* ERRCKS 13515 4021 9200* ERRDIO 13504 3773 9199* ERRDSK 14012 3411 4156 9233* 9242 ERRILV 13432 1793 2917 3147 3242 9194* ERRNBP 13655 2463 9213* ERRNBT 13530 3088 9201* ERRNDK 13541 3161 9202* ERRNST 13664 2547 9214* ERROR 00600 1539 1733* 1736 ERRRAN 13455 5326 9196* ERRSRF 13444 2426 9195* ERRWRP 13466 2240 9197* EXMEM 05751 2031 2046 2870 4790 4805 4828 4840* 6279 EXTFLG 00033 1459* 1712 4392 4397 6796 8398 9616 9713 EXTRO2 20412 9629 9642* EXTROM 20400 1324 9614* F0PATCH 05000 4659* 9703 F0VECTOR 04310 4328* 9702 F1ADDR 04561 4551 4562* F1PATCH 13000 8809* 9705 F1VECTOR 12520 8446* 9704 F1X0 10000 6294* F28FCS 0120 8681* 8691 F28FERA1 0040 8683* 8695 F28FERA2 0320 8684* 8697 F28FPROG 0100 8682* 8693 F2PATCH 22600 9707 10342* F2VECTOR 20503 9706 9727* FCFMSG 13745 3134 9229* FCMDCS 12737 8518 8674* 8692 FCMDERA1 12741 8590 8625 8676* 8696 FCMDERA2 12742 8592 8677* 8698 FCMDPROG 12740 8551 8675* 8694 FCMDRA 0377 4201* 4228 4240 4286 8520 8656 FCMDRI 0220 4202* 4234 4249 4276 FIRSTPSS 0020 1450* 9517 9566 9579 9582 FL28CMD 03355 3669* 3671 FL28F 12743 4283 8689* FL29F 04256 4286* 4310 FL29JF 04275 4305* 8700 FLCMD 03361 3674* 3677 8706 FLCMD0 03346 3661* 3670 3675 4229 4235 4241 4250 4287 4307 FLCMD1 12757 8519 8521 8552 8591 8593 8657 8704* 8707 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 278 Symbol Table bts6120.plx FLCTM0 03360 3662 3668 3672* FLDONE 12655 8570* 8608 FLDTS1 10127 1245* 1248 FLDTS2 10134 1250* 1256 FLDTST 10122 1209 1217 1240* 1260 FLHASH 04303 4231 4237 4243 4252 4278 4315* 4319 FLJMP 03357 3671* 4306 FLLOAD 04200 4208* 9117 FLMEM 01503 2304* 9069 FLMSG1 14362 4268 9279* FLMSG2 14371 4292 9280* FM1MSG 13765 3285 9230* FM2MSG 13774 3350 9231* 9241 FM3MSG 14005 3452 9232* 9238 FMTAR1 02536 3132 3142* FMTARG 02514 3128* 3431 3462 FMTCNT 00075 1507* 3299 3301 3319 3333 3372 3378 3387 3401 3439 3445 3476 3485 FMTP1 02710 3284* 3442 3480 FMTP11 02717 3293* 3335 3337 FMTP12 02725 3299* 3305 FMTP2 03000 3349* 3448 3489 FMTP21 03006 3357* 3403 3405 FMTP22 03023 3372* 3383 FMTP23 03040 3387* 3416 FMTP29 03063 3376 3381 3408* FMTRDP 03012 3361* 3447 3488 FMTWRP 02741 3313* 3441 3479 FNSTAT 00061 1489* 4670 4719 4743 4748 FPDTCT 00060 1488* 4681 4682 4713 4914 4962 8353 FPINIT 05600 1368 4669* FPPGMD 00064 1492* 3327 3395 3820 3830 5000 8348 FPPGMM 00063 1491* 2881 3287 3819 4672 4895 4965 8346 FRDONE 03121 3451* 3492 FTCONT 0310 3631* 3634 FUNTBL 10261 6385 6445* 6471 8089 8093 8448 GCF 6256 6117 GET 00465 1530 1660* 4345 GET1 00505 1664 1680* GET2 00511 1677 1686* GETARG 10241 6375 6377 6421* 6569 7843 7877 7910 8058 8071 8149 8159 8164 8174 8179 8237 8241 8245 8284 8344 8387 GETBAT 10544 6448 6768* GETDKS 11136 6450 7307* GETPMP 12000 6452 7877* GETPP 04000 4043* 4053 4060 GETRDS 11000 6447 6992* GETVER 10303 6445 6475* GOOD 01367 2174 2175 2179 2187 2193* GRP1 22150 10238* GRP2 22350 10289* GRP3 22424 10312* HALTED 07711 2762 6154 6176 6255* HELLO 00711 1372 1827* HELLO1 00720 1831 1834* HELP 00514 1701* 9045 HELP2 00524 1705 1708* HELP3 00530 1709 1712* HELP4 00535 1714 1717* HGHFLD 00044 1472* 2324 2379 4357 5288 5332 5360 9789 9811 9819 HIGH 00042 1470* 1508 1892 1895 2322 2377 4238 4255 4261 4280 4356 5286 5330 5363 9792 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 279 Symbol Table bts6120.plx 9807 9815 HLPB 16421 9308 9313 9378* HLPBL 15452 9301 9352* HLPBM 15147 9298 9342* HLPBP 15377 9301 9350* HLPBPC 15361 9300 9349* HLPBR 15423 9301 9351* HLPC 15600 9304 9358* HLPCK 15204 9298 9343* HLPCM 15332 9298 9346* HLPCTC 17150 9326 9399* HLPCTH 17203 9326 9400* HLPCTL 17003 9325 9395* HLPCTO 17115 9326 9398* HLPCTQ 17057 9326 9397* HLPCTR 17277 9326 9402* HLPCTS 17020 9326 9396* HLPCTU 17332 9326 9403* HLPD 14772 9295 9336* HLPDD 16131 9312 9371* HLPDF 16216 9312 9373* HLPDL 16170 9312 9372* HLPDOL 16756 9323 9392* HLPDP 15036 9295 9337* HLPDR 15103 9295 9338* HLPE 14542 9294 9331* HLPEDC 14516 9293 9330* HLPEND 17361 9404* HLPEP 14604 9294 9332* HLPER 14647 9294 9333* HLPEX 15673 9304 9361* HLPFL 16464 9317 9382* HLPFM 15300 9298 9345* HLPIDE 14452 1711 9311* HLPIDS 15763 9312 9366* HLPIOB 14465 1716 9316* HLPJDK 16450 9317 9381* HLPLP 16000 9323 9367* HLPMEM 15134 9297 9341* HLPMR 15727 9304 9362* HLPMSC 16507 9322 9385* HLPNUL 14442 9297 9300 9303 9305* 9308 9312 9317 9322 9325 HLPP 15474 9301 9353* HLPP1 14404 1703 9291* HLPP2 14471 1718 9320* HLPPC 16275 9313 9375* HLPPCC 15522 9303 9356* HLPPE 16334 9313 9376* HLPPM 16243 9313 9374* HLPRAM 14443 1707 9307* HLPRD 16025 9308 9368* HLPRDS 15746 9308 9365* HLPRF 16106 9308 9370* HLPRL 16062 9308 9369* HLPRP 16720 9323 9391* HLPRUB 17237 9326 9401* HLPSC 16611 9323 9388* HLPSD 16370 9313 9377* HLPSEM 16665 9323 9390* HLPSI 15623 9304 9359* HLPST 15543 9304 9357* HLPTP 16556 9323 9387* HLPTR 15646 9304 9360* HLPTW 16527 9323 9386* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 280 Symbol Table bts6120.plx HLPVE 16640 9323 9389* HLPWS 15241 9298 9344* HLPX 14674 9294 9334* HLPXP 14733 9294 9335* HLT 7402 2711 HLTMSG 13627 6261 9209* HPOS 00055 1483* 5651 5697 5722 5725 5941 5947 IAC 7001 918 930 931 932 933 934 935 1054 1122 1170 1406 1410 2266 3286 3379 3647 3818 4553 4733 5359 6647 6850 6940 7175 7607 9026 9460 9476 9806 9813 IDAMSG 14114 3111 9250* IDBOOT 11200 3106 7317* IDDEV1 11072 7247* 7258 IDDEV2 11110 7264* 7271 IDEIN1 11045 7168 7191* IDEINI 11013 4495 4534 7162* IDEINP 0222 7107* 7169 7238 7725 7749 8008 8027 IDEMS1 14310 4493 9268* IDEMS2 14315 4510 9269* IDEOUT 0200 7108* 7683 7989 IDERDR 12101 7185 7506 7539 7555 8025* 8029 8030 8041 IDETMP 12122 7988 7998 8037 8040 8044* IDEWRR 12061 7182 7227 7358 7390 7416 7426 7443 7455 7460 7470 7475 7987* 7991 7992 8010 IFDF 20005 9426* 9765 9833 9839 9939 9942 9948 ILLPR0 07707 6236* 6410 INCH10 07356 5802 5886* INCHBS 07300 5838* 5870 INCHR1 07517 6032 6040* INCHR2 07534 6042 6053* INCHR3 07542 6055 6061* INCHR4 07550 6063 6069* INCHRS 07477 1524 4337 5962 6023* INCHW1 07210 1608 3941 5783* 5808 5823 5840 5873 5883 5887 INCHW2 07227 5799* 5855 INCHW3 07242 5793 5811* INCHW4 07264 5813 5826* INCHW5 07275 5828 5835* INCHW6 07312 5837 5847* INCHW7 07326 5849 5852 5860* INCHW8 07335 5796 5868* INCHW9 07350 5844 5879* INCHWL 07200 1606 3940 5773* 5832 INCR 20662 9791 9798* INIPM1 11721 7812* 7818 INIPMP 11713 2014 2869 7806* INLMES 06237 1523 5088* 5090 5092 5093 IOTGRP 21217 10032* 10061 IRMA 00057 1485* 3635 3650 5995 6007 IRNAME 13724 9222* ISZ 2000 1128 1173 1203 1247 1255 2234 2454 2455 2510 2511 2554 2589 2593 2632 2633 2634 2658 2659 2660 2923 3174 3193 3248 3304 3319 3323 3324 3382 3387 3391 3392 3530 3587 3650 3762 3763 3765 3888 3962 3991 4098 4168 4817 4826 4873 4921 5026 5056 5092 5149 5187 5244 5342 5464 5509 5552 5700 5807 5941 6007 6425 6590 6591 6703 6747 6885 7257 7270 7517 7519 7584 7649 7703 7706 7717 7769 7772 7783 7817 7951 7958 7960 7992 8030 8190 8263 8427 8428 8478 8537 8563 8566 8587 8663 8960 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 281 Symbol Table bts6120.plx 8982 9550 9598 9658 9681 9798 JMP 5000 1057 1074 1129 1132 1137 1174 1176 1179 1183 1204 1211 1219 1234 1248 1254 1256 1260 1266 1314 1317 1335 1339 1342 1351 1354 1397 1408 1412 1413 1610 1617 1627 1633 1637 1651 1664 1677 1705 1709 1714 1738 1750 1778 1781 1784 1788 1802 1805 1808 1811 1820 1831 1856 1886 1903 1908 1910 1924 1925 1931 1969 1970 1984 1990 2003 2016 2031 2046 2065 2069 2078 2097 2215 2233 2235 2257 2273 2275 2282 2289 2306 2330 2342 2347 2350 2387 2391 2410 2417 2419 2451 2456 2496 2500 2505 2512 2528 2533 2539 2555 2576 2583 2592 2594 2621 2629 2635 2649 2655 2661 2688 2714 2723 2745 2752 2762 2794 2817 2831 2835 2862 2870 2907 2915 2929 2935 3034 3061 3070 3076 3081 3084 3132 3141 3175 3188 3194 3212 3218 3225 3237 3252 3266 3305 3315 3335 3337 3363 3376 3381 3383 3403 3405 3416 3453 3469 3492 3529 3531 3537 3552 3574 3582 3589 3594 3600 3606 3614 3639 3649 3651 3654 3670 3671 3677 3704 3728 3743 3758 3766 3797 3838 3839 3892 3899 3901 3943 3947 3961 3963 3969 3975 3979 3995 3998 3999 4010 4013 4051 4058 4069 4092 4100 4106 4108 4114 4127 4145 4169 4216 4247 4257 4263 4269 4283 4295 4303 4310 4319 4394 4399 4403 4406 4411 4435 4440 4443 4451 4453 4456 4459 4464 4491 4497 4501 4507 4513 4519 4524 4561 4586 4611 4627 4643 4735 4759 4764 4767 4769 4772 4774 4777 4792 4807 4819 4835 4874 4876 4916 4922 4967 4971 4974 4977 4982 4987 4992 4997 5019 5031 5057 5075 5084 5093 5104 5115 5133 5148 5150 5158 5163 5188 5196 5200 5204 5208 5249 5252 5266 5273 5313 5404 5413 5425 5459 5463 5465 5471 5491 5494 5511 5517 5537 5540 5554 5560 5589 5623 5633 5636 5654 5660 5665 5670 5675 5680 5684 5704 5708 5716 5724 5780 5793 5796 5802 5808 5813 5823 5828 5832 5837 5840 5844 5849 5852 5855 5870 5873 5883 5887 5906 5911 5912 5917 5919 5928 5945 5949 5966 5969 5973 5999 6004 6008 6009 6032 6037 6042 6055 6063 6100 6135 6148 6150 6154 6176 6182 6184 6222 6226 6280 6383 6406 6410 6578 6583 6586 6588 6592 6623 6626 6628 6629 6637 6640 6642 6643 6704 6748 6789 6799 6802 6823 6831 6835 6853 6872 6884 6886 6969 7168 7177 7189 7258 7271 7328 7349 7364 7381 7404 7418 7428 7510 7518 7520 7543 7549 7585 7590 7610 7633 7656 7705 7707 7718 7771 7773 7784 7818 7953 7961 7966 8010 8041 8095 8124 8191 8264 8288 8304 8320 8401 8408 8425 8429 8479 8526 8536 8538 8561 8567 8588 8597 8598 8608 8630 8638 8664 8700 8707 8854 8961 8983 9030 9468 9484 9494 9532 9536 9551 9599 9629 9633 9659 9668 9672 9682 9685 9688 9740 9750 9791 9796 9803 9820 9865 9885 9890 9894 9900 9901 9916 9917 9940 9981 9990 10001 10014 10036 JMS 4000 1209 1217 1228 1702 1704 1706 1708 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 282 Symbol Table bts6120.plx 1710 1715 1717 1792 1827 1832 1834 1838 1850 1853 2013 2082 2087 2092 2101 2106 2111 2116 2184 2239 2286 2425 2462 2546 2584 2595 2744 2761 2868 2916 2930 2932 3087 3092 3097 3105 3110 3133 3146 3157 3160 3185 3241 3256 3260 3284 3309 3312 3349 3357 3360 3410 3451 3466 3675 3752 3755 3772 3832 3835 4020 4054 4063 4072 4082 4089 4112 4117 4124 4135 4142 4155 4229 4231 4235 4237 4241 4243 4250 4252 4267 4278 4287 4291 4389 4395 4404 4409 4428 4430 4432 4441 4444 4454 4457 4462 4492 4494 4498 4509 4517 4522 4533 4589 4594 5325 6162 6192 6228 6232 6236 6260 6627 6641 6674 6688 6718 6728 6788 6871 7182 7185 7227 7358 7390 7416 7426 7443 7455 7460 7470 7475 7506 7539 7555 7589 7599 7687 7753 8230 8234 8519 8521 8552 8560 8591 8593 8596 8657 8706 8950 8955 8972 8976 9492 9656 9699 9746 9752 9755 9852 9855 9860 9924 9930 9993 9998 10023 KCC 6032 863* 1349 KEY 01672 2373 2399 2402 2408 2429* KRB 6036 865* 3641 6079 9630 KRS 6034 864* KSF 6031 862* 1352 3638 6077 9628 L 00013 1445* 1622 1636 1646 1661 1763 4650 4651 5775 5806 5814 5861 5863 5875 LAS 7604 2115 4788 4798 4815 LASTPSS 0033 1455* 9579 9582 LBATMP 11344 7449 7454 7480* LDAR 6410 6547* 6811 6909 7598 7617 7620 8253 8260 8512 8840 8917 9013 9525 9569 9653 10204 LDBU20 03665 3941* 3943 LDBUF 03653 3824 3930* LDBUF2 03662 3939* 3999 LDBUF3 03710 3961 3966* LDBUF4 03727 3983* 3995 LDBUF5 03752 3947 4005* LDPAGE 03770 3935 3959 3962 3965 4016 4024* LENGTH 00031 1453* 1810 2010 5702 LIGHTS 12442 6455 8344* LOW 00043 1471* 1509 1889 2600 2602 2604 2606 4232 4245 4259 5294 5317 5329 5372 5375 LOWFLD 00045 1473* 5296 5319 5331 5378 5381 LSP1 6217 1299 1600 2785 6133 LSP2 6237 2787 MASK 01673 2381 2394 2400 2407 2430* MAT0B 21021 9885 9891* MATCH 06642 1619 1989 2003 3068 5453* MATCH1 06644 5457* 5465 MATCH2 06655 5459 5463 5468* MATCH3 06661 5469 5471 5474* MAXBPT 0010 1576* 1577 1578 1579 1580 2479 MAXCMD 0147 1583* 1584 5800 MAXFUN 0021 6381 6471* MCALL 10201 6226 6375* MCALL1 10225 6397* MCALL2 10237 6383 6409* 6443 MEA 20001 9422* 9540 9550 9583 9598 9921 9922 9972 9987 9992 10045 MEMMOV 12230 6453 8149* MEMMSG 13415 2185 9193* MEMMVX 12306 6454 8228* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 283 Symbol Table bts6120.plx MEMTS1 10107 1209* 1211 MEMTS2 10114 1217* 1219 MIA 20002 9423* 9655 9658 9679 9681 9975 9986 9989 9997 MM0 6400 981* 10196 MM1 6401 982* 1124 10198 MM2 6402 983* 1126 4265 4288 4305 6684 6745 6844 7628 7811 8267 8318 8553 8570 8850 8954 8980 9029 9547 9554 9585 9601 10200 MM3 6403 984* 4225 4308 6675 6729 6812 7600 8301 8514 8557 8842 8951 8977 9014 9527 9542 9571 9588 10202 MNEMP 20000 9421* 9871 9905 10012 10032 MOVE1 01411 2221* 2235 MOVE2 01440 2233 2239* MPTR 20012 9432* 9488 9489 MQA 7501 2044 3565 4803 5074 5376 5382 6119 8916 9970 MQDISP 06076 4977 4995* MQL 7421 2041 2789 3562 4746 4760 4800 5069 5373 5379 8255 8292 8912 9017 9958 MQNAME 13721 2093 9221* MUUO 10050 6326* 6378 6379 6384 6386 6387 6388 6396 6400 6403 6573 6584 7916 7927 8059 8060 8064 8094 8095 8405 MVXARG 12400 8230 8234 8282* 8304 8320 NAME 00047 1475* 1615 5398 5407 5415 5416 5461 NAMENW 06600 1614 1986 1998 3063 5397* NDETMS 14322 4410 4463 4523 9270* NL0000 7200 917* NL0001 7201 918* 6838 6842 7474 NL0002 7326 919* 6651 6852 9687 NL0003 7325 930* 3652 NL0004 7307 931* NL0006 7327 932* NL0010 7215 935* 7812 NL0100 7203 934* NL2000 7332 920* NL3777 7350 921* 1759 6401 NL4000 7330 922* 8067 NL5777 7352 923* NL6000 7333 933* NL7775 7346 924* 925 NL7776 7344 926* 927 NL7777 7240 928* 929 3020 8109 9642 9647 9651 9662 9676 NLM1 7240 929* 3737 6834 6840 NLM2 7344 927* 5062 6801 6849 8107 9025 NLM3 7346 925* 5051 5060 5195 NOBOOT 02462 3070 3087* NODISK 02542 3154* 3430 3707 3800 4043 4351 4583 NOERA 12627 8526 8542* NOIDE 04535 4497 4501 4522* NOMNEM 21222 10014 10035* NONVR 04473 4435 4462* NOP 7000 1243 1312 1593 1594 1595 2922 3154 3155 3156 3588 4818 4827 4859 5027 5701 6189 6190 6191 6209 6426 6431 6968 7266 7267 7340 7341 7342 7372 7373 7374 7959 8034 8119 8184 8185 8187 8188 8249 8250 8251 8256 8257 8258 8564 NORDM 04472 4451 4456 4459* NOUNIT 02540 3146* 3469 NOXROM 20477 9633 9668 9672 9714* NSUPMS 14333 4518 9271* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 284 Symbol Table bts6120.plx NUMXRARGS 0007 9693* 9696 NX1 12763 8532 8533 8537 8546 8558 8563 8604 8621 8658 8710* NXTADR 06512 1534 5341* OCTN1 06725 5535* 5554 OCTN2 06750 5537 5540 5557* OCTNF 07004 5278 5592* OCTNF1 07010 5589 5596* OCTNI 07000 2530 2573 2821 5586* OCTNW 06720 1531 4346 5529* OKFLR 04245 4263 4276* OP0 21420 10058 10071* OP1 21424 10058 10073* OP2 21430 10059 10075* OP3 21434 10059 10077* OP4 21440 10060 10079* OP5 21444 10060 10081* OP6 21450 10061 10085* OP6NOCF 21470 10015 10094* OP7 22150 10061 10236* OPJMP 21400 9877 10058* OPRGRP 21200 10011* 10061 OUTCH1 07411 5911 5915* OUTCH2 07416 5917 5922* OUTCH3 07426 5906 5931* OUTCHR 07400 1512 4336 5902* 9493 9853 9931 10024 OUTST1 06204 5055* 5084 OUTST2 06227 5057 5078* OUTST3 06230 5075 5079* OUTSTR 06200 1737 2076 5049* 5091 5250 6271 PAC1 6215 57 PACK 10504 6643 6713* PACK1 10507 6718* 6748 PARMAP 00020 1451* 3232 3263 4359 7323 7809 7851 7885 7918 PARSDX 03413 3704 3714* PCCHK1 04162 4167* 4169 PCNAME 13716 2088 9220* PCOMP 04015 4053* 9119 PCOPY 04024 4060* 9115 PCOPY0 04043 4058 4077* PCOPY1 04046 4082* 4106 4108 PCOPY3 04063 4097* PCOPY4 04100 4100 4111* PCOPYE 04120 4056 4132* PCOPYW 04104 4074 4117* PEX 6004 2793 PFAIL0 00267 1266 1339 1351 1354 1405* 1408 1413 PFAIL1 10147 1057 1074 1176 1204 1254 1265* PFAIL2 00273 1409* 1412 PGMDSP 06101 4967 5000* PGO 6003 2710 2751 PJ0F2 20100 9454* 9457 9459 9492 9746 9752 9755 9852 9855 9860 9924 9930 9993 9998 10023 PJ1F2 20117 9470* 9473 9475 9656 PLOF 6415 893* 1405 5038 PLON 6417 894* 1409 5034 PM1MSG 14067 3257 9245* PM2MSG 14074 3261 9246* PMALL 02663 3212 3246* 3252 PMEDI1 02661 3218 3241* PMEDIT 02622 3210* 9113 PMSHOW 02674 3225 3247 3256* PNLBUF 12210 3310 3358 3753 3833 4083 4118 4136 8103* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 285 Symbol Table bts6120.plx PNLCDF 07671 6207 6216* PNLMEM 00041 1469* 1881 1953 2141 2218 2259 2325 2382 2481 2679 3521 PNLTRP 07653 6148 6202* POP1 6235 57 POPJ1 10306 4556 6486* POST 6440 897* 1053 1063 1168 1197 1322 1331 1360 2780 6138 10230 PPC1 6205 57 PR0 6206 6223 PR0MSG 13562 6237 9206* PR3 6236 898 PRCR 6473 876* PRISLU 6412 870* 9621 10208 PRNMSG 13614 6229 9208* PROCEE 02207 2721* 9083 PROGLP 12636 8551* 8567 PROMPT 00144 1556* 5773 5779 5818 PRPA 6470 873* 7249 7761 10182 PRPB 6471 874* 7252 7758 8035 10184 PRPC 6472 875* 10186 PRS 6000 2782 6145 PSDISP 06070 4971 4985* PSNAME 13732 2102 9224* PUSHAC 04562 4549 4559 4563* PUSHAC2 20020 9438* 9455 9466 9471 9482 PUSHJ1 04543 1540 4548* 4550 4552 PWCR 6477 880* 7170 7173 7179 7239 7248 7256 7265 7269 7684 7700 7702 7714 7716 7726 7750 7757 7768 7780 7782 7990 8001 8003 8009 8028 8033 8039 10194 PWPA 6474 877* 7698 10188 PWPB 6475 878* 7693 7999 10190 PWPC 6476 879* 7171 7241 7686 7752 7993 8031 10192 PWRON 07634 6162* R3L 7014 935 1054 5193 5594 6941 8291 8310 9813 9943 9961 9978 RAL 7004 926 930 2264 4757 4775 5498 5501 5502 5547 6146 6151 6895 6937 7287 7511 7544 8932 9979 RAM128 1240 6543* 6905 7624 7625 RAM512 5200 6542* 7624 RAMBAS 00034 1460* 4360 6898 9521 9562 RAMBUF 10027 6314* 6678 6681 6683 6689 6693 6695 6699 6720 6722 6730 6732 6734 6738 6739 6743 8953 8956 8974 8978 RAMCDF 10753 6674 6728 6944 6967* 6969 7599 8418 8925 8950 8976 9650 RAMDAR 10032 6315* 6879 6885 6908 RAMDR1 10417 6589 6627* RAMDRD 10407 3487 3700 6621* RAMDRW 10310 6446 6568* RAMDW1 10432 6587 6641* RAMDWR 10422 3478 3793 6635* RAMER1 10435 6578 6623 6637 6647* 8401 8408 RAMER2 10437 6583 6626 6640 6651* 8425 RAMINIT 01144 1365 2008* RAMMS1 14250 4431 9261* RAMMS3 14255 4445 9262* RAMMS4 14260 4442 9263* RAMPTR 10010 6298* 6676 6679 6682 6731 6733 6744 6893 6894 6896 6900 8935 8952 8979 9652 RAMSEL 10722 3467 6576 6621 6635 6928* 7596 RAMSIZ 10044 6318* 7576 7643 7646 7657 8832 8860 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 286 Symbol Table bts6120.plx 8861 8864 RAMUSZ 10046 3475 3484 6320* 6866 6904 6958 6959 8420 RANGE 06460 1532 4347 5309* 9756 RANGE1 06504 5313 5329* RAR 7010 921 922 3294 3367 4969 4972 4975 5180 5270 6399 7280 7508 7541 9762 9841 10020 RC0KW 0700 8792* 8831 RC0OFF 1000 8794* 8902 RC0PAG 7000 8790* 8829 RC1IDE 04540 4491 4533* RC1KW 1000 8793* 8859 RC1PAG 7776 8791* 8857 RCFLAG 00035 1316 1463* 1829 4214 4386 4438 4489 5015 7165 8475 RCPAGE 10026 6313* 8904 8908 8921 8930 RCRDR1 13072 8950* 8961 RCRDRD 13067 6628 8947* RCRDW1 13113 8972* 8983 RCRDWR 13110 6642 8969* RCSDAR 13033 6872 8895* RCTES1 13031 8854 8864* RCTEST 13000 7590 8829* RDADDR 06435 1956 2216 5278* 5284 5292 RDBFAI 04470 4453 4457* RDBOOT 10400 3093 6603* RDCH10 10613 6799 6810* RDCH11 10643 6831 6838* RDCH12 10650 6802 6823 6835 6843* 6853 RDCH20 10653 6789 6848* RDCHK1 10600 4429 6787* RDDUMP 03400 3700* 9101 RDF 6214 1130 1177 1257 9513 9557 RDHIGH 06442 5284* 5316 RDIBU1 11656 7756* 7773 RDIBU2 11700 7779* 7784 RDIBU3 11706 7771 7789* RDIBUF 11646 7364 7746* RDLOW 06451 5292* 5309 RDMEM 01316 1535 2150* 2177 RDPAGE 10025 1541 6312* 6570 6590 6609 6865 6880 8226 8394 8427 8903 RDPMLOC 7700 9507* 9522 9563 RDPMS1 0136 9509* 9530 9574 RDPMS2 0266 9510* 9534 9576 RDPS0 20230 9542* 9551 RDPSS 20201 2016 9512* RDPSX 20240 9515 9532 9536 9553* RDPTR 03467 3701 3709 3756* RDROM 12456 6469 8386* RDRW1 10324 6581* 6592 RDRW2 10336 6586 6589* RDRW3 10340 6588 6590* RDSIZE 10034 6317* 6954 6999 7581 8830 8858 RDTES0 11460 7596* 7656 RDTES1 11512 7610 7628* RDTES2 11527 7633 7649* RDTEST 11446 4433 7576* RDTYPE 10047 3171 6321* 6843 7650 RDUNIT 10024 3464 3719 3811 6311* 6575 6608 6929 6936 6953 6992 6993 6998 7580 7584 7649 7654 8225 8900 8913 RDYTMO 11424 7504 7505 7517 7519 7527* RECCNT 00074 1506* 3723 3738 3748 3765 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 287 Symbol Table bts6120.plx RECSIZ 00073 1505* 3293 3311 3331 3359 3366 3399 3436 3471 3703 3711 3754 3759 3796 3804 3823 3834 4302 REGCMD 0107 7130* 7228 7359 7391 7417 7427 REGCNT 0102 7124* 7476 REGDAT 0100 7122* 7240 7685 7751 REGERR 0101 7123* 7556 REGLB0 0103 7125* 7444 REGLB1 0104 7126* 7456 REGLB2 0105 7127* 7461 REGLB3 0106 7128* 7183 7471 REGLSC 01240 1984 2068* 2688 6277 REGLST 01224 2059* 2068 REGSTS 0107 7129* 7186 7507 7540 REPCNT 00065 1495* 1611 1631 1634 1760 1767 3130 REPEA1 00625 1750 1759* REPEAT 00610 1748* 9047 REPLOC 00066 1496* 1635 1764 1765 RESTA 00400 1537 1593* 1651 4348 RET0F2 04400 4369* 9463 RET0F3 04402 4329 4372* RET1F2 12514 8435* 9479 RET1F3 12516 8438* 8447 RET2F3 20501 9719* 9728 RFNS 6434 887* 4716 4740 4917 4968 10224 RFRMAT 03124 3462* 9109 RLLOAD 03513 3793* 9105 RLOF 6435 888* 1597 4698 6255 6268 10226 RLON 6437 889* 2779 10228 ROMCH0 10062 1172* 1174 ROMCH1 10076 1179 1184* ROMCHK 10060 1170* 1183 ROMCK0 00200 1291* 1840 ROMCK1 10200 1843 6341* ROMCK2 20200 1847 9502* ROMCP0 10036 1122* 1137 ROMCP1 10056 1132 1138* ROMCPY 10040 1067 1069 1070 1071 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1124* 1129 ROMR1 12501 8423* 8429 ROMWR 12600 4299 8507* RSP1 6207 2777 6121 RSP2 6227 6123 RTF 6005 2791 RTL 7006 919 924 931 932 2828 4765 4770 5068 5176 5177 5546 6152 6691 6696 6697 7285 7286 7451 7452 7764 8545 9962 RTN1 6225 57 RTR 7012 920 923 933 2827 5073 5271 6737 6741 6742 7281 7447 7458 7459 7696 8510 8511 8910 8922 9761 9840 9875 10019 RWCNT 10055 6331* 6591 7951 7960 8070 8108 8428 SAVCHR 00052 1478* 1686 1687 2385 2389 2905 3966 3976 4011 4608 4612 4640 5178 5179 5182 5504 5549 5624 5625 5630 5786 5790 5803 5805 SBBLO 6415 6548* 6839 10212 SBBLO2 6436 1311 5018 6549* 6848 10214 SCAN 20010 9430* 9663 9665 9669 9699 9878 9880 9920 SCCOM 00700 1816* 9125 SCOPE 00032 1454* 1819 5868 SCPT 6433 886* 4955 6181 10222 SDNCMD 04614 4586 4594* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 288 Symbol Table bts6120.plx SEAR1 01633 2387 2391 2398* SEAR2 01640 2405* 2419 SEAR3 01656 2410 2415* SEAR4 01665 2417 2422* SEARCH 01600 2371* 9065 SETBUF 12123 6568 7909 8058* 8386 SETDA1 10672 6881* 6886 SETDA2 10700 6884 6891* SETDAR 10661 6581 6624 6638 6864* 8423 SETDRD 0007 7109* 7247 7264 7756 7779 8032 SETDRE 0013 7113* 7172 SETDWR 0011 7111* 7699 7713 8000 SETLBA 11310 7356 7388 7441* SETPMP 11732 6451 7842* SHOEX1 04424 4394 4402* SHOEX2 04431 4403 4409* SHOEXT 04404 1396 4385* SHOIDE 04476 1378 4488* SHONV1 04454 4440 4444* SHONV2 04456 4443 4447* SHONVR 04434 1375 4428* SHSW 6431 884* 6174 10218 SICOM 02144 2669* 9085 SIMFLG 00051 1477* 2713 2750 6257 SINGLE 02202 2684 2710* 2722 SIZPTR 10045 6319* 6955 6956 7000 7001 7630 7631 SKP 7410 1338 1353 1758 1878 1950 3158 3320 3388 4099 6175 7704 7770 7952 9799 10042 SKPMSG 13477 2931 9198* SMA 7500 1663 1783 1807 2914 4452 5424 5431 5493 5539 5801 5905 6585 7651 7928 SNA 7450 1131 1178 1609 1616 1626 1668 1671 1674 1681 1713 1749 1766 1777 1801 1830 1920 1965 1983 2142 2180 2281 2329 2386 2390 2450 2495 2527 2532 2575 2591 2620 2648 2816 2906 3024 3060 3211 3224 3536 3573 3599 3727 3742 3942 3946 3960 4151 4282 4434 4439 4450 4506 4585 4610 4683 4714 4721 4750 4915 4963 5016 5030 5081 5101 5112 5157 5248 5400 5458 5462 5516 5559 5622 5632 5635 5703 5784 5795 5839 5848 5851 5872 5902 5944 6026 6221 6225 6798 6830 6906 6961 7515 7632 7644 8066 8091 8122 8356 8400 8477 8637 8662 8901 9024 9490 9632 9684 9749 9795 9889 9893 9899 10013 SNCOM 02200 2699* 9079 SNL 7420 1885 2214 2256 2538 2582 3080 3083 3140 4068 4294 5147 5403 5412 6883 8287 8315 9968 9980 SP1NAM 13735 2107 9225* SP2NAM 13741 2112 9226* SPA 7510 1632 1681 1780 1804 4393 4763 4768 4773 4776 5346 5490 5536 5601 5707 5723 5792 5948 6147 6153 7634 SPACM0 04621 1526 4341 4607* SPACMP 04617 1525 4340 4604* 4611 9747 SPANXT 04637 1999 4635* SPATST 04641 1957 4047 4639* SPD 6276 1064 1202 1214 1296 1596 2140 2155 2166 3030 4697 4844 6136 6215 6434 6701 6723 7724 7790 8157 8172 8194 8268 8299 8316 8843 8958 8975 9743 9780 10047 SPINCD 04600 4581* 9127 SPINDN 11303 4595 7424* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 289 Symbol Table bts6120.plx SPINUP 11276 4590 7414* SPLK 6432 885* 4720 4919 10220 SRCCDF 12272 8154 8184* 8191 SRCDAR 0024 8225* 8231 8252 SRCSPD 12273 8158 8185* SRNAME 13727 2117 9223* STA 7240 1198 1310 1348 1630 1756 1877 1949 2225 2321 2376 2380 2413 2712 2882 3934 4649 4678 4879 5241 5711 5721 5864 5880 6056 6202 6603 7317 7645 8839 STACK 0177 1298 1560* 1561 1599 START 02251 2815* 9081 START1 02275 2817 2834* STARTXROM 20462 9685 9695* STKLEN 0031 1561* 1562 STKSAV 00145 1559* 2778 6132 STL 7120 930 932 933 2506 3031 5422 5641 6652 7557 8607 STSBSY 0200 7133* 7512 7545 STSCOR 0004 7138* STSDF 0040 7135* STSDRQ 0010 7137* 7545 7546 STSDSC 0020 7136* STSERR 0001 7139* STSRDY 0100 7134* 7512 7513 SUPCMD 04611 4589* SWBOO1 06014 4874 4879* SWBOOT 06007 4759 4873* SWCLR 06017 4769 4888* SWDEP 05725 4777 4813* SWEXA 05735 4774 4826* SWEXA1 05741 4819 4829* SWLA 05702 4764 4788* SWLXA 05711 4767 4798* SWP 7521 8261 8295 8303 SWPADR 06540 2221 2228 5371* SWSCA1 05634 4733* 4735 SWSCAN 05621 1607 4713* SWTEMP 05701 4742 4745 4747 4781* SYSCRN 14172 1854 9258* SYSI20 00216 1314 1322* SYSI21 00222 1317 1331* SYSIN2 00201 1234 1295* SYSIN3 00245 1360* SYSIN9 00264 1396* 4333 SYSINI 10001 1053* 6100 SYSNM0 14121 1828 9253* SYSNM1 14127 1835 9254* SYSNM2 14142 1839 9255* SYSNM3 14152 1851 9256* SYSNM4 14167 1833 9257* SZA 7440 1056 1073 1175 1210 1218 1253 1313 1350 1407 1411 1783 1807 1907 1923 1968 2409 2423 2460 2499 2504 2928 3032 3131 3173 3187 3192 3217 3251 3334 3375 3380 3402 3528 3551 3581 3648 3891 3898 3968 3974 3978 3994 3997 4009 4012 4105 4215 4246 4256 4262 4387 4402 4490 4626 4642 4734 4920 4966 5312 5361 5493 5539 5653 5812 5827 5836 5854 5869 5910 5916 5965 5968 6031 6041 6054 6062 6258 6822 7167 7176 7188 7348 7380 7548 7609 7623 7655 8407 8525 8535 8629 8853 8914 9531 9535 9667 9671 9790 9915 10033 SZL 7430 1902 2224 2232 2265 2272 2339 2416 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 290 Symbol Table bts6120.plx 3069 3095 3108 3314 3362 3468 3757 3837 4091 4126 4144 4496 4500 4758 4766 4771 4970 4973 4976 5323 6149 6382 6577 6582 6622 6625 6636 6639 6867 6931 6939 6996 7224 7230 7354 7361 7386 7393 7509 7542 7848 7882 7956 8156 8171 8424 9809 9816 10016 TAD 1000 1055 1066 1068 1070 1071 1080 1082 1084 1086 1088 1090 1125 1133 1172 1180 1216 1241 1245 1250 1252 1258 1298 1361 1599 1605 1615 1618 1622 1624 1625 1631 1635 1648 1661 1662 1667 1669 1670 1672 1673 1675 1676 1680 1682 1683 1687 1712 1736 1757 1763 1765 1776 1779 1782 1785 1800 1803 1806 1809 1818 1829 1836 1840 1843 1847 1889 1892 1894 1905 1922 1961 1967 1988 2002 2008 2024 2029 2034 2039 2042 2049 2075 2077 2081 2086 2091 2100 2105 2110 2127 2129 2141 2152 2154 2164 2175 2179 2187 2229 2263 2269 2280 2288 2305 2323 2336 2372 2378 2385 2389 2393 2399 2408 2422 2445 2447 2449 2459 2473 2475 2477 2479 2494 2498 2501 2503 2531 2540 2574 2590 2599 2601 2603 2605 2619 2623 2627 2647 2651 2653 2672 2675 2677 2784 2786 2788 2790 2792 2824 2826 2829 2902 2905 2912 2913 2921 2927 2934 3018 3023 3028 3067 3074 3130 3135 3137 3142 3171 3190 3215 3219 3231 3232 3234 3249 3250 3258 3262 3263 3265 3293 3296 3299 3301 3311 3325 3331 3359 3366 3369 3372 3374 3377 3378 3393 3399 3413 3435 3440 3446 3470 3475 3478 3484 3487 3524 3527 3535 3538 3543 3549 3555 3559 3563 3571 3572 3575 3576 3577 3579 3585 3592 3597 3601 3609 3611 3634 3663 3665 3668 3700 3702 3708 3710 3716 3718 3732 3734 3746 3754 3759 3774 3793 3795 3801 3803 3810 3812 3823 3827 3829 3834 3863 3869 3873 3880 3883 3884 3886 3889 3896 3897 3900 3931 3939 3944 3945 3957 3959 3964 3966 3967 3971 3973 3976 3977 3984 3987 3988 3992 4006 4008 4011 4016 4045 4049 4056 4065 4074 4084 4088 4101 4119 4123 4137 4141 4150 4158 4162 4164 4167 4214 4228 4234 4240 4245 4249 4255 4259 4261 4276 4280 4286 4299 4301 4306 4316 4318 4386 4391 4392 4397 4438 4448 4489 4504 4511 4550 4552 4556 4559 4584 4608 4609 4612 4640 4641 4650 4682 4695 4713 4719 4732 4743 4747 4801 4829 4831 4842 4855 4857 4892 4914 4962 4965 4986 4991 4996 5000 5015 5028 5049 5063 5065 5070 5078 5090 5100 5110 5123 5126 5132 5142 5146 5153 5156 5171 5175 5179 5182 5242 5246 5261 5263 5279 5285 5287 5293 5295 5311 5317 5319 5329 5331 5344 5345 5348 5358 5360 5363 5365 5372 5374 5378 5380 5405 5414 5415 5423 5426 5430 5433 5457 5461 5468 5489 5492 5497 5500 5503 5504 5505 5515 5535 5538 5543 5545 5549 5550 5558 5587 5593 5599 5600 5605 5625 5630 5631 5634 5651 5659 5664 5669 5674 5679 5683 5695 5702 5706 5715 5722 5726 5774 5779 5790 5791 5794 5799 5800 5803 5805 5811 5815 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 291 Symbol Table bts6120.plx 5818 5820 5826 5829 5835 5838 5847 5850 5853 5858 5862 5868 5871 5875 5881 5904 5909 5915 5918 5924 5927 5931 5943 5947 5964 5967 6000 6030 6035 6040 6044 6047 6053 6061 6069 6132 6203 6205 6207 6211 6213 6219 6220 6223 6257 6270 6272 6275 6379 6381 6384 6385 6387 6394 6403 6423 6427 6429 6433 6476 6573 6584 6605 6666 6676 6679 6682 6689 6693 6695 6699 6714 6719 6721 6730 6732 6734 6739 6743 6769 6796 6810 6814 6816 6818 6819 6827 6829 6865 6866 6880 6882 6891 6894 6896 6898 6904 6905 6907 6908 6929 6930 6936 6938 6943 6953 6954 6956 6959 6993 6995 6998 6999 7001 7165 7169 7172 7174 7178 7181 7187 7226 7234 7236 7238 7240 7247 7255 7262 7264 7268 7279 7284 7289 7308 7319 7323 7327 7347 7357 7363 7379 7389 7395 7415 7425 7442 7445 7450 7454 7457 7469 7503 7513 7546 7579 7581 7597 7601 7603 7605 7606 7616 7619 7621 7624 7625 7631 7635 7636 7643 7650 7652 7653 7654 7657 7681 7683 7685 7690 7692 7694 7699 7701 7713 7715 7725 7747 7749 7751 7756 7765 7767 7779 7781 7807 7809 7813 7845 7847 7850 7851 7853 7880 7881 7884 7885 7888 7916 7918 7921 7927 7929 7930 7954 7965 7989 7991 7998 8000 8002 8008 8027 8029 8032 8038 8040 8060 8062 8064 8072 8089 8090 8093 8103 8105 8121 8151 8153 8155 8157 8160 8166 8168 8170 8172 8175 8186 8229 8233 8238 8242 8252 8254 8259 8286 8297 8299 8301 8308 8312 8314 8316 8318 8347 8353 8393 8398 8405 8417 8419 8475 8509 8518 8520 8523 8533 8534 8542 8548 8551 8554 8556 8590 8592 8594 8600 8601 8602 8604 8606 8621 8623 8627 8632 8656 8658 8660 8689 8691 8693 8695 8697 8829 8831 8844 8846 8848 8849 8857 8859 8860 8864 8900 8902 8903 8908 8913 8915 8921 8924 8930 8934 8948 8952 8956 8970 8973 8978 9012 9016 9022 9457 9459 9463 9466 9473 9475 9479 9482 9489 9514 9517 9521 9522 9529 9530 9533 9534 9538 9544 9546 9558 9562 9563 9566 9574 9576 9579 9582 9587 9631 9645 9649 9654 9665 9666 9669 9670 9678 9680 9696 9739 9743 9760 9764 9767 9770 9771 9773 9777 9787 9789 9792 9794 9800 9801 9807 9810 9811 9814 9817 9818 9830 9832 9834 9836 9839 9851 9854 9857 9859 9862 9873 9877 9880 9883 9887 9892 9897 9904 9906 9920 9929 9939 9942 9945 9948 9950 9953 9956 9960 9965 9977 9983 9986 9992 9995 9997 10000 10012 10015 10018 10022 10032 10035 10045 TADDR 06417 1898 1929 2186 5260* TASCI1 06247 5100* 5104 TASCIZ 06246 1649 5099* 5821 TASZF1 06255 4512 5108* 5115 TASZF2 20136 9488* 9494 9858 9863 9984 9996 10001 10036 TBACKS 07131 1514 5721* TBELL 07071 5668* 5710 5886 TCF 6042 867* 1336 TCKSUM 01472 2280* 3613 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 292 Symbol Table bts6120.plx TCKSUN 01477 2273 2282 2286* TDECN1 06302 5145* 5150 TDECN2 06310 5148 5153* TDECN3 06320 5158 5162* TDECNW 06277 1520 4350 5140* 5159 TDIGIT 07102 3259 5163 5184 5273 5683* TDOT 07077 1521 5678* TFCHA1 07445 5962* 5969 TFCHA2 07460 5966 5976* TFCHAR 07444 5670 5696 5716 5727 5925 5961* TFIELD 06431 5262 5270* 6274 TFILV 00656 1781 1784 1792* 1805 1808 THCHA1 07443 5945 5949 5951* THCHAR 07427 5133 5660 5665 5675 5680 5684 5919 5928 5940* TLS 6046 869* 1333 1340 6001 TMEM 01060 1913 1929* 2411 2452 4834 TOCT3 06343 1519 5193* TOCT4 06322 1515 4338 5170* 5199 5203 5206 9856 9861 9994 9999 TOCT4C 06352 1516 5203* TOCT4M 06355 1517 5206* TOCT4S 06347 1518 5199* TOCTL 06325 5175* 5188 TOCTN 06324 5172* 5196 TPC 6044 868* TPCOM 00660 1798* 9091 TPCOM1 00676 1802 1810* TQUEST 07066 1647 1650 1735 2283 5620 5663* TRACE 02146 2672* 2745 TRAP 07720 6162 6192 6228 6232 6236 6260 6267* 6270 TRPMSG 13640 6163 9210* TSF 6041 866* 1334 1337 1341 2861 5998 TSIXB 21062 9910 9912 9928* TSIXC 06274 5125 5131* TSIXW 06266 5122* TSLASH 07074 3875 5265 5673* TSPACE 07063 1513 5650 5658* TSTADR 06525 1533 5321 5357* TTABC 07054 5650* 5654 5912 TTEXT1 06405 5245* 5252 TTEXTT 06400 1702 1706 1710 1715 1717 5240* 5242 5244 5249 TWCOM 00635 1774* 9089 TWCOM1 00653 1778 1786* TWCOM2 00654 1787* 1811 1820 TYPEAC 01252 2062 2081* 9155 TYPEIR 01263 2096* 2687 4352 TYPEMQ 01260 2063 2091* 9159 TYPEPC 01255 2060 2086* 4791 9157 TYPEPS 01265 2061 2100* 4806 9161 TYPESR 01276 2115* 9163 TYPRG4 01243 2073* 2075 2082 2087 2092 2101 2106 2111 2116 TYPSP1 01270 2064 2105* TYPSP2 01273 2065 2110* UAC 00001 1432* 2025 2081 2792 2876 4331 4891 4991 6116 6394 6398 8347 UFLAGS 00002 1433* 2042 2045 2100 2672 2790 2830 2878 4332 4801 4804 4831 4855 4892 4894 4986 5587 5593 6118 6205 6272 6402 6404 6427 9832 UIR 00007 1438* 2681 4353 6214 6219 9834 UIRPC 00006 1437* 2678 6212 9830 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 293 Symbol Table bts6120.plx UMQ 00003 1434* 2035 2091 2788 2877 4890 4996 6120 UNPAC1 10445 6674* 6704 UNPACK 10442 6629 6665* 8426 9657 UNPLP 20430 9656* 9659 UPC 00000 1431* 2030 2086 2675 2677 2794 2825 2883 3075 4330 4789 4816 4817 4826 4829 4842 6203 6204 6211 6213 6275 6423 6425 UPDIS1 06102 4987 4992 4997 5004* UPDIS2 06103 4982 5005* UPDISI 06044 4955* 6004 6023 UPDISP 06047 4962* 6183 USERDF 06000 4813 4840 4854* USP1 00004 1435* 2105 2784 2879 4888 6122 USP2 00005 1436* 2110 2786 2880 4889 6124 VALUE 00046 1474* 2074 2077 2153 2154 2161 2164 2229 2318 2336 2442 2454 2459 2924 2934 3136 3137 3142 3566 3585 3592 3609 3771 3774 3882 3883 3886 VECOM 00707 1826* 9087 VERSION 0321 839* 1836 4695 6476 9701 VMAMSG 14107 3098 9249* VPOS 00056 1484* 5700 5706 5709 5789 6065 6137 WDRQ 11426 7229 7360 7392 7539* 7549 WF28FM 12734 8666* 8689 WFDQ7 12735 8555 8556 8595 8623 8660 8667* WFERRM 12733 8633 8665* 8690 WFNST 12736 8622 8627 8632 8668* WFRDY 12703 8560 8596 8620* 8638 8663 8664 WFRET 12722 8630 8656* WIDTH 00030 1452* 1786 2009 5943 WORD 00067 1499* 1623 1624 1757 1776 1800 1818 1961 2024 2029 2034 2039 2049 2305 2372 2393 2531 2574 2824 2902 2904 2921 3135 3215 3219 3234 3539 3549 3555 3570 3571 3597 3601 3605 3716 3718 3732 3734 3746 3810 3812 3957 3964 3971 3984 3987 4006 4045 4049 4584 5122 5123 5126 5140 5142 5170 5175 5181 5194 5279 5484 5497 5499 5500 5503 5506 5530 5543 5545 5551 WORDH 00070 1500* 5544 5605 WREAD1 11403 7506* 7518 7520 WREADY 11400 7189 7223 7353 7385 7404 7418 7428 7503* WRIBU1 11610 7690* 7707 WRIBU2 11632 7713* 7718 WRIBU3 11640 7705 7723* WRIBUF 11600 7396 7680* WRMEM 01330 2161* 2176 WRPS0 20266 9585* 9599 WRPSS 20243 1788 3237 7858 9557* WRPSX 20303 9559 9603* WRPTR 03561 3794 3802 3836* 4300 WSR 6246 2050 5004 X1 00010 1442* 2445 2474 2494 2540 2551 2590 2599 2619 2647 3019 3023 3233 3235 3264 3265 3297 3300 3303 3370 3374 3377 3864 3880 3932 3986 4163 4167 5050 5063 5064 5065 5070 5078 5099 5100 5108 5110 5453 5457 5464 5468 X2 00011 1443* 2447 2476 2501 2510 2552 2589 2603 2623 2632 2651 2658 3021 3028 X3 00012 1444* 2478 2553 2626 2633 2653 2659 5243 5246 XCMDDN 20710 9796 9822* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 294 Symbol Table bts6120.plx XCOMM 20605 9740 9744* XCT1 02340 2907 2912* XCT2 02346 2915 2920* XCT3 02360 2929 2932* XCTBLK 02350 2903 2912 2922* XCTCOM 02324 2901* 9093 XDSCDF 12340 8233 8256* XFRCNT 10052 6328* 6667 6703 6715 6747 7237 7257 7263 7270 7682 7703 7717 7748 7769 7783 8181 8190 8247 8263 8949 8960 8971 8982 XIR 20004 9425* 9778 9835 9859 9873 9883 9887 9956 9960 9977 10018 XOFF 00054 1482* 5712 5777 5787 5967 6034 6043 6057 6064 XPC 20003 9424* 9768 9777 9831 9854 9965 XRCHECK 20453 9680* 9682 XRMES1 14345 4390 9274* XRMES2 14352 4396 9275* XRMES3 14357 4405 9276* XROMERR 20475 9688 9711* XSRCDF 12331 8229 8249* 8264 XTYPIR 20712 2097 9830* XX1 10012 6300* 7582 7583 7810 7815 7852 7855 7886 7888 7919 7921 8161 8186 8239 8254 8283 8298 8300 8302 8313 8317 8319 8531 8549 8554 8587 8603 8606 XX2 10013 6301* 8176 8189 8243 8262 ZBACKS 00100 1514* 5841 5843 ZBACKUP 00115 1527* 1751 1918 1985 2331 2529 2820 3062 3213 3226 3729 3744 5413 5822 5874 5879 ZCOMERR 00130 1538* 1924 1969 2215 2257 2533 2576 3963 3969 3975 3979 3998 4013 4627 4643 5404 5517 5560 ZCRLF 00110 1371 1522* 1601 1852 1855 1856 1909 1917 1990 2069 2412 2453 3099 3112 3409 3453 3895 4114 4154 4399 4406 4411 4459 4464 4513 4519 4524 4792 4807 4835 4875 5204 5207 5251 5627 5817 5831 5860 5950 6046 6269 ZDANDV 00126 1536* 1962 2230 2337 2628 2654 3586 ZDKRBN 00134 1542* 3289 3323 3352 3391 3413 3720 3733 3762 3826 3827 3829 3869 4078 4098 4103 4158 ZEOLNXT 00117 1529* 1826 1987 2440 2669 2699 2721 2739 2846 3064 3520 ZEOLTST 00116 1528* 1701 1753 1775 1799 1817 2001 2217 2258 2333 2395 2578 2822 2909 3129 3228 3749 3808 4051 4582 ZERROR 00131 1539* 1792 2239 2425 2462 2546 2584 2595 2916 3087 3146 3160 3241 4020 5325 ZGET 00120 1530* 2316 2526 2815 3996 4604 4621 4635 5410 5510 5553 ZINCHRS 00112 1524* 2405 3328 3396 5621 5783 ZINLMES 00111 1523* 1827 1832 1834 1838 1850 1853 2184 2286 2930 2932 3097 3110 3133 3256 3260 3284 3349 3410 3451 3772 4054 4063 4072 4112 4155 4267 4291 4389 4395 4404 4409 4430 4441 4444 4454 4457 4462 4492 4509 4517 4522 ZK177 00135 1545* 3029 5079 6025 ZK7 00137 1547* 1894 1906 3890 3993 5183 5272 5652 ZK70 00136 1546* 2128 2323 2378 2673 3602 4832 4856 5349 5588 5595 5607 6206 6273 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 295 Symbol Table bts6120.plx ZK7400 0142 1552* 5066 5071 ZK7600 0141 1550* ZM128 00141 1549* 1550 3470 3702 3795 ZM256 00142 1551* 1552 3435 3710 3803 4088 4101 4123 4141 4301 ZMSPACE 00140 1548* 4609 4641 5405 5414 5791 5904 ZNXTADR 00124 1534* 1904 1963 2227 2231 2274 2341 2418 ZOCTNW 00121 1531* 1960 2000 2304 2371 2392 2901 2908 3128 3214 3227 3714 3730 3745 3807 3956 3970 3983 4005 4044 4048 5597 ZOUTCHR 00076 1512* 3653 5083 5103 5114 5626 5780 5804 5816 5819 5830 5859 5876 6036 6045 ZPUSHJ1 00132 1540* 2013 2868 3092 3105 3185 3309 3312 3357 3360 3466 3752 3755 3832 3835 4082 4089 4117 4124 4135 4142 4428 4432 4494 4498 4533 4589 4594 ZRANGE 00122 1532* 1884 2213 2255 2332 2388 ZRDMEM 00125 1535* 1899 1930 2189 2222 2268 2406 2625 2680 ZRDPAGE 00133 1541* 3290 3324 3325 3353 3392 3393 3721 3735 3763 3828 ZRESTA 00127 1397 1537* 1738 3141 3654 4069 4269 4295 5208 6037 6280 ZSPACM0 00114 1526* 1964 2328 3223 3726 3741 4625 5310 ZSPACMP 00113 1525* 1748 1919 1982 3059 3210 5399 5486 5532 ZTDECNW 00106 1520* 4398 4436 4508 ZTDOT 00107 1521* 3336 3404 3872 4107 ZTOCT3 00105 1519* 1837 3874 ZTOCT4 00101 1515* 3871 5264 ZTOCT4C 00102 1516* 2289 2935 3266 3415 3901 4160 6276 ZTOCT4M 00103 1517* 2190 3775 ZTOCT4S 00104 1518* 1841 1845 1849 1900 1931 2078 2188 3138 3887 4066 ZTSPACE 00077 1513* 3876 5200 5266 5842 ZTSTADR 00123 1533* 1901 2223 2271 2338 2415 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 296 bts6120.plx PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 297 Table of Contents bts6120.plx SBC6120 ROM Monitor . . . . . . . . . . . . . . . . . . . . . . 1 BTS6120 Memory Layout . . . . . . . . . . . . . . . . . . . . . 2 Edit History . . . . . . . . . . . . . . . . . . . . . . . . . 4 SBC6120 IOTs and Definitions . . . . . . . . . . . . . . . . . 15 SBC6120 Memory Mapping Hardware . . . . . . . . . . . . . . . . 17 System Startup and POST Codes . . . . . . . . . . . . . . . . . 18 System Startup, Part 1 . . . . . . . . . . . . . . . . . . . . 19 System Startup, Part 2 . . . . . . . . . . . . . . . . . . . . 24 Field 0 Variables . . . . . . . . . . . . . . . . . . . . . . . 27 Monitor Main Loop . . . . . . . . . . . . . . . . . . . . . . . 30 Command Error Processing . . . . . . . . . . . . . . . . . . . 31 Get Next Command Character . . . . . . . . . . . . . . . . . . 32 H Command - Show Monitor Help . . . . . . . . . . . . . . . . . 33 Command Error Processing . . . . . . . . . . . . . . . . . . . 34 RP Command -- Repeat . . . . . . . . . . . . . . . . . . . . . 35 TW, TP, SC Commands - Set Terminal Width, Page and Scope . . . 36 VE Command - Show System Name and Version . . . . . . . . . . . 37 E and EP Commands -- Examine Main Memory or Panel Memory . . . 38 D and DP Commands -- Deposit in Main Memory or Panel Memory . . 40 ER and DR Commands - Examine and Deposit in Registers . . . . . 41 Initialize Terminal, Breakpoint, Partition Map, etc . . . . . . 42 Deposit in Registers . . . . . . . . . . . . . . . . . . . . . 43 Examine Registers . . . . . . . . . . . . . . . . . . . . . . . 44 Read and Write Memory . . . . . . . . . . . . . . . . . . . . . 46 BM Command -- Memory Block Move . . . . . . . . . . . . . . . . 48 CK Command -- Checksum Memory . . . . . . . . . . . . . . . . . 49 CM and FM Commands -- Clear Memory and Fill Memory . . . . . . 50 X / XP Command Stubs -- Disassemble memory . . . . . . . . . . 51 WS Command -- Word Search Memory . . . . . . . . . . . . . . . 52 BL Command -- List Breakpoints . . . . . . . . . . . . . . . . 54 Search for Breakpoints . . . . . . . . . . . . . . . . . . . . 55 BR Command -- Remove Breakpoints . . . . . . . . . . . . . . . 56 BP Command -- Set Breakpoints . . . . . . . . . . . . . . . . . 57 Insert Breakpoints in Memory . . . . . . . . . . . . . . . . . 58 Remove Breakpoints from Memory . . . . . . . . . . . . . . . . 59 TR Command -- Single Instruction with Trace . . . . . . . . . . 60 SI and P Commands - Single Instruction and Proceed . . . . . . 61 C Command - Restore Main Memory Context and Continue . . . . . 62 ST Command -- Start a Main Memory Program . . . . . . . . . . . 64 MR Command - Master Reset . . . . . . . . . . . . . . . . . . . 65 EX Command - Execute IOT Instructions . . . . . . . . . . . . . 66 OS/8 Bootstrap . . . . . . . . . . . . . . . . . . . . . . . . 67 Boot Sniffer . . . . . . . . . . . . . . . . . . . . . . . . . 69 B Command - Boot Disk . . . . . . . . . . . . . . . . . . . . . 70 Parse FORMAT Unit/Partition Argument . . . . . . . . . . . . . 72 Test for RAM Disk and/or IDE Disk . . . . . . . . . . . . . . . 73 PM Command - Show and Edit Disk Partition Map . . . . . . . . . 74 Disk Formatter, Pass 1 . . . . . . . . . . . . . . . . . . . . 76 Disk Formatter, Pass 2 . . . . . . . . . . . . . . . . . . . . 78 DF Command - Format IDE Disk Partition . . . . . . . . . . . . 80 RF Command - Format a RAM Disk . . . . . . . . . . . . . . . . 81 LP Command - Load Binary Paper Tapes from the Console . . . . . 82 Paper Tape Console Input Routine . . . . . . . . . . . . . . . 85 RD and DD Commands - Dump Disk (RAM and IDE) Records . . . . . 87 RL and DL Commands - Load Disk (RAM and IDE) Records . . . . . 89 Dump Disk Buffer on Console . . . . . . . . . . . . . . . . . . 91 Load Disk Buffer from Console . . . . . . . . . . . . . . . . . 93 PC Command - Copy an IDE Disk Partition . . . . . . . . . . . . 96 FL Command - Flash download . . . . . . . . . . . . . . . . . . 99 Field 0 Vector Table . . . . . . . . . . . . . . . . . . . . . 102 Show Extension ROM Status . . . . . . . . . . . . . . . . . . . 103 Initialize and Show RAM Disk Status . . . . . . . . . . . . . . 104 Initialize and Show IDE Disk Status . . . . . . . . . . . . . . 105 Call Routines in Field 1 . . . . . . . . . . . . . . . . . . . 107 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 298 Table of Contents bts6120.plx SD Command - Spin IDE Drives UP or DOWN . . . . . . . . . . . . 108 Simple Lexical Functions . . . . . . . . . . . . . . . . . . . 109 Free Space for Future Expansion! . . . . . . . . . . . . . . . 110 Front Panel Initialization . . . . . . . . . . . . . . . . . . 111 Scan Front Panel Switches . . . . . . . . . . . . . . . . . . . 112 FP LA, LXA, EXAMINE and DEPOSIT Switches . . . . . . . . . . . 114 Change Current DF to User's IF . . . . . . . . . . . . . . . . 116 START, CONTINUE and BOOT Switches . . . . . . . . . . . . . . . 117 HALT Switch . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Update the Front Panel Data Display . . . . . . . . . . . . . . 119 Blink Power LED for Low Battery . . . . . . . . . . . . . . . . 121 Type ASCII Strings . . . . . . . . . . . . . . . . . . . . . . 122 Type SIXBIT Words, and Characters . . . . . . . . . . . . . . . 124 Type Decimal Numbers . . . . . . . . . . . . . . . . . . . . . 125 Type Octal Numbers . . . . . . . . . . . . . . . . . . . . . . 126 Type Table of Messages . . . . . . . . . . . . . . . . . . . . 127 Type 15 Bit Addresses . . . . . . . . . . . . . . . . . . . . . 128 Scan Addresses . . . . . . . . . . . . . . . . . . . . . . . . 129 Scan an Address Range . . . . . . . . . . . . . . . . . . . . . 130 Address Arithmetic . . . . . . . . . . . . . . . . . . . . . . 131 Scan a Command Name . . . . . . . . . . . . . . . . . . . . . . 132 Command Lookup and Dispatch . . . . . . . . . . . . . . . . . . 133 Scan Decimal Numbers . . . . . . . . . . . . . . . . . . . . . 134 Scan Octal Numbers . . . . . . . . . . . . . . . . . . . . . . 135 Scan 15 Bit Addresses . . . . . . . . . . . . . . . . . . . . . 136 Ask For Confirmation . . . . . . . . . . . . . . . . . . . . . 137 Type Special Characters . . . . . . . . . . . . . . . . . . . . 138 Type Carriage Return, Line Feed and Backspace . . . . . . . . . 139 Read Command Lines . . . . . . . . . . . . . . . . . . . . . . 141 Terminal Output Primitives . . . . . . . . . . . . . . . . . . 144 Terminal Input Primitives . . . . . . . . . . . . . . . . . . . 146 Control Panel Entry Points . . . . . . . . . . . . . . . . . . 148 Field 1 Variables . . . . . . . . . . . . . . . . . . . . . . . 152 ROM Calls (PR0 Instructions) . . . . . . . . . . . . . . . . . 153 Fetch PR0 Arguments . . . . . . . . . . . . . . . . . . . . . . 155 ROM Call Table . . . . . . . . . . . . . . . . . . . . . . . . 156 Return from Routines in Field 1 . . . . . . . . . . . . . . . . 157 RAM Disk support . . . . . . . . . . . . . . . . . . . . . . . 158 RAM Disk Read/Write ROM Call . . . . . . . . . . . . . . . . . 159 RAM Disk Primary Bootstrap . . . . . . . . . . . . . . . . . . 161 Read and Write RAM Disk Pages . . . . . . . . . . . . . . . . . 162 Unpack RAM Disk Pages . . . . . . . . . . . . . . . . . . . . . 163 Pack RAM Disk Pages . . . . . . . . . . . . . . . . . . . . . . 164 Get Battery Status ROM Call . . . . . . . . . . . . . . . . . . 165 Determine RAM Disk Model . . . . . . . . . . . . . . . . . . . 166 Calculate RAM Disk Addresses . . . . . . . . . . . . . . . . . 168 Select RAM Disk Unit . . . . . . . . . . . . . . . . . . . . . 169 Get RAM Disk Size ROM Call . . . . . . . . . . . . . . . . . . 171 ATA Disk Support . . . . . . . . . . . . . . . . . . . . . . . 172 IDE Disk Interface . . . . . . . . . . . . . . . . . . . . . . 174 Initialize IDE Drive and Interface . . . . . . . . . . . . . . 175 Identify IDE/ATA Device . . . . . . . . . . . . . . . . . . . . 176 Get IDE Disk Size ROM Call . . . . . . . . . . . . . . . . . . 178 IDE Disk Primary Bootstrap . . . . . . . . . . . . . . . . . . 179 Read and Write IDE Sectors . . . . . . . . . . . . . . . . . . 180 Spin Up and Spin Down IDE Drive . . . . . . . . . . . . . . . . 182 Setup IDE Unit, LBA and Sector Count Registers . . . . . . . . 183 Wait for IDE Drive Ready . . . . . . . . . . . . . . . . . . . 185 Wait for IDE Data Request . . . . . . . . . . . . . . . . . . . 186 RAM Disk Diagnostics . . . . . . . . . . . . . . . . . . . . . 187 Write IDE Sector Buffer . . . . . . . . . . . . . . . . . . . . 189 Read IDE Sector Buffer . . . . . . . . . . . . . . . . . . . . 191 Initialize Disk Partition Map . . . . . . . . . . . . . . . . . 193 Set Disk Partition Map ROM Call . . . . . . . . . . . . . . . . 194 Get Disk Partition Map ROM Call . . . . . . . . . . . . . . . . 195 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 07-MAR-11 14:04:47 Page 299 Table of Contents bts6120.plx IDE Disk Read/Write ROM Call . . . . . . . . . . . . . . . . . 196 Write IDE Register . . . . . . . . . . . . . . . . . . . . . . 198 Read IDE Register . . . . . . . . . . . . . . . . . . . . . . . 199 Setup Disk I/O Buffer . . . . . . . . . . . . . . . . . . . . . 200 Test for IOB6120 CompactFlash Card . . . . . . . . . . . . . . 201 Setup Disk I/O Buffer Field and Space . . . . . . . . . . . . . 202 Copy Memory ROM Calls . . . . . . . . . . . . . . . . . . . . . 203 Copy Memory Extended ROM Call . . . . . . . . . . . . . . . . . 205 Get Arguments for MEMMOV Calls . . . . . . . . . . . . . . . . 207 LIGHTS Monitor Call . . . . . . . . . . . . . . . . . . . . . . 208 Read Flash ROM Call . . . . . . . . . . . . . . . . . . . . . . 209 Field 1 Vector Table . . . . . . . . . . . . . . . . . . . . . 211 Test for SBC6120-RC . . . . . . . . . . . . . . . . . . . . . . 212 Flash ROM erasure and writing . . . . . . . . . . . . . . . . . 213 SBC6120-RC RAM Disk support . . . . . . . . . . . . . . . . . . 217 SBC6120-RC RAM Disk Diagnostic . . . . . . . . . . . . . . . . 219 Set SBC6120-RC RAM Disk Address Register . . . . . . . . . . . 221 Read or Write SBC6120-RC RAM Disk . . . . . . . . . . . . . . . 223 Test DS1221 Batteries . . . . . . . . . . . . . . . . . . . . . 224 Command Names Table . . . . . . . . . . . . . . . . . . . . . . 225 Argument Tables for Various Commands . . . . . . . . . . . . . 227 Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Help Text . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Temporary Disk Buffer . . . . . . . . . . . . . . . . . . . . . 234 Field 2 Variables . . . . . . . . . . . . . . . . . . . . . . . 235 Field 2 Cross Field Linkages . . . . . . . . . . . . . . . . . 236 Persistent setting support (NVRAM) . . . . . . . . . . . . . . 237 Extension ROM management . . . . . . . . . . . . . . . . . . . 239 Field 2 Vector Table . . . . . . . . . . . . . . . . . . . . . 241 X / XP Commands -- Disassemble memory . . . . . . . . . . . . . 242 Disassemble Current Trace Location . . . . . . . . . . . . . . 244 Disassembler Top Level . . . . . . . . . . . . . . . . . . . . 245 Disassemble EA For MRIs . . . . . . . . . . . . . . . . . . . . 247 Disassemble OPR and IOT instructions . . . . . . . . . . . . . 249 Disassembler Tables (MRIs) . . . . . . . . . . . . . . . . . . 250 Disassembler Tables (IOTs) . . . . . . . . . . . . . . . . . . 251 Disassembler Tables (OPRs) . . . . . . . . . . . . . . . . . . 256 Disassembler Messages . . . . . . . . . . . . . . . . . . . . . 259 Free Space for Future Expansion! . . . . . . . . . . . . . . . 260 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 Symbol Table . . . . . . . . . . . . . . . . . . . . . . . . . . 267