PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 10-MAY-18 23:00:32 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 ; [End of monitor edit history] 837 0320 VERSION=320 ; latest edit number 838 839 ; TODO 840 ; Make the non-volatile settings stuff work with the RC RAM disk 841 ; We could to this easily enough by carving one page off the end of the first 842 ; RAMdisk bank (just reduce the size by 1 page), but is it really worth it? 843 ; All this would save for the RC is the terminal settings. On the SBC6120 it 844 ; also saves the partition map, but of course the RC doesn't have that. 845 ; Add a "burn in" command to exercise new systems? 846 ; Make the RP command display the iteration number in the address LEDs? 847 ; The ROM test/checksums can't distiguish the case of shorted EMA bits 848 ; (as evidenced by David Power's SBC6120 that had EMA1 stuck at 0!) 849 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 15 SBC6120 IOTs and Definitions bts6120.plx 850 .TITLE SBC6120 IOTs and Definitions 851 852 853 ; The console terminal interface of the SBC6120 is actually straight -8 854 ; compatible, which is a proper subset of the KL8E except that the KCF, TFL, 855 ; KIE and TSK (or SPI, depending on which manual you read!) instructions are 856 ; omitted. Console interrupts are permanently enabled, as they were in the 857 ; original PDP-8. The console interface in the SBC6120 DOES NOT use a 6121, 858 ; so there'll be none of this skip-on-flag-and-clear-it nonsense with KSF or 859 ; TSF! 860 6031 KSF=6031 ; Skip of console receive flag is set 861 6032 KCC=6032 ; Clear receive flag and AC 862 6034 KRS=6034 ; OR AC with receive buffer and DON't clear the flag 863 6036 KRB=6036 ; Read receive buffer into AC and clear the flag 864 6041 TSF=6041 ; Skip if the console transmit flag is set 865 6042 TCF=6042 ; Clear transmit flag, but not the AC 866 6044 TPC=6044 ; Load AC into transmit buffer, but don't clear flag 867 6046 TLS=6046 ; Load AC into transmit buffer and clear the flag 868 6412 PRISLU=6412 ; set console to primary SLU (03/04) 869 870 ; 8255 PPI Interface IOTs... 871 6470 PRPA=6470 ; read PPI port A 872 6471 PRPB=6471 ; " " " B 873 6472 PRPC=6472 ; " " " C 874 6473 PRCR=6473 ; " " control register 875 6474 PWPA=6474 ; write PPI port A 876 6475 PWPB=6475 ; " " " B 877 6476 PWPC=6476 ; " " " C 878 6477 PWCR=6477 ; " " control register 879 880 ; Front panel (FP612) IOTs... 881 6430 CCPR=6430 ; clear AC, HALT SW REQ and 30Hz REQ flags 882 6431 SHSW=6431 ; skip on HALT SW REQ flag 883 6432 SPLK=6432 ; skip on panel lock 884 6433 SCPT=6433 ; skip on 30Hz timer REQ flag 885 6434 RFNS=6434 ; read function switches (BOOT, EXAM, DEP, ROTSW, etc) 886 6435 RLOF=6435 ; turn off RUN LED 887 6437 RLON=6437 ; " on " " 888 ;SBBLO2 (6436) skip on backup battery low (SBC6120-RC only!) 889 ;OSR (7404) read data switches 890 ;WSR (6246) write data LEDs (when ROTSW != MD) 891 6415 PLOF=6415 ; POWER LED off (SBC6120-RC only!) 892 6417 PLON=6417 ; " " on ( " " " ) 893 894 ; Other SBC6120 instructions... 895 6440 POST=6440 ; Display a 3 bit POST code 896 6236 BPT=PR3 ; Breakpoint trap instruction 897 898 ; Special ASCII control characters that get used here and there... 899 0000 CHNUL=000 ; A null character (for fillers) 900 0003 CHCTC=003 ; Control-C (Abort command) 901 0007 CHBEL=007 ; Control-G (BELL) 902 0010 CHBSP=010 ; Control-H (Backspace) 903 0011 CHTAB=011 ; Control-I (TAB) 904 0012 CHLFD=012 ; Control-J (Line feed) 905 0015 CHCRT=015 ; Control-M (carriage return) 906 0017 CHCTO=017 ; Control-O (Suppress output) 907 0021 CHXON=021 ; Control-Q (XON) 908 0022 CHCTR=022 ; Control-R (Retype command line) 909 0023 CHXOF=023 ; Control-S (XOFF) 910 0025 CHCTU=025 ; Control-U (Delete command line) 911 0033 CHESC=033 ; Control-[ (Escape) 912 0177 CHDEL=177 ; RUBOUT (Delete) 913 914 ; OPR microinstructions that load the AC with various special constants... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 16 SBC6120 IOTs and Definitions bts6120.plx 915 7200 NL0000=CLA ; all models 916 7201 NL0001=CLA IAC ; all models 917 7326 NL0002=CLA CLL CML RTL ; all models 918 7332 NL2000=CLA CLL CML RTR ; all models 919 7350 NL3777=CLA CLL CMA RAR ; all models 920 7330 NL4000=CLA CLL CML RAR ; all models 921 7352 NL5777=CLA CLL CMA RTR ; all models 922 7346 NL7775=CLA CLL CMA RTL ; all models 923 7346 NLM3=NL7775 ; all models 924 7344 NL7776=CLA CLL CMA RAL ; all models 925 7344 NLM2=NL7776 ; all models 926 7240 NL7777=CLA CMA ; all models 927 7240 NLM1=NL7777 ; all models 928 7325 NL0003=CLA STL IAC RAL ; PDP-8/I and later 929 7307 NL0004=CLA CLL IAC RTL ; PDP-8/I and later 930 7327 NL0006=CLA STL IAC RTL ; PDP-8/I and later 931 7333 NL6000=CLA STL IAC RTR ; PDP-8/I and later 932 7203 NL0100=CLA IAC BSW ; PDP-8/E and later 933 7215 NL0010=CLA IAC R3L ; HM6120 only PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 17 SBC6120 Memory Mapping Hardware bts6120.plx 934 .TITLE SBC6120 Memory Mapping Hardware 935 936 937 ; The SBC6120 has three memory subsystems - 64K words of twelve bit RAM, 938 ; 8K words of 12 bit EPROM (actually the EPROM is 16 bits wide, but the 939 ; hardware just throws away the extra four bits), and up to 2Mb of 8 bit 940 ; battery backed up SRAM for a RAM disk. 941 ; 942 ; The HM6120 on the other hand, has only two memory spaces - panel memory 943 ; and main memory, and each of these is limited to 32K words. The SBC6120 944 ; implements a simple memory mapping scheme to allow all three memory 945 ; subsystems to fit in the available address space. Up to four different 946 ; memory maps are possible, although only three are currently implemented. 947 ; 948 ; The memory map in use is selected by four IOT instructions, MM0, MM1 949 ; MM2 and (what else) MM3. Memory map changes take place immediately with 950 ; the next instruction fetch - there's no delay until the next indirect JMP 951 ; the way there is with a CIF instruction. 952 ; 953 ; The four memory maps implemented by the SBC6120 are: 954 ; 955 ; * Map 0 uses the EPROM for all direct memory accesses, including instruction 956 ; fetch, and uses the RAM for all indirect memory accesses. This is the 957 ; mapping mode set by the hardware after a power on reset. 958 ; 959 ; * Map 1 uses the RAM for all direct memory accesses, including instruction 960 ; fetch, and uses the EPROM for all indirect memory references. This mode 961 ; is the "complement" of map 0, and it's used by the panel memory bootstrap 962 ; to copy the EPROM contents to RAM. 963 ; 964 ; * Map 2 uses the RAM for all memory accesses, regardless. This is the 965 ; mapping mode used during almost all operation after booting. 966 ; 967 ; * Map 3 is the same as map 2, except that the RAM disk memory is enabled 968 ; for all indirect accesses. BEWARE - RAM disk memory is only eight bits 969 ; wide and reads and writes to this memory space only store and return the 970 ; lower byte of a twelve bit word. This mode is used only while we're 971 ; accessing the RAM disk. 972 ; 973 ; IMPORTANT! The memory mapping mode affects only 6120 control panel memory 974 ; accesses. Main memory is always mapped to RAM regardless of the mapping 975 ; mode selected. 976 977 ; DIRECT INDIRECT 978 ; -------- -------- 979 6400 MM0=6400 ; EPROM RAM (automatically selected by a RESET) 980 6401 MM1=6401 ; RAM EPROM (used during system initialization) 981 6402 MM2=6402 ; RAM RAM (used almost all the time) 982 6403 MM3=6403 ; RAM DISK (used to access RAM disk only) PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 18 System Startup and POST Codes bts6120.plx 983 .TITLE System Startup and POST Codes 984 985 986 ; Getting the SBC6120 monitor up and running after a power up is a little 987 ; harder than we might wish. Our first problem is that we're actually 988 ; executing code from the EPROM now, and a lot of the usual PDP-8 techniques 989 ; of "self manipulation" (e.g. a JMS instruction!) won't work because the 990 ; program store isn't writable. Our second problem is that all of panel 991 ; fields 0 and 1 are mapped to EPROM, and there's no RAM anywhere in these 992 ; fields at all, not even in page zero. 993 ; 994 ; Our final problem is that we can't even be sure that all the hardware is 995 ; working correctly at this point. If some part isn't working, for example, 996 ; the RAM, we'd like to provide at least some kind of diagnostic message 997 ; before we end up lost forever. The minimum set of system components that 998 ; this monitor needs to have working before it can print a prompt and execute 999 ; commands is 1) the CPU, 2) the ROM, 3) the RAM, and 4) the console terminal. 1000 ; 1001 ; This means we need to accomplish two things during a cold boot - first, 1002 ; to execute a simple power on self test (aka POST), and second, to copy this 1003 ; monitor's code from EPROM to panel RAM where we can execute it without 1004 ; restriction. 1005 ; 1006 ; The SBC6120 has a single digit LED display that the program can set, via 1007 ; the POST instruction. At the beginning of each step in testing and 1008 ; initialization we set this digit to a particular value, and then if that 1009 ; test or startup part fails, we simply halt and the display remains at the 1010 ; last value set. The digits and their associated failure modes are: 1011 ; 1012 ; 7 - CPU failure (or it's not a 6120) 1013 ; 6 - panel RAM bootstrap failure 1014 ; 5 - RAM checksum failure 1015 ; 4 - memory test failure 1016 ; 3 - currently unused (reserved for 6121 failure?) 1017 ; 2 - console terminal failure 1018 ; 1 - panel monitor running (success!) 1019 ; 0 - user (main memory) program running PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 19 System Startup, Part 1 bts6120.plx 1020 .TITLE System Startup, Part 1 1021 1022 1023 ; This code lives in field one, page zero of the EPROM and it's the first 1024 ; thing that gets executed after a power on clear. Its main job is to get 1025 ; the SBC6120 memory initialized, which it does it with these steps: 1026 ; 1027 ; 1 - execute a simple CPU test 1028 ; 2 - execute a very simple RAM test 1029 ; 3 - copy EPROM to panel RAM 1030 ; 4 - verify the firmware checksum 1031 ; 5 - execute an extensive test on the remaining memory 1032 ; 1033 ; After it's done, it jumps to the second phase of initialization, which 1034 ; lives in field zero. When this code starts we're in memory mapping mode 1035 ; zero, which means that all instructions are being executed from EPROM and 1036 ; RAM can be addressed only indirectly. When it finishes, all code will be 1037 ; in panel RAM and we'll be running in memory mapping mode two, which means 1038 ; that all memory accesses go to RAM and the EPROM is inaccesible. 1039 ; 1040 ; After system initialization is complete, all this code is over written 1041 ; with page zero variables and storage for field one. 1042 10200 .FIELD 1 1043 10000 .PAGE 0 1044 1045 ; Location zero of field 1 (and field 0, for that matter) must contain a 1046 ; zero for the checksum routine. See the code at ROMCHK: for a discussion. 1047 10000 0000 0000 1048 1049 ; The first step is the CPU test, which is trivially simple. We just 1050 ; verify that we're actually running on a HM6120 and let it go at that... 1051 10001 6447 SYSINI: POST+7 ; set the POST code to 7 1052 10002 7215 CLA IAC R3L ; Only a 6120 has the R3L instruction 1053 10003 1177 TAD [-10] ; Did we get the right answer? 1054 10004 7440 SZA ; ??? 1055 10005 5147 JMP PFAIL1 ; Nope - halt forever 1056 1057 ; Before we copy the boot code to panel RAM, do a primitive (and it's really 1058 ; primitive!) test of RAM just to make sure there's something there we can 1059 ; read and write. Remember that at this point we're using memory map 0, so 1060 ; all direct references are to EPROM, but all indirect references are to RAM. 1061 10006 6446 POST+6 ; set the POST code to six 1062 10007 6276 SPD ; be sure we're accessing panel memory now! 1063 10010 7200 CLA ; ... 1064 10011 1176 TAD [2525] ; write an alternating bit pattern 1065 10012 3575 DCA @[ROMCPY] ; ... to RAM location zero 1066 10013 1174 TAD [5252] ; and write the complement to location 1 1067 10014 3573 DCA @[ROMCPY+1] ; ... 1068 10015 1575 TAD @[ROMCPY] ; now read them both back 1069 10016 1573 TAD @[ROMCPY+1] ; and add them up 1070 10017 7040 CMA ; and the result should be -1 1071 10020 7440 SZA ; ???? 1072 10021 5147 JMP PFAIL1 ; low RAM failure 1073 1074 ; Copy all of the EPROM moving code, which is six words starting at the label 1075 ; ROMCPY, from EPROM to exactly the same location in RAM. There's no way to 1076 ; use a loop to do this since we don't have any RAM that we can access directly 1077 ; to use as a pointer! 1078 10022 1040 TAD ROMCPY ; copy this one word from EPROM 1079 10023 3575 DCA @[ROMCPY] ; ... to RAM 1080 10024 1041 TAD ROMCPY+1 ; and do it for the entire routine 1081 10025 3573 DCA @[ROMCPY+1] ; ... 1082 10026 1042 TAD ROMCPY+2 ; ... 1083 10027 3572 DCA @[ROMCPY+2] ; ... 1084 10030 1043 TAD ROMCPY+3 ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 20 System Startup, Part 1 bts6120.plx 1085 10031 3571 DCA @[ROMCPY+3] ; ... 1086 10032 1044 TAD ROMCPY+4 ; ... 1087 10033 3570 DCA @[ROMCPY+4] ; ... 1088 10034 1045 TAD ROMCPY+5 ; ... 1089 10035 3567 DCA @[ROMCPY+5] ; ... 1090 1091 ; Now it gets tricky. At this instant we're still running in EPROM, and the 1092 ; first two instructions (at ROMCP0) get executed from EPROM. As soon as we 1093 ; execute the MM1 at ROMCPY:, however, the very next instruction is fetched 1094 ; from RAM. This should work, because the previous code has copied the six 1095 ; words that make up the ROMCPY loop from EPROM to exactly the same location 1096 ; in RAM. 1097 ; 1098 ; The loop the copies an entire field from EPROM to RAM, executing from RAM 1099 ; the whole time. It actually over writes itself in the process, but since it 1100 ; over writes itself with a copy of the exact same code we should be OK. By 1101 ; the time it falls thru the ISZ at the end of the loop, the subsequent code 1102 ; should exist in RAM. 1103 ; 1104 ; After copying field 1, we copy fields 2, 3, and 0. There is another 1105 ; subtlety here. The next step will be to checksum the RAM copy, but we're 1106 ; modifying it before we get there! Without some adjustment, the checksum 1107 ; will fail. As it turns out, there is a simple fix- the self-modifying code 1108 ; location is initialized with the value we expect it to have when the copy 1109 ; is complete. This actual instance of the value is never actually executed, 1110 ; but it is seen by the checksum generator and incorporated into the checksum, 1111 ; so everything works out. Although the first time thru we executed ROMCP0 1112 ; from EPROM, the next time thru we execute it from RAM, which is OK because 1113 ; it got copied during the first pass. 1114 ; BTW, Field 3 gets copied to RAM, but BTS6120 is only 3 fields long. Since 1115 ; there won't be a valid checksum in field 3, we will ignore it. 1116 ; 1117 ; Say goodbye to memory map 0 - we'll never need it again! 1118 1119 ; This loop copies all of a field, except location 0, from EPROM to RAM. 1120 10036 7201 ROMCP0: CLA IAC ; always start with location 1, not zero 1121 10037 3566 DCA @[0] ; save the address pointer here 1122 10040 6401 ROMCPY: MM1 ; (1) address RAM directly, EPROM indirectly 1123 10041 1400 TAD @0 ; (2) and load a word from EPROM 1124 10042 6402 MM2 ; (3) address RAM for all memory accesses 1125 10043 3400 DCA @0 ; (4) and store the word in RAM 1126 10044 2000 ISZ 0 ; (5) have we done an entire field? 1127 10045 5040 JMP ROMCPY ; (6) nope - keep copying 1128 10046 6214 RDF ; which field did we just copy? 1129 10047 7450 SNA ; was it 0? 1130 10050 5056 JMP ROMCP1 ; yes, finished copying fields 1131 10051 1165 TAD [CDF 1] ; no, make it a CDF to the next field 1132 10052 0164 AND [7737] ; wrap it around from CDF 3 to CDF 0 1133 10053 3054 DCA .+1 ; and store it to be executed 1134 10054 6201 CDF 0 ; change to new field *** see note above *** 1135 10055 5036 JMP ROMCP0 ; and copy it 1136 10056 ROMCP1: 1137 1138 ; When we leave this loop, we're using memory map 2 which means panel RAM 1139 ; is used everywhere and the EPROM is inaccessible. We'll stay in this mapping 1140 ; mode forever, except when we're accessing the RAM disk. 1141 1142 ; Each field of the panel ROM contains a 12 bit checksum, put there by the 1143 ; PDP2HEX program and calculated so that the sum of all words in the field, 1144 ; including the checksum word, will be zero. Now we'll compute and verify the 1145 ; checksum of both RAM fields, which proves that our RAMs work, that the 1146 ; EPROMS were programmed correctly, and that we copied them correctly. 1147 ; 1148 ; It might seem a better to do this before on the EPROMs before we've copied 1149 ; them to RAM, but the answer is that it's just impossible to compute a PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 21 System Startup, Part 1 bts6120.plx 1150 ; checksum using memory map 0 - there's no directly addressible RAM to use for 1151 ; address pointers or for storing the sum! 1152 ; 1153 ; Another issue here is the use of self-modifying code here and in the ROM 1154 ; copy function. Here, like above, we finesse the issue by initializing the 1155 ; modified location to the value it's expected to have (CDF 1) when this field 1156 ; is checksummed. 1157 ; 1158 ; One last subtle point is that we're keeping an address pointer in location 1159 ; zero of RAM, which wasn't in the EPROM when PDP2HEX calculated its checksum. 1160 ; This actually works by accident (er - excuse me, "Design"), since we keep 1161 ; our pointer in location zero of RAM, it will have the value zero when we 1162 ; checksum it. Coincidentally, this is exactly the same value that's in 1163 ; location zero of the ROM image. 1164 1165 ; This loop checksums one RAM field... 1166 10056 6445 POST+5 ; set the POST code to five 1167 10057 6221 CDF 2 ; checksum field 2 first 1168 10060 7201 ROMCHK: CLA IAC ; and start with location 1 (skip zero) 1169 10061 3000 DCA 0 ; ... 1170 10062 1400 ROMCH0: TAD @0 ; add up another word from RAM 1171 10063 2000 ISZ 0 ; have we done an entire field? 1172 10064 5062 JMP ROMCH0 ; nope - keep adding 1173 10065 7640 SZA CLA ; yes - did the checksum pass? 1174 10066 5147 JMP PFAIL1 ; RAM checksum failure 1175 10067 6214 RDF ; get the field we just did 1176 10070 7450 SNA ; was it field 0? 1177 10071 5076 JMP ROMCH1 ; yes, we're done 1178 10072 1163 TAD [6171] ; no, make it previous CDF by adding [CDF 0]-10 1179 10073 3074 DCA .+1 ; and store for execution next 1180 10074 6211 CDF 1 ; *** see note above *** 1181 10075 5060 JMP ROMCHK ; continue checksumming 1182 10076 ROMCH1: 1183 1184 ; The next step is to run a memory test on the remaining fields (2 thru 7) 1185 ; of panel memory and all fields of main memory. It's not a very sophisticated 1186 ; test - it just writes each memory location with its address in the first pass 1187 ; and then reads it back in the second, but it does prove that there's at least 1188 ; some memory out there listening. 1189 ; 1190 ; Before we do that, however, we do an even simpler test to verify that the 1191 ; panel data flag is working and that main memory and panel memory are two 1192 ; separate and distinct memory spaces... 1193 1194 ; Make sure that panel memory and main memory are distinct... 1195 10076 6444 POST+4 ; set the POST code to four 1196 10077 7240 STA ; put -1 in location 0 of panel memory 1197 10100 3566 DCA @[0] ; ... 1198 10101 6266 CPD ; and then put 0 in the same location 1199 10102 3566 DCA @[0] ; ... of main memory 1200 10103 6276 SPD ; back to panel memory 1201 10104 2566 ISZ @[0] ; and increment -1 1202 10105 5147 JMP PFAIL1 ; if it doesn't skip something is wrong 1203 1204 ; Test all eight fields of main memory... 1205 ; CLA ; and start testing with field zero 1206 10106 6266 CPD ; address main memory again 1207 10107 4122 MEMTS1: JMS FLDTST ; test this field, halt if it's bad 1208 10110 7440 SZA ; have we wrapped around to field 0 again ? 1209 10111 5107 JMP MEMTS1 ; no - test the next field 1210 1211 ; Then test only fields 3 thru 7 of panel memory... 1212 10112 6276 SPD ; address panel memory this time 1213 ;*** change this constant to 40 if testing extension ROM code in EPROM 1214 10113 1162 TAD [30] ; start testing with field 2 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 22 System Startup, Part 1 bts6120.plx 1215 10114 4122 MEMTS2: JMS FLDTST ; test this field, halt if it's bad 1216 10115 7440 SZA ; ... 1217 10116 5114 JMP MEMTS2 ; ... 1218 1219 ; As the last step in this part of the initialization, test the RAMdisk 1220 ; batteries (if a RAMdisk is installed). The DS1221 version of the RAMdisk 1221 ; requires that the battery test be performed before ANY other access to 1222 ; the RAMdisk array, so this has to happen before we can initialize the 1223 ; extension ROM. BTW, note that a) we have no stack yet, and b) the 1224 ; CK1221 routine also lives in field one, and c) CK1221 is only called 1225 ; once, from here! 1226 10117 4561 JMS @[CK1221] ; go test the DS1221 battery 1227 ; CDF 1 ; (CK1221 changes the DF!) 1228 1229 ; System initialization, part 1, is finished. The remainder of the code 1230 ; lives in field zero... 1231 10120 6203 CXF 0 1232 10121 5560 JMP @[SYSIN2] 1233 1234 ; This subroutine will test one field of either main memory or panel memory. 1235 ; It's a fairly simple minded test - it just writes each location with its 1236 ; address in the first pass and then reads it back in the second pass. If the 1237 ; test fails it just halts - there is no error return! 1238 10122 0000 FLDTST: 0 ; enter here with the field in the AC 1239 10123 1157 TAD [CDF 0] ; make a CDF instruction out of it 1240 10124 3125 DCA .+1 ; and execute it inline 1241 10125 7000 NOP ; gets over written with a CDF 1242 10126 3000 DCA 0 ; reset the address pointer 1243 10127 1000 FLDTS1: TAD 0 ; write each word with its address 1244 10130 3400 DCA @0 ; ... 1245 10131 2000 ISZ 0 ; have we done all 4K? 1246 10132 5127 JMP FLDTS1 ; nope - keep going 1247 10133 3000 DCA 0 ; yes - reset the s in field zeroaddress pointer 1248 10134 1000 FLDTS2: TAD 0 ; and make another pass to test 1249 10135 7041 CIA ; ... what we wrote 1250 10136 1400 TAD @0 ; ... 1251 10137 7440 SZA ; does this location contain the right value? 1252 10140 5147 JMP PFAIL1 ; no - just halt 1253 10141 2000 ISZ 0 ; yes - keep going for all 4K 1254 10142 5134 JMP FLDTS2 ; ... 1255 10143 6214 RDF ; get the data field we just tested 1256 10144 1156 TAD [10] ; and increment it for the caller 1257 10145 0155 AND [70] ; remove any overflow bits 1258 10146 5522 JMP @FLDTST ; return the next field to the caller 1259 1260 ; We jump here if any POST test fails so that we can blink the power LED. 1261 ; Unfortunately there isn't enough room for that on this page, so the real 1262 ; code lives with SYSIN2 in field 0 ... 1263 10147 6203 PFAIL1: CXF 0 ; change to field zero 1264 10150 5554 JMP @[PFAIL0] ; and go do the real code 1265 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 10-MAY-18 23:00:32 Page 23 System Startup, Part 1 bts6120.plx 10172 0042 10173 0041 10174 5252 10175 0040 10176 2525 10177 7770 1266 10200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 24 System Startup, Part 2 bts6120.plx 1267 .TITLE System Startup, Part 2 1268 1269 1270 ; This routine is the second phase of system initialization, and it lives 1271 ; in page one of field zero. It's called at the end of the first phase, and 1272 ; it will: 1273 ; 1274 ; 1 - test and initialize any extra hardware (e.g. 6121 chips) 1275 ; 2 - test and initialize the console terminal 1276 ; 3 - initialize any RAM that needs it 1277 ; 4 - print a sign on message 1278 ; 5 - jump to the monitor restart address 1279 ; 1280 ; After this code finishes, the monitor is running and a prompt will have been 1281 ; printed on the terminal. This code code gets overwritten immediately by the 1282 ; monitor's command line buffer, which also lives in page 1 of field 0. 1283 00200 .FIELD 0 1284 00200 .PAGE 1 1285 1286 ; The PDP2HEX program (which converts BIN files into ROM images in Intel 1287 ; HEX format) stores a checksum of ROM field 0 in location 00200, which will 1288 ; later be used by the POST... 1289 00200 ROMCK0: .BLOCK 1 1290 1291 1292 ; Create a software stack and initialize the stack pointer.... 1293 00201 6203 SYSIN2: CXF 0 ; Be sure the IB and DF are both zero 1294 00202 6276 SPD ; Address CP memory with indirect cycles 1295 00203 7200 CLA ; just in case... 1296 00204 1377 TAD [STACK] ; reset the 6120 stack pointer 1297 00205 6217 LSP1 ; ... 1298 1299 ; The SBC6120-RC model is nearly identical to the original, EXCEPT for the 1300 ; RAMdisk implementation. At this point (before we check for the extension 1301 ; ROM, which is yet another pseudo-RAM disk implementation!) we want to figure 1302 ; out if this machine is the RC model. Turns out that's fairly easy to do 1303 ; because the RC has the SBBLO2 (6436) IOT - this skips on backup battery low, 1304 ; which we don't care about right now, but it also clears the AC. Yes, it's 1305 ; a bit unusual for a skip IOT to clear the AC, but the SBC6120-RC does that 1306 ; on purpose just so that we can use this IOT (which is a NOP on the original 1307 ; SBC6120/FP6120) to distinguish that machine. 1308 00206 7240 STA ; AC = -1 1309 00207 6436 SBBLO2 ; clear the AC if this is an SBC6120-RC 1310 00210 7000 NOP ; (don't care about the battery right now) 1311 00211 7640 SZA CLA ; skip if this is the RC model 1312 00212 5216 JMP SYSI20 ; nope - go ahead with the extension ROM test 1313 00213 7040 CMA ; RC model - set RCFLAG = -1 1314 00214 3035 DCA RCFLAG ; ... 1315 00215 5222 JMP SYSI21 ; and skip the extension ROM test 1316 1317 ; check for an extension ROM in ramdisk memory at DAR=0000, DF=1, O=0000. 1318 ; The check looks for a signature of 'SB' 'C6' at the start, and a valid 1319 ; checksum. 1320 00216 6443 SYSI20: POST+3 ; set the POST code to three 1321 00217 6222 CIF 2 1322 00220 6205 .PUSHJ @[EXTROM] ; and call the extension ROM check 00221 5776 1323 1324 ; The next stage in initialization is to test the console terminal. Since 1325 ; the SBC6120 hardware doesn't have a loopback mode we can't really verify that 1326 ; data is being sent and received correctly, but we can at least test that the 1327 ; flags set and clear at appropriate times. That way we'll know, at last, that 1328 ; we won't hang forever if we do a "TLS; JMP .-1" loop. 1329 00222 6442 SYSI21: POST+2 ; set the POST code to two 1330 00223 7200 CLA ; send a null character to the console PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 25 System Startup, Part 2 bts6120.plx 1331 00224 6046 TLS ; ... 1332 00225 6041 TSF ; and then wait for the flag to set 1333 00226 5225 JMP .-1 ; waiting forever, if necessary! 1334 00227 6042 TCF ; clear the console flag 1335 00230 6041 TSF ; and then test it again 1336 00231 7410 SKP ; good - it _isn't_ set! 1337 00232 5267 JMP PFAIL0 ; bad - it's still set, so the console fails 1338 00233 6046 TLS ; send another null 1339 00234 6041 TSF ; and be sure it sets one more time 1340 00235 5234 JMP .-1 ; ... 1341 1342 ; Now make sure we can clear the keyboard input flag, and that KCC also 1343 ; clears the AC. The latter proves that there is at least some hardware out 1344 ; there controlling the C lines for the console terminal, although it doesn't 1345 ; guarantee that we can receive data. 1346 00236 7240 STA ; Load the AC with -1 1347 00237 6032 KCC ; Clear the keyboard flag and the AC 1348 00240 7440 SZA ; Verify that the AC got cleared 1349 00241 5267 JMP PFAIL0 ; Nope - console test failed! 1350 00242 6031 KSF ; And test the keyboard flag 1351 00243 7410 SKP ; Good - it _isn't_ set! 1352 00244 5267 JMP PFAIL0 ; Bad - the keyboard test failed 1353 1354 ; Set the control panel entry vector in 7777 to be a "JMP CPSAVE" instruction. 1355 ; We have to do this in a rather awkward way because PALX won't assemble a 1356 ; current page reference to CPSAVE unless we're actually on the same page as 1357 ; CPSAVE! 1358 00245 6441 SYSIN3: POST+1 ; the monitor is up and running now 1359 00246 1375 TAD [CPSAVE&177 | 5200] 1360 00247 3774 DCA @[7777] 1361 1362 ; Do any RAM initialization that needs to be done... 1363 00250 6205 .PUSHJ @[RAMINIT] 00251 5773 1364 1365 ; Figure out if we have a front panel (FP6120) and, if we do, turn it on... 1366 00252 6205 .PUSHJ @[FPINIT] 00253 5772 1367 1368 ; Type out the system name... 1369 00254 6205 .PUSHJ @ZCRLF ; First start on a new line 00255 5510 1370 00256 6205 .PUSHJ @[HELLO] ; Finally add our name and version 00257 5771 1371 1372 ; Initialize the RAM disk array (if any) and show its configuration ... 1373 00260 6205 .PUSHJ @[SHONVR] ; ... 00261 5770 1374 1375 ; Finally, probe the IDE bus for any drive that might be attached. 1376 00262 6205 .PUSHJ @[SHOIDE] ; ... 00263 5767 1377 1378 ; HOOK: End of startup, after BTS6120 messages but before command prompt. 1379 ; Unlike most hooks, this one does not have continuation code after the 1380 ; three hook words; the interceptor must instead jump to RESTA, which 1381 ; is also a hook and therefore known to the extension ROM. 1382 ; 1383 ; To Jim's kludge I add this even bigger kludge - we only need to print 1384 ; out information about the IOB6120 _if_ it fails to initialize successfully. 1385 ; In that case we're printing the error code from IOB initialization to tell 1386 ; the user that the IOB6120 was detected but it failed to initialize (probably 1387 ; because the flash is corrupt). If the IOB does initialize successfully, then 1388 ; it will overwrite the next three instructions with a jump to the IOB6120 1389 ; startup code, and that will print out everything you ever wanted to know PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 26 System Startup, Part 2 bts6120.plx 1390 ; about your IOB6120. 1391 ; 1392 ; QED - put the call to SHOEXT here, and it will only be executed if there's 1393 ; no IOB installed OR if the IOB6120 fails to start up successfully... 1394 00264 6205 SYSIN9: .PUSHJ @[SHOEXT] ; (note that this takes two words!) 00265 5766 1395 00266 5527 JMP @ZRESTA ; And we're ready for commands... 1396 1397 1398 ; This routine blinks the power LED on the SBC6120-RC at a pretty fast rate 1399 ; (much faster than the lazy 1Hz rate we use for the battery low warning). It's 1400 ; called whenever a POST step fails, and just loops forever blinking the LED. 1401 ; FWIW, this has no effect on the original SBC6120 or the SBC6120/FP6120 combo, 1402 ; since neither implements the PLOF or PLON IOTs. 1403 00267 6415 PFAIL0: PLOF ; power LED off 1404 00270 7001 IAC ; delay for a short time 1405 00271 7440 SZA ; ... 1406 00272 5267 JMP PFAIL0 ; (going back to PFAIL0 makes the delay longer) 1407 00273 6417 PFAIL2: PLON ; now do the same thing for LED on 1408 00274 7001 IAC ; ... 1409 00275 7440 SZA ; ... 1410 00276 5273 JMP PFAIL2 ; ... 1411 00277 5267 JMP PFAIL0 ; and just do that forever 1412 00366 4400 00367 4472 00370 4430 00371 0711 00372 5600 00373 4200 00374 7777 00375 5202 00376 0400 00377 0177 1413 00400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 27 Field 0 Variables bts6120.plx 1414 .TITLE Field 0 Variables 1415 1416 1417 ; Page zero of field zero contains most of the runtime data for the monitor, 1418 ; including the saved state of the user (main memory) program. It is purposely 1419 ; NOT overlayed by any startup code so that it may also contain initialized 1420 ; variables, such as JMP/JMS vectors. Data in this page gets initialized 1421 ; automatically when the first phase of system initialization copies the EPROM 1422 ; to RAM. 1423 1424 ; These words contain the saved state of the main memory (aka user) 1425 ; program. The PC gets saved to location zero automatically by the 6120 1426 ; on any entry to control panel, and the rest get saved by the code around 1427 ; CPSAVE... 1428 00000 .ORG 0000 1429 00000 UPC: .BLOCK 1 ; program counter (saved by the hardware) 1430 00001 UAC: .BLOCK 1 ; accumulator 1431 00002 UFLAGS: .BLOCK 1 ; status (LINK, GT, IF, DF, etc) from GCF 1432 00003 UMQ: .BLOCK 1 ; MQ register 1433 00004 USP1: .BLOCK 1 ; 6120 stack pointer #1 1434 00005 USP2: .BLOCK 1 ; " " " #2 1435 00006 UIRPC: .BLOCK 1 ; program counter where IR was fetched from 1436 00007 UIR: .BLOCK 1 ; the last main memory instruction to be executed 1437 1438 ; Auto-index registers... 1439 00010 .ORG 0010 ; this must be at location 10 !!! 1440 00010 X1: .BLOCK 1 ; the first auto-index register 1441 00011 X2: .BLOCK 1 ; the second auto-index register 1442 00012 X3: .BLOCK 1 ; the third auto-index register 1443 00013 L: .BLOCK 1 ; the command line pointer 1444 1445 00020 .ORG 0020 ; don't put anything else in auto-index locations 1446 1447 ; Persistent settings - will be read from NVRAM if any exists - 1448 0020 FIRSTPSS=. 1449 00020 PARMAP: .BLOCK 10 ; unit number to partition map for eight OS/8 units 1450 00030 WIDTH: .BLOCK 1 ; the width of the terminal 1451 00031 LENGTH: .BLOCK 1 ; the number of lines on the screen 1452 00032 SCOPE: .BLOCK 1 ; 1 if DEL should backspace 1453 0033 LASTPSS=. 1454 ; - end of persistent settings 1455 1456 ; Extension ROM info 1457 EXTFLG: .DATA 0 ; 0=no ext. ROM, 1=OK, 2=Bad checksum, 3..=error code 00033 0000 1458 RAMBAS: .DATA -1 ; RAM disk starting offset - 1 in each field 00034 7777 1459 1460 ; Other miscellanous data ... 1461 RCFLAG: .DATA 0 ; -1 if this machine is a SBC6120-RC 00035 0000 1462 BLTIME: .DATA 0 ; timer for blinking the power LED 00036 0000 1463 1464 ; Command parameters... 1465 00037 ADDR: .BLOCK 1 ; the current address 1466 00040 ADRFLD: .BLOCK 1 ; the field of this command 1467 00041 PNLMEM: .BLOCK 1 ; non-zero if ADDR/ADRFLD references panel memory 1468 00042 HIGH: .BLOCK 1 ; the high end of an address range 1469 00043 LOW: .BLOCK 1 ; the low end of an address range 1470 00044 HGHFLD: .BLOCK 1 ; the field of the high address 1471 00045 LOWFLD: .BLOCK 1 ; the field of the low address 1472 00046 VALUE: .BLOCK 1 ; the data word or value 1473 00047 NAME: .BLOCK 1 ; the name of this command 1474 00050 CHKSUM: .BLOCK 1 ; the checksum of memory or tape PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 28 Field 0 Variables bts6120.plx 1475 00051 SIMFLG: .BLOCK 1 ; non-zero if we're executing a single instruction 1476 00052 SAVCHR: .BLOCK 1 ; a place to save a character 1477 1478 ; Terminal parameters... 1479 00053 CTRLO: .BLOCK 1 ; non-zero if output is supressed 1480 00054 XOFF: .BLOCK 1 ; non-zero if output is suspended 1481 00055 HPOS: .BLOCK 1 ; the current horizontal position 1482 00056 VPOS: .BLOCK 1 ; the current vertical position 1483 00057 IRMA: .BLOCK 1 ; the console flag timeout counter 1484 1485 ; Front panel data... 1486 00060 FPDTCT: .BLOCK 1 ; non-zero if a FP6120 is present 1487 00061 FNSTAT: .BLOCK 1 ; last known state of the function switches 1488 00062 BTSWCN: .BLOCK 1 ; number of times the BOOT switch was pushed 1489 00063 FPPGMM: .BLOCK 1 ; non-zero for FP "program" mode 1490 00064 FPPGMD: .BLOCK 1 ; program data for program mode 1491 1492 ; Parameters for the repeat command... 1493 00065 REPCNT: .BLOCK 1 ; the number of times to repeat 1494 00066 REPLOC: .BLOCK 1 ; the location to repeat from 1495 1496 ; Number I/O locations... 1497 00067 WORD: .BLOCK 1 ; the number being read or written 1498 00070 WORDH: .BLOCK 1 ; the high order bits of the last word read 1499 00071 COUNT: .BLOCK 1 ; the number of digits read or written 1500 00072 DIGITS: .BLOCK 1 ; counts digits for numeric input/output routines 1501 1502 ; Storage for RDDUMP, DDDUMP, RLLOAD and DLLOAD, RFRMAT, and DFRMAT... 1503 00073 RECSIZ: .BLOCK 1 ; disk (page, block) size 1504 00074 RECCNT: .BLOCK 1 ; number of records to dump 1505 00075 FMTCNT: .BLOCK 1 ; number of blocks/records processed by FORMAT 1506 0042 CPYSRC=HIGH ; source partition for PC command 1507 0043 CPYDST=LOW ; destination partition for PC command 1508 1509 ; Page zero vectors (to save literal space)... 1510 00076 7400 ZOUTCHR: OUTCHR ; type a single character 1511 00077 7063 ZTSPACE: TSPACE ; type a space 1512 00100 7131 ZBACKS: TBACKS ; type a backspace 1513 00101 6322 ZTOCT4: TOCT4 ; type an octal number 1514 00102 6352 ZTOCT4C: TOCT4C ; type an octal number followed by a CRLF 1515 00103 6355 ZTOCT4M: TOCT4M ; type an octal number, a CRLF, and goto RESTA 1516 00104 6347 ZTOCT4S: TOCT4S ; type an octal number followed by a space 1517 00105 6343 ZTOCT3: TOCT3 ; type a 3 digit octal number 1518 00106 6277 ZTDECNW: TDECNW ; type a decimal number 1519 00107 7077 ZTDOT: TDOT ; type a dot (".") 1520 00110 7104 ZCRLF: CRLF ; type a carriage return/line feed 1521 00111 6237 ZINLMES: INLMES ; type a string passed in-line 1522 00112 7477 ZINCHRS: INCHRS ; poll the operator for input 1523 00113 4617 ZSPACMP: SPACMP ; get the next non-blank command character 1524 00114 4621 ZSPACM0: SPACM0 ; get a non-blank character starting with the current 1525 00115 4647 ZBACKUP: BACKUP ; backup the command line pointer 1526 00116 4632 ZEOLTST: EOLTST ; test current character for end of line 1527 00117 4630 ZEOLNXT: EOLNXT ; test the next character for end of line 1528 00120 0465 ZGET: GET ; get the next character from the command line 1529 00121 6720 ZOCTNW: OCTNW ; scan an octal number 1530 00122 6460 ZRANGE: RANGE ; scan an address range (e.g. "0-7777") 1531 00123 6525 ZTSTADR: TSTADR ; compare the HIGH/HGHFLD to LOW/LOWFLD 1532 00124 6512 ZNXTADR: NXTADR ; increment ADDR/ADRFLD 1533 00125 1316 ZRDMEM: RDMEM ; read a word from main or panel memory 1534 00126 1342 ZDANDV: DANDV ; deposit (in memory) and verify 1535 00127 0400 ZRESTA: RESTA ; monitor restart vector 1536 00130 0453 ZCOMERR: COMERR ; report a command syntax error and restart 1537 00131 0600 ZERROR: ERROR ; print an error message and restart 1538 00132 4537 ZPUSHJ1: PUSHJ1 ; call a routine in field 1 and return to field 0 1539 00133 0025 ZRDPAGE: RDPAGE ; current RAM disk page number in field 1 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 29 Field 0 Variables bts6120.plx 1540 00134 0021 ZDKRBN: DKRBN ; current IDE disk block number in field 1 1541 1542 ; Page zero constants (to save literal space)... 1543 00135 0177 ZK177: 177 ; used everywhere as a mask for ASCII characters 1544 00136 0070 ZK70: 70 ; used as a mask for data/instruction fields 1545 00137 0007 ZK7: 7 ; yet another mask 1546 00140 7740 ZMSPACE: -" " ; an ASCII space character (or the negative there of) 1547 00141 7600 ZM128: -128. ; record size of RAM disk 1548 0141 ZK7600=ZM128 1549 00142 7400 ZM256: -256. ; record size of IDE disk 1550 0142 ZK7400=ZM256 1551 1552 ; Local storage for INCHWL... 1553 00143 CMDLEN: .BLOCK 1 ; the length of the current line 1554 00144 PROMPT: .BLOCK 1 ; the prompting character 1555 1556 ; The software stack occupies all of the rest of page zero. 1557 00145 STKSAV: .BLOCK 1 ; the last monitor SP is saved here by CONTINUE 1558 0177 STACK=0177 1559 0031 STKLEN=STACK-. ; Length of the stack (if anybody cares) 1560 00146 .BLOCK STKLEN 1561 1562 1563 ; Page one of field zero contains the second phase system initialization 1564 ; code, and it's over written by the command line buffer and break point 1565 ; tables after we're running. 1566 00200 .ORG 0200 1567 1568 ; The PDP2HEX program stores a checksum of ROM field 0 in location 00200, 1569 ; and we have to reserve space for it here so it doesn't get overwritten by 1570 ; any of our data. See the code at ROMCK0: for more discussion. 1571 00200 .BLOCK 1 1572 1573 ; Breakpoint storage... 1574 0010 MAXBPT=8. ; maximum number of breakpoints 1575 00201 BPTADR: .BLOCK MAXBPT ; address assigned to each breakpoint 1576 00211 BPTFLD: .BLOCK MAXBPT ; field of the breakpoint 1577 00221 BPTDAT: .BLOCK MAXBPT ; original data at the breakpoint 1578 0210 BPTEND=BPTADR+MAXBPT-1 ; end of the breakpoint address table 1579 1580 ; The command line buffer for INCHWL occupies all that remains of page one... 1581 0147 MAXCMD=0400-. ; space available for the command buffer 1582 00231 CMDBUF: .BLOCK MAXCMD ; and the actual command buffer PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 30 Monitor Main Loop bts6120.plx 1583 .TITLE Monitor Main Loop 1584 1585 00400 .PAGE 2 1586 1587 ; This routine will read commands from the terminal and execute them. It 1588 ; can be entered at RESTA to restart after a control-C or a fatal error, and 1589 ; at BOOTS after completion of a normal command... 1590 ; HOOK: Monitor reentry 1591 00400 7000 RESTA: NOP 1592 00401 7000 NOP 1593 00402 7000 NOP 1594 00403 6276 SPD ; Ensure that CP memory is always selected 1595 00404 6435 RLOF ; The RUN LED is off while we're here 1596 00405 7200 CLA ; And be sure the AC is cleared 1597 00406 1377 TAD [STACK] ; Point to the stack 1598 00407 6217 LSP1 ; Clean up the stack pointer 1599 00410 6205 .PUSHJ @ZCRLF ; Be sure the terminal is ready 00411 5510 1600 1601 ; Read another command line... 1602 00412 7200 BOOTS: CLA ; ... 1603 00413 1376 TAD [">"] ; Point to the prompt 1604 00414 6205 .PUSHJ @[INCHWL] ; Initialize the line input routine 00415 5775 1605 00416 6205 BOOTS0: .PUSHJ @[SWSCAN] ; Scan the switches while we're waiting 00417 5774 1606 00420 6205 .PUSHJ @[INCHW1] ; Read another character into the line 00421 5773 1607 00422 7650 SNA CLA ; EOL? 1608 00423 5216 JMP BOOTS0 ; Nope - keep reading 1609 00424 3065 DCA REPCNT ; Clear the repeat counter initially 1610 1611 ; Execute the next command... 1612 00425 6205 BOOTS1: .PUSHJ @[NAMENW] ; First identify a command 00426 5772 1613 00427 1047 TAD NAME ; Get the name we read 1614 00430 7650 SNA CLA ; Is this a null command ?? 1615 00431 5235 JMP BOOTS2 ; Yes -- just ignore it 1616 00432 1371 TAD [CMDTBL-1] ; Then point to the list of commands 1617 00433 6205 .PUSHJ @[MATCH] ; And look it up 00434 5770 1618 1619 ; See if there are more commands on this line... 1620 00435 1013 BOOTS2: TAD L ; Get the pointer to the last character 1621 00436 3067 DCA WORD ; And save it in a non-autoindex location 1622 00437 1467 TAD @WORD ; Get the last character we saw 1623 00440 1367 TAD [-073] ; Was it a command seperator ?? 1624 00441 7650 SNA CLA ; ???? 1625 00442 5225 JMP BOOTS1 ; Yes -- go execute another command 1626 1627 ; See if this command needs to be repeated... 1628 00443 7240 STA ; Load the AC with -1 1629 00444 1065 TAD REPCNT ; And add to the repeat counter 1630 00445 7510 SPA ; Is the counter positive ?? 1631 00446 5212 JMP BOOTS ; No -- go read anothter line 1632 00447 3065 DCA REPCNT ; Yes -- save the new count 1633 00450 1066 TAD REPLOC ; And get the location to start from 1634 00451 3013 DCA L ; Backup the command scanner 1635 00452 5225 JMP BOOTS1 ; Then go execute this command again PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 31 Command Error Processing bts6120.plx 1636 .TITLE Command Error Processing 1637 1638 1639 ; This routine is called when a syntax error is found in the command and it 1640 ; echo the part of the command which has already been scanned inside question 1641 ; marks (very much like TOPS-10 used to do!). After that, the monitor is 1642 ; restarted (i.e. the stack is cleaned up and another prompt issued). 1643 00453 7200 COMERR: CLA ; Ignore the contents of the AC 1644 00454 3413 DCA @L ; And mark the end of what was actually scanned 1645 00455 6205 .PUSHJ @[TQUEST] ; Type the first question mark 00456 5766 1646 00457 1365 TAD [CMDBUF-1] ; And point to the command line 1647 00460 6205 .PUSHJ @[TASCIZ] ; Echo that 00461 5764 1648 00462 6205 .PUSHJ @[TQUEST] ; Then type another question 00463 5766 1649 00464 5200 JMP RESTA ; Go restart the monitor PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 32 Get Next Command Character bts6120.plx 1650 .TITLE Get Next Command Character 1651 1652 1653 ; This routine will get the next character from the command line. If the 1654 ; character is lower case, it is folded to upper case. If the character is a 1655 ; TAB, it is converted to a space. And, if the character is ";" or "!" (the 1656 ; start of a comment) it is converted to zero (end of line). Finally, the 1657 ; character is returned in both the AC and location SAVCHR. 1658 00465 7200 GET: CLA ; Be sure the AC is safe to use 1659 00466 1413 TAD @L ; Get another character from the line 1660 00467 1363 TAD [-"A"-40] ; Compare this character to lower case A 1661 00470 7500 SMA ; ??? 1662 00471 5305 JMP GET1 ; It might be a lower case letter 1663 1664 ; The character is not lower case -- check for a TAB, ; or !... 1665 00472 1362 TAD ["A"+40-CHTAB] ; Is this a tab character ?? 1666 00473 7450 SNA ; ??? 1667 00474 1361 TAD [" "-CHTAB] ; Yes -- convert it to a space 1668 00475 1360 TAD [CHTAB-"!"] ; No -- Is it a ! character ?? 1669 00476 7450 SNA ; ??? 1670 00477 1357 TAD [-"!"] ; Yes -- Convert it to a null 1671 00500 1356 TAD ["!"-073] ; Last chance -- is it a ; ?? 1672 00501 7450 SNA ; ??? 1673 00502 1367 TAD [-073] ; Yes -- convert that to zero too 1674 00503 1355 TAD [073] ; No -- restore the original character 1675 00504 5311 JMP GET2 ; Then store the character and return 1676 1677 ; Here if the character might be lower case... 1678 00505 1354 GET1: TAD ["A"-"Z"] ; Compare to the other end of the range 1679 00506 7550 SPA SNA ; ??? 1680 00507 1353 TAD [-40] ; It's lower case -- convert to upper 1681 00510 1352 TAD ["Z"+40] ; Restore the correct character 1682 1683 ; Store the character and return... 1684 00511 3052 GET2: DCA SAVCHR ; Remember this character 1685 00512 1052 TAD SAVCHR ; And also return it in the AC 1686 00513 6225 .POPJ ; And that's it PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 33 H Command - Show Monitor Help bts6120.plx 1687 .TITLE H Command - Show Monitor Help 1688 1689 ; The H command generates a simple list of all monitor commands and a 1690 ; brief, one line, help message for each. The whole function is driven 1691 ; by a table of help messages stored in field one - this table contains 1692 ; a list of pointers and each pointer points to the packed ASCII text of 1693 ; a single line of help. We simply print each line and add a CRLF at the 1694 ; end. It's done this way (as a table of lines) rather than as a single, 1695 ; huge, string with embedded CRLFs because the automatic XOFF (i.e. terminal 1696 ; page) processing is done via the CRLF routine. Embedded CRLFs wouldn't 1697 ; automatically XOFF, and so most of the text would scroll right off the 1698 ; top of the CRT. 1699 00514 6205 HELP: .PUSHJ @ZEOLTST ; no arguments are allowed 00515 5516 1700 00516 4751 JMS @[TTEXTT] ; generic help for all models, part 1 1701 00517 4404 HLPP1 ; ... 1702 00520 4750 JMS @[CHKRAM] ; skip if a RAM disk is attached 1703 00521 5324 JMP HELP2 ; no RAM disk - skip this part 1704 00522 4751 JMS @[TTEXTT] ; print the RAM disk commands 1705 00523 4443 HLPRAM ; ... 1706 00524 4747 HELP2: JMS @[CHKIDE] ; skip if an IDE disk is attached 1707 00525 5330 JMP HELP3 ; no IDE disk - skip these commands 1708 00526 4751 JMS @[TTEXTT] ; print the IDE disk commands 1709 00527 4452 HLPIDE ; ... 1710 00530 1033 HELP3: TAD EXTFLG ; is an IOB6120 attached? 1711 00531 7650 SNA CLA ; skip if yes 1712 00532 5335 JMP HELP4 ; nope - skip the IOB6120 commands 1713 00533 4751 JMS @[TTEXTT] ; print the IOB6120 commands 1714 00534 4465 HLPIOB ; ... 1715 00535 4751 HELP4: JMS @[TTEXTT] ; generic help for all models, part 2 1716 00536 4471 HLPP2 ; ... 1717 00537 6225 .POPJ 1718 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 1719 00600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 34 Command Error Processing bts6120.plx 1720 .TITLE Command Error Processing 1721 1722 1723 ; This routine prints an error message and then restarts the monitor. Unlike 1724 ; nearly every other routine in the monitor this one is called via a JMS 1725 ; instruction rather than a .PUSHJ, and that so that the address of the error 1726 ; message can be passed in line, in the word after the JMS. 1727 ; 1728 ; CALL: 1729 ; JMS @ZERROR 1730 ;
1731 00600 0000 ERROR: 0 ; enter here with a JMS 1732 00601 7200 CLA ; the AC is unknown here 1733 00602 6205 .PUSHJ @[TQUEST] ; always type a question mark 00603 5777 1734 00604 1600 TAD @ERROR ; pick up the address of the message 1735 00605 6205 .PUSHJ @[OUTSTR] ; and type that out too 00606 5776 1736 00607 5527 JMP @ZRESTA ; restart the monitor and read another command PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 35 RP Command -- Repeat bts6120.plx 1737 .TITLE RP Command -- Repeat 1738 1739 1740 ; This command allows the rest of the command line to be repeated, and it 1741 ; accepts an optional argument which specifes the number of times to repeat, 1742 ; in decimal. The range for this argument is 1 to 2047 and if it is omitted, 1743 ; it defaults to 2047. Note that repeat commands may not be nested; a repeat 1744 ; command will cancel any previous repeat on the same command line. Any error 1745 ; or a control-C will terminate the repetition prematurely. 1746 00610 6205 REPEAT: .PUSHJ @ZSPACMP ; Get the next character 00611 5513 1747 00612 7650 SNA CLA ; Is it the end of the command ?? 1748 00613 5225 JMP REPEA1 ; Yes -- use the default count 1749 00614 6205 .PUSHJ @ZBACKUP ; No -- backup the scanner 00615 5515 1750 00616 6205 .PUSHJ @[DECNW] ; Then read a decimal number 00617 5775 1751 00620 6205 .PUSHJ @ZEOLTST ; Then test for the end of the line 00621 5516 1752 1753 ; Set up the repeat counter... 1754 00622 7240 STA ; Subtract one from the user's 1755 00623 1067 TAD WORD ; argument... 1756 00624 7410 SKP ; ... 1757 00625 7350 REPEA1: NL3777 ; If there's no argument, use 2047 1758 00626 3065 DCA REPCNT ; Set the repeat counter 1759 1760 ; Set up the repeat pointer... 1761 00627 1013 TAD L ; Get the current line pointer 1762 00630 3066 DCA REPLOC ; Remember where to start from 1763 00631 1466 TAD @REPLOC ; Then examine the current character 1764 00632 7650 SNA CLA ; Is the repeat the last command on the line ?? 1765 00633 3065 DCA REPCNT ; Yes -- this is all pointless after all 1766 00634 6225 .POPJ ; Then proceed with the next command PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 36 TW, TP, SC Commands - Set Terminal Width, Page and Scope bts6120.plx 1767 .TITLE TW, TP, SC Commands - Set Terminal Width, Page and Scope 1768 1769 1770 ; The TW command sets the terminal screen width to the value of its argument, 1771 ; which is a _decimal_ number. Screen widths are limited to the range 32..255. 1772 00635 6205 TWCOM: .PUSHJ @[DECNW] ; read a decimal operand again 00636 5775 1773 00637 6205 .PUSHJ @ZEOLTST ; then check for the end of the line 00640 5516 1774 00641 1067 TAD WORD ; get the desired width 1775 00642 7450 SNA ; is it zero ?? 1776 00643 5253 JMP TWCOM1 ; yes -- that disables automatic returns 1777 00644 1374 TAD [-32.] ; compare it to 32 1778 00645 7510 SPA ; is it at least 32 ?? 1779 00646 5256 JMP TFILV ; no -- ?ILLEGAL VALUE 1780 00647 1373 TAD [32.-255.] ; now compare it to 255 1781 00650 7540 SMA SZA ; it can't be bigger than that 1782 00651 5256 JMP TFILV ; but it is... 1783 00652 1372 TAD [255.] ; restore the original number 1784 00653 3030 TWCOM1: DCA WIDTH ; and set the terminal width 1785 00654 6222 TWCOM2: CIF 2 1786 00655 5771 JMP @[WRPSS] ; store it in NVRAM if it exists 1787 ; and we're all done 1788 1789 ; Here if the parameter value is illegal... 1790 00656 4531 TFILV: JMS @ZERROR ; yes -- it isn't legal 1791 00657 3432 ERRILV ; ?ILLEGAL VALUE 1792 1793 ; The TP command sets the terminal page size to the value of its argument, 1794 ; in _decimal_. Page sizes may range from 12 to 48, or zero. A value of zero 1795 ; disables the automatic XOFF function completely. 1796 00660 6205 TPCOM: .PUSHJ @[DECNW] ; Read a decimal operand 00661 5775 1797 00662 6205 .PUSHJ @ZEOLTST ; And check for the end of the line 00663 5516 1798 00664 1067 TAD WORD ; Get the value he gave 1799 00665 7450 SNA ; Is it zero ?? 1800 00666 5276 JMP TPCOM1 ; Yes -- that is legal (to disable) 1801 00667 1370 TAD [-12.] ; Compare it to 12 lines 1802 00670 7510 SPA ; We have to have at least that many 1803 00671 5256 JMP TFILV ; No -- ?ILLEGAL VALUE 1804 00672 1374 TAD [16.-48.] ; Then compare it to 48 1805 00673 7540 SMA SZA ; Is it more than that ?? 1806 00674 5256 JMP TFILV ; Yes -- that won't work, either 1807 00675 1367 TAD [48.] ; Restore the original number 1808 00676 3031 TPCOM1: DCA LENGTH ; And set the new terminal length 1809 00677 5254 JMP TWCOM2 1810 1811 ; The SC command sets the SCOPE flag to its operand. When non-zero, the 1812 ; line input command will respond to a DEL with a destructive backspace 1813 ; instead of the default echo. 1814 00700 6205 SCCOM: .PUSHJ @[DECNW] ; Read a decimal operand 00701 5775 1815 00702 6205 .PUSHJ @ZEOLTST ; And check for the end of the line 00703 5516 1816 00704 1067 TAD WORD ; Get the value he gave 1817 00705 3032 DCA SCOPE 1818 00706 5254 JMP TWCOM2 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 37 VE Command - Show System Name and Version bts6120.plx 1819 .TITLE VE Command - Show System Name and Version 1820 1821 1822 ; This routine will type the name and version of the monitor. It is called 1823 ; at startup, and by the VE command. 1824 00707 6205 VECOM: .PUSHJ @ZEOLNXT ; enter here for the VE command 00710 5517 1825 00711 4511 HELLO: JMS @ZINLMES ; type out "SBC6120" 1826 00712 4121 SYSNM0 ; ... 1827 00713 1035 TAD RCFLAG ; check the SBC6120-RC flag 1828 00714 7650 SNA CLA ; skip if this is the SBC6120-RC model 1829 00715 5320 JMP HELLO1 ; nope - this is the original deal 1830 00716 4511 JMS @ZINLMES ; add "-RC" to SBC6120 for this model 1831 00717 4167 SYSNM4 ; ... 1832 00720 4511 HELLO1: JMS @ZINLMES ; type out the name of the system 1833 00721 4127 SYSNM1 ; ... 1834 00722 1366 TAD [VERSION] ; get the present edit level 1835 00723 6205 .PUSHJ @ZTOCT3 ; type that in octal 00724 5505 1836 00725 4511 JMS @ZINLMES ; say 1837 00726 4142 SYSNM2 ; "Checksum " 1838 00727 1765 TAD @[ROMCK0] ; get the checksum of ROM field 0 1839 00730 6205 .PUSHJ @ZTOCT4S ; type that and a space 00731 5504 1840 00732 6211 CDF 1 ; then do the same for ROM field 1 1841 00733 1765 TAD @[ROMCK1] ; ... 1842 00734 6201 CDF 0 ; ... 1843 00735 6205 .PUSHJ @ZTOCT4S ; .... 00736 5504 1844 00737 6221 CDF 2 ; and do the same for ROM field 2 1845 00740 1765 TAD @[ROMCK2] ; ... 1846 00741 6201 CDF 0 ; ... 1847 00742 6205 .PUSHJ @ZTOCT4S ; ... 00743 5504 1848 00744 4511 JMS @ZINLMES ; finally, type the system date 1849 00745 4152 SYSNM3 ; ... 1850 00746 6205 .PUSHJ @ZCRLF ; finish that line 00747 5510 1851 00750 4511 JMS @ZINLMES ; then type the copyright notice 1852 00751 4172 SYSCRN ; ... 1853 00752 6205 .PUSHJ @ZCRLF 00753 5510 1854 00754 5510 JMP @ZCRLF ; finish that line and we're done 1855 00765 0200 00766 0320 00767 0060 00770 7764 00771 0243 00772 0377 00773 7441 00774 7740 00775 6662 00776 6200 00777 7066 1856 01000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 38 E and EP Commands -- Examine Main Memory or Panel Memory bts6120.plx 1857 .TITLE E and EP Commands -- Examine Main Memory or Panel Memory 1858 1859 1860 ; The E command allows the user to examine the contents of memory in octal, 1861 ; either one word at a time or an entire range of addresses. In the latter 1862 ; case a memory dump is printed with eight PDP-8 words per line. It accepts 1863 ; several forms of operands, for example: 1864 ; 1865 ; >E 1234 -> Examine location 1234 in the data field 1866 ; >E 01234 -> Examime location 1234 of field zero 1867 ; >E 41234 -> Examine location 1234, field 4 1868 ; >E 71000-2000 -> Examine locations 1000 through 2000, field 7 1869 ; >E 50000-77777 -> Examine location 0, field 5 thru 7777, field 7 1870 ; 1871 ; The EP command is identical to E, except that panel memory is examined 1872 ; rather than main memory. 1873 1874 ; Enter here for the EP command... 1875 01000 7240 EPMEM: STA ; set the PNLMEM flag 1876 01001 7410 SKP ; fall into the regular code 1877 ; Enter here for the E command... 1878 01002 7200 EMEM: CLA ; clear the PNLMEM flag 1879 01003 3041 DCA PNLMEM ; to reference main memory 1880 1881 ; Both forms join up here... 1882 01004 6205 EMEM0: .PUSHJ @ZRANGE ; go read an address range 01005 5522 1883 01006 7420 SNL ; was there just one address ??? 1884 01007 5242 JMP EONE ; yes -- just examine one location 1885 1886 ; Fix up the address range for multiple word examines... 1887 01010 1043 TAD LOW ; get the low boundry 1888 01011 0377 AND [7770] ; round it down to a multiple of 8 1889 01012 3037 DCA ADDR ; then it becomes the starting address 1890 01013 1042 TAD HIGH ; get the ending address 1891 01014 0377 AND [7770] ; round it up to a multiple of 8 1892 01015 1137 TAD ZK7 ; ... 1893 01016 3042 DCA HIGH ; and remember the last address to process 1894 1895 ; Type out lines of 8 memory locations... 1896 01017 6205 EMEM1: .PUSHJ @[TADDR] ; type out the address of the next word 01020 5776 1897 01021 6205 EMEM2: .PUSHJ @ZRDMEM ; go read a word from main memory 01022 5525 1898 01023 6205 .PUSHJ @ZTOCT4S ; type the word in octal 01024 5504 1899 01025 6205 .PUSHJ @ZTSTADR ; have we done all the locations ?? 01026 5523 1900 01027 7430 SZL ; are we there yet ??? 1901 01030 5244 JMP EMEM3 ; yes -- finish the line and return 1902 01031 6205 .PUSHJ @ZNXTADR ; no -- increment to the next address 01032 5524 1903 01033 1037 TAD ADDR ; get the current address 1904 01034 0137 AND ZK7 ; is it a multiple of 8 ?? 1905 01035 7640 SZA CLA ; ??? 1906 01036 5221 JMP EMEM2 ; no -- keep typing 1907 01037 6205 .PUSHJ @ZCRLF ; yes -- start on a new line 01040 5510 1908 01041 5217 JMP EMEM1 ; and type the next address 1909 1910 ; Here to examine a single memory location... 1911 01042 6205 EONE: .PUSHJ @[TMEM] ; type out the contents of memory 01043 5775 1912 ; and fall into the next range 1913 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 39 E and EP Commands -- Examine Main Memory or Panel Memory bts6120.plx 1914 ; Here when we've finished examining one range of addresses... 1915 01044 6205 EMEM3: .PUSHJ @ZCRLF ; finish the current line 01045 5510 1916 01046 6205 .PUSHJ @ZBACKUP ; backup the command line pointer 01047 5515 1917 01050 6205 .PUSHJ @ZSPACMP ; ... and get the next character 01051 5513 1918 01052 7450 SNA ; is it the end of the line ?? 1919 01053 6225 .POPJ ; yes -- just stop now 1920 01054 1374 TAD [-","] ; no -- check for a comma 1921 01055 7640 SZA CLA ; ???? 1922 01056 5530 JMP @ZCOMERR ; this isn't legal 1923 01057 5204 JMP EMEM0 ; yes -- do another operand 1924 1925 ; This routine will type the address and contents of the memory location 1926 ; indicated by registers ADDR and ADRFLD. 1927 01060 6205 TMEM: .PUSHJ @[TADDR] ; first type the address 01061 5776 1928 01062 6205 .PUSHJ @ZRDMEM ; then load the indicated word 01063 5525 1929 01064 5504 JMP @ZTOCT4S ; type it out and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 40 D and DP Commands -- Deposit in Main Memory or Panel Memory bts6120.plx 1930 .TITLE D and DP Commands -- Deposit in Main Memory or Panel Memory 1931 1932 1933 ; The D command allows the user to deposit one or more words in memory. The 1934 ; general format is: 1935 ; 1936 ; >D 60123 4567 -> Deposit 4567 into location 0123, field 6 1937 ; >D 40000 1,2,3,4 -> Deposit 0001 into location 0, field 4, and 0002 1938 ; into location 1, field 4, and 0003 into location 1939 ; 2, etc... 1940 ; 1941 ; The DP command is identical to D, except that panel memory is chaged rather 1942 ; than main memory. WARNING - there is no protection against changing the 1943 ; monitor when using this command, so it's up to the user to make sure the 1944 ; changes don't corrupt something important! 1945 1946 ; Enter here for the DP command... 1947 01065 7240 DPMEM: STA ; set the PNLMEM flag 1948 01066 7410 SKP ; fall into the regular code 1949 ; Enter here for the D command... 1950 01067 7200 DMEM: CLA ; clear the PNLMEM flag 1951 01070 3041 DCA PNLMEM ; to reference main memory 1952 1953 ; Both forms join up here... 1954 01071 6205 .PUSHJ @[RDADDR] ; Then read an address 01072 5773 1955 01073 6205 .PUSHJ @[SPATST] ; the next character has to be a space 01074 5772 1956 1957 ; Read words of data and deposit them... 1958 01075 6205 DMEM1: .PUSHJ @ZOCTNW ; read an octal operand 01076 5521 1959 01077 1067 TAD WORD ; get the data we found 1960 01100 6205 .PUSHJ @ZDANDV ; write and verify it 01101 5526 1961 01102 6205 .PUSHJ @ZNXTADR ; advance to the next address 01103 5524 1962 01104 6205 .PUSHJ @ZSPACM0 ; get the break character from OCTNW 01105 5514 1963 01106 7450 SNA ; was it the end of the line ?? 1964 01107 6225 .POPJ ; yes, we're done... 1965 01110 1374 TAD [-","] ; no - it has to be a comma otherwise 1966 01111 7640 SZA CLA ; ???? 1967 01112 5530 JMP @ZCOMERR ; bad command 1968 01113 5275 JMP DMEM1 ; go read and deposit another word PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 41 ER and DR Commands - Examine and Deposit in Registers bts6120.plx 1969 .TITLE ER and DR Commands - Examine and Deposit in Registers 1970 1971 1972 ; The ER command examines either a single register, when the register name 1973 ; is given as an argument, or all registers when no argument is given. For 1974 ; example: 1975 ; 1976 ; >ER AC - examine the AC 1977 ; >ER PC - examine the PC 1978 ; >ER - print all registers 1979 ; 1980 01114 6205 EREG: .PUSHJ @ZSPACMP ; get the next non-space character 01115 5513 1981 01116 7650 SNA CLA ; is it the end of line? 1982 01117 5771 JMP @[REGLSC] ; yes - type all registers and return 1983 01120 6205 .PUSHJ @ZBACKUP ; nope - backup the command scanner 01121 5515 1984 01122 6205 .PUSHJ @[NAMENW] ; and go read the register name 01123 5770 1985 01124 6205 .PUSHJ @ZEOLNXT ; now we have to be at the end of line 01125 5517 1986 01126 1367 TAD [ENAMES-1] ; point to the name table 1987 01127 6205 .PUSHJ @[MATCH] ; find it and call a routine to print 01130 5766 1988 01131 5510 JMP @ZCRLF ; finish the line and we're done 1989 1990 ; The DR command deposits a value in a register, and both a register name and 1991 ; an octal value are required arguments. For example: 1992 ; 1993 ; >DR AC 7777 - set the AC to 7777 1994 ; >DR SR 3345 - set the switch register to 3345 1995 ; 1996 01132 6205 DREG: .PUSHJ @[NAMENW] ; get the register name 01133 5770 1997 01134 6205 .PUSHJ @[SPANXT] ; the terminator has to be a space 01135 5765 1998 01136 6205 .PUSHJ @ZOCTNW ; read an octal number to deposit 01137 5521 1999 01140 6205 .PUSHJ @ZEOLTST ; followed by the end of the line 01141 5516 2000 01142 1364 TAD [DNAMES-1] ; point to the list of deposit names 2001 01143 5766 JMP @[MATCH] ; call the right routine and we're done 2002 01164 3361 01165 4637 01166 6642 01167 3345 01170 6600 01171 1240 01172 4641 01173 6435 01174 7724 01175 1060 01176 6417 01177 7770 2003 01200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 42 Deposit in Registers bts6120.plx 2004 .TITLE Deposit in Registers 2005 2006 2007 ; Here to deposit in the AC... 2008 01200 1067 DAC: TAD WORD ; Get his value 2009 01201 3001 DCA UAC ; And change the AC 2010 01202 6225 .POPJ ; Then that's all 2011 2012 ; Here to deposit in the PC... 2013 01203 1067 DPC: TAD WORD ; The same old routine... 2014 01204 3000 DCA UPC ; ... 2015 01205 5777 JMP @[EXMEM] ; sync the display with the new PC 2016 2017 ; Here to deposit in the MQ... 2018 01206 1067 DMQ: TAD WORD ; ... 2019 01207 3003 DCA UMQ ; ... 2020 01210 6225 .POPJ ; ... 2021 2022 ; Here to deposit in the PS... 2023 01211 1067 DPS: TAD WORD ; ... 2024 01212 0376 AND [6277] ; only these bits can actually change 2025 01213 7421 MQL ; save the new value for a minute 2026 01214 1002 TAD UFLAGS ; get the current status 2027 01215 0375 AND [1500] ; clear the complementary bits 2028 01216 7501 MQA ; or everything together 2029 01217 3002 DCA UFLAGS ; and update the PS 2030 01220 5777 JMP @[EXMEM] ; sync the display with the new IF 2031 2032 ; Here to deposit in the switch register... 2033 01221 1067 DSR: TAD WORD ; ... 2034 01222 6246 WSR ; Load the switch register 2035 01223 6225 .POPJ ; Then that's all 2036 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 43 Examine Registers bts6120.plx 2037 .TITLE Examine Registers 2038 2039 2040 ; This routine is called to type out all the important internal registers. 2041 ; It is used by the ER, and SI commands, and after breakpoints, traps and 2042 ; halts. 2043 01224 7200 REGLST: CLA ; be sure the AC is cleared 2044 01225 6205 .PUSHJ TYPEPC ; type the PC first 01226 5255 2045 01227 6205 .PUSHJ TYPEPS ; then the LINK 01230 5265 2046 01231 6205 .PUSHJ TYPEAC ; then the AC 01232 5252 2047 01233 6205 .PUSHJ TYPEMQ ; then the MQ 01234 5260 2048 01235 6205 .PUSHJ TYPSP1 ; user stack pointer 1 01236 5270 2049 01237 5273 JMP TYPSP2 ; and finally stack pointer 2 2050 2051 ; The same as REGLST, but with a carriage return added... 2052 01240 6205 REGLSC: .PUSHJ REGLST ; first type the registers 01241 5224 2053 01242 5510 JMP @ZCRLF ; type the carriage return and we're done 2054 2055 ; This routine types a register name followed by an octal register value. 2056 ; The latter is passed in the AC, and the register name is passed inline. 2057 01243 0000 TYPRG4: 0 ; enter here with a JMS instruction 2058 01244 3046 DCA VALUE ; save the register contents for a moment 2059 01245 1643 TAD @TYPRG4 ; and get the address of the register name 2060 01246 6205 .PUSHJ @[OUTSTR] ; type that 01247 5774 2061 01250 1046 TAD VALUE ; get the contents of the register 2062 01251 5504 JMP @ZTOCT4S ; type that in octal and leave a blank 2063 2064 ; This routine will type the last user AC contents... 2065 01252 1001 TYPEAC: TAD UAC ; get the contents of the register 2066 01253 4243 JMS TYPRG4 ; type it and return 2067 01254 3713 ACNAME ; "AC>" 2068 2069 ; This routine will type the last user PC... 2070 01255 1000 TYPEPC: TAD UPC ; the same old routine... 2071 01256 4243 JMS TYPRG4 ; ... 2072 01257 3716 PCNAME ; "PC>" 2073 2074 ; This routine will type the last user MQ contents... 2075 01260 1003 TYPEMQ: TAD UMQ ; ... 2076 01261 4243 JMS TYPRG4 ; ... 2077 01262 3721 MQNAME ; "MQ>" 2078 2079 ; This routine will type the last instruction executed... 2080 01263 6222 TYPEIR: CIF 2 2081 01264 5773 JMP @[XTYPIR] 2082 2083 ; This routine will type the current interrupt flags... 2084 01265 1002 TYPEPS: TAD UFLAGS ; get the flags 2085 01266 4243 JMS TYPRG4 ; ... 2086 01267 3732 PSNAME ; "PS>" 2087 2088 ; This routine will type the 6120 stack pointer #1... 2089 01270 1004 TYPSP1: TAD USP1 ; ... 2090 01271 4243 JMS TYPRG4 ; ... 2091 01272 3735 SP1NAM ; "SP1>" 2092 2093 ; This routine will type the 6120 stack pointer #2... 2094 01273 1005 TYPSP2: TAD USP2 ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 44 Examine Registers bts6120.plx 2095 01274 4243 JMS TYPRG4 ; ... 2096 01275 3741 SP2NAM ; "SP2>" 2097 2098 ; This routine will type the current switch register contents... 2099 01276 7604 TYPESR: LAS ; actually read the switch register 2100 01277 4243 JMS TYPRG4 ; ... 2101 01300 3727 SRNAME ; "SR>" PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 45 Read and Write Memory bts6120.plx 2102 .TITLE Read and Write Memory 2103 2104 2105 ; This routine will change the current data field to the field indicated in 2106 ; location ADRFLD. It's normally used by commands that read or write memory, 2107 ; such as Examine, Deposit, etc. Remember that on the 6120 the EMA works in 2108 ; panel memory as well, so don't forget to change back to field zero after 2109 ; you're done! 2110 01301 7200 CFIELD: CLA ; ... 2111 01302 1040 TAD ADRFLD ; get the desired field number 2112 01303 0136 AND ZK70 ; just in case! 2113 01304 1372 TAD [CDF 0] ; and make a CDF instruction 2114 01305 3306 DCA .+1 ; store that in memory 2115 01306 0000 0 ; isn't self manipulation wonderful? 2116 01307 6225 .POPJ ; that's all 2117 2118 ; This routine will set or clear the panel data flag according to the state 2119 ; of the PNLMEM flag. If PNLMEM is non-zero, the panel data flag is set and 2120 ; commands that access memory (e.g. Examine, Deposit, etc) access panel memory 2121 ; instead. If PNLMEM is zero, then the panel data flag is cleared and these 2122 ; commands access main memory. 2123 01310 7200 CPANEL: CLA ; don't expect anything from the caller 2124 01311 6276 SPD ; assume we're referencing panel memory 2125 01312 1041 TAD PNLMEM ; but get the flag to be sure 2126 01313 7650 SNA CLA ; non-zero means access panel memory 2127 01314 6266 CPD ; we were wrong - use main memory instead 2128 01315 6225 .POPJ ; and we're done 2129 2130 ; This short routine returns, in the AC and memory location VALUE, the 2131 ; contents of the memory location addressed by ADDR and ADRFLD. If PNLMEM is 2132 ; non-zero it reads panel memory to get the data; otherwise it reads main 2133 ; memory... 2134 01316 6205 RDMEM: .PUSHJ CFIELD ; first select the proper field 01317 5301 2135 01320 6205 .PUSHJ CPANEL ; then select main memory or panel memory 01321 5310 2136 01322 1437 TAD @ADDR ; load the data 2137 01323 3046 DCA VALUE ; save the contents in VALUE 2138 01324 1046 TAD VALUE ; and also return it in the AC 2139 01325 6276 SPD ; back to panel memory 2140 01326 6201 CDF 0 ; and back to the monitor's field 2141 01327 6225 .POPJ ; that's all there is 2142 2143 ; This routine will deposit the contents of the AC into the memory location 2144 ; specified by ADRFLD, ADDR and PNLMEM. It's the complement of RDMEM... 2145 01330 3046 WRMEM: DCA VALUE ; save the number to deposit 2146 01331 6205 .PUSHJ CFIELD ; be sure we're in the right field 01332 5301 2147 01333 6205 .PUSHJ CPANEL ; and the right memory space (panel vs main) 01334 5310 2148 01335 1046 TAD VALUE ; get the value back again 2149 01336 3437 DCA @ADDR ; store the data 2150 01337 6276 SPD ; back to panel memory 2151 01340 6201 CDF 0 ; and the monitor's data field 2152 01341 6225 .POPJ ; and return 2153 2154 ; This routine is just like WRMEM, except that it will read back the value 2155 ; deposited and verify that it is, in fact, correct! If it isn't (i.e. there's 2156 ; no memory at that address or the memory there isn't working) a ?MEM ERR 2157 ; message is generated and this command is aborted. 2158 01342 3367 DANDV: DCA GOOD ; save the original, good, value 2159 01343 1367 TAD GOOD ; ... 2160 01344 6205 .PUSHJ WRMEM ; store it 01345 5330 2161 01346 6205 .PUSHJ RDMEM ; read it back PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 46 Read and Write Memory bts6120.plx 01347 5316 2162 01350 7041 CIA ; make what we read negative 2163 01351 1367 TAD GOOD ; and compare it to the desired value 2164 01352 7650 SNA CLA ; did they match ?? 2165 01353 6225 .POPJ ; yes -- this memory is ok 2166 2167 ; Type a "?MEM ERR AT faaaa ..." message 2168 01354 4511 JMS @ZINLMES ; type out the first part of the message 2169 01355 3415 MEMMSG ; ... 2170 01356 6205 .PUSHJ @[TADDR] ; then type the address of the error 01357 5771 2171 01360 1367 TAD GOOD ; get the expected value 2172 01361 6205 .PUSHJ @ZTOCT4S ; type that out first 01362 5504 2173 01363 6205 .PUSHJ @ZRDMEM ; read what we actually get from memory 01364 5525 2174 01365 6205 .PUSHJ @ZTOCT4M ; then type that with a CRLF 01366 5503 2175 2176 ; Temporary storage for DANDV... 2177 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 2178 01400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 47 BM Command -- Memory Block Move bts6120.plx 2179 .TITLE BM Command -- Memory Block Move 2180 2181 2182 ; The BM command is used to move blocks of memory words from one location to 2183 ; another. It has three parameters - the source address range (two 15 bit 2184 ; numbers), and the destination address (a single 15 bit number). All words 2185 ; from the starting source address to the ending source address are transferred 2186 ; to the corresponding words starting at the destination address. More than 2187 ; one field may be transferred, and transfers may cross a field boundry. 2188 ; 2189 ; >BM 200-377 400 -> move all of page 1 in the current data field 2190 ; to page 2 of the same field. 2191 ; >BM 0-7777 10000 -> move all of field 0 to field 1 2192 ; >BM 00000-37777 40000 -> move fields 0 thru 3 to fields 4 thru 7 2193 ; 2194 ; Note that this command operates only on main memory - there is no 2195 ; corresponding block move command for panel memory! 2196 ; 2197 01400 6205 BMOVE: .PUSHJ @ZRANGE ; read the source address range 01401 5522 2198 01402 7420 SNL ; did he give 2 numbers ??? 2199 01403 5530 JMP @ZCOMERR ; no -- don't allow a one address range 2200 01404 6205 .PUSHJ @[RDADDR] ; now read the destination 01405 5777 2201 01406 6205 .PUSHJ @ZEOLTST ; this should be the end of the command 01407 5516 2202 01410 3041 DCA PNLMEM ; this command ALWAYS operates on main memory 2203 2204 ; Now copy words from the source to the destination... 2205 01411 6205 MOVE1: .PUSHJ @[SWPADR] ; swap the LOW/LOWFLD (the source address) 01412 5776 2206 01413 6205 .PUSHJ @ZRDMEM ; read a word from the source 01414 5525 2207 01415 6205 .PUSHJ @ZTSTADR ; go see if this is the last address 01416 5523 2208 01417 7630 SZL CLA ; is it the end ??? 2209 01420 7240 STA ; yes -- load -1 into the AC 2210 01421 3071 DCA COUNT ; and remember that fact for later 2211 01422 6205 .PUSHJ @ZNXTADR ; now increment the source address 01423 5524 2212 01424 6205 .PUSHJ @[SWPADR] ; swap the source back into LOW/LOWFLD 01425 5776 2213 01426 1046 TAD VALUE ; get the data we read from the source 2214 01427 6205 .PUSHJ @ZDANDV ; and deposit it in the destination 01430 5526 2215 01431 6205 .PUSHJ @ZNXTADR ; increment the destination address too 01432 5524 2216 01433 7430 SZL ; did we wrap out of field 7 ??? 2217 01434 5240 JMP MOVE2 ; yes -- stop here 2218 01435 2071 ISZ COUNT ; have we copied all the words ?? 2219 01436 5211 JMP MOVE1 ; no -- keep looping 2220 01437 6225 .POPJ ; yes -- that's all 2221 2222 ; Here if the destination address runs out of field 7... 2223 01440 4531 MOVE2: JMS @ZERROR ; don't allow that to continue 2224 01441 3466 ERRWRP ; ?WRAP AROUND PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 48 CK Command -- Checksum Memory bts6120.plx 2225 .TITLE CK Command -- Checksum Memory 2226 2227 2228 ; This command will compute the checksum of all memory locations between the 2229 ; two addresses specified and the resulting 12 bit value is then printed 2230 ; on the terminal. This is useful for testing memory, comparing blocks of 2231 ; memory, and so on. Note that the checksum algorithm used rotates the 2232 ; accumulator one bit between each words, so blocks of memory with identical 2233 ; contents in different orders will give different results. 2234 ; 2235 ; >CK 10000-10177 -> checksum all of page 0, field 1 2236 ; 2237 ; Note that this command operates only on main memory - there is no 2238 ; corresponding command for panel memory! 2239 01442 6205 CKMEM: .PUSHJ @ZRANGE ; read a two address range 01443 5522 2240 01444 7420 SNL ; two addresses are required 2241 01445 5530 JMP @ZCOMERR ; ... 2242 01446 6205 .PUSHJ @ZEOLTST ; be sure this is the end of the command 01447 5516 2243 01450 3041 DCA PNLMEM ; this command ALWAYS operates on main memory 2244 01451 3050 DCA CHKSUM ; and clear the checksum accumulator 2245 2246 ; Read words and checksum them... 2247 01452 1050 CKMEM1: TAD CHKSUM ; get the previous total 2248 01453 7104 CLL RAL ; and shift it left one bit 2249 01454 7430 SZL ; did we shift out a one ?? 2250 01455 7001 IAC ; yes -- shift it in the right end 2251 01456 3050 DCA CHKSUM ; save that for a while 2252 01457 6205 .PUSHJ @ZRDMEM ; and go read a word from real memory 01460 5525 2253 01461 1050 TAD CHKSUM ; add it to the checksum 2254 01462 3050 DCA CHKSUM ; save the new checksum 2255 01463 6205 .PUSHJ @ZTSTADR ; compare the addresses next 01464 5523 2256 01465 7430 SZL ; are we all done ?? 2257 01466 5277 JMP TCKSUN ; yes -- type the checksum and return 2258 01467 6205 .PUSHJ @ZNXTADR ; no -- increment the address 01470 5524 2259 01471 5252 JMP CKMEM1 ; and proceed 2260 2261 ; This routine will type out the checksum currently contained in location 2262 ; CHKSUM. If the checksum isn't zero, it will type a question mark (making 2263 ; a pseudo error message) first... 2264 01472 1050 TCKSUM: TAD CHKSUM ; see if the checksum is zero 2265 01473 7650 SNA CLA ; ??? 2266 01474 5277 JMP TCKSUN ; yes -- type it normally 2267 01475 6205 .PUSHJ @[TQUEST] ; no -- type a question mark first 01476 5775 2268 2269 ; Now type the checksum... 2270 01477 4511 TCKSUN: JMS @ZINLMES ; type out the checksum message 2271 01500 3404 CKSMSG ; ... 2272 01501 1050 TAD CHKSUM ; get the actual checksum 2273 01502 5502 JMP @ZTOCT4C ; type it with a CRLF and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 49 CM and FM Commands -- Clear Memory and Fill Memory bts6120.plx 2274 .TITLE CM and FM Commands -- Clear Memory and Fill Memory 2275 2276 2277 ; The FM command fills a range of memory locations with a constant. For 2278 ; example: 2279 ; 2280 ; >FM 7402 0-7777 -> fill all of field zero with HLT instructions 2281 ; >FM 7777 0-77777 -> fill all of memory with -1 2282 ; 2283 ; The second and third arguments (the address range) may be omitted, in 2284 ; which case all of memory is filled. 2285 ; 2286 ; Note that this command operates only on main memory - there is no 2287 ; corresponding command for panel memory! 2288 01503 6205 FLMEM: .PUSHJ @ZOCTNW ; read the constant to fill with 01504 5521 2289 01505 1067 TAD WORD ; get the desired value 2290 01506 5312 JMP CMEM0 ; then join the CM command 2291 2292 ; The CM command is identical to FM, except that the fill value is always 2293 ; zero (hence the name - "Clear" memory). For example: 2294 ; 2295 ; >CM 50000 57777 -> clear all of field 5 2296 ; >CM -> (with no arguments) clear all of memory! 2297 ; 2298 ; Like FM, this command operates only on main memory. There is no 2299 ; equivalent for panel memory. 2300 01507 6205 CMEM: .PUSHJ @ZGET ; advance the scanner to the break character 01510 5520 2301 01511 7200 CLA ; and throw it away for now 2302 01512 3046 CMEM0: DCA VALUE ; and fill with zeros 2303 01513 3037 DCA ADDR ; initialize the address range to start 2304 01514 3040 DCA ADRFLD ; at location 0000, field 0 2305 01515 7240 STA ; and to finish at location 7777, 2306 01516 3042 DCA HIGH ; ... 2307 01517 1136 TAD ZK70 ; field 7 2308 01520 3044 DCA HGHFLD ; ... 2309 01521 3041 DCA PNLMEM ; this command ALWAYS operates on main memory 2310 2311 ; See if there is an address range... 2312 01522 6205 .PUSHJ @ZSPACM0 ; get the break character 01523 5514 2313 01524 7650 SNA CLA ; is there any more out there ?? 2314 01525 5334 JMP CMEM1 ; no -- start filling 2315 01526 6205 .PUSHJ @ZBACKUP ; yes - backup to the first character 01527 5515 2316 01530 6205 .PUSHJ @ZRANGE ; and read the address range 01531 5522 2317 01532 6205 .PUSHJ @ZEOLTST ; then check for the end of the line 01533 5516 2318 2319 ; Clear/set memory locations... 2320 01534 1046 CMEM1: TAD VALUE ; get the value to store 2321 01535 6205 .PUSHJ @ZDANDV ; store it and verify 01536 5526 2322 01537 6205 .PUSHJ @ZTSTADR ; see if we have done all the addresses 01540 5523 2323 01541 7430 SZL ; well ?? 2324 01542 6225 .POPJ ; yes -- we can stop now 2325 01543 6205 .PUSHJ @ZNXTADR ; no -- increment the address field 01544 5524 2326 01545 5334 JMP CMEM1 ; then go clear this word PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 50 X / XP Command Stubs -- Disassemble memory bts6120.plx 2327 .TITLE X / XP Command Stubs -- Disassemble memory 2328 2329 ; stubs in field 0 call actual functions in field 2 2330 01546 6223 DISASM: CXF 2 2331 01547 5774 JMP @[CMDX] 2332 2333 01550 6223 DISASMP: CXF 2 2334 01551 5773 JMP @[CMDXP] 2335 01573 0603 01574 0600 01575 7066 01576 6540 01577 6435 2336 01600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 51 WS Command -- Word Search Memory bts6120.plx 2337 .TITLE WS Command -- Word Search Memory 2338 2339 2340 ; The WS command searches memory for a specific bit pattern. It accepts up 2341 ; to 4 operands: (1) the value to search for, (2) the starting search address, 2342 ; (3) the final search address, and (4) a search mask. All values except the 2343 ; first are optional and have appropriate defaults. Any location in the 2344 ; specified range which matches the given value after being masked is typed 2345 ; out along with its address. For example: 2346 ; 2347 ; >WS 6031 -> search all of memory for KSF instructions 2348 ; >WS 6031 30000-33777 -> search words 0..3377 of field 3 for KSFs 2349 ; >WS 6030 0-77777 7770 -> search memory for any keyboard IOTs 2350 ; 2351 ; N.B. this command operates only on main memory and there is no equivalent 2352 ; for panel memory. 2353 2354 ; Read the first (required) operand and set defaults for all the rest... 2355 01600 6205 SEARCH: .PUSHJ @ZOCTNW ; read the value to search for 01601 5521 2356 01602 1067 TAD WORD ; then get that 2357 01603 3272 DCA KEY ; and save it 2358 01604 3037 DCA ADDR ; set the starting address to 0 2359 01605 3040 DCA ADRFLD ; in field 0 2360 01606 7240 STA ; then stop at location 7777 2361 01607 3042 DCA HIGH ; ... 2362 01610 1136 TAD ZK70 ; field 7 2363 01611 3044 DCA HGHFLD ; ... 2364 01612 7240 STA ; and set the mask to 7777 2365 01613 3273 DCA MASK ; ... 2366 01614 3041 DCA PNLMEM ; this command _always_ searches main memory 2367 2368 ; Try to read any optional operands... 2369 01615 1052 TAD SAVCHR ; is there any more there ?? 2370 01616 7650 SNA CLA ; ??? 2371 01617 5233 JMP SEAR1 ; no -- start looking 2372 01620 6205 .PUSHJ @ZRANGE ; yes -- read the address range 01621 5522 2373 01622 1052 TAD SAVCHR ; is there a mask out there ?? 2374 01623 7650 SNA CLA ; ??? 2375 01624 5233 JMP SEAR1 ; no -- start looking 2376 01625 6205 .PUSHJ @ZOCTNW ; yes -- read the mask too 01626 5521 2377 01627 1067 TAD WORD ; load the mask 2378 01630 3273 DCA MASK ; and save that for later 2379 01631 6205 .PUSHJ @ZEOLTST ; this has to be the end of the line 01632 5516 2380 2381 ; Here to start the search... 2382 01633 3071 SEAR1: DCA COUNT ; count the number of matches we find 2383 01634 1272 TAD KEY ; get the search key 2384 01635 0273 AND MASK ; apply the mask to it too 2385 01636 7041 CIA ; make it negative 2386 01637 3272 DCA KEY ; and remember that instead 2387 2388 ; Look through memory for matches... 2389 01640 6205 SEAR2: .PUSHJ @ZINCHRS ; poll the operator for control-C 01641 5512 2390 01642 6205 .PUSHJ @ZRDMEM ; read a word from real memory 01643 5525 2391 01644 0273 AND MASK ; apply the mask to it 2392 01645 1272 TAD KEY ; and compare to the value 2393 01646 7640 SZA CLA ; does it match ?? 2394 01647 5256 JMP SEAR3 ; no -- skip it 2395 01650 6205 .PUSHJ @[TMEM] ; yes -- type the address and contents PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 52 WS Command -- Word Search Memory bts6120.plx 01651 5777 2396 01652 6205 .PUSHJ @ZCRLF ; then finish the line 01653 5510 2397 01654 7240 STA ; make the AC non-zero 2398 01655 3071 DCA COUNT ; and remember that we found a match 2399 01656 6205 SEAR3: .PUSHJ @ZTSTADR ; see if we have looked everywhere 01657 5523 2400 01660 7430 SZL ; well ?? 2401 01661 5265 JMP SEAR4 ; yes -- finish up now 2402 01662 6205 .PUSHJ @ZNXTADR ; no -- increment the address 01663 5524 2403 01664 5240 JMP SEAR2 ; and keep looking 2404 2405 ; Here at the end of the search... 2406 01665 1071 SEAR4: TAD COUNT ; see how many matches there were 2407 01666 7640 SZA CLA ; were there any at all ?? 2408 01667 6225 .POPJ ; yes -- that's fine 2409 01670 4531 JMS @ZERROR ; no -- give an error message 2410 01671 3444 ERRSRF ; ? SEARCH FAILS 2411 2412 ; Temporary storage for the SEARCH routine... 2413 01672 KEY: .BLOCK 1 ; a search key 2414 01673 MASK: .BLOCK 1 ; a search mask 2415 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 53 BL Command -- List Breakpoints bts6120.plx 2416 .TITLE BL Command -- List Breakpoints 2417 2418 2419 ; This command will list all the breakpoints which are currently set in 2420 ; the user's program. It has no operands... 2421 ; 2422 ; >BL 2423 ; 2424 01674 6205 BLIST: .PUSHJ @ZEOLNXT ; there should be no more 01675 5517 2425 01676 6205 .PUSHJ BSETUP ; set up X1, X2 and COUNT 01677 5324 2426 01700 3046 DCA VALUE ; count the number of breakpoints here 2427 2428 ; Loop through the breakpoint table and list all valid breakpoints... 2429 01701 1410 BLIST1: TAD @X1 ; get the address of this breakpoint 2430 01702 3037 DCA ADDR ; and remember that 2431 01703 1411 TAD @X2 ; then get the corresponding field 2432 01704 3040 DCA ADRFLD ; ... 2433 01705 1037 TAD ADDR ; let's see that address again 2434 01706 7650 SNA CLA ; is there really a breakpoint set here ?? 2435 01707 5315 JMP BLIST2 ; no -- on to the next one 2436 01710 6205 .PUSHJ @[TMEM] ; yes -- type out the address and memory 01711 5777 2437 01712 6205 .PUSHJ @ZCRLF ; finish this line 01713 5510 2438 01714 2046 ISZ VALUE ; and count the number we find 2439 01715 2071 BLIST2: ISZ COUNT ; are there more breakpoints to do? 2440 01716 5301 JMP BLIST1 ; yes - keep going 2441 2442 ; Here after going through the table... 2443 01717 1046 TAD VALUE ; see how many we found 2444 01720 7640 SZA CLA ; any at all ?? 2445 01721 6225 .POPJ ; yes -- that's great 2446 01722 4531 JMS @ZERROR ; no -- print an error message 2447 01723 3655 ERRNBP ; ?NONE SET 2448 2449 ; This routine will set up the pointers for traversing the break point 2450 ; table. X1 always points to the break point address table, X2 points to 2451 ; the break point field table, and X3 points to the break point data table. 2452 ; COUNT is initialized to the negative of the table size (all three tables 2453 ; are the same size) so that it can be used as an ISZ counter. This same 2454 ; arrangement of pointers is used by all the routines that operate on 2455 ; breakpoints. 2456 01724 7200 BSETUP: CLA ; just in case... 2457 01725 1376 TAD [BPTADR-1] ; X1 points to the address table 2458 01726 3010 DCA X1 ; ... 2459 01727 1375 TAD [BPTFLD-1] ; X2 points to the field table 2460 01730 3011 DCA X2 ; ... 2461 01731 1374 TAD [BPTDAT-1] ; X3 points to the data table 2462 01732 3012 DCA X3 ; ... 2463 01733 1373 TAD [-MAXBPT] ; and COUNT is the table size 2464 01734 3071 DCA COUNT ; ... 2465 01735 3041 DCA PNLMEM ; break points always refer to main memory! 2466 01736 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 54 Search for Breakpoints bts6120.plx 2467 .TITLE Search for Breakpoints 2468 2469 2470 ; This routine will search the breakpoint table to see if there is a one set 2471 ; at the location specified by ADDR and ADRFLD. If one is found, it will 2472 ; return with the LINK set and with X1/X2 pointing to the table entry. If 2473 ; there is no breakpoint at the specified address, it returns with the LINK 2474 ; cleared. 2475 01737 6205 BPTFND: .PUSHJ BSETUP ; set up X1, X2 and COUNT 01740 5324 2476 2477 ; Look through the entire table... 2478 01741 1410 BPTFN1: TAD @X1 ; get this breakpoint address 2479 01742 7450 SNA ; is there breakpoint here at all ?? 2480 01743 5357 JMP BPTFN2 ; no -- just forget it 2481 01744 7041 CIA ; make this address negative 2482 01745 1037 TAD ADDR ; and compare to what we want 2483 01746 7640 SZA CLA ; does it match ?? 2484 01747 5357 JMP BPTFN2 ; no -- on to the next one 2485 01750 1411 TAD @X2 ; yes -- get the field number 2486 01751 7041 CIA ; make that negative 2487 01752 1040 TAD ADRFLD ; and compare to the field we need 2488 01753 7640 SZA CLA ; do they match to ?? 2489 01754 5360 JMP BPTFN3 ; no -- keep looking 2490 01755 7120 STL ; yes -- set the LINK 2491 01756 6225 .POPJ ; and stop right now 2492 2493 ; Here if the current address dosen't match... 2494 01757 2011 BPTFN2: ISZ X2 ; increment the field pointer too 2495 01760 2071 BPTFN3: ISZ COUNT ; have we searched the entire table? 2496 01761 5341 JMP BPTFN1 ; no -- keep looking 2497 01762 7100 CLL ; yes -- clear the LINK 2498 01763 6225 .POPJ ; and return 2499 01773 7770 01774 0220 01775 0210 01776 0200 01777 1060 2500 02000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 55 BR Command -- Remove Breakpoints bts6120.plx 2501 .TITLE BR Command -- Remove Breakpoints 2502 2503 2504 ; The BR command removes a breakpoint at a specific address or, if no 2505 ; operand is given, removes all breakpoints. For example: 2506 ; 2507 ; >BR 17605 -> remove the breakpoint at location 7605, field 1 2508 ; >BR -> remove all breakpoints regardless of address 2509 ; 2510 02000 6205 BREMOV: .PUSHJ @ZGET ; get the next character 02001 5520 2511 02002 7650 SNA CLA ; is it the end of the line ?? 2512 02003 5226 JMP BPTCLR ; yes -- clear all breakpoints 2513 02004 6205 .PUSHJ @ZBACKUP ; no -- backup the scanner 02005 5515 2514 02006 6205 .PUSHJ @[OCTNI] ; then read an address 02007 5777 2515 02010 1067 TAD WORD ; get the breakpoint address 2516 02011 7450 SNA ; be sure it isn't location zero 2517 02012 5530 JMP @ZCOMERR ; that isn't legal 2518 02013 3037 DCA ADDR ; save the address of the breakpoint 2519 2520 ; Here to remove a single breakpoint... 2521 02014 6205 .PUSHJ @[BPTFND] ; look for this breakpoint it the table 02015 5776 2522 02016 7420 SNL ; did we find it ?? 2523 02017 5224 JMP BREMO1 ; no -- there's no breakpoint at that address 2524 02020 1010 TAD X1 ; yes -- get the pointer to BPTADR 2525 02021 3037 DCA ADDR ; and save it in a non-autoindex location 2526 02022 3437 DCA @ADDR ; clear the BPTADR entry (to remove it) 2527 02023 6225 .POPJ ; and that's all 2528 2529 ; Here if the breakpoint does not exist... 2530 02024 4531 BREMO1: JMS @ZERROR ; give an appropriate error message 2531 02025 3664 ERRNST ; ?NOT SET 2532 2533 ; Here to clear all breakpoints... 2534 02026 6205 BPTCLR: .PUSHJ @[BSETUP] ; setup X1, X2, X3 and COUNT 02027 5775 2535 02030 3410 BPTCL2: DCA @X1 ; clear this breakpoint 2536 02031 3411 DCA @X2 ; ... 2537 02032 3412 DCA @X3 ; ... 2538 02033 2071 ISZ COUNT ; have we done them all? 2539 02034 5230 JMP BPTCL2 ; no -- keep looping 2540 02035 6225 .POPJ ; yes -- that's it PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 56 BP Command -- Set Breakpoints bts6120.plx 2541 .TITLE BP Command -- Set Breakpoints 2542 2543 2544 ; The BP command sets a breakpoint in the main memory (aka user) program. 2545 ; It requires a single argument giving the 15 bit address where the breakpoint 2546 ; is to be set. For example: 2547 ; 2548 ; >BP 07605 -> set a breakpoint at location 7605, field 0 2549 ; >BP 7605 -> same, but in the current instruction field 2550 ; 2551 ; It's not possible to set a breakpoint at location zero in any field because 2552 ; the monitor uses zero as a marker for an unused breakpoint table entry. 2553 ; 2554 ; Note that this routine only enters the breakpoint into the table - nothing 2555 ; actually happens to the main memory program until we start running it and 2556 ; the BPTINS routine is called. 2557 02036 6205 BPTCOM: .PUSHJ @[OCTNI] ; go read the address 02037 5777 2558 02040 1067 TAD WORD ; get the address operand 2559 02041 7450 SNA ; be sure it isn't zero 2560 02042 5530 JMP @ZCOMERR ; no breakpoints at address zero 2561 02043 3037 DCA ADDR ; and put it in a safe place 2562 02044 6205 .PUSHJ @ZEOLTST ; then test for the end of the line 02045 5516 2563 2564 ; See if this breakpoint is already in the table.. 2565 02046 6205 .PUSHJ @[BPTFND] ; ... 02047 5776 2566 02050 7620 SNL CLA ; was it found ?? 2567 02051 5254 JMP BPTCO1 ; no -- go try to add it 2568 02052 4531 JMS @ZERROR ; yes -- say that it is already set 2569 02053 3672 ERRAST ; ?ALREADY SET 2570 2571 ; Here to search for a free location in the table... 2572 02054 6205 BPTCO1: .PUSHJ @[BSETUP] ; setup X1 and COUNT 02055 5775 2573 02056 2011 BPTCO2: ISZ X2 ; keep X1 and X2 in sync 2574 02057 1410 TAD @X1 ; get this table entry 2575 02060 7650 SNA CLA ; have we found an empty one ?? 2576 02061 5266 JMP BPTCO3 ; yes -- great 2577 02062 2071 ISZ COUNT ; have we searched the entire table? 2578 02063 5256 JMP BPTCO2 ; no -- keep trying 2579 02064 4531 JMS @ZERROR ; yes -- say that the table is full 2580 02065 3703 ERRBTF ; ?TABLE FULL 2581 2582 ; Here to insert the breakpoint in the table... 2583 02066 1010 BPTCO3: TAD X1 ; get the pointer to the free location 2584 02067 3043 DCA LOW ; and put it in a non-autoindex location 2585 02070 1037 TAD ADDR ; get the desired address 2586 02071 3443 DCA @LOW ; and store that in the table 2587 02072 1011 TAD X2 ; do the same with the field table 2588 02073 3043 DCA LOW ; ... 2589 02074 1040 TAD ADRFLD ; get the field we need 2590 02075 3443 DCA @LOW ; and put that in the table 2591 02076 6225 .POPJ ; then that's all PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 57 Insert Breakpoints in Memory bts6120.plx 2592 .TITLE Insert Breakpoints in Memory 2593 2594 2595 ; This routine will insert breakpoints in main memory (aka the user program) 2596 ; at the locations specified in the breakpoint table. The current contents of 2597 ; each breakpoint location are stored in CP memory in the BPTDAT table, and 2598 ; then are replaced by a BPT instruction. This routine is normally called 2599 ; just before returning control to the user's program. 2600 02077 6205 BPTINS: .PUSHJ @[BSETUP] ; set up X1, X2, X3 and COUNT 02100 5775 2601 2602 ; Loop through the table and insert the breakpoints... 2603 02101 1410 BPTIN1: TAD @X1 ; get the next address 2604 02102 7450 SNA ; is there a breakpoint set there ?? 2605 02103 5316 JMP BPTIN2 ; no -- proceed to the next one 2606 02104 3037 DCA ADDR ; yes -- save the address 2607 02105 1411 TAD @X2 ; and get the field 2608 02106 3040 DCA ADRFLD ; save that too 2609 02107 6205 .PUSHJ @ZRDMEM ; go read the contents of that location 02110 5525 2610 02111 3412 DCA @X3 ; save the user's data in the table 2611 02112 1374 TAD [BPT] ; then get a breakpoint instruction 2612 02113 6205 .PUSHJ @ZDANDV ; deposit that in the breakpoint location 02114 5526 2613 02115 5320 JMP BPTIN3 ; proceed to the next one 2614 2615 ; See if we have finished the table... 2616 02116 2011 BPTIN2: ISZ X2 ; keep the pointers in sync 2617 02117 2012 ISZ X3 ; ... 2618 02120 2071 BPTIN3: ISZ COUNT ; have we been all the way through ?? 2619 02121 5301 JMP BPTIN1 ; no -- keep going 2620 02122 6225 .POPJ ; yes -- quit now PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 58 Remove Breakpoints from Memory bts6120.plx 2621 .TITLE Remove Breakpoints from Memory 2622 2623 2624 ; This routine will restore the original contents of all breakpoint locations 2625 ; in the main memory program from the table at BPTDAT. It is normally called 2626 ; after a trap to CP memory occurs. Breakpoints must be restored so that the 2627 ; user may examine or change them. 2628 02123 6205 BPTRMV: .PUSHJ @[BSETUP] ; set up X1, X2, X3 and COUNT 02124 5775 2629 2630 ; Loop through the breakpoint table and restore all data... 2631 02125 1410 BPTRM1: TAD @X1 ; get the address of this breakpoint 2632 02126 7450 SNA ; is there one there at all ?? 2633 02127 5337 JMP BPTRM2 ; no -- on to the next one 2634 02130 3037 DCA ADDR ; yes -- remember the address 2635 02131 1411 TAD @X2 ; then get the correct field too 2636 02132 3040 DCA ADRFLD ; ... 2637 02133 1412 TAD @X3 ; finally get the original contents 2638 02134 6205 .PUSHJ @ZDANDV ; deposit and verify it back where it goes 02135 5526 2639 02136 5341 JMP BPTRM3 ; on to the next one 2640 2641 ; Here to advance to the next breakpoint... 2642 02137 2011 BPTRM2: ISZ X2 ; keep the pointers in sync 2643 02140 2012 ISZ X3 ; ... 2644 02141 2071 BPTRM3: ISZ COUNT ; have we done them all ?? 2645 02142 5325 JMP BPTRM1 ; no -- keep looping 2646 02143 6225 .POPJ ; yes -- that's it for this time PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 59 TR Command -- Single Instruction with Trace bts6120.plx 2647 .TITLE TR Command -- Single Instruction with Trace 2648 2649 2650 ; The TR command will execute one instruction of the user's program and then 2651 ; print the registers. It always executes one instruction, but it may be 2652 ; combined with the repeat (RP) command to execute multiple instructions. 2653 02144 6205 SICOM: .PUSHJ @ZEOLNXT ; there are no operands 02145 5517 2654 2655 ; Figure out what we are going to execute... 2656 02146 1002 TRACE: TAD UFLAGS ; get the instruction field 2657 02147 0136 AND ZK70 ; ... 2658 02150 3040 DCA ADRFLD ; so we can change to that field 2659 02151 1000 TAD UPC ; get the current main memory PC 2660 02152 3037 DCA ADDR ; and point to that 2661 02153 1000 TAD UPC ; also save a copy for the disassember 2662 02154 3006 DCA UIRPC ; to print 2663 02155 3041 DCA PNLMEM ; always access main memory 2664 02156 6205 .PUSHJ @ZRDMEM ; go read what we're about to execute 02157 5525 2665 02160 3007 DCA UIR ; remember that for later 2666 2667 ; Execute 1 instruction... 2668 02161 6205 .PUSHJ @[SINGLE] ; just like it says 02162 5773 2669 2670 ; Print all the registers... 2671 02163 6205 .PUSHJ @[TYPEIR] ; first type the UIR 02164 5772 2672 02165 5771 JMP @[REGLSC] ; and then print the rest and return 2673 02171 1240 02172 1263 02173 2202 02174 6236 02175 1724 02176 1737 02177 7000 2674 02200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 60 SI and P Commands - Single Instruction and Proceed bts6120.plx 2675 .TITLE SI and P Commands - Single Instruction and Proceed 2676 2677 2678 ; This routine will execute a single instruction of the user's program and 2679 ; then return to the caller. It is used directly to execute the SI command, 2680 ; and indirectly by many other commands... 2681 2682 ; Here for the SI command... 2683 02200 6205 SNCOM: .PUSHJ @ZEOLNXT ; make sure that there is no more 02201 5517 2684 2685 ; Setting the HALT flip flop will cause the HM6120 to immediately trap back 2686 ; to panel mode after it has executed exactly one instruction of the main 2687 ; memory program. This makes it easy to implement a single step function. 2688 ; 2689 ; Note that SINGLE is a subroutine which you can actually call, via a 2690 ; .PUSHJ, from anywhere in the monitor and it will return after the main 2691 ; memory instruction has been executed. This little bit of magic happens 2692 ; because the code at CONT1 saves the monitor stack and then restores 2693 ; it after the single instruction trap. 2694 02202 6003 SINGLE: PGO ; first make sure the HALT flip flop is cleared 2695 02203 7402 HLT ; then make sure it's set 2696 02204 7240 STA ; set the software single step flag 2697 02205 3051 DCA SIMFLG ; ... so that CPSAVE will know what to do 2698 02206 5227 JMP CONT1 ; then restore the registers and go 2699 2700 ; The P command is used to proceed after the main memory program has stopped 2701 ; at a breakpoint. You can't simply continue at this point because the PC 2702 ; points to the location of the breakpoint, and Continue would simply break 2703 ; again, instantly. The Proceed command gets around this problem by first 2704 ; executing a single instruction, and then contining normally. 2705 02207 6205 PROCEE: .PUSHJ @ZEOLNXT ; this command has no operands 02210 5517 2706 02211 6205 .PUSHJ SINGLE ; first execute the location under the BPT 02212 5202 2707 02213 5216 JMP CONT ; then restore the breakpoints and continue PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 61 C Command - Restore Main Memory Context and Continue bts6120.plx 2708 .TITLE C Command - Restore Main Memory Context and Continue 2709 2710 2711 ; This routine will restore all the user's registers and return to his 2712 ; program. It is called directly for the continue command, and is used 2713 ; indirectly (to change contexts) by several other commands. 2714 ; 2715 ; When this routine finishes in the most literal sense, the user mode 2716 ; program is running and the monitor is no longer active. However the 2717 ; CONT function can and will actually return, via a POPJ, if the user 2718 ; program causes a breakpoint or single instruction trap. This property is 2719 ; critical to the operation of the Proceed, TRace and Single Instruction 2720 ; commands! 2721 2722 ; Here for the continue command... 2723 02214 6205 CONTCM: .PUSHJ @ZEOLNXT ; continue has no operands 02215 5517 2724 2725 ; If we have a front panel and the HALT switch is currently DOWN, then 2726 ; we want to execute a single instruction only. Only if the HALT switch 2727 ; is UP (or if there's no front panel at all), do we run free! 2728 02216 4777 CONT: JMS @[CHKHLT] ; test the HALT switch 2729 02217 5776 JMP @[TRACE] ; down - trace one instruction instead 2730 ; up - proceed normally 2731 2732 ; Select free running mode and insert all breakpoints... 2733 02220 6205 .PUSHJ @[BPTINS] ; insert all breakpoints 02221 5775 2734 02222 3051 DCA SIMFLG ; clear our software single step flag 2735 02223 6003 PGO ; make sure the HALT flip-flop is cleared 2736 02224 5227 JMP CONT1 ; restore registers and resume 2737 2738 2739 ; The monitor call processor, MCALL, jumps here after it finishes executing 2740 ; a PR0 ROM call. Some of these calls, especially ones that access the disk, 2741 ; take a fairly long time and if the user flips the HALT switch while the 2742 ; program is doing a lot of disk I/O there's a good chance we'll miss it. 2743 ; To fix that, we check the state of the HALT switch after completing a 2744 ; ROM call and just halt if it's been flipped while were busy. 2745 02225 4777 CONT2: JMS @[CHKHLT] ; test the HALT switch 2746 02226 5774 JMP @[HALTED] ; down - pretend we halted after the MUUO 2747 ; otherwise fall into CONT1 and return 2748 2749 2750 ; Restore all registers and context switch. Naturally, part of this involves 2751 ; restoring the original user mode stack pointers, so before we lose our own 2752 ; stack forever, we save a copy of the last monitor stack pointer in RAM. It 2753 ; gets restored by the code at CPSAVE after a breakpoint or single instruction 2754 ; trap. 2755 ; 2756 ; Another gotcha - if a transition on CPREQ L occurs while we're in panel 2757 ; mode, the BTSTRP flag in the panel status will still set anyway. If that 2758 ; happens and we try to continue, the 6120 will trap back to panel mode 2759 ; immediately. The simplest fix for this is to do a dummy read of the panel 2760 ; status flags, which clears them. 2761 02227 6207 CONT1: RSP1 ; get our monitor's stack pointer 2762 02230 3145 DCA STKSAV ; and save it for later 2763 02231 6437 RLON ; turn the RUN LED on 2764 02232 6440 POST+0 ; and show post code 0 2765 02233 6430 CCPR ; make sure no panel request is pending 2766 02234 6000 PRS ; dummy read of panel status to clear BTSTRP 2767 02235 7200 CLA ; ... 2768 02236 1004 TAD USP1 ; reload stack pointer #1 2769 02237 6217 LSP1 ; ... 2770 02240 1005 TAD USP2 ; and stack #2 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 62 C Command - Restore Main Memory Context and Continue bts6120.plx 2771 02241 6237 LSP2 ; ... 2772 02242 1003 TAD UMQ ; restore the MQ register 2773 02243 7421 MQL ; ... 2774 02244 1002 TAD UFLAGS ; restore the flags, including IF, DF and LINK 2775 02245 6005 RTF ; ... 2776 02246 1001 TAD UAC ; restore the AC 2777 02247 6004 PEX ; exit panel mode 2778 02250 5400 JMP @UPC ; and, lastly, restore the PC 2779 2780 ; At this point we're running the main memory program. If that program 2781 ; causes a breakpoint or single instruction trap, then the HM6120 will enter 2782 ; the CPSAVE routine thru the vector at 7777. After it figures out the reason 2783 ; for the trap, CPSAVE will restore the original monitor's stack, from STKSAV, 2784 ; and execute a .POPJ. Only then will this routine "return". PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 63 ST Command -- Start a Main Memory Program bts6120.plx 2785 .TITLE ST Command -- Start a Main Memory Program 2786 2787 2788 ; The start command initializes the CPU registers and all I/O devices and 2789 ; then transfers control to a main memory (user) program. A single, optional, 2790 ; argument may be given to specify the start address of the the main memory 2791 ; program. If the start address is omitted, then the default is location 2792 ; 7777 of field 0 (this is a little strange by PDP-8 standards, but it's the 2793 ; typical reset vector for 6100 and 6120 devices). For example: 2794 ; 2795 ; >ST 00200 - start at location 200 in field 0 (DF is also 0) 2796 ; >ST 70200 - start at location 200 in field 7 (DF is also 7) 2797 ; >ST - start at location 7777 of field 0 (DF is also 0) 2798 ; 2799 02251 6205 START: .PUSHJ @ZGET ; get the next character 02252 5520 2800 02253 7650 SNA CLA ; is there anything out there ?? 2801 02254 5275 JMP START1 ; no -- use the defaults 2802 2803 ; Start at a specific (non-default) address... 2804 02255 6205 .PUSHJ @ZBACKUP ; backup to the start of the address 02256 5515 2805 02257 6205 .PUSHJ @[OCTNI] ; then read it 02260 5773 2806 02261 6205 .PUSHJ @ZEOLTST ; now it has to be the end of the line 02262 5516 2807 02263 6205 .PUSHJ CLRCPU ; clear the saved main memory registers 02264 5312 2808 02265 1067 TAD WORD ; and overwrite the PC with the desired address 2809 02266 3000 DCA UPC ; ... 2810 02267 1040 TAD ADRFLD ; get the start field 2811 02270 7112 CLL RTR ; and make the DF be the same 2812 02271 7106 CLL RTL ; ... 2813 02272 1040 TAD ADRFLD ; ... 2814 02273 3002 DCA UFLAGS ; those are the default processor flags 2815 02274 5216 JMP CONT ; insert any breakpoints and then go 2816 2817 ; Start at the default address. 2818 02275 6205 START1: .PUSHJ CLRCPU ; set all main saved CPU registers to default 02276 5312 2819 02277 5216 JMP CONT ; and then start there PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 64 MR Command - Master Reset bts6120.plx 2820 .TITLE MR Command - Master Reset 2821 2822 2823 ; The MR command executes a CAF instruction to assert IOCLR L and initialize 2824 ; all external I/O devices, and then it resets the saved state of the main 2825 ; memory program to the "default" values. From the point of view of an I/O 2826 ; device on the bus, this is equivalent to pressing the RESET button, but it 2827 ; doesn't actually reset the CPU itself (which would re-initialize this 2828 ; monitor!). This command doesn't have any effect on the contents of main 2829 ; memory. 2830 02300 6205 CLRCOM: .PUSHJ @ZEOLNXT ; There are no operands 02301 5517 2831 2832 ; Initialize the saved user context... 2833 02302 6205 .PUSHJ CLRCPU ; clear UAC, UPC, UMQ, etc... 02303 5312 2834 2835 ; Execute a CAF instruction to clear all I/O devices. On the IM6100 we 2836 ; couldn't do this, since CAF would also clear the CP flag (!), but the 6120 2837 ; designers allowed for this case. 2838 ; 2839 ; Unfortunately IOCLR L also resets the console UART, which plays havoc 2840 ; with any character that we might be transmitting at the moment. The only 2841 ; safe thing is to wait for the console to finish before executing the CAF. 2842 ; Note that this will _leave_ the console flag cleared, which is the way a 2843 ; real PDP-8 program should expect it (clearing a real PDP-8 clears the 2844 ; console flag too, after all). 2845 02304 6041 TSF ; has the console finished yet? 2846 02305 5304 JMP .-1 ; no - wait for it 2847 02306 6007 CAF ; clear all I/O flags 2848 2849 ; Reset the IDE disk too. If none is attached, then this is harmless... 2850 ;[250] JMS @ZPUSHJ1 ; (cross field call) 2851 ;[250] IDEINI ; reset the IDE disk and then return 2852 02307 4532 JMS @ZPUSHJ1 ; (cross field call) 2853 02310 1713 INIPMP ; and initialize the partition map 2854 02311 5772 JMP @[EXMEM] ; sync the FP6120 display and we're done 2855 2856 2857 ; This routine is called by the START and RESET commands and at system 2858 ; initialization to clear the saved user context... 2859 02312 7200 CLRCPU: CLA ; start with all zeros 2860 02313 3001 DCA UAC ; clear the AC 2861 02314 3003 DCA UMQ ; and the MQ 2862 02315 3002 DCA UFLAGS ; the DF, IF and LINK 2863 02316 3004 DCA USP1 ; stack pointer #1 2864 02317 3005 DCA USP2 ; and #2 2865 02320 3063 DCA FPPGMM ; clear the front panel program mode 2866 02321 7240 STA ; then finally set the PC to 7777 2867 02322 3000 DCA UPC ; ... 2868 02323 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 65 EX Command - Execute IOT Instructions bts6120.plx 2869 .TITLE EX Command - Execute IOT Instructions 2870 2871 2872 ; The EX command allows a user to type in and execute an IOT instruction 2873 ; directly from the terminal, which can be very useful for testing peripheral 2874 ; devices. Either one or two operands are allowed - the first is the octal 2875 ; code of the IOT to be executed, and the second (which is optional) is a 2876 ; value to be placed in the AC before the IOT is executed. If it is omitted, 2877 ; zero is placed in the AC. After the instruction is executed, the word SKIP 2878 ; is typed if the instruction skipped, along with the new contents of the AC. 2879 ; 2880 ; >EX 6471 -> execute IOT 6741 (the AC will be cleared) 2881 ; >EX 6474 1176 -> put 1176 in the AC and execute IOT 6474 2882 ; 2883 ; WARNING - some care must be exercised with this command, since executing 2884 ; the wrong IOT can crash the monitor! 2885 02324 6205 XCTCOM: .PUSHJ @ZOCTNW ; go read the IOT instruction code 02325 5521 2886 02326 1067 TAD WORD ; then get the value 2887 02327 3350 DCA XCTBLK ; save that where we'll execute it 2888 02330 3067 DCA WORD ; assume to use zero in the AC 2889 02331 1052 TAD SAVCHR ; next get the break character 2890 02332 7650 SNA CLA ; was it the end of the line ?? 2891 02333 5340 JMP XCT1 ; yes -- default to zero 2892 02334 6205 .PUSHJ @ZOCTNW ; no -- read another number 02335 5521 2893 02336 6205 .PUSHJ @ZEOLTST ; then test for the end of the line 02337 5516 2894 2895 ; Be sure the instruction is really an IOT... 2896 02340 1350 XCT1: TAD XCTBLK ; get the instruction 2897 02341 1371 TAD [-6000] ; compare it to 6000 2898 02342 7700 SMA CLA ; is it an IOT or OPR instruction ? 2899 02343 5346 JMP XCT2 ; yes -- that's OK 2900 02344 4531 JMS @ZERROR ; no -- don't allow this 2901 02345 3432 ERRILV ; ?ILLEGAL VALUE 2902 2903 ; Execute the instruction... 2904 02346 3071 XCT2: DCA COUNT ; will be non-zero if the IOT doesn't skip 2905 02347 1067 TAD WORD ; get the value we're supposed to put in the AC 2906 02350 7000 XCTBLK: NOP ; gets overwritten with the IOT to execute 2907 02351 2071 ISZ COUNT ; set the flag if it doesn't skip 2908 02352 3046 DCA VALUE ; and remember what is left in the AC 2909 2910 ; Print the results of the instruction.. 2911 02353 1071 TAD COUNT ; see if it skipped 2912 02354 7640 SZA CLA ; well ?? 2913 02355 5360 JMP XCT3 ; no -- no message 2914 02356 4511 JMS @ZINLMES ; yes -- say that it did 2915 02357 3477 SKPMSG ; ... 2916 02360 4511 XCT3: JMS @ZINLMES ; then print the AC after the instruction 2917 02361 3713 ACNAME ; ... 2918 02362 1046 TAD VALUE ; ... 2919 02363 5502 JMP @ZTOCT4C ; in octal, with a CRLF, and return 2920 02371 2000 02372 5751 02373 7000 02374 7711 02375 2077 02376 2146 02377 6031 2921 02400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 66 OS/8 Bootstrap bts6120.plx 2922 .TITLE OS/8 Bootstrap 2923 2924 2925 ; How to boot OS/8 (there's lots of documentation on how to write a device 2926 ; handler, even a system handler, but I couldn't find a description of how 2927 ; to make a bootable device anywhere!): 2928 ; 2929 ; The primary bootstrap for a device (the one which you have to toggle in 2930 ; with the switches!) normally loads cylinder 0, head 0, sector 0 (which is 2931 ; the equivalent to OS/8 logical block zero) into memory page zero field zero. 2932 ; The code loaded into page zero is then started in some device specific way, 2933 ; but usually the primary bootstrap is overwritten by this data and the CPU 2934 ; just "ends up" there. 2935 ; 2936 ; The first few words of block zero are called the secondary bootstrap, and 2937 ; it's normally found in the header for the system device handler. OS/8 BUILD 2938 ; copies this code from the handler to block zero when it builds the system 2939 ; device. The second half of block zero contains the system handler, what's 2940 ; resident in page 7600 while OS/8 is running, plus some OS/8 resident code 2941 ; that BUILD wraps around it. All of the second half of block zero must be 2942 ; loaded into page 7600, field 0 by the secondary bootstrap. 2943 ; 2944 ; The remainder of the first half of block zero, the part after the secondary 2945 ; bootstrap, contains the OS/8 resident code for field 1. This starts some 2946 ; where around offset 47 in the first half of block zero, and this code needs 2947 ; to be loaded into the corresponding locations of page 7600, field 1. The 2948 ; remaining words in page 7600, field 1 (i.e. those that belong to the 2949 ; secondary bootstrap) OS/8 uses for tables and their initial values are 2950 ; unimportant. It suffices to simply copy all of the first half of block zero 2951 ; to page 7600, field 1. 2952 ; 2953 ; All this discussion presupposes a single page system handler, as we have 2954 ; here. For a two page handler BUILD will put the second page in the first 2955 ; half of block 66 on the system device and I believe (although I can't 2956 ; guarantee it) that the second half of this block also contains an image 2957 ; of the OS/8 resident code at page 7600, field 1. This would make it the 2958 ; same as, excepting the bootstrap part, the first half of block zero. In 2959 ; the case of a two page handler, the secondary bootstrap is also responsible 2960 ; for loading the second handler page from block 66 into page 7600, field 2. 2961 ; OS/8 bootstrap code (secondary bootstrap). 2962 ; 2963 ; Once everything has been loaded, the secondary bootstrap can simply do a 2964 ; "CDF CIF 0" and then jump to location 7600 to load the keyboard monitor. 2965 ; 2966 ; The primary bootstrap for the SBC6120 RAM and IDE disks are six words 2967 ; loaded in locations 0 thru 5: 2968 ; 2969 ; 0000/ 6206 PR0 / execute a panel request 2970 ; 0001/ 0001 1 / 1 for RAM disk, 4 for IDE disk 2971 ; 0002/ 0100 0100 / read one page into field zero 2972 ; 0003/ 0000 0000 / location zero 2973 ; 0004/ 0000 0000 / from page/block zero of the device 2974 ; 0005/ 7402 HLT / should never get here 2975 ; 2976 ; If all goes well, the HLT in location 5 is never executed - it gets 2977 ; overwritten by the secondary bootstrap code before the ROM returns from 2978 ; the PR0 function. 2979 ; 2980 ; The B (BOOT) command in BTS6120 actually bypasses the primary bootstrap 2981 ; step and simply reads block zero of the boot device into page zero, field 2982 ; zero directly. The VM01 and ID01 secondary bootstraps all contain a special 2983 ; "key" in words 0 thru 4, the ones which would normally overwrite the primary 2984 ; boostrap, and BTS6120 looks for this key to identify a bootable volume. 2985 ; If the key is found, then BTS6120 simply jumps to main memory location 5 2986 ; to start the secondary bootstrap and finish loading OS/8. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 67 OS/8 Bootstrap bts6120.plx 2987 ; 2988 ; This system should also work for any other, non OS/8, system provided that 2989 ; it uses the same primary bootstrap shown above and that its secondary boot 2990 ; contains the special key in the first five words. As long as the secondary 2991 ; bootstrap starts at offset 5, the remainder of its code is unimportant to 2992 ; BTS6120 and it can do anything it likes. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 68 Boot Sniffer bts6120.plx 2993 .TITLE Boot Sniffer 2994 2995 2996 ; The secondary bootstraps for both VM01 and ID01 devices contain a special 2997 ; key, the ASCIZ string "BOOT", in the first five words. The caller is 2998 ; expected to read block zero of the boot device into memory, and then call 2999 ; this routine to examine page zero, field zero, of main memory to determine 3000 ; if a valid secondary bootstrap exists. If the key is found, then the LINK 3001 ; will be cleared on return... 3002 02400 1377 CKBOOT: TAD [BOOKEY-1] ; point X1 to the key string 3003 02401 3010 DCA X1 ; ... 3004 02402 7240 NL7777 ; and point X2 to page zero of main memory 3005 02403 3011 DCA X2 ; ... 3006 02404 7100 CKBOO1: CLL ; be sure the LINK is in a known state 3007 02405 1410 TAD @X1 ; get the next word of the key 3008 02406 7450 SNA ; have we done them all ? 3009 02407 6225 .POPJ ; yes - return success 3010 02410 7041 CIA ; make it negative 3011 02411 6266 CPD ; address main memory now 3012 02412 1411 TAD @X2 ; and compare our key to what's there 3013 02413 0135 AND ZK177 ; (PAL8 likes to set the high bit for ASCII!) 3014 02414 6276 SPD ; (back to panel memory) 3015 02415 7120 STL ; assume that we failed 3016 02416 7640 SZA CLA ; did the key match ? 3017 02417 6225 .POPJ ; nope - return with the LINK set 3018 02420 5204 JMP CKBOO1 ; yes - keep testing... 3019 3020 ; Ok, here it is - the magic key that makes a volume bootable! 3021 02421 BOOKEY: .ASCIZ /BOOT/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 69 B Command - Boot Disk bts6120.plx 3022 .TITLE B Command - Boot Disk 3023 3024 3025 ; The B command boots, or at least it tries to, either RAM or IDE disk. 3026 ; It can be used with an argument to specify the device to be booted, or 3027 ; without to ask BTS6120 to search for a bootable volume. For example: 3028 ; 3029 ; >B VM - boot device VMA0 3030 ; >B ID - boot device IDA0 3031 ; >B - search VMA0, then IDA0, for a bootstrap 3032 ; 3033 ; If no valid bootsrap can be found, then the message "?Not bootable" is 3034 ; printed. 3035 ; 3036 ; NOTE: It is currently only possible to bootstrap from unit zero for RAM 3037 ; disk, or partition zero in the case of IDE disk. 3038 ; 3039 ; NOTE also - the BOOT command ignores the state of the front panel (if 3040 ; any) RUN/HALT switch. In particular, it doesn't single step if the 3041 ; HALT switch is down when this command is executed. That seems like 3042 ; the most sensible thing. 3043 02426 6205 BOOT: .PUSHJ @ZSPACMP ; get the next non-space character 02427 5513 3044 02430 7650 SNA CLA ; is it the end of the line ? 3045 02431 5252 JMP BOOT1 ; yes - go search for a bootstrap 3046 02432 6205 .PUSHJ @ZBACKUP ; nope - backup to the first letter 02433 5515 3047 02434 6205 .PUSHJ @[NAMENW] ; and read the boot device name 02435 5776 3048 02436 6205 .PUSHJ @ZEOLNXT ; now there has to be an EOL 02437 5517 3049 3050 ; Here if a specific device name is given on the command line... 3051 02440 1375 TAD [BNAMES-1] ; point to the table of boot names 3052 02441 6205 .PUSHJ @[MATCH] ; go call the right boot routine 02442 5774 3053 02443 7430 SZL ; did we find a bootstrap ? 3054 02444 5262 JMP NOBOOT ; nope - print an error message 3055 3056 ; Now do the equivalent of a "ST 5" to start the bootstrap running... 3057 02445 6205 BOOTGO: .PUSHJ @[CLRCPU] ; clear all saved main memory state 02446 5773 3058 02447 1372 TAD [5] ; the secondary bootstrap starts at offset 5 3059 02450 3000 DCA UPC ; ... 3060 02451 5771 JMP @[CONT] ; cross your fingers! 3061 3062 ; Here to search for a bootable device... 3063 02452 6205 BOOT1: .PUSHJ BTVMA0 ; first try booting VMA0 02453 5264 3064 02454 7420 SNL ; did we succeed? 3065 02455 5245 JMP BOOTGO ; yes - go start the bootstrap 3066 02456 6205 .PUSHJ BTIDA0 ; nope - try IDA0 next 02457 5300 3067 02460 7420 SNL ; how about this? 3068 02461 5245 JMP BOOTGO ; yes - use that on instead 3069 3070 ; Here if no bootstrap can be found... 3071 02462 4531 NOBOOT: JMS @ZERROR ; print an error and return to command level 3072 02463 3530 ERRNBT ; ?NO BOOTSTRAP 3073 3074 3075 ; Here to attempt booting VMA0... 3076 02464 4532 BTVMA0: JMS @ZPUSHJ1 ; (cross field call) 3077 02465 0400 RDBOOT ; RAM disk primary bootstrap 3078 02466 6205 .PUSHJ CKBOOT ; is this volume bootable? PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 70 B Command - Boot Disk bts6120.plx 02467 5200 3079 02470 7430 SZL ; skip if yes 3080 02471 6225 .POPJ ; not bootable - just give up 3081 02472 4511 JMS @ZINLMES ; say 3082 02473 4107 VMAMSG ; "-VMA0" 3083 02474 6205 .PUSHJ @ZCRLF ; ... 02475 5510 3084 02476 7100 CLL ; be sure to return success 3085 02477 6225 .POPJ ; ... 3086 3087 3088 ; Here to attempt booting IDA0... 3089 02500 4532 BTIDA0: JMS @ZPUSHJ1 ; (cross field call) 3090 02501 1200 IDBOOT ; IDE disk primary bootstrap 3091 02502 6205 .PUSHJ CKBOOT ; is this volume bootable? 02503 5200 3092 02504 7430 SZL ; skip if yes 3093 02505 6225 .POPJ ; not bootable - just give up 3094 02506 4511 JMS @ZINLMES ; say 3095 02507 4114 IDAMSG ; "-IDA0" 3096 02510 6205 .PUSHJ @ZCRLF ; ... 02511 5510 3097 02512 7100 CLL ; and be sure to return success 3098 02513 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 71 Parse FORMAT Unit/Partition Argument bts6120.plx 3099 .TITLE Parse FORMAT Unit/Partition Argument 3100 3101 3102 ; This routine will parse the unit/partition number argument for FORMAT. 3103 ; Since this command is little on the dangerous side (it does erase all the 3104 ; data on the disk, after all!), we'll go to the extraordinary length of 3105 ; asking for confirmation before we do anything. Confirmation is nothing 3106 ; more than a single character (we don't wait for a carriage return) - "Y" 3107 ; continues with the format and anything else, including ^C, aborts... 3108 ; 3109 ; Assuming the user confirms, then the unit/partition number will be 3110 ; returned in the AC. If the user aborts, or if there are any syntax 3111 ; errors, then we restart the command scanner and never return. 3112 02514 6205 FMTARG: .PUSHJ @ZOCTNW ; read the unit/partition number 02515 5521 3113 02516 6205 .PUSHJ @ZEOLTST ; that has to be followed by the end of line 02517 5516 3114 02520 1065 TAD REPCNT ; is the format command repeated? 3115 02521 7640 SZA CLA ; skip if not 3116 02522 5336 JMP FMTAR1 ; yes - just do it without confirmation 3117 02523 4511 JMS @ZINLMES ; say 3118 02524 3745 FCFMSG ; "Format partition/unit " 3119 02525 1067 TAD WORD ; get the partition number once again 3120 02526 3046 DCA VALUE ; TOCT corrupts WORD, 3121 02527 1046 TAD VALUE ; .... so we have to stash it here 3122 02530 6205 .PUSHJ @ZTOCT4S ; and type it out 02531 5504 3123 02532 6205 .PUSHJ @[CONFRM] ; go wait for a "Y" or "y" 02533 5770 3124 02534 7620 SNL CLA ; did he confirm? 3125 02535 5527 JMP @ZRESTA ; no - just abort now 3126 02536 1046 FMTAR1: TAD VALUE ; yes he did - return the unit in the AC 3127 02537 6225 .POPJ ; ... 3128 3129 ; Here if the RAM disk unit number is illegal... 3130 02540 4531 NOUNIT: JMS @ZERROR ; ... 3131 02541 3432 ERRILV ; "?Illegal value" 3132 3133 ; This little routine verifies that a hard disk is attached to the system. 3134 ; If there is none, then an error message is printed and the command aborted. 3135 ; HOOK: an extension ROM can intercept this call in order to do its own 3136 ; checking if a disk is installed, e.g. in the case of a system with 3137 ; a storage device on a different interface. 3138 02542 7000 NODISK: NOP 3139 02543 7000 NOP 3140 02544 7000 NOP 3141 02545 4767 JMS @[CHKIDE] ; test DKSIZE to see if a disk is attached 3142 02546 7410 SKP ; no disk - print an error 3143 02547 6225 .POPJ ; there is a disk - return now 3144 02550 4531 JMS @ZERROR ; print a message and abort the command 3145 02551 3541 ERRNDK ; "?No disk" 3146 02567 2607 02570 7025 02571 2216 02572 0005 02573 2312 02574 6642 02575 3375 02576 6600 02577 2420 3147 02600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 72 Test for RAM Disk and/or IDE Disk bts6120.plx 3148 .TITLE Test for RAM Disk and/or IDE Disk 3149 3150 3151 ; This little routine will take the skip return if a RAM disk is installed 3152 ; on the current system, and the non-skip return if not ... 3153 02600 0000 CHKRAM: 0 3154 02601 6211 CDF 1 ; (RDTYPE lives in field 1) 3155 02602 1777 TAD @[RDTYPE] ; do we have a RAM disk attached? 3156 02603 6203 CXF 0 ; ... 3157 02604 7640 SZA CLA ; skip if no 3158 02605 2200 ISZ CHKRAM ; yes - take the skip return 3159 02606 5600 JMP @CHKRAM ; and we're done 3160 3161 3162 ; This little routine will take the skip return if an IDE disk is attached 3163 ; to the current system, and the non-skip return if none ... 3164 ; 3165 ; Things get a little bit tricky if an IOB6120 is installed, because the 3166 ; IOB firmware DOES NOT update DKSIZE if a CF card is installed on that device. 3167 ; Fortunately, we have a special routine to take care of just that case... 3168 02607 0000 CHKIDE: 0 3169 02610 4532 JMS @ZPUSHJ1 ; call CHKCFC in our field 1 3170 02611 2200 CHKCFC ; ... go see if an IOB6120 CF card is present 3171 02612 7640 SZA CLA ; skip if none 3172 02613 5220 JMP CHKID1 ; a CompactFlash card counts as an IDE drive 3173 02614 6211 CDF 1 ; (DKSIZE lives in field 1) 3174 02615 1776 TAD @[DKSIZE] ; do we have an IDE disk attached? 3175 02616 6203 CXF 0 ; ... 3176 02617 7640 SZA CLA ; skip if no 3177 02620 2207 CHKID1: ISZ CHKIDE ; yes - take the skip return 3178 02621 5607 JMP @CHKIDE ; and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 73 PM Command - Show and Edit Disk Partition Map bts6120.plx 3179 .TITLE PM Command - Show and Edit Disk Partition Map 3180 3181 3182 ; The PM command allows the default mapping of OS/8 units to IDE disk 3183 ; partitions to be changed. PM accepts two arguments, both of which are 3184 ; optional. The first argument is the OS/8 logical unit number, and the 3185 ; second argument a partition number, in octal. Used without any arguments, 3186 ; the PM command will display a list of all eight OS/8 units and their current 3187 ; mappings. With one argument, PM will display only the mapping for that 3188 ; unit, and with two arguments PM will change the mapping of that unit. 3189 ; 3190 ; >PM u pppp - map OS/8 ID01 unit u to IDE partition pppp 3191 ; >PM u - display the mapping for unit u 3192 ; >PM - display the mapping for all units 3193 ; 3194 02622 6205 PMEDIT: .PUSHJ @ZSPACMP ; get the next non-space character 02623 5513 3195 02624 7650 SNA CLA ; is it the end of the line ? 3196 02625 5263 JMP PMALL ; yes - show the entire map 3197 02626 6205 .PUSHJ @ZBACKUP ; nope - backup and read this character 02627 5515 3198 02630 6205 .PUSHJ @ZOCTNW ; it should be a unit number 02631 5521 3199 02632 1067 TAD WORD ; get the value we read 3200 02633 0375 AND [7770] ; and the unit number must be less than 7 3201 02634 7640 SZA CLA ; ?? 3202 02635 5261 JMP PMEDI1 ; nope - "Illegal value" 3203 02636 1067 TAD WORD ; transfer the unit number 3204 02637 3071 DCA COUNT ; to COUNT for later use 3205 3206 ; See if there's also a partition number on the line... 3207 02640 6205 .PUSHJ @ZSPACM0 ; get the next non-space character 02641 5514 3208 02642 7650 SNA CLA ; is it the end of the line? 3209 02643 5274 JMP PMSHOW ; yes - print the mapping for this unit only 3210 02644 6205 .PUSHJ @ZBACKUP ; nope - read what comes next 02645 5515 3211 02646 6205 .PUSHJ @ZOCTNW ; this should be the partition number 02647 5521 3212 02650 6205 .PUSHJ @ZEOLTST ; and then we have to be at the EOL 02651 5516 3213 3214 ; Here to change the mapping for a specific unit... 3215 02652 1071 TAD COUNT ; get the unit number 3216 02653 1374 TAD [PARMAP-1] ; and make an index into the mapping table 3217 02654 3010 DCA X1 ; ... 3218 02655 1067 TAD WORD ; get the desired mapping 3219 02656 3410 DCA @X1 ; and update the partition table 3220 02657 6222 CIF 2 3221 02660 5773 JMP @[WRPSS] ; store the PM in NVRAM if it exists 3222 ; and we're all done 3223 3224 ; Here if the unit number is illegal... 3225 02661 4531 PMEDI1: JMS @ZERROR ; say 3226 02662 3432 ERRILV ; "?Illegal value" and abort 3227 3228 3229 ; Here to show all eight entries in the entire partition map... 3230 02663 3071 PMALL: DCA COUNT ; start with unit zero 3231 02664 6205 .PUSHJ PMSHOW ; and show the mapping for that unit 02665 5274 3232 02666 2071 ISZ COUNT ; now onto the next one 3233 02667 1071 TAD COUNT ; have we done eight ? 3234 02670 1375 TAD [-10] ; ??? 3235 02671 7640 SZA CLA ; well ? PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 74 PM Command - Show and Edit Disk Partition Map bts6120.plx 3236 02672 5264 JMP PMALL+1 ; nope - keep going 3237 02673 6225 .POPJ ; yes, we can quit now 3238 3239 ; Here to show the mapping for the unit in COUNT... 3240 02674 4511 PMSHOW: JMS @ZINLMES ; say 3241 02675 4067 PM1MSG ; "Unit " 3242 02676 1071 TAD COUNT ; get the selected unit 3243 02677 6205 .PUSHJ @[TDIGIT] ; and type it 02700 5772 3244 02701 4511 JMS @ZINLMES ; now say 3245 02702 4074 PM2MSG ; " mapped to partition " 3246 02703 1071 TAD COUNT ; get the count again 3247 02704 1374 TAD [PARMAP-1] ; and index the partition table 3248 02705 3010 DCA X1 ; ... 3249 02706 1410 TAD @X1 ; get the partition mapped to this unit 3250 02707 5502 JMP @ZTOCT4C ; type it, in octal, and a CRLF PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 75 Disk Formatter, Pass 1 bts6120.plx 3251 .TITLE Disk Formatter, Pass 1 3252 3253 3254 ; Pass one of the RAM/IDE disk formatter writes every block with a simple 3255 ; test pattern consisting of alternating words filled with the block number 3256 ; and its complement. Although it's not too creative, this pattern does do 3257 ; two things - it guarantees that each block is unique (so we can make sure 3258 ; the disk addresssing is working!) and it does ensure that every bit gets 3259 ; tested with a zero and a one (so we can make sure the data lines are 3260 ; working). 3261 ; 3262 ; This routine expects that a number of memory locations will be initialized 3263 ; before it's called. RECSIZ must contain the negative of the logical record 3264 ; size for the device (-256 for IDE disk or -128 for RAM disk). FMTCNT should 3265 ; contain the negative of the device size, in blocks/pages, and FMTWRP (a 3266 ; location in this routine!) must be initialized with the address of the 3267 ; disk write routine... 3268 02710 4511 FMTP1: JMS @ZINLMES ; say 3269 02711 3765 FM1MSG ; ... "Writing " 3270 02712 7201 CLA IAC ; put the FP6120 data display 3271 02713 3063 DCA FPPGMM ; ... in "program" mode 3272 02714 6211 CDF 1 ; ... 3273 02715 3534 DCA @ZDKRBN ; reset the current disk block 3274 02716 3533 DCA @ZRDPAGE ; and page numbers 3275 3276 ; Fill the disk buffer with the test pattern... 3277 02717 1073 FMTP11: TAD RECSIZ ; get the negative of the record size 3278 02720 7130 CLL CML RAR ; and divide it by two 3279 02721 3071 DCA COUNT ; since we'll fill the buffer in word pairs 3280 02722 1371 TAD [DSKBUF-1] ; point X1 to the disk buffer 3281 02723 3010 DCA X1 ; ... 3282 02724 6211 CDF 1 ; (the disk buffer is in field 1) 3283 02725 1075 FMTP12: TAD FMTCNT ; get the current block/page number 3284 02726 3410 DCA @X1 ; store that 3285 02727 1075 TAD FMTCNT ; then store its complement 3286 02730 7040 CMA ; ... 3287 02731 3410 DCA @X1 ; in the next word 3288 02732 2071 ISZ COUNT ; have we done the whole buffer? 3289 02733 5325 JMP FMTP12 ; nope - keep filling 3290 02734 6201 CDF 0 ; return to our default field 3291 3292 ; Write the buffer to the disk... 3293 02735 4532 JMS @ZPUSHJ1 ; (cross field call) 3294 02736 2210 PNLBUF ; setup our temporary buffer in field 1 3295 02737 1073 TAD RECSIZ ; pass the record size to the I/O routine 3296 02740 4532 JMS @ZPUSHJ1 ; (cross field call) 3297 02741 FMTWRP: .BLOCK 1 ; modified to either DISKWR or RAMDWR 3298 02742 7430 SZL ; were there any errors ? 3299 02743 5770 JMP @[DIOERR] ; yes - quit now 3300 3301 ; See if we've done the whole disk... 3302 02744 7200 CLA ; ... 3303 02745 2075 ISZ FMTCNT ; increment the page/block counter 3304 02746 7410 SKP ; not done yet - keep going 3305 02747 6225 .POPJ ; all done! 3306 02750 6211 CDF 1 ; disk data lives in field 1 3307 02751 2534 ISZ @ZDKRBN ; increment the disk block number 3308 02752 2533 ISZ @ZRDPAGE ; and the RAM disk page number 3309 02753 1533 TAD @ZRDPAGE ; get the current page/block number again 3310 02754 6201 CDF 0 ; back to safe ground 3311 02755 3064 DCA FPPGMD ; display the current page/block on the FP6120 3312 02756 6205 .PUSHJ @ZINCHRS ; update the display and check for ^C 02757 5512 3313 3314 ; Print a dot every so often to make a simple "progress bar"... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 76 Disk Formatter, Pass 1 bts6120.plx 3315 02760 1073 TAD RECSIZ ; get the current record size 3316 02761 7040 CMA ; and make it a mask for the lower bits 3317 02762 0075 AND FMTCNT ; apply it to the current block/page number 3318 02763 7640 SZA CLA ; ... 3319 02764 5317 JMP FMTP11 ; not time for a dot yet 3320 02765 6205 .PUSHJ @ZTDOT ; print a dot to show our progress 02766 5507 3321 02767 5317 JMP FMTP11 ; and another page or block 3322 02770 3504 02771 7377 02772 7102 02773 0243 02774 0017 02775 7770 02776 0022 02777 0047 3323 03000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 77 Disk Formatter, Pass 2 bts6120.plx 3324 .TITLE Disk Formatter, Pass 2 3325 3326 3327 ; Pass two of the RAM/IDE disk formatter reads back every block and verifies 3328 ; that the test pattern written by pass 1 is there. If any block doesn't 3329 ; contain the data we expect, then a "Verification error" message will be 3330 ; printed, but verification continues. This routine expects all the same 3331 ; data to be set up in FMTCNT and RECSIZ as Pass 1, and in addition it 3332 ; expects FMTRDP to be initialized with the address of the disk read routine. 3333 03000 4511 FMTP2: JMS @ZINLMES ; say 3334 03001 3774 FM2MSG ; "Verifying" 3335 03002 6211 CDF 1 ; ... 3336 03003 3534 DCA @ZDKRBN ; reset the current disk block 3337 03004 3533 DCA @ZRDPAGE ; and page numbers 3338 03005 6201 CDF 0 ; ... 3339 3340 ; Read the next block/page from the disk... 3341 03006 4532 FMTP21: JMS @ZPUSHJ1 ; (cross field call) 3342 03007 2210 PNLBUF ; setup a temporary disk buffer in panel memory 3343 03010 1073 TAD RECSIZ ; pass the record size to DISKRD 3344 03011 4532 JMS @ZPUSHJ1 ; (cross field call) 3345 03012 FMTRDP: .BLOCK 1 ; gets modified to either DISKRD or RAMDRD! 3346 03013 7430 SZL ; any I/O errors ? 3347 03014 5777 JMP @[DIOERR] ; yes - just give up now 3348 3349 ; Verify that the data in the buffer matches what we wrote... 3350 03015 1073 TAD RECSIZ ; and get the block/page size 3351 03016 7130 CLL CML RAR ; divide it by two 3352 03017 3071 DCA COUNT ; because we'll test in double word pairs 3353 03020 1376 TAD [DSKBUF-1] ; point X1 to the disk buffer 3354 03021 3010 DCA X1 ; ... 3355 03022 6211 CDF 1 ; (disk buffer lives in field 1) 3356 03023 1075 FMTP22: TAD FMTCNT ; get the current block/page number 3357 03024 7041 CIA ; make it negative 3358 03025 1410 TAD @X1 ; and compare to the first word in the buffer 3359 03026 7640 SZA CLA ; it matches, no? 3360 03027 5263 JMP FMTP29 ; no - verify error! 3361 03030 1410 TAD @X1 ; the second word is the complement of the page 3362 03031 1075 TAD FMTCNT ; so that plus this 3363 03032 7001 IAC ; plus 1 should be zero! 3364 03033 7640 SZA CLA ; are we right? 3365 03034 5263 JMP FMTP29 ; no - verify error! 3366 03035 2071 ISZ COUNT ; have we done the whole buffer? 3367 03036 5223 JMP FMTP22 ; nope - keep testing 3368 03037 6201 CDF 0 ; return to our regular field 3369 3370 ; See if we've done the whole disk... 3371 03040 2075 FMTP23: ISZ FMTCNT ; increment the page/block counter 3372 03041 7410 SKP ; not done yet - keep going 3373 03042 6225 .POPJ ; all done! 3374 03043 6211 CDF 1 ; disk data lives in field 1 3375 03044 2534 ISZ @ZDKRBN ; increment the disk block number 3376 03045 2533 ISZ @ZRDPAGE ; and the RAM disk page number 3377 03046 1533 TAD @ZRDPAGE ; get the current page/block number again 3378 03047 6201 CDF 0 ; back to safe ground 3379 03050 3064 DCA FPPGMD ; display the current page/block on the FP6120 3380 03051 6205 .PUSHJ @ZINCHRS ; update display and check for ^C 03052 5512 3381 3382 ; Print a dot every so often to make a simple "progress bar"... 3383 03053 1073 TAD RECSIZ ; get the current record size 3384 03054 7040 CMA ; and make it a mask for the lower bits 3385 03055 0075 AND FMTCNT ; apply it to the current block/page number 3386 03056 7640 SZA CLA ; ... 3387 03057 5206 JMP FMTP21 ; not time for a dot yet PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 78 Disk Formatter, Pass 2 bts6120.plx 3388 03060 6205 .PUSHJ @ZTDOT ; print a dot to show our progress 03061 5507 3389 03062 5206 JMP FMTP21 ; and another page or block 3390 3391 ; Here if one (or more) words don't match.. 3392 03063 6201 FMTP29: CDF 0 ; restore the usual field 3393 03064 6205 .PUSHJ @ZCRLF ; we're in the middle of a line now 03065 5510 3394 03066 4511 JMS @ZINLMES ; so start a new one and print 3395 03067 4012 ERRDSK ; "?Verification error, block/page " 3396 03070 6211 CDF 1 ; (disk data is in field 1) 3397 03071 1534 TAD @ZDKRBN ; get the current block/page number 3398 03072 6201 CDF 0 ; ... 3399 03073 6205 .PUSHJ @ZTOCT4C ; and type it (in octal) 03074 5502 3400 03075 5240 JMP FMTP23 ; better luck with the next block PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 79 DF Command - Format IDE Disk Partition bts6120.plx 3401 .TITLE DF Command - Format IDE Disk Partition 3402 3403 3404 ; The DF command will "format" an IDE disk partition. The name is a misnomer 3405 ; because there's nothing about an IDE disk that needs formatting in the way 3406 ; a floppy does, but this command does write and then read back every single 3407 ; block of the partition which serves the useful function of testing the disk. 3408 ; It works in two passes - the first pass writes every block with a test 3409 ; pattern, and the second pass reads and verifies every block for the correct 3410 ; data. 3411 ; 3412 ; >DF pppp - format disk partition pppp 3413 ; 3414 03076 6205 DFRMAT: .PUSHJ @[NODISK] ; verify that a hard disk is attached 03077 5775 3415 03100 6205 .PUSHJ @[FMTARG] ; get the partition and ask for confirmation 03101 5774 3416 03102 6211 CDF 1 ; the IDE disk data lives in field one 3417 03103 3773 DCA @[DKPART] ; save the partition number 3418 03104 6201 CDF 0 ; ... 3419 03105 1142 TAD ZM256 ; the record size for IDE disk is 256 words 3420 03106 3073 DCA RECSIZ ; ... 3421 3422 ; Do pass 1... 3423 03107 3075 DCA FMTCNT ; an IDE partition always holds 4096 blocks 3424 03110 1372 TAD [DISKWR] ; point to the correct I/O routine 3425 03111 3771 DCA @[FMTWRP] ; and point pass 1 towards that 3426 03112 6205 .PUSHJ @[FMTP1] ; go do pass 1 03113 5770 3427 3428 ; And do pass 2... 3429 03114 3075 DCA FMTCNT ; reset the block count to 4096 3430 03115 1367 TAD [DISKRD] ; and point pass 2 to the disk read routine 3431 03116 3212 DCA FMTRDP ; ... 3432 03117 6205 .PUSHJ FMTP2 ; and away we go! 03120 5200 3433 3434 ; We've tested the entire disk... 3435 03121 4511 FRDONE: JMS @ZINLMES ; let the operator know we're done 3436 03122 4005 FM3MSG ; "Finished" 3437 03123 5510 JMP @ZCRLF ; finish the line and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 80 RF Command - Format a RAM Disk bts6120.plx 3438 .TITLE RF Command - Format a RAM Disk 3439 3440 3441 ; The RF command will "format" a RAM disk virtual drive and it's essentially 3442 ; identical to the DF command that formats IDE disks. 3443 ; 3444 ; >RF u - format RAM disk unit u 3445 ; 3446 03124 6205 RFRMAT: .PUSHJ @[FMTARG] ; get the unit and ask for confirmation 03125 5774 3447 03126 6211 CDF 1 ; the RAM disk data lives in field one 3448 03127 3766 DCA @[RDUNIT] ; save the unit 3449 03130 6201 CDF 0 ; ... 3450 03131 4532 JMS @ZPUSHJ1 ; (cross field call) 3451 03132 0722 RAMSEL ; try to select this RAM disk unit 3452 03133 7630 SZL CLA ; was the unit number legal ?? 3453 03134 5765 JMP @[NOUNIT] ; nope - quit while we're ahead! 3454 03135 1141 TAD ZM128 ; the record size for RAM disk is 128 words 3455 03136 3073 DCA RECSIZ ; ... 3456 3457 ; Do pass 1... 3458 03137 6211 CDF 1 ; get the size of this RAM disk unit 3459 03140 1764 TAD @[RAMUSZ] ; which is left here by RAMSEL 3460 03141 3075 DCA FMTCNT ; save it for pass 1 3461 03142 6201 CDF 0 ; ... 3462 03143 1363 TAD [RAMDWR] ; get the correct I/O routine 3463 03144 3771 DCA @[FMTWRP] ; and point pass 1 towards that 3464 03145 6205 .PUSHJ @[FMTP1] ; go do pass 1 03146 5770 3465 3466 ; And do pass 2... 3467 03147 6211 CDF 1 ; get the size of this RAM disk unit 3468 03150 1764 TAD @[RAMUSZ] ; which is left here by RAMSEL 3469 03151 3075 DCA FMTCNT ; save it for pass1 3470 03152 6201 CDF 0 ; ... 3471 03153 1362 TAD [RAMDRD] ; and point pass 2 to the disk read routine 3472 03154 3212 DCA FMTRDP ; ... 3473 03155 6205 .PUSHJ FMTP2 ; and away we go! 03156 5200 3474 3475 ; We've tested the entire disk... 3476 03157 5321 JMP FRDONE ; say "Finished" and we're done! 3477 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 3478 03200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 81 LP Command - Load Binary Paper Tapes from the Console bts6120.plx 3479 .TITLE LP Command - Load Binary Paper Tapes from the Console 3480 3481 3482 ; The LP command loads a "paper tape" in standard PDP-8 BIN loader format 3483 ; from the console. If the console is actually an ASR-33 and you actually 3484 ; have a real PDP-8 paper tape, then this will probably even work, but a more 3485 ; likely situation is that you're using a PC with a terminal emulator. In 3486 ; that case the paper tape image can be downloaded from the PC's disk. 3487 ; 3488 ; The loader accepts all standard BIN data frames, including field changes, 3489 ; and correctly calculates and verifies the tape checksum. If the checksum 3490 ; matches then the number of words loaded is printed - otherwise a checksum 3491 ; error message is generated. When initially started, this routine ignores 3492 ; all input until two consectutive leader codes (octal 200) are found - this 3493 ; allows us to ignore any extra ASCII characters from the terminal emulator 3494 ; (such as carriage returns, spaces, etc). 3495 ; 3496 ; Since we're using the real console, the same one that you're typing 3497 ; commands on, for input we have a problem in that we need some way to 3498 ; terminate loading. Control-C won't work since the BIN loader eats all 3499 ; eight bit characters. A hardware reset isn't a good idea, since the POST 3500 ; memory test will erase everything we've loaded. Instead we use a special 3501 ; routine, CONGET, to read characters from the console and this routine has a 3502 ; timeout built in. If we go approximately 5 seconds without any input then 3503 ; the loader is terminated. 3504 03200 6205 CONLOD: .PUSHJ @ZEOLNXT ; this command has no operands 03201 5517 3505 03202 3041 DCA PNLMEM ; files are always lodaded into main memory 3506 3507 ; Look for two consecutive bytes of leader code... 3508 03203 1377 BINLO1: TAD [-2] ; we need two bytes of leader/trailer 3509 03204 3071 DCA COUNT ; ... 3510 03205 6205 BINLO2: .PUSHJ CONGET ; go read a byte of input 03206 5325 3511 03207 1376 TAD [-200] ; is this a leader code ?? 3512 03210 7640 SZA CLA ; ?? 3513 03211 5203 JMP BINLO1 ; no -- keep looking for two 3514 03212 2071 ISZ COUNT ; yes -- is this the second in a row ?? 3515 03213 5205 JMP BINLO2 ; no -- go look for the next one 3516 3517 ; Here after we have 2 bytes of leader -- look for the end of the leader... 3518 03214 6205 BINLO3: .PUSHJ CONGET ; get another byte of data 03215 5325 3519 03216 1376 TAD [-200] ; are we still in the leader ?? 3520 03217 7450 SNA ; ??? 3521 03220 5214 JMP BINLO3 ; yes -- keep looking 3522 03221 1375 TAD [200] ; no -- restore the character 3523 03222 3067 DCA WORD ; and remember it for later 3524 3525 ; Now actually start loading data... 3526 03223 3050 DCA CHKSUM ; start with a zero checksum 3527 03224 1375 TAD [200] ; set the default load address to location 200 3528 03225 3037 DCA ADDR ; ... 3529 03226 3040 DCA ADRFLD ; in field zero 3530 3531 ; Decode the type of the next load record... 3532 03227 7621 BINLO5: CAM ; ... 3533 03230 1067 TAD WORD ; Get the last character we read 3534 03231 0375 AND [200] ; Is this a single byte frame ??? 3535 03232 7640 SZA CLA ; ?? 3536 03233 5301 JMP BINLO7 ; Yes -- this is EOF or a field setting 3537 3538 ; Load a two frame record (either data or an address)... 3539 03234 1067 TAD WORD ; get the first byte back again 3540 03235 3323 DCA BINCH1 ; and remember that PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 82 LP Command - Load Binary Paper Tapes from the Console bts6120.plx 3541 03236 6205 .PUSHJ CONGET ; then go read the next byte 03237 5325 3542 03240 3324 DCA BINCH2 ; and save that 3543 03241 1323 TAD BINCH1 ; get the first byte 3544 03242 0374 AND [77] ; trim it to just 6 bits 3545 03243 7002 BSW ; put it in the left half 3546 03244 7421 MQL ; and save it in the MQ for now 3547 03245 1324 TAD BINCH2 ; then get the second character 3548 03246 0374 AND [77] ; trim it to 6 bits too 3549 03247 7501 MQA ; and OR it with the first character 3550 03250 3046 DCA VALUE ; remember what we read 3551 3552 ; Determine what to do with this word... 3553 03251 6205 .PUSHJ CONGET ; look ahead one byte 03252 5325 3554 03253 3067 DCA WORD ; save that character 3555 03254 1067 TAD WORD ; and get it back 3556 03255 1376 TAD [-200] ; is this the end of the tape ?? 3557 03256 7650 SNA CLA ; ?? 3558 03257 5314 JMP BINLO8 ; yes -- we read a checksum word 3559 03260 1050 TAD CHKSUM ; no -- checksum the two characters we read 3560 03261 1323 TAD BINCH1 ; ... 3561 03262 1324 TAD BINCH2 ; ... 3562 03263 3050 DCA CHKSUM ; ... 3563 03264 1323 TAD BINCH1 ; then look at the first character 3564 03265 0373 AND [100] ; is this an address or data frame ?? 3565 03266 7640 SZA CLA ; skip if it's data 3566 03267 5276 JMP BINLO6 ; no -- it is an address 3567 3568 ; Load this word of data into memory... 3569 03270 1046 TAD VALUE ; get the word back 3570 03271 6205 .PUSHJ @ZDANDV ; and write it into memory 03272 5526 3571 03273 2037 ISZ ADDR ; automatically advance the address 3572 03274 7000 NOP ; (and ignore any wrap around) 3573 03275 5227 JMP BINLO5 ; then go process the next frame 3574 3575 ; This word is an address... 3576 03276 1046 BINLO6: TAD VALUE ; get the 12 bits of data 3577 03277 3037 DCA ADDR ; and change to that address 3578 03300 5227 JMP BINLO5 ; then go process the next frame 3579 3580 ; Here of the current frame is a field setting... 3581 03301 1067 BINLO7: TAD WORD ; get the last character back again 3582 03302 0373 AND [100] ; see if it is really a field frame 3583 03303 7650 SNA CLA ; ??? 3584 03304 5314 JMP BINLO8 ; no -- treat it like a trailer code 3585 03305 1067 TAD WORD ; get the field back 3586 03306 0136 AND ZK70 ; we only want these bits 3587 03307 3040 DCA ADRFLD ; and change to the selected field 3588 03310 6205 .PUSHJ CONGET ; Then look ahead one byte 03311 5325 3589 03312 3067 DCA WORD ; ... 3590 03313 5227 JMP BINLO5 ; and go process that frame 3591 3592 ; Here when we find the checksum byte... 3593 03314 1046 BINLO8: TAD VALUE ; get the checksum byte 3594 03315 7041 CIA ; make it negative 3595 03316 1050 TAD CHKSUM ; and add it to our checksum 3596 03317 3050 DCA CHKSUM ; this should leave zero 3597 03320 6205 .PUSHJ @[TCKSUM] ; go type the checksum and return 03321 5772 3598 03322 5203 JMP BINLO1 3599 3600 ; Temporary storage for BIN loader routine... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 83 LP Command - Load Binary Paper Tapes from the Console bts6120.plx 3601 03323 BINCH1: .BLOCK 1 ; the first of a two character frame 3602 03324 BINCH2: .BLOCK 1 ; the second of a two character frame PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 84 Paper Tape Console Input Routine bts6120.plx 3603 .TITLE Paper Tape Console Input Routine 3604 3605 3606 ; This routine will read a character from the console, waiting if there is 3607 ; none ready right now, and with a timeout if one doesn't arrive soon. It is 3608 ; intended to be used only with the paper tape binary loader routine, and most 3609 ; "textual" input should be done via the INCHRS or INCHWL routines. Since the 3610 ; user cannot type control-C to abort the paper tape loader (data is being read 3611 ; from the console, remember ?) this routine provides a timeout feature to 3612 ; prevent the monitor from becoming 'hung'. If no character is received from 3613 ; the console in approximately 10 seconds, a control-C is simulated by jumping 3614 ; to RESTA. 3615 0310 FTCONT=200. ; approximately 10 seconds with a 4.9152Mhz clock 3616 3617 03325 7200 CONGET: CLA ; ... 3618 03326 1371 TAD [-FTCONT] ; get the console timeout time 3619 03327 3057 DCA IRMA ; and set up a counter 3620 3621 ; Try to read a character... 3622 03330 6031 CONGE1: KSF ; is there a character there ??? 3623 03331 5335 JMP CONGE2 ; no -- check the timer 3624 03332 7200 CLA ; yes -- clear the timer 3625 03333 6036 KRB ; and get the character 3626 03334 6225 .POPJ ; then return that 3627 3628 ; Here to keep the timeout counter. The loop between CONGE1 and CONGE2 3629 ; requires 56 states, or approximately .1835 seconds at 2.5Mhz. This is 3630 ; executed FTCONT times for the overall timeout. 3631 03335 7001 CONGE2: IAC ; increment the timer 3632 03336 7440 SZA ; has it counted to 4096 ??? 3633 03337 5330 JMP CONGE1 ; no -- keep waiting 3634 03340 2057 ISZ IRMA ; yes -- have we waited long enough ?? 3635 03341 5330 JMP CONGE1 ; no -- wait a little longer 3636 03342 7325 NL0003 ; yes -- simulate a control-C 3637 03343 6205 .PUSHJ @ZOUTCHR ; echo ^C 03344 5476 3638 03345 5527 JMP @ZRESTA ; and restart 3639 03371 7470 03372 1472 03373 0100 03374 0077 03375 0200 03376 7600 03377 7776 3640 03400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 85 RD and DD Commands - Dump Disk (RAM and IDE) Records bts6120.plx 3641 .TITLE RD and DD Commands - Dump Disk (RAM and IDE) Records 3642 3643 3644 ; These commands dump one or more disk records, in octal, to the console. 3645 ; What you get from DP is exactly how the OS/8 device driver sees the disk 3646 ; data. Each command accepts one, two or three parameters. The first is unit 3647 ; number for RAM Disk (RD) commands, or the partition number for IDE Disk (DD) 3648 ; commands. The second parameter is the number of the block to be dumped, in 3649 ; octal. If this number is omitted then the ENTIRE disk will be dumped which, 3650 ; although legal, will take quite a while! The third parameter is the count 3651 ; of pages (for RAM Disk) or blocks (for IDE disk) to be dumped and, if 3652 ; omitted, this defaults to 1. For example: 3653 ; 3654 ; >RD 0 0 - dump only page 0 (the boot block) of RAM disk unit 0 3655 ; >DD 2 100 - dump only page 100 (octal) of IDE partition 2 3656 ; >RD 1 100 77 - dump 64 (77 octal) pages of unit 1 from 100 to 177 3657 ; >DD 0 - dump ALL of IDE partition zero (4095 blocks!) 3658 ; 3659 3660 ; Enter here for the RD command... 3661 03400 1377 RDDUMP: TAD [RAMDRD] ; point to the RAM disk read routine 3662 03401 3267 DCA RDPTR ; modify the code to use that 3663 03402 1141 TAD ZM128 ; get the record size for RAM disk 3664 03403 3073 DCA RECSIZ ; and save that 3665 03404 5213 JMP PARSDX ; fall into the regular code now 3666 3667 ; And here for the DD command... 3668 03405 6205 DDDUMP: .PUSHJ @[NODISK] ; verify that a hard disk exists 03406 5776 3669 03407 1375 TAD [DISKRD] ; point to the IDE disk read routine 3670 03410 3267 DCA RDPTR ; and use that instead 3671 03411 1142 TAD ZM256 ; IDE disk uses 256 word records 3672 03412 3073 DCA RECSIZ ; ... 3673 3674 ; Parse the argument lists for either command... 3675 03413 6205 PARSDX: .PUSHJ @ZOCTNW ; read the unit/partition number (required) 03414 5521 3676 03415 6211 CDF 1 ; all disk data lives in field 1 3677 03416 1067 TAD WORD ; get what we found 3678 03417 3774 DCA @[DKPART] ; save both the partition number 3679 03420 1067 TAD WORD ; ... 3680 03421 3773 DCA @[RDUNIT] ; and the unit number 3681 03422 3534 DCA @ZDKRBN ; set the default starting block/page to zero 3682 03423 3533 DCA @ZRDPAGE ; ... 3683 03424 6201 CDF 0 ; back to the current field 3684 03425 3074 DCA RECCNT ; make the default record count the whole disk 3685 3686 ; See if there's a starting page number on the command line... 3687 03426 6205 .PUSHJ @ZSPACM0 ; are there any more characters in the command? 03427 5514 3688 03430 7650 SNA CLA ; skip if there are 3689 03431 5263 JMP DDUMP1 ; nope - start dumping now 3690 03432 6205 .PUSHJ @ZBACKUP ; yes - re-read the character 03433 5515 3691 03434 6205 .PUSHJ @ZOCTNW ; and read the page/block number 03435 5521 3692 03436 6211 CDF 1 ; back to field 1 3693 03437 1067 TAD WORD ; get the starting block/page number 3694 03440 3534 DCA @ZDKRBN ; and save it for both RAM disk and IDE disk 3695 03441 1067 TAD WORD ; ... 3696 03442 3533 DCA @ZRDPAGE ; ... 3697 03443 6201 CDF 0 ; back to our field 3698 03444 7240 NLM1 ; now the default record count is one 3699 03445 3074 DCA RECCNT ; ... 3700 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 86 RD and DD Commands - Dump Disk (RAM and IDE) Records bts6120.plx 3701 ; See if there's a page/block count too.. 3702 03446 6205 .PUSHJ @ZSPACM0 ; still more characters? 03447 5514 3703 03450 7650 SNA CLA ; skip if there are 3704 03451 5263 JMP DDUMP1 ; nope - start dumping now 3705 03452 6205 .PUSHJ @ZBACKUP ; yes - re-read the character 03453 5515 3706 03454 6205 .PUSHJ @ZOCTNW ; and read the page count 03455 5521 3707 03456 1067 TAD WORD ; ... 3708 03457 7041 CIA ; make it negative for ISZ 3709 03460 3074 DCA RECCNT ; and save the count 3710 03461 6205 .PUSHJ @ZEOLTST ; finally, this has to be the end of the line 03462 5516 3711 3712 ; Read a page from the disk into the panel memory buffer and dump it... 3713 03463 4532 DDUMP1: JMS @ZPUSHJ1 ; (call field 1 routine) 3714 03464 2210 PNLBUF ; set the disk buffer to DSKBUF 3715 03465 1073 TAD RECSIZ ; pass the record size to the I/O routine 3716 03466 4532 JMS @ZPUSHJ1 ; (cross field call) 3717 03467 RDPTR: .BLOCK 1 ; gets overwritten with DISKRD or RAMDRD! 3718 03470 7430 SZL ; were there any errors detected ? 3719 03471 5304 JMP DIOERR ; yes - report it and quit 3720 03472 1073 TAD RECSIZ ; nope - get the size of this record 3721 03473 6205 .PUSHJ @[DDBUF] ; and go dump the DSKBUF 03474 5772 3722 03475 6211 CDF 1 ; disk data lives in field 1 3723 03476 2534 ISZ @ZDKRBN ; increment both the IDE block 3724 03477 2533 ISZ @ZRDPAGE ; and RAM disk page 3725 03500 6201 CDF 0 ; ... 3726 03501 2074 ISZ RECCNT ; have we done all we need to? 3727 03502 5263 JMP DDUMP1 ; nope - go dump another one 3728 03503 6225 .POPJ ; yes - we're done (finally!!) 3729 3730 ; Here if a disk I/O error occurs... 3731 03504 6201 DIOERR: CDF 0 ; just in case 3732 03505 3046 DCA VALUE ; save the error code for a minute 3733 03506 4511 JMS @ZINLMES ; say 3734 03507 3504 ERRDIO ; "?I/O Error " 3735 03510 1046 TAD VALUE ; get the error status 3736 03511 6205 .PUSHJ @ZTOCT4M ; type it and a CRLF 03512 5503 3737 ; and abort this command completely PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 87 RL and DL Commands - Load Disk (RAM and IDE) Records bts6120.plx 3738 .TITLE RL and DL Commands - Load Disk (RAM and IDE) Records 3739 3740 3741 ; The DL and RL commands allow a disk to be downloaded over the console 3742 ; serial port. The format of the data expected is identical that that 3743 ; generated by the RD and DD (dump RAM/IDE disk) commands, which makes it 3744 ; possible to upload a disk image to the PC and then later download the same 3745 ; image back to the SBC6120. Since all the data is simple printing ASCII 3746 ; text, any terminal emulator program can be used to capture and replay the 3747 ; data will suffice. 3748 ; 3749 ; >RL u - download data to RAM disk unit u 3750 ; >DL pppp - download data to IDE disk partition pppp 3751 ; >FL - download data to Flash ROM 3752 3753 ; Enter here for the RL command... 3754 03513 1371 RLLOAD: TAD [RAMDWR] ; point to the RAM disk write routine 3755 03514 3361 DCA WRPTR ; modify the code to use that 3756 03515 1141 TAD ZM128 ; set the record (page) size for RAM disk 3757 03516 3073 DCA RECSIZ ; ... 3758 03517 5326 JMP DLOAD ; fall into the regular code 3759 3760 ; Enter here for the DL command... 3761 03520 6205 DLLOAD: .PUSHJ @[NODISK] ; verify that a hard disk is attached 03521 5776 3762 03522 1370 TAD [DISKWR] ; this time use the IDE disk write routine 3763 03523 3361 DCA WRPTR ; ... 3764 03524 1142 TAD ZM256 ; and the record (block) size is 256 3765 03525 3073 DCA RECSIZ ; ... 3766 3767 ; Parse the argument for the DL and RL commands... 3768 03526 6205 DLOAD: .PUSHJ @ZOCTNW ; read the unit/partition number (required) 03527 5521 3769 03530 6205 .PUSHJ @ZEOLTST ; that has to be followed by the end of line 03531 5516 3770 03532 6211 CDF 1 ; all disk data lives in field 1 3771 03533 1067 TAD WORD ; get the number entered 3772 03534 3773 DCA @[RDUNIT] ; and set the RAM disk unit number 3773 03535 1067 TAD WORD ; ... 3774 03536 3774 DCA @[DKPART] ; and the IDE disk partition number 3775 03537 6201 CDF 0 ; back to our field now 3776 3777 ; Put the FP6120 data LEDs in "program" mode and initially clear them, and 3778 ; we'll use these to display the current block number as data is downloaded. 3779 03540 7201 CLA IAC ; enable FP6120 "program" mode 3780 03541 3063 DCA FPPGMM ; ... 3781 03542 3064 DCA FPPGMD ; and initially clear the display 3782 3783 ; Here to read another disk page of data from the host... 3784 03543 1073 DLOAD1: TAD RECSIZ ; pass the block size in the AC 3785 03544 6205 .PUSHJ @[LDBUF] ; load the disk buffer from the serial port 03545 5767 3786 03546 6211 CDF 1 ; (disk data lives in field 1) 3787 03547 3534 DCA @ZDKRBN ; save the address of the block we read 3788 03550 1534 TAD @ZDKRBN ; ... 3789 03551 3533 DCA @ZRDPAGE ; and the page number too 3790 03552 1534 TAD @ZDKRBN ; ... 3791 03553 3064 DCA FPPGMD ; display the page/block number on the LEDs 3792 03554 6201 CDF 0 ; (back to our field now) 3793 03555 4532 JMS @ZPUSHJ1 ; (call field 1 routine) 3794 03556 2210 PNLBUF ; set the disk buffer to DSKBUF 3795 03557 1073 TAD RECSIZ ; pass the record size to the I/O routine 3796 03560 4532 JMS @ZPUSHJ1 ; (call a field 1 routine) 3797 03561 WRPTR: .BLOCK 1 ; gets modified to DISKWR, RAMDWR or ROMWR 3798 03562 7430 SZL ; were there any I/O errors? PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 88 RL and DL Commands - Load Disk (RAM and IDE) Records bts6120.plx 3799 03563 5304 JMP DIOERR ; yes - go report that and quit 3800 03564 5343 JMP DLOAD1 ; go read another page 3801 03567 3653 03570 1244 03571 0422 03572 3600 03573 0024 03574 0020 03575 1214 03576 2542 03577 0407 3802 03600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 89 Dump Disk Buffer on Console bts6120.plx 3803 .TITLE Dump Disk Buffer on Console 3804 3805 3806 ; This routine will dump the contents of DSKBUF on the console in ASCII. 3807 ; For each block dumped the output format consists of 33 lines of data, where 3808 ; the first 32 lines contain a disk address in the format "." 3809 ; (e.g. "0122.0160" is word 160 (octal) of block 122 (octal)) followed by 8 3810 ; words of data, also in octal. The 33rd line contains just a single octal 3811 ; number, a checksum of all 256 words in the block. 3812 ; 3813 ; This format is exactly the same input that's accepted by the LDBUF, which 3814 ; allows you to capture the output of a disk dump on a PC terminal emulator 3815 ; and then download the same data later to a different disk. This is the 3816 ; primary motivation for the checksum - it isn't too useful to humans, but 3817 ; it will guard against errors in the upload/download procedure. 3818 ; 3819 ; This routine should be called with the number of words to dump in the 3820 ; AC, which will normally be either -256 (to dump an IDE block) or -128 3821 ; (for a RAM disk page). 3822 03600 3252 DDBUF: DCA DDCNT ; save the count of words to dump 3823 03601 3071 DCA COUNT ; and clear the current word count 3824 03602 1377 TAD [DSKBUF-1] ; set up X1 to point to the buffer 3825 03603 3010 DCA X1 ; ... 3826 03604 3050 DCA CHKSUM ; and clear the checksum 3827 3828 ; Start a new line of data... 3829 03605 6211 DDBUF2: CDF 1 ; ... 3830 03606 1534 TAD @ZDKRBN ; get the page/block number we're dumping 3831 03607 6201 CDF 0 ; ... 3832 03610 6205 .PUSHJ @ZTOCT4 ; type it in octal 03611 5501 3833 03612 6205 .PUSHJ @ZTDOT ; then type the separator 03613 5507 3834 03614 1071 TAD COUNT ; then type the offset 3835 03615 6205 .PUSHJ @ZTOCT3 ; ... 03616 5505 3836 03617 6205 .PUSHJ @[TSLASH] ; another separator character 03620 5776 3837 03621 6205 .PUSHJ @ZTSPACE ; ... 03622 5477 3838 3839 ; Dump eight words of data, in octal... 3840 03623 6211 DDBUF3: CDF 1 ; the disk buffer is in field 1 3841 03624 1410 TAD @X1 ; get another word 3842 03625 6201 CDF 0 ; and go back to our field 3843 03626 3046 DCA VALUE ; save it for a minute 3844 03627 1046 TAD VALUE ; get it back 3845 03630 1050 TAD CHKSUM ; and accumulate a checksum 3846 03631 3050 DCA CHKSUM ; ... 3847 03632 1046 TAD VALUE ; now we're ready to type the data 3848 03633 6205 .PUSHJ @ZTOCT4S ; in octal, with a space 03634 5504 3849 03635 2071 ISZ COUNT ; count the number we've done 3850 03636 1071 TAD COUNT ; ... 3851 03637 0137 AND ZK7 ; have we done a complete row of eight? 3852 03640 7640 SZA CLA ; ??? 3853 03641 5223 JMP DDBUF3 ; no - keep going 3854 3855 ; Here after we've finished a line of eight data words... 3856 03642 6205 .PUSHJ @ZCRLF ; start a new line 03643 5510 3857 03644 1071 TAD COUNT ; see if we've done the whole page/block 3858 03645 1252 TAD DDCNT ; compare to the block size 3859 03646 7640 SZA CLA ; ??? 3860 03647 5205 JMP DDBUF2 ; not there yet - keep dumping PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 90 Dump Disk Buffer on Console bts6120.plx 3861 03650 1050 TAD CHKSUM ; type just the checksum 3862 03651 5502 JMP @ZTOCT4C ; in octal, with a CRLF, and we're done 3863 3864 3865 ; Local storage for DDBUF... 3866 03652 DDCNT: .BLOCK 1 ; the number of words in this buffer PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 91 Load Disk Buffer from Console bts6120.plx 3867 .TITLE Load Disk Buffer from Console 3868 3869 3870 ; This routine loads the disk buffer with data from a disk block image 3871 ; transmitted over the console port. The format of the data expected is 3872 ; identical that that generated by the DDBUF routine, which makes it possible 3873 ; to upload a disk image to the PC and then later download the same image back 3874 ; to the SBC6120 with DL. Since all the data is simple printing ASCII text, 3875 ; any terminal emulator program can be used to capture and replay the data. 3876 ; 3877 ; LDBUF prompts for each line of data with a ":", and most terminal emulator 3878 ; programs for the PC can be set to look for this prompting character before 3879 ; transmitting the next line. This eliminates the need to insert fixed delays 3880 ; to avoid overrunning the SBC6120. Since LDBUF reads only printing ASCII 3881 ; characters, a download can be aborted at any time just by typing a control-C 3882 ; and there's no need for a timeout the way there is with loading paper tape 3883 ; images. 3884 ; 3885 ; The expected block size, either -128. for RAM disk or -256. for IDE disk, 3886 ; should be passed in the AC. The data read is left in DSKBUF, and the 3887 ; page/block number, extracted from the data, is left in LDPAGE. Note that 3888 ; in the event a checksum or syntax error is found, LDBUF prints an error 3889 ; message and restarts the command scanner. In that case control never 3890 ; returns to the caller! 3891 03653 3252 LDBUF: DCA DDCNT ; save the expected block size 3892 03654 1377 TAD [DSKBUF-1] ; initialize X1 to point at our buffer 3893 03655 3010 DCA X1 ; ... 3894 03656 3071 DCA COUNT ; count the data words read here 3895 03657 7240 STA ; the current disk page is unknown 3896 03660 3370 DCA LDPAGE ; ... 3897 03661 3050 DCA CHKSUM ; clear the checksum accumulator 3898 3899 ; Read the next line of data... 3900 03662 1375 LDBUF2: TAD [":"] ; prompt for data with a ":" 3901 03663 6205 .PUSHJ @[INCHWL] ; initialize the line input routine 03664 5774 3902 03665 6205 LDBU20: .PUSHJ @[INCHW1] ; read another character into the buffer 03666 5773 3903 03667 7650 SNA CLA ; EOL? 3904 03670 5265 JMP LDBU20 ; nope - keep reading 3905 03671 1071 TAD COUNT ; see how many words we've read so far 3906 03672 1252 TAD DDCNT ; is it time for the checksum? 3907 03673 7650 SNA CLA ; ??? 3908 03674 5352 JMP LDBUF5 ; yes - go parse a checksum record 3909 3910 ; First parse the disk page number and offset. The offset has to match the 3911 ; number of words we've already read, but the disk address is slightly more 3912 ; complicated. For the first data record in a page we allow the address to 3913 ; be anything, and that tells us which disk page is to be written. Each data 3914 ; record after that up to the end of the page has to have the same disk 3915 ; address as the first one. This allows disk pages to be loaded in any random 3916 ; order and, more importantly, it allows unused pages to be skipped. 3917 03675 6205 .PUSHJ @ZOCTNW ; go read an octal number 03676 5521 3918 03677 1067 TAD WORD ; get the value we scanned 3919 03700 7041 CIA ; compare it to LDPAGE 3920 03701 1370 TAD LDPAGE ; ??? 3921 03702 7650 SNA CLA ; do they match ? 3922 03703 5310 JMP LDBUF3 ; yes - all is well 3923 03704 2370 ISZ LDPAGE ; no - is this the first data record? 3924 03705 5530 JMP @ZCOMERR ; not that either - the data is corrupt 3925 03706 1067 TAD WORD ; yes - just use this page number without 3926 03707 3370 DCA LDPAGE ; ... question 3927 03710 1052 LDBUF3: TAD SAVCHR ; get the separator character 3928 03711 1372 TAD [-"."] ; it has to be a "." PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 92 Load Disk Buffer from Console bts6120.plx 3929 03712 7640 SZA CLA ; ??? 3930 03713 5530 JMP @ZCOMERR ; nope - bad load format 3931 03714 6205 .PUSHJ @ZOCTNW ; now read the relative offset within the page 03715 5521 3932 03716 1067 TAD WORD ; ... 3933 03717 7041 CIA ; it has to match our data count 3934 03720 1071 TAD COUNT ; does it? 3935 03721 7640 SZA CLA ; ??? 3936 03722 5530 JMP @ZCOMERR ; nope - more bad data 3937 03723 1052 TAD SAVCHR ; one last test 3938 03724 1371 TAD [-"/"] ; the separator this time has to be a slash 3939 03725 7640 SZA CLA ; ??? 3940 03726 5530 JMP @ZCOMERR ; another corrupted data record 3941 3942 ; Now read the rest of the data record, which should consist of exactly 3943 ; eight data words, in octal... 3944 03727 6205 LDBUF4: .PUSHJ @ZOCTNW ; scan the next data word 03730 5521 3945 03731 1067 TAD WORD ; get the value we read 3946 03732 6211 CDF 1 ; remember that the disk buffer is in field 1 3947 03733 3410 DCA @X1 ; and store the data word 3948 03734 1067 TAD WORD ; accumulate a checksum of the data words 3949 03735 1050 TAD CHKSUM ; ... we read 3950 03736 3050 DCA CHKSUM ; ... 3951 03737 6201 CDF 0 ; back to home ground 3952 03740 2071 ISZ COUNT ; count the number of words we've read 3953 03741 1071 TAD COUNT ; let's have a look at it 3954 03742 0137 AND ZK7 ; have we read exactly eight words? 3955 03743 7640 SZA CLA ; skip if we have 3956 03744 5327 JMP LDBUF4 ; no - go read another data word 3957 03745 6205 .PUSHJ @ZGET ; yes - after eight data words 03746 5520 3958 03747 7640 SZA CLA ; ... the next thing should be the EOL 3959 03750 5530 JMP @ZCOMERR ; not EOL - this data is corrupted somehow 3960 03751 5262 JMP LDBUF2 ; this is the EOL - go read another record 3961 3962 ; We get here when we're read 128 or 256 words of data - the next thing we 3963 ; expect to find is a checksum record, which is a single octal number all by 3964 ; itself. This has to match the checksum we've calculated or the data is 3965 ; corrupted. 3966 03752 6205 LDBUF5: .PUSHJ @ZOCTNW ; scan an octal value 03753 5521 3967 03754 1067 TAD WORD ; and get what we found 3968 03755 7041 CIA ; ... 3969 03756 1050 TAD CHKSUM ; compare it to the checksum we accumulated 3970 03757 7640 SZA CLA ; they have to be the same! 3971 03760 5366 JMP DERCKS ; they aren't - bad checksum for data 3972 03761 1052 TAD SAVCHR ; get the next character 3973 03762 7640 SZA CLA ; it has to be the EOL 3974 03763 5530 JMP @ZCOMERR ; no - the syntax of this record is wrong 3975 3976 ; The checksum matches - all is well! 3977 03764 1370 TAD LDPAGE ; return the page number in the AC 3978 03765 6225 .POPJ ; ... 3979 3980 ; Here if the data checksum doesn't match... 3981 03766 4531 DERCKS: JMS @ZERROR ; print a message and restart 3982 03767 3515 ERRCKS ; ?DATA CHECKSUM MISMATCH 3983 3984 ; Local storage for LDBUF... 3985 03770 LDPAGE: .BLOCK 1 ; page number being read 3986 03771 7721 03772 7722 03773 7210 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 93 Load Disk Buffer from Console bts6120.plx 03774 7200 03775 0072 03776 7074 03777 7377 3987 04000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 94 PC Command - Copy an IDE Disk Partition bts6120.plx 3988 .TITLE PC Command - Copy an IDE Disk Partition 3989 3990 3991 ; The PC command will copy an entire disk partition to another partition. 3992 ; It's a convenient way to create backups of OS/8 partitions, especially since 3993 ; most modern IDE drives have room for thousands of OS/8 partitions! 3994 ; 3995 ; The PE command will compare two partitions, especially useful after a PC. 3996 ; Due to lack of space for another disk buffer the comparison is done by 3997 ; generating a checksum, unfortunately. 3998 ; 3999 ; >PC ssss dddd - copy IDE partition ssss to partition dddd 4000 ; >PE ssss dddd - compare IDE partition ssss to partition dddd 4001 ; 4002 4003 ; common function to get params 4004 04000 6205 GETPP: .PUSHJ @[NODISK] ; be sure a drive is attached! 04001 5777 4005 04002 6205 .PUSHJ @ZOCTNW ; read the source partition number 04003 5521 4006 04004 1067 TAD WORD ; ... 4007 04005 3042 DCA CPYSRC ; ... 4008 04006 6205 .PUSHJ @[SPATST] ; the next character has to be a space 04007 5776 4009 04010 6205 .PUSHJ @ZOCTNW ; then read the destination partition 04011 5521 4010 04012 1067 TAD WORD ; ... 4011 04013 3043 DCA CPYDST ; ... 4012 04014 5516 JMP @ZEOLTST ; that'd better be all there is 4013 4014 04015 6205 PCOMP: .PUSHJ GETPP 04016 5200 4015 04017 4511 JMS @ZINLMES ; say 4016 04020 3774 CE1MSG ; ... "Verifying " 4017 04021 1375 TAD [PCOPYE] ; operation will be compare block 4018 04022 3037 DCA ADDR ; 4019 04023 5243 JMP PCOPY0 4020 4021 04024 6205 PCOPY: .PUSHJ GETPP 04025 5200 4022 4023 ; Ask for confirmation before overwriting the destination partition... 4024 04026 4511 JMS @ZINLMES ; say 4025 04027 4041 CCFMSG ; "Overwrite partition/unit " 4026 04030 1043 TAD CPYDST ; and then type the partition number 4027 04031 6205 .PUSHJ @ZTOCT4S ; ... 04032 5504 4028 04033 6205 .PUSHJ @[CONFRM] ; then wait for a "Y" or "N" 04034 5774 4029 04035 7620 SNL CLA ; did he answer yes??? 4030 04036 5527 JMP @ZRESTA ; nope - just quit now 4031 4032 ; Prepare to begin copying... 4033 04037 4511 JMS @ZINLMES ; say 4034 04040 4060 CP1MSG ; ... "Copying " 4035 04041 1373 TAD [PCOPYW] ; operation will be write block 4036 04042 3037 DCA ADDR ; 4037 4038 04043 6211 PCOPY0: CDF 1 ; reset the current block number 4039 04044 3534 DCA @ZDKRBN ; ... 4040 04045 6201 CDF 0 ; ... 4041 4042 ; Read the next block from the SRC partition... 4043 04046 4532 PCOPY1: JMS @ZPUSHJ1 ; (cross field call) 4044 04047 2210 PNLBUF ; setup a temporary disk buffer in panel memory PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 95 PC Command - Copy an IDE Disk Partition bts6120.plx 4045 04050 1042 TAD CPYSRC ; get the source partition 4046 04051 6211 CDF 1 ; ... 4047 04052 3772 DCA @[DKPART] ; and point DISKRD there 4048 04053 6201 CDF 0 ; ... 4049 04054 1142 TAD ZM256 ; the IDE record size is always 256 words 4050 04055 4532 JMS @ZPUSHJ1 ; (cross field call) 4051 04056 1214 DISKRD ; and go read a block from the disk 4052 04057 7430 SZL ; disk error ?? 4053 04060 5771 JMP @[DIOERR] ; yes - go report it and give up 4054 4055 04061 6205 .PUSHJ @ADDR ; call the operation 04062 5437 4056 4057 ; Print a dot every so often to make a simple "progress bar"... 4058 04063 6211 PCOPY3: CDF 1 ; ... 4059 04064 2534 ISZ @ZDKRBN ; increment the block number 4060 04065 7410 SKP ; still more to go 4061 04066 5300 JMP PCOPY4 ; we've done all 4096 blocks! 4062 04067 1142 TAD ZM256 ; the format command uses the record size as 4063 04070 7040 CMA ; a mask for printing the progress bar 4064 04071 0534 AND @ZDKRBN ; and so we will too 4065 04072 6201 CDF 0 ; ... 4066 04073 7640 SZA CLA ; time for another dot?? 4067 04074 5246 JMP PCOPY1 ; nope - just keep copying 4068 04075 6205 .PUSHJ @ZTDOT ; print a dot to show our progress 04076 5507 4069 04077 5246 JMP PCOPY1 ; and another page or block 4070 4071 ; All done... 4072 04100 6201 PCOPY4: CDF 0 ; ... 4073 04101 4511 JMS @ZINLMES ; say 4074 04102 4005 CP2MSG ; " Done" 4075 04103 5510 JMP @ZCRLF ; and that's all! 4076 4077 ; Operation: write it to the destination... 4078 04104 4532 PCOPYW: JMS @ZPUSHJ1 ; (cross field call) 4079 04105 2210 PNLBUF ; setup the panel memory disk buffer 4080 04106 1043 TAD CPYDST ; change DKPART to the destination partition 4081 04107 6211 CDF 1 ; ... 4082 04110 3772 DCA @[DKPART] ; ... 4083 04111 6201 CDF 0 ; ... 4084 04112 1142 TAD ZM256 ; load the record size for DISKWR 4085 04113 4532 JMS @ZPUSHJ1 ; (cross field call) 4086 04114 1244 DISKWR ; and go write a block to the disk 4087 04115 7430 SZL ; any disk errors? 4088 04116 5771 JMP @[DIOERR] ; yes - give up 4089 04117 6225 .POPJ 4090 4091 ; Operation: compare it to the other partition 4092 ; (1) checksum the disk buffer 4093 04120 6205 PCOPYE: .PUSHJ DBCHKS 04121 5355 4094 04122 3050 DCA CHKSUM 4095 ; (2) read the other partition's block 4096 04123 4532 JMS @ZPUSHJ1 ; (cross field call) 4097 04124 2210 PNLBUF ; setup the panel memory disk buffer 4098 04125 1043 TAD CPYDST ; change DKPART to the destination partition 4099 04126 6211 CDF 1 ; ... 4100 04127 3772 DCA @[DKPART] ; ... 4101 04130 6201 CDF 0 ; ... 4102 04131 1142 TAD ZM256 ; load the record size for DISKWR 4103 04132 4532 JMS @ZPUSHJ1 ; (cross field call) 4104 04133 1214 DISKRD ; and go read a block from the disk 4105 04134 7430 SZL ; any disk errors? 4106 04135 5771 JMP @[DIOERR] ; yes - give up PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 96 PC Command - Copy an IDE Disk Partition bts6120.plx 4107 ; (3) checksum that block 4108 04136 6205 .PUSHJ DBCHKS 04137 5355 4109 ; (4) make sure they're equal 4110 04140 7041 CIA 4111 04141 1050 TAD CHKSUM 4112 04142 7450 SNA 4113 04143 6225 .POPJ ; alles ganz gut 4114 ; (5) if they weren't equal, report that 4115 04144 6205 .PUSHJ @ZCRLF ; we're in the middle of a line now 04145 5510 4116 04146 4511 JMS @ZINLMES ; so start a new one and print 4117 04147 4012 ERRDSK ; "?Verification error, block/page " 4118 04150 6211 CDF 1 ; (disk data is in field 1) 4119 04151 1534 TAD @ZDKRBN ; get the current block/page number 4120 04152 6201 CDF 0 ; ... 4121 04153 6205 .PUSHJ @ZTOCT4C ; and type it (in octal) 04154 5502 4122 4123 04155 1370 DBCHKS: TAD [DSKBUF-1] ; point to the disk buffer 4124 04156 3010 DCA X1 4125 04157 1367 TAD [-256.] ; and it's 256 words long 4126 04160 3071 DCA COUNT 4127 04161 6211 CDF 1 4128 04162 1410 PCCHK1: TAD @X1 4129 04163 2071 ISZ COUNT 4130 04164 5362 JMP PCCHK1 4131 04165 6201 CDF 0 4132 04166 6225 .POPJ 4133 04167 7400 04170 7377 04171 3504 04172 0020 04173 4104 04174 7025 04175 4120 04176 4641 04177 2542 4134 04200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 97 Initialize Terminal, Breakpoint, Partition Map, etc bts6120.plx 4135 .TITLE Initialize Terminal, Breakpoint, Partition Map, etc 4136 4137 4138 04200 1377 RAMINIT: TAD [80.] ; the default terminal width is 80 4139 04201 3030 DCA WIDTH ; ... 4140 04202 3031 DCA LENGTH ; and automatic XOFF is disabled 4141 04203 6205 .PUSHJ @[CLRCPU] ; clear the saved user context 04204 5776 4142 04205 6205 .PUSHJ @[BPTCLR] ; clear the breakpoint tables 04206 5775 4143 04207 4532 JMS @ZPUSHJ1 ; (cross field call) 4144 04210 1713 INIPMP ; initialize the IDE disk partition map 4145 04211 6222 CIF 2 4146 04212 5774 JMP @[RDPSS] ; if NVRAM present, possibly overwrite some 4147 ; of these settings with stored ones 4148 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 98 FL Command - Flash download bts6120.plx 4149 .TITLE FL Command - Flash download 4150 4151 ; 4152 ; Flash command codes for 28Fx00 type EEPROMS 4153 ; 4154 7777 FCMDRA=7777 4155 0220 FCMDRI=0220 4156 0120 FCMDCS=0120 4157 0040 FCMDERA1=0040 4158 0320 FCMDERA2=0320 4159 0100 FCMDPROG=0100 4160 4161 ; Enter here for the FL command... It uses the same download code 4162 ; as DL and RL, but checks for presence of flash and prompts for 4163 ; overwriting it before executing that. 4164 4165 04213 FLLOAD: 4166 4167 ; The RAM disk used by the SBC6120-RC apparently confuses this code enough 4168 ; to make it think that a flash is actually present. That's not going to lead 4169 ; to a happy outcome, so so just prevent this command from ever working on the 4170 ; RC model. You can't attach an IOB6120 to the SBC6120-RC anyway ... 4171 04213 1035 TAD RCFLAG ; is this the SBC6120-RC model? 4172 04214 7640 SZA CLA ; skip if it's the original flavor 4173 04215 5265 JMP BADFLR ; yep - the RC model always says "?No flash" 4174 4175 ; We want to check that a flash ROM is actually there. This is a bit 4176 ; problematic because the Read ID command returns a manufacturer and 4177 ; device code that are basically arbitrary. However, at least the commands 4178 ; seem to be the same for all flash devices in this class. 4179 ; What we'll do is try switching between array read and ID read mode a 4180 ; couple of times and see if the results are consistent with a flash ROM 4181 ; being there. 4182 04216 6403 MM3 ; access flash (if it's there) 4183 04217 6211 CDF 1 4184 4185 04220 1373 TAD [FCMDRA] ; reset flash to array read mode 4186 04221 3772 DCA @[0] 4187 4188 04222 1772 TAD @[0] ; array read mode - hash and stash 4189 04223 7002 BSW 4190 04224 1771 TAD @[2] 4191 04225 3043 DCA LOW 4192 4193 04226 1370 TAD [FCMDRI] ; set flash to read ID mode 4194 04227 3772 DCA @[0] 4195 4196 04230 1772 TAD @[0] ; fetch 1st ID byte 4197 04231 7002 BSW 4198 04232 1771 TAD @[2] ; combine with 2nd ID byte 4199 04233 3042 DCA HIGH 4200 4201 04234 1373 TAD [FCMDRA] ; reset flash to array read mode 4202 04235 3772 DCA @[0] 4203 4204 04236 1772 TAD @[0] ; array read mode - hash and compare 4205 04237 7002 BSW ; with the last result 4206 04240 1771 TAD @[2] 4207 04241 7041 CIA 4208 04242 1043 TAD LOW 4209 04243 7440 SZA 4210 04244 5265 JMP BADFLR ; didn't match! 4211 4212 04245 1370 TAD [FCMDRI] ; set flash to read ID mode 4213 04246 3772 DCA @[0] PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 99 FL Command - Flash download bts6120.plx 4214 4215 04247 1772 TAD @[0] ; fetch 1st ID byte 4216 04250 7002 BSW 4217 04251 1771 TAD @[2] ; combine with 2nd ID byte 4218 4219 04252 6402 MM2 ; back to normal memory access mode 4220 04253 6201 CDF 0 4221 4222 04254 7041 CIA ; compare with last result 4223 04255 1042 TAD HIGH 4224 04256 7440 SZA 4225 04257 5265 JMP BADFLR ; didn't match! 4226 4227 04260 1043 TAD LOW ; now make sure that we got distinct 4228 04261 7041 CIA ; values from Read Array and Read ID 4229 04262 1042 TAD HIGH 4230 04263 7440 SZA 4231 04264 5270 JMP OKFLR ; different - everything looks okay! 4232 4233 04265 4511 BADFLR: JMS @ZINLMES ; display an error 4234 04266 4362 FLMSG1 4235 04267 5527 JMP @ZRESTA ; and back to prompt 4236 4237 04270 1373 OKFLR: TAD [FCMDRA] ; reset flash to array read mode 4238 04271 3772 DCA @[0] 4239 4240 04272 4511 JMS @ZINLMES ; prompt to make sure we want to do this... 4241 04273 4371 FLMSG2 4242 04274 6205 .PUSHJ @[CONFRM] ; go wait for a "Y" or "y" 04275 5767 4243 04276 7620 SNL CLA ; did they confirm? 4244 04277 5527 JMP @ZRESTA ; no - just abort now 4245 4246 ; and start the download 4247 4248 04300 1366 TAD [ROMWR] ; use the ROM write routine 4249 04301 3765 DCA @[WRPTR] ; ... 4250 04302 1142 TAD ZM256 ; and the record (block) size is 256 4251 04303 3073 DCA RECSIZ ; ... 4252 04304 5764 JMP @[DLOAD1] ; and off we go, no arguments please PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 100 Field 0 Vector Table bts6120.plx 4253 .TITLE Field 0 Vector Table 4254 4255 4256 ; this is a very small stub that allows us to call functions in Field 0 4257 ; from Field 3. This is accomplished by making .POPJ return via here. 4258 4259 04305 6223 RET0F2: CXF 2 ; return to field 2 4260 04306 6225 .POPJ ; the address is already on the stack 4261 4262 04307 6233 RET0F3: CXF 3 ; return to field 3 4263 04310 6225 .POPJ ; the address is already on the stack 4264 4265 ; variable and functions that we may want to access or hook in this field 4266 ; codes: I=instruction pointer, V=variable, H=hook (CIF n, JMP @.+1, V) 4267 ; Add only to the *end* of this list, please! 4268 ; n.b. JMS linkage functions generally cannot be used here 4269 04311 F0VECTOR: 4270 04311 4307 RET0F3 ; I utility - return to field 0 (must be first) 4271 04312 0000 UPC ; V user program counter (saved by the hardware) 4272 04313 0001 UAC ; V user accumulator 4273 04314 0002 UFLAGS ; V user status (LINK, GT, IF, DF, etc) from GCF 4274 04315 0263 SYSIN9-1 ; H initialization just before monitor entered 4275 04316 7463 CONOUT ; I output a character, no processing 4276 04317 7552 CONIN ; I input a character, no processing, null if none 4277 04320 7400 OUTCHR ; I type a single character 4278 04321 7477 INCHRS ; I input a character, null if none 4279 04322 6322 TOCT4 ; I type an octal number 4280 04323 7104 CRLF ; I type a carriage return/line feed 4281 04324 4617 SPACMP ; I get the next non-blank command character 4282 04325 4621 SPACM0 ; I get a non-blank character starting with the current 4283 04326 4647 BACKUP ; I backup the command line pointer 4284 04327 4632 EOLTST ; I test current character for end of line 4285 04330 4630 EOLNXT ; I test the next character for end of line 4286 04331 0465 GET ; I get the next character from the command line 4287 04332 6720 OCTNW ; I scan an octal number 4288 04333 6460 RANGE ; I scan an address range (e.g. "0-7777") 4289 04334 0377 RESTA-1 ; H monitor restart vector 4290 04335 0453 COMERR ; I report a command syntax error and restart 4291 04336 6277 TDECNW ; I print an unsigned decimal number 4292 04337 2541 NODISK-1 ; H check for disk presence 4293 04340 1262 TYPEIR-1 ; H print the current IR 4294 04341 0007 UIR ; V user IR 4295 04342 0037 ADDR ; V start address returned from RANGE 4296 04343 0040 ADRFLD ; V start field returned from RANGE 4297 04344 0042 HIGH ; V end address returned from RANGE 4298 04345 0044 HGHFLD ; V end field returned from RANGE 4299 04346 7645 BTSTR1-1 ; H CPREQ signaled 4300 04347 0020 PARMAP ; V partition map 4301 04350 0034 RAMBAS ; V base offset - 1 for each RAM disk field 4302 04364 3543 04365 3561 04366 2600 04367 7025 04370 0220 04371 0002 04372 0000 04373 7777 04374 0201 04375 2026 04376 2312 04377 0120 4303 04400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 101 Show Extension ROM Status bts6120.plx 4304 .TITLE Show Extension ROM Status 4305 4306 ; This routine will display the status of the extension ROM - it will print 4307 ; exactly one of these lines - 4308 ; 4309 ; IOB: not detected 4310 ; IOB: OK 4311 ; IOB: error n 4312 ; 4313 ; as is appropriate. In the case of the "Error n" option, error 2 means 4314 ; that its checksum was invalid and error 3 or greater means that the ROM 4315 ; initialization was called but it returned this error code. 4316 4317 04400 7200 SHOEXT: CLA ; ... 4318 04401 1035 TAD RCFLAG ; is this the RC model? 4319 04402 7640 SZA CLA ; ??? 4320 04403 6225 .POPJ ; Yep - there's never an IOB6120 on this model 4321 04404 4511 JMS @ZINLMES ; say "IOB: " 4322 04405 4345 XRMES1 ; ... 4323 04406 1377 TAD [-2] ; compare the status code to 2 4324 04407 1033 TAD EXTFLG ; ... 4325 04410 7510 SPA ; ... 4326 04411 5220 JMP SHOEX1 ; either there's no extension ROM or it's OK 4327 04412 4511 JMS @ZINLMES ; otherwise say "Error " 4328 04413 4352 XRMES2 ; ... 4329 04414 1033 TAD EXTFLG ; and add the error code 4330 04415 6205 .PUSHJ @ZTDECNW ; ... 04416 5506 4331 04417 5510 JMP @ZCRLF ; finish the line and return 4332 4333 ; Here if there's no extension ROM, or if it's OK ... 4334 04420 7640 SHOEX1: SZA CLA ; which is it? 4335 04421 5225 JMP SHOEX2 ; no ROM 4336 04422 4511 JMS @ZINLMES ; say "OK " 4337 04423 4357 XRMES3 ; ... 4338 04424 5510 JMP @ZCRLF ; and we're done 4339 4340 ; Here if there's no extension ROM ... 4341 04425 4511 SHOEX2: JMS @ZINLMES ; say "Not detected" 4342 04426 4322 NDETMS ; ... 4343 04427 5510 JMP @ZCRLF ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 102 Initialize and Show RAM Disk Status bts6120.plx 4344 .TITLE Initialize and Show RAM Disk Status 4345 4346 ; This routine will initialize the RAM disk array and then show it's status 4347 ; by printing a message like one of these - 4348 ; 4349 ; NVR: Not detected 4350 ; NVR: 1024K 4351 ; 4352 ; In addition, if the battery status is known then it will be appended to 4353 ; the message - 4354 ; 4355 ; NVR: 1024K, battery OK 4356 ; 4357 ; This is normally called only once, by the startup code. It does actually 4358 ; initialize the RAM disk related variables such as RDTYPE and RDSIZE, although 4359 ; it is harmless and this routine could actually be called more than once. 4360 04430 4532 SHONVR: JMS @ZPUSHJ1 ; first determine the type of the RAMDisk 4361 04431 0600 RDCHK1 ; .... and set RDTYPE 4362 04432 4511 JMS @ZINLMES ; say 4363 04433 4250 RAMMS1 ; "NVR: " 4364 04434 4532 JMS @ZPUSHJ1 ; test all eight RAM disk units 4365 04435 1446 RDTEST ; .... and set RDSIZE 4366 04436 7450 SNA ; skip if a RAM disk is present 4367 04437 5267 JMP NONVR ; none detected 4368 04440 6205 .PUSHJ @ZTDECNW ; type out the total RAM size 04441 5506 4369 4370 04442 1035 TAD RCFLAG ; is this the SBC6120-RC model? 4371 04443 7650 SNA CLA ; skip if it's the SBC6120-RC model 4372 04444 5250 JMP SHONV1 ; 4373 04445 4511 JMS @ZINLMES ; on the RC model say "KW" not "KB" 4374 04446 4260 RAMMS4 ; ... 4375 04447 5252 JMP SHONV2 ; ... 4376 04450 4511 SHONV1: JMS @ZINLMES ; say 4377 04451 4255 RAMMS3 ; "KB" 4378 4379 04452 6211 SHONV2: CDF 1 ; the battery OK flag lives in field 1 4380 04453 1776 TAD @[BATTOK] ; get the battery status flag 4381 04454 6201 CDF 0 ; ... 4382 04455 7450 SNA ; if it's zero the battery status is unknown 4383 04456 5266 JMP NORDM ; ... so say nothing 4384 04457 7700 SMA CLA ; -1 means battery OK 4385 04460 5264 JMP RDBFAI ; and +1 is battery fail 4386 04461 4511 JMS @ZINLMES ; say 4387 04462 4263 BOKMSG ; ... "- Battery OK" 4388 04463 5266 JMP NORDM ; and we're done 4389 04464 4511 RDBFAI: JMS @ZINLMES ; say 4390 04465 4275 BFAMSG ; ... "- Battery FAIL" 4391 04466 5510 NORDM: JMP @ZCRLF ; finish the status report and we're done 4392 4393 ; Here if no RAM disk is detected ... 4394 04467 4511 NONVR: JMS @ZINLMES ; say "not detected" ... 4395 04470 4322 NDETMS ; ... 4396 04471 5510 JMP @ZCRLF ; print a new line and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 103 Initialize and Show IDE Disk Status bts6120.plx 4397 .TITLE Initialize and Show IDE Disk Status 4398 4399 ; This routine will probe the IDE bus for any drive that might be attached 4400 ; and, depending on what it finds, it will print out a line like this - 4401 ; 4402 ; IDE: 122MB - SanDisk SDCFJ-128 4403 ; IDE: Not detected 4404 ; IDE: Not supported 4405 ; 4406 ; The information about the drive size and manufacturer comes from an ATA 4407 ; IDENTIFY DEVICE command which we send to the drive. The DISKID routine will 4408 ; extract the drive's capacity, in MB, from that and leave the result at DKSIZE. 4409 ; DISKID also leaves the first 256 bytes of the drive's response in the DSKBUF, 4410 ; and we can use that to type out the drive's make and model, which appears 4411 ; there in plain ASCII. 4412 ; 4413 ; Note that this routine actually does initialize the drive and it is called 4414 ; during the startup procedure for just that purpose. This is mostly harmless, 4415 ; however, and it can actually be done more than once. 4416 ; 4417 ; Also note that under some circumstances if a non-working drive is attached, 4418 ; then we may have to wait for IDEINI to time out before proceeding. This can 4419 ; take upwards of 30 seconds! 4420 04472 7200 SHOIDE: CLA ; ... 4421 04473 1035 TAD RCFLAG ; is this the RC model? 4422 04474 7640 SZA CLA ; ??? 4423 04475 5334 JMP RC1IDE ; yep - it has no IDE option of any kind 4424 04476 4511 JMS @ZINLMES ; say 4425 04477 4310 IDEMS1 ; "IDE: " 4426 04500 4532 JMS @ZPUSHJ1 ; (cross field call) 4427 04501 1013 IDEINI ; initialize the IDE interface 4428 04502 7430 SZL ; is there a drive attached? 4429 04503 5331 JMP NOIDE ; nope - quit now 4430 04504 4532 JMS @ZPUSHJ1 ; (cross field call) 4431 04505 1047 DISKID ; send an IDENTIFY DEVICE command to the drive 4432 04506 7630 SZL CLA ; did it work ? 4433 04507 5331 JMP NOIDE ; nope - there's no disk there after all 4434 04510 6211 CDF 1 ; disk data lives in field 1 4435 04511 3775 DCA @[DSKBUF+135] ; (make the model string ASCIZ) 4436 04512 1774 TAD @[DKSIZE] ; get the total disk size 4437 04513 6201 CDF 0 ; ... 4438 04514 7450 SNA ; is the disk size zero ? 4439 04515 5326 JMP BADIDE ; yes - this disk is "unsupported" ! 4440 04516 6205 .PUSHJ @ZTDECNW ; and type it out in decimal 04517 5506 4441 04520 4511 JMS @ZINLMES ; say 4442 04521 4315 IDEMS2 ; "MB" 4443 04522 1373 TAD [DSKBUF+66-1] ; point to the make/model string 4444 04523 6205 .PUSHJ @[TASZF1] ; and type that out, in ASCII 04524 5772 4445 04525 5510 JMP @ZCRLF ; go type a CRLF and we're done 4446 4447 ; Here if an unsupported (i.e. one which does not support LBA addressing) 4448 ; is detected... 4449 04526 4511 BADIDE: JMS @ZINLMES ; say 4450 04527 4333 NSUPMS ; "not supported" 4451 04530 5510 JMP @ZCRLF ; ... 4452 4453 ; Here if no IDE disk is detected... 4454 04531 4511 NOIDE: JMS @ZINLMES ; and say 4455 04532 4322 NDETMS ; "NONE" 4456 04533 5510 JMP @ZCRLF ; finish the line and we're done 4457 4458 ; Here if we're running on the SBC6120-RC model. This model has no IDE 4459 ; option so we know there's no drive out there, but we have to call IDEINI PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 104 Initialize and Show IDE Disk Status bts6120.plx 4460 ; anyway so that the disk related variables (like DKSIZE) will get initialized 4461 ; to their "no drive attached" state. It we don't do this, then we'll get 4462 ; random results on the RC model if somebody actually tries to access the 4463 ; drive. BTW, the only reason this needs to be a special case at all is so that 4464 ; we can avoid printing "IDE: Not detected" on the RC model. 4465 04534 4532 RC1IDE: JMS @ZPUSHJ1 ; call IDEINI anyway 4466 04535 1013 IDEINI ; initialize the IDE interface 4467 04536 6225 .POPJ ; and ignore the result PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 105 Call Routines in Field 1 bts6120.plx 4468 .TITLE Call Routines in Field 1 4469 4470 ; This routine will allow a routine in field zero to simulate a .PUSHJ 4471 ; to a routine in field one. Even better, when the routine in field one 4472 ; executes a .POPJ, the return will eventually be to field zero! The 4473 ; contents of the AC are preserved both ways across the call. 4474 ; 4475 ;CALL: 4476 ; JMS @ZPUSHJ1 ; cross field call 4477 ; ; address of a routine in field 1 4478 ; ; with the AC preserved across the call 4479 ; 4480 04537 0000 PUSHJ1: 0 ; call here with a JMS instruction 4481 04540 3356 DCA PUSHAC ; save the caller's AC for a minute 4482 04541 1737 TAD @PUSHJ1 ; then get caller's argument 4483 04542 3355 DCA F1ADDR ; that's the address of the routine to call 4484 04543 1337 TAD PUSHJ1 ; now get caller's return address 4485 04544 7001 IAC ; and skip over the argument 4486 04545 6215 .PUSH ; put that on the stack 4487 04546 7200 CLA ; (PUSH doesn't clear the AC!) 4488 04547 1371 TAD [POPJ1] ; the field one routine will return to 4489 04550 6215 .PUSH ; ... POPJ1: in field one 4490 04551 7200 CLA ; ... 4491 04552 1356 TAD PUSHAC ; restore the original AC contents 4492 04553 6213 CXF 1 ; call with IF = DF = 1 4493 04554 5755 JMP @.+1 ; and go to the code in field 1 4494 04555 F1ADDR: .BLOCK 1 ; gets the address of the field 1 routine 4495 04556 PUSHAC: .BLOCK 1 ; a temporary place to save the AC 4496 4497 ; When the routine in field one executes a .POPJ, it will actually return to 4498 ; the code at POPJ1: _in field one_ !! Since we've also stacked our original 4499 ; caller's return address, the code at POPJ1 really only needs to do two 4500 ; things, a "CXF 0" to return to field zero, and then another .POPJ. 4501 ; Unfortunately, this code has to live in field one, so you won't find it 4502 ; here! 4503 04571 0306 04572 6255 04573 7465 04574 0022 04575 7535 04576 0033 04577 7776 4504 04600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 106 SD Command - Spin IDE Drives UP or DOWN bts6120.plx 4505 .TITLE SD Command - Spin IDE Drives UP or DOWN 4506 4507 4508 ; The SD command takes a single argument (interpreted as a decimal number, 4509 ; if it matters). It will spin up the attached IDE disk if the argument is 4510 ; non-zero or spin the drive down if the argument is zero. Note that not all 4511 ; IDE drives support the spin down command, but we'll give it our best try. 4512 4513 04600 6205 SPINCD: .PUSHJ @[DECNW] ; get the 0/1 argument 04601 5777 4514 04602 6205 .PUSHJ @ZEOLTST ; and that should be the end 04603 5516 4515 04604 6205 .PUSHJ @[NODISK] ; be sure an IDE disk is actually attached 04605 5776 4516 04606 1067 TAD WORD ; get the argument 4517 04607 7650 SNA CLA ; non-zero -> SPIN UP, zero -> SPIN DOWN 4518 04610 5214 JMP SDNCMD ; spin down 4519 4520 ; Here to SPIN UP ... 4521 04611 4532 SUPCMD: JMS @ZPUSHJ1 ; call a field 1 routine 4522 04612 1276 SPINUP ; spin up the attached IDE drive 4523 04613 6225 .POPJ ; and we're all done 4524 4525 ; And here for SPIN DOWN ... 4526 04614 4532 SDNCMD: JMS @ZPUSHJ1 ; pretty much the same as the SPIN UP case 4527 04615 1303 SPINDN ; ... 4528 04616 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 107 Simple Lexical Functions bts6120.plx 4529 .TITLE Simple Lexical Functions 4530 4531 4532 ; This routine will skip over any spaces in the command line and return the 4533 ; next non-space character in the AC and SAVCHR... 4534 4535 ; Here to start skipping with the next character... 4536 04617 6205 SPACMP: .PUSHJ @ZGET ; Get the next character 04620 5520 4537 4538 ; Here to consider the current character and then skip... 4539 04621 7200 SPACM0: CLA ; Be sure the AC is safe to use 4540 04622 1052 TAD SAVCHR ; And look at the current character 4541 04623 1140 TAD ZMSPACE ; Compare it to a space 4542 04624 7650 SNA CLA ; ??? 4543 04625 5217 JMP SPACMP ; Keep going until we don't find one 4544 04626 1052 TAD SAVCHR ; Restore the character 4545 04627 6225 .POPJ ; And we're all done 4546 4547 ; This routine will examine the current character (in SAVCHR) or the next 4548 ; character (via GET) for end of line, which is stored as a null byte). If 4549 ; it isn't the EOL, then COMERR is called and the current command is aborted, 4550 ; otherwise this routine just returns... 4551 4552 ; Enter here to examine the next character... 4553 04630 6205 EOLNXT: .PUSHJ @ZGET ; Load the next character 04631 5520 4554 ; Then fall into the current character test 4555 4556 ; Enter here to examine the current character... 4557 04632 6205 EOLTST: .PUSHJ @ZSPACM0 ; Allow blanks at the end of the line 04633 5514 4558 04634 7640 SZA CLA ; Is it the end of the line ?? 4559 04635 5530 JMP @ZCOMERR ; No -- that's bad 4560 04636 6225 .POPJ ; Yes -- that's good 4561 4562 ; This routine will test either the current character (via SAVCHR) or the 4563 ; next character (via GET) to see if it's a space. If it isn't, then it 4564 ; jumps to COMERR and aborts the current command... 4565 4566 ; Enter here to examine the next character... 4567 04637 6205 SPANXT: .PUSHJ @ZGET ; get the next character 04640 5520 4568 ; and fall into SPATST... 4569 4570 ; Enter here to examine the current character 4571 04641 7200 SPATST: CLA ; don't require that the AC be cleared 4572 04642 1052 TAD SAVCHR ; get the current character 4573 04643 1140 TAD ZMSPACE ; and compare it to a space 4574 04644 7640 SZA CLA ; well?? 4575 04645 5530 JMP @ZCOMERR ; not equal - this is a bad command line 4576 04646 6225 .POPJ ; it's a space 4577 4578 4579 ; This routine will backup the command scanner so that the character 4580 ; just read will be read again with the next call to GET... 4581 04647 7240 BACKUP: STA ; Load the AC with -1 4582 04650 1013 TAD L ; Then decrement the line pointer 4583 04651 3013 DCA L ; ... 4584 04652 6225 .POPJ ; That's all it takes 4585 04776 2542 04777 6662 4586 05000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 108 Free Space for Future Expansion! bts6120.plx 4587 .TITLE Free Space for Future Expansion! 4588 4589 4590 ; space to put patch code for this field 4591 05000 F0PATCH: 4592 4593 05600 .PAGE 30-1 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 109 Front Panel Initialization bts6120.plx 4594 .TITLE Front Panel Initialization 4595 4596 4597 ; This routine will determine if a FP6120 front panel is attached and, if 4598 ; one is, will initialize it. If a front panel is present, the FPDTCT word 4599 ; will be set to a non-zero value. This serves as a flag to control the 4600 ; actions of all the other front panel code. 4601 05600 7200 FPINIT: CLA ; clear all the FP variables anyway 4602 05601 3061 DCA FNSTAT ; just in case 4603 05602 3062 DCA BTSWCN ; ... 4604 05603 3063 DCA FPPGMM ; ... 4605 4606 ; If a front panel is installed, then the CCPR IOT will not only clear 4607 ; the CP timer and HALTSW flags, but it will also clear the AC as well. 4608 ; If no front panel is present, then CCPR is a no-op. That's an easy 4609 ; way to determine if a FP6120 is present. 4610 05604 7240 STA ; set the AC to -1 4611 05605 6430 CCPR ; clear the AC if an FP is present 4612 05606 7040 CMA ; 0 if no FP, -1 if an FP 4613 05607 3060 DCA FPDTCT ; and set the flag 4614 05610 1060 TAD FPDTCT ; get it back again 4615 05611 7650 SNA CLA ; if there's no front panel 4616 05612 6225 .POPJ ; then we can quit now 4617 4618 ; Just for fun, we display "6120" (in octal, of course) on the ADDRESS 4619 ; LEDs and our BTS6120 version on the DATA LEDs. Unfortunately this works 4620 ; only if the rotary switch is set to MD - you might think it would be easy 4621 ; to make it work for the other positions by adding a WSR here, but it's 4622 ; not that simple. If the rotary switch is set to PS, AC or MQ anything we 4623 ; write there will be overwritten by the UPDISP routine before you ever see 4624 ; it. Sorry. By the way, this rather causually corrupts a word of memory, 4625 ; but this routine is supposed to be used only during initialization anyway... 4626 05613 6266 CPD ; write to main memory 4627 05614 1377 TAD [VERSION] ; get our version number 4628 05615 3776 DCA @[6120] ; and write it to location 6120 4629 05616 6276 SPD ; back to panel data mode 4630 05617 6435 RLOF ; lastly, turn the RUN LED off 4631 05620 6225 .POPJ ; that'll be enough fun for today PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 110 Scan Front Panel Switches bts6120.plx 4632 .TITLE Scan Front Panel Switches 4633 4634 4635 ; This routine will scan all front panel switches, except for HALT and the 4636 ; rotary switch, and look for work to be done. The HALT switch is ignored 4637 ; until we give a command that will transfer control to main memory (e.g. 4638 ; CONTINUE or BOOT), and the rotary switch is handled by the data display 4639 ; update routine. 4640 ; 4641 ; Note that this routine is called only while we're in panel mode and 4642 ; BTS6120 is active - it's never called by the CP timer. The panel switches 4643 ; (except for HALT and the rotary switch) do nothing while a main memory 4644 ; program is running. 4645 05621 1060 SWSCAN: TAD FPDTCT ; get the front panel flag 4646 05622 7650 SNA CLA ; skip if a panel is attached 4647 05623 6225 .POPJ ; no panel - just quit now 4648 05624 6434 RFNS ; read the state of the function switches 4649 05625 0375 AND [7740] ; isolate the switches we know about 4650 05626 7041 CIA ; has there been any change in switch state 4651 05627 1061 TAD FNSTAT ; ... since we were last here? 4652 05630 6432 SPLK ; ignore everything if PANEL LOCK is on! 4653 05631 7650 SNA CLA ; (switches changed ???) 4654 05632 6225 .POPJ ; no (or PANEL LOCK) - there's nothing to do 4655 4656 ; Now that we've detected a change in the switch state, delay for 4657 ; approximately 10-15 milliseconds to allow the switch to stop bouncing. 4658 ; Remember - this code is used only when we're in panel mode; it's never 4659 ; called by the CP timer, so the delay is inconsequential. 4660 ; 4661 ; Each iteration of the delay loop requires 17 minor cycles, or 4.25us 4662 ; with a 8Mhz clock (6.8us at 5Mhz). A 15 ms delay therefore needs 3529 4663 ; iterations (again, assuming an 8Mhz clock). 4664 05633 1374 TAD [-3529.] ; initialize the timer 4665 05634 7001 SWSCA1: IAC ; [6] increment the AC 4666 05635 7440 SZA ; [7] has it overflowed yet? 4667 05636 5234 JMP SWSCA1 ; [4] nope - keep looping 4668 4669 ; Compute (.NOT. ) .AND. - this function gives a 4670 ; 1 bit for every switch which was not pressed before and is pressed now; 4671 ; those are the ones we want to process! 4672 05637 6434 RFNS ; read the current state 4673 05640 0375 AND [7740] ; mask off the unimportant switches 4674 05641 3301 DCA SWTEMP ; save it for a moment 4675 05642 1061 TAD FNSTAT ; get the old state 4676 05643 7040 CMA ; complement 4677 05644 0301 AND SWTEMP ; not old and new 4678 05645 7421 MQL ; save _that_ too 4679 05646 1301 TAD SWTEMP ; lastly update FNSTAT 4680 05647 3061 DCA FNSTAT ; ... for next time around 4681 05650 7701 ACL ; restore the changed switch map 4682 05651 7450 SNA ; if there are no one bits 4683 05652 6225 .POPJ ; then we've got nothing to do! 4684 4685 ; Now figure out which switch is set. It's not really clear what we should 4686 ; do if more than one switch is depressed at the same time (does a real -8 4687 ; have N key rollover for the front panel?) - in this case we just process 4688 ; the first switch that we detect and ignore the rest. 4689 05653 7004 RAL ; put BOOT in LINK and LA in AC0 4690 05654 7430 SZL ; is BOOT pressed? 4691 05655 5773 JMP @[SWBOOT] ; ... 4692 05656 7421 MQL ; save the bits again 4693 05657 3062 DCA BTSWCN ; clear the BOOT count for any key 4694 05660 7701 ACL ; ... _other_ than BOOT 4695 05661 7510 SPA ; what about LA ? 4696 05662 5302 JMP SWLA ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 111 Scan Front Panel Switches bts6120.plx 4697 05663 7006 RTL ; get the next two bits 4698 05664 7430 SZL ; next up is LXA 4699 05665 5311 JMP SWLXA ; ... 4700 05666 7510 SPA ; and after that is CLEAR 4701 05667 5772 JMP @[SWCLR] ; ... 4702 05670 7006 RTL ; position the next bits 4703 05671 7430 SZL ; this position is CONTINUE 4704 05672 5771 JMP @[CONT] ; (CONTINUE is exactly C command) 4705 05673 7510 SPA ; and then EXAM 4706 05674 5335 JMP SWEXA ; .... 4707 05675 7004 RAL ; only one left! 4708 05676 7710 SPA CLA ; the last one is DEP 4709 05677 5325 JMP SWDEP ; ... 4710 05700 6225 .POPJ ; it should be impossible to get here! 4711 4712 ; Temporary storage... 4713 05701 0000 SWTEMP: 0 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 112 FP LA, LXA, EXAMINE and DEPOSIT Switches bts6120.plx 4714 .TITLE FP LA, LXA, EXAMINE and DEPOSIT Switches 4715 4716 4717 ; The LOAD ADDRess switch loads the switches (data switches, this time) 4718 ; into the PC and then displays (if the rotary switch is set to MD) the 4719 ; contents of the addressed location. 4720 05702 7604 SWLA: LAS ; read the switch register 4721 05703 3000 DCA UPC ; and deposit that in the PC 4722 05704 6205 .PUSHJ EXMEM ; display that location 05705 5351 4723 05706 6205 .PUSHJ @[TYPEPC] ; type the PC too 05707 5770 4724 05710 5510 JMP @ZCRLF ; finish the line and exit 4725 4726 4727 ; The LOAD EXTenDed ADDRess switch loads SR9..11 into the user's data 4728 ; field and SR7..9 into the user's instruction field. This is similar 4729 ; to loading the flags register, however the upper six bits are unchanged. 4730 05711 7604 SWLXA: LAS ; read the switch register 4731 05712 0367 AND [77] ; keep only the lower six bits 4732 05713 7421 MQL ; save that for a moment 4733 05714 1002 TAD UFLAGS ; get the last user mode flags 4734 05715 0366 AND [7700] ; keep the upper six bits of that 4735 05716 7501 MQA ; put the two together 4736 05717 3002 DCA UFLAGS ; and update the IF/DF 4737 05720 6205 .PUSHJ EXMEM ; display that location 05721 5351 4738 05722 6205 .PUSHJ @[TYPEPS] ; and type it on the console too 05723 5765 4739 05724 5510 JMP @ZCRLF ; finish the line and exit 4740 4741 4742 ; The DEPosit switch writes SR0..11 to the memory location addressed by 4743 ; the PC, increments the PC (but not the IF!) and then displays the contents 4744 ; of the next location. 4745 05725 6205 SWDEP: .PUSHJ @[USERDF] ; change DF to the last user mode IF 05726 5764 4746 05727 6266 CPD ; address main memory 4747 05730 7604 LAS ; read the data switch register 4748 05731 3400 DCA @UPC ; deposit them into memory 4749 05732 2000 ISZ UPC ; increment the memory address 4750 05733 7000 NOP ; ... 4751 05734 5341 JMP SWEXA1 ; and fall into the EXMEM routine 4752 4753 4754 ; The EXAMine switch increments the PC and then displays the memory location 4755 ; addressed by {IR,PC}. Note that the EXAM switch always does the same thing, 4756 ; however the data display only shows the memory data if the rotary switch is 4757 ; set to MD! 4758 05735 2000 SWEXA: ISZ UPC ; no - increment the user PC 4759 05736 7000 NOP ; ignore any wrap around 4760 05737 6205 .PUSHJ EXMEM ; display that location on the lights 05740 5351 4761 05741 1000 SWEXA1: TAD UPC ; fix up the PC and IF 4762 05742 3037 DCA ADDR ; ... for TMEM 4763 05743 1002 TAD UFLAGS ; ... 4764 05744 0136 AND ZK70 ; ... 4765 05745 3040 DCA ADRFLD ; ... 4766 05746 6205 .PUSHJ @[TMEM] ; type it on the console too 05747 5763 4767 05750 5510 JMP @ZCRLF ; ... 4768 4769 4770 ; This routine displays the location addressed by {IF,PC}. It's used 4771 ; by all the examine, load address and deposit routines... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 113 FP LA, LXA, EXAMINE and DEPOSIT Switches bts6120.plx 4772 05751 6205 EXMEM: .PUSHJ @[USERDF] ; change DF to the last user mode IF 05752 5764 4773 05753 6266 CPD ; address main memory next 4774 05754 1400 TAD @UPC ; and read the location at {IF,PC} 4775 05755 7200 CLA ; we don't actually care what we read! 4776 05756 6276 SPD ; back to panel memory 4777 05757 6201 CDF 0 ; ... 4778 05760 6225 .POPJ ; and we're done... 4779 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 0320 4780 06000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 114 Change Current DF to User's IF bts6120.plx 4781 .TITLE Change Current DF to User's IF 4782 4783 4784 ; This routine will change the current data field to the user's instruction 4785 ; field, as determined by the last user mode PS in UFLAGS... 4786 06000 7200 USERDF: CLA ; just in case! 4787 06001 1002 TAD UFLAGS ; get the last user mode flags 4788 06002 0136 AND ZK70 ; isolate just the instruction field 4789 06003 1377 TAD [CDF 0] ; make a CDF instruction out of it 4790 06004 3205 DCA .+1 ; and execute that 4791 06005 7000 NOP ; (gets overwritten with a CDF instruction) 4792 06006 6225 .POPJ ; return and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 115 START, CONTINUE and BOOT Switches bts6120.plx 4793 .TITLE START, CONTINUE and BOOT Switches 4794 4795 4796 ; The BOOT switch (what else?) boots the PDP-8. Because BOOT is a fairly 4797 ; dangerous function, we steal a cue from the PDP-8/A and require it to be 4798 ; pressed _twice_ in succession before anything happens. The flag BTSWCN 4799 ; (BooT SWitch CouNt) keeps track of the number of times BOOT has been 4800 ; pressed. 4801 ; 4802 ; Note that the BOOT switch ignores the state of the RUN/HALT switch (i.e. 4803 ; it doesn't single step if the HALT switch is down). That seems like the 4804 ; most useful behavior. 4805 06007 2062 SWBOOT: ISZ BTSWCN ; have we been here before (recently)? 4806 06010 5214 JMP SWBOO1 ; no - wait for a second toggle 4807 06011 6205 .PUSHJ @ZCRLF ; ... 06012 5510 4808 06013 5776 JMP @[BOOT1] ; yes - go find something to boot! 4809 4810 ; Here for the first toggle of two... 4811 06014 7240 SWBOO1: STA ; set the AC to -1 4812 06015 3062 DCA BTSWCN ; and set the counter for next time 4813 06016 6225 .POPJ ; do nothing else this time 4814 4815 4816 ; The CLEAR key clears the AC and other processor registers and then 4817 ; asserts IOCLR L. It also clears the flag bits in the PS, but it leaves 4818 ; the IF, DF and PC alone. It does _not_ (contrary to what I once thought) 4819 ; actually start execution! 4820 06017 3004 SWCLR: DCA USP1 ; clear both stack pointers 4821 06020 3005 DCA USP2 ; ... 4822 06021 3003 DCA UMQ ; the multiplier quotient 4823 06022 3001 DCA UAC ; and the AC 4824 06023 1002 TAD UFLAGS ; get the current flags 4825 06024 0375 AND [77] ; clear all but the IF and DF 4826 06025 3002 DCA UFLAGS ; ... 4827 06026 3063 DCA FPPGMM ; clear the front panel program mode 4828 06027 6007 CAF ; finally, assert IOCLR L 4829 06030 6225 .POPJ ; all done! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 116 HALT Switch bts6120.plx 4830 .TITLE HALT Switch 4831 4832 4833 ; This routine will test the state of the front panel HALT switch and 4834 ; take the skip return if it is in the RUN (i.e. UP) position. If the 4835 ; switch is in the HALT (DOWN) position, then commands that would normally 4836 ; start a main memory program (e.g. STart, Continue, etc) single step 4837 ; instead. 4838 ; 4839 ; If no front panel is installed, this routine always takes the skip 4840 ; (i.e. RUN) return! 4841 ; 4842 ; NOTE that this routine must be called with a JMS and not the usual 4843 ; PUSHJ/POPJ combination! 4844 06031 0000 CHKHLT: 0 ; call here with a JMS! 4845 06032 7300 CLA CLL ; just in case 4846 06033 1060 TAD FPDTCT ; any front panel installed? 4847 06034 7650 SNA CLA ; skip if a FP6120 is present 4848 06035 5242 JMP CHKHL1 ; nope - take the skip return now 4849 06036 6434 RFNS ; read the function switches 4850 06037 0374 AND [20] ; isolate the halt switch bit 4851 06040 6432 SPLK ; ignore it if PANEL LOCK is on! 4852 06041 7640 SZA CLA ; HALT is 1 for UP, 0 for DOWN 4853 06042 2231 CHKHL1: ISZ CHKHLT ; switch is UP, take the skip return 4854 06043 5631 JMP @CHKHLT ; and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 117 Update the Front Panel Data Display bts6120.plx 4855 .TITLE Update the Front Panel Data Display 4856 4857 4858 ; This routine will read the rotary switch position and display the 4859 ; selected data on the data LEDs. There are a couple of points to 4860 ; keep in mind while you read this: 4861 ; 4862 ; * The display is selected by the 4 least significant bits returned 4863 ; by the RFNS IOT. Exactly _one_ of these bits will be a one! 4864 ; 4865 ; * The MD DISP position is handled by the hardware and requires no 4866 ; action on our part. Actually the CP timer interrupt is disabled 4867 ; when the switch is in the MD DISP position, but that doesn't 4868 ; guarantee that this routine won't be called from somewhere else. 4869 ; 4870 ; * If the FPPGMM (Front Panel Program Mode) flag is non-zero, then the 4871 ; main memory program is controlling the data display and, rather than 4872 ; displaying any of the registers, we display the contents of FPPGMD. 4873 ; Of course, this works only if the rotary switch is NOT set to MD! 4874 ; 4875 ; * Since this routine is also called by the 30Hz timer, we want it 4876 ; to be as fast as possible! 4877 4878 ; This entry point is called by the CONOUT and INCHRS routines to keep the 4879 ; front panel alive while BTS6120 is active. That means that you can turn the 4880 ; knob while you're at the BTS6120 prompt and the LEDs will still update as 4881 ; expected. 4882 ; 4883 ; Why bother synchronizing with the CP timer? After all, it doesn't actually 4884 ; matter if the LEDs are updated more often, does it? The problem is the power 4885 ; LED, which blinks when the backup battery is low. If we don't synchronize 4886 ; the display updates with that, then the blinking gets all screwed up. 4887 06044 6433 UPDISI: SCPT ; has the CP timer ticked? 4888 06045 6225 .POPJ ; nope - do nothing 4889 06046 6430 CCPR ; yep - clear the timer flag 4890 ; and fall into UPDISP... 4891 4892 ; And this entry point is called by BTSTRP when a CP timer interrupt occurs 4893 ; and the main memory program is active... 4894 06047 1060 UPDISP: TAD FPDTCT ; get the front panel flag 4895 06050 7650 SNA CLA ; is a front panel attached? 4896 06051 6225 .POPJ ; nope - just quit now 4897 06052 1063 TAD FPPGMM ; front panel program mode? 4898 06053 7640 SZA CLA ; skip if not 4899 06054 5301 JMP PGMDSP ; yes - display the program data only 4900 06055 6434 RFNS ; read the rotary switch 4901 06056 7010 RAR ; put PS DISP L in the link 4902 06057 7430 SZL ; is it set? 4903 06060 5270 JMP PSDISP ; yes - go display the flags 4904 06061 7010 RAR ; next up is AC DISP 4905 06062 7430 SZL ; ??? 4906 06063 5273 JMP ACDISP ; ... 4907 06064 7010 RAR ; test MQ DISP next 4908 06065 7430 SZL ; ??? 4909 06066 5276 JMP MQDISP ; that's the one - go show the MQ 4910 ; The last bit is MD DISP L which, unless the FP hardware is 4911 ; broken, _MUST_ be set. There's no point in checking - just do it. 4912 ; It gets even better because the memory display is handled by the 4913 ; hardware, so there's nothing we need to do! 4914 06067 5303 JMP UPDIS2 ; no action required 4915 4916 ; Here to display the processor flags... 4917 06070 7200 PSDISP: CLA ; ... 4918 06071 1002 TAD UFLAGS ; get the user mode flags 4919 06072 5302 JMP UPDIS1 ; update the LEDs and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 118 Update the Front Panel Data Display bts6120.plx 4920 4921 ; Here to display the AC on the lights... 4922 06073 7200 ACDISP: CLA ; ... 4923 06074 1001 TAD UAC ; display the last user mode AC 4924 06075 5302 JMP UPDIS1 ; ... 4925 4926 ; And here to display the MQ... 4927 06076 7200 MQDISP: CLA ; ... 4928 06077 1003 TAD UMQ ; display the last user mode MQ 4929 06100 5302 JMP UPDIS1 ; ... 4930 4931 ; Here to display the program data.. 4932 06101 1064 PGMDSP: TAD FPPGMD ; get the program data 4933 ;; JMP UPDIS1 ; display it and return 4934 4935 ; Here to actually update the LEDs with whatever is in the AC ... 4936 06102 6246 UPDIS1: WSR ; display that on the lights 4937 06103 7300 UPDIS2: CLA CLL ; (just in case!) 4938 ; fall into the low battery warning function PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 119 Blink Power LED for Low Battery bts6120.plx 4939 .TITLE Blink Power LED for Low Battery 4940 4941 ; This routine will blink the power LED on the SBC6120-RC model when the 4942 ; memory backup battery is low. It's called via the UPDISP front panel update 4943 ; function and it times the blinking to roughly a 1Hz rate by counting the CP 4944 ; timer interrupts. Sadly, it only works on the RC model - the original FP6120 4945 ; lacks any kind of power LED... 4946 4947 06104 1035 BLOWRN: TAD RCFLAG ; see if this is even the -RC model at all 4948 06105 7650 SNA CLA ; skip if we're running on the SBC6120-RC 4949 06106 6225 .POPJ ; nope - just quit now 4950 06107 6436 SBBLO2 ; SBC6120-RC - is the backup batter low? 4951 06110 5317 JMP BLOWR1 ; nope - turn the power LED on and quit 4952 4953 ; If we get here then we are running on the SBC6120-RC model AND the backup 4954 ; battery is really low. We want to blink the power LED at roughly a 1Hz rate. 4955 ; That's easy enough to do if we increment the BLTIME counter every time we're 4956 ; here (assuming that we're only called once per CP timer event) and then use 4957 ; bit 7 (2**5 == 32) of the count to tell us whether to turn the LED on or off. 4958 06111 2036 ISZ BLTIME ; increment the count 4959 06112 7000 NOP ; ... don't care ... 4960 06113 1036 TAD BLTIME ; get the current count 4961 06114 0374 AND [20] ; check just one bit 4962 06115 7650 SNA CLA ; should we turn the LED on or off ?? 4963 06116 5321 JMP BLOWR2 ; off... 4964 4965 ; Power LED on ... 4966 06117 6417 BLOWR1: PLON ; power LED on ... 4967 06120 6225 .POPJ ; and we're done 4968 4969 ; Power LED off... 4970 06121 6415 BLOWR2: PLOF ; ... 4971 06122 6225 .POPJ ; ... 4972 06174 0020 06175 0077 06176 2452 06177 6201 4973 06200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 120 Type ASCII Strings bts6120.plx 4974 .TITLE Type ASCII Strings 4975 4976 4977 ; This routine will type a ASCIZ string stored in field 1 using the standard 4978 ; OS/8 "3 for 2" packing system. This format is used by the monitor to store 4979 ; help and error messages. On call, the address of the string is passed in the 4980 ; AC and, on return, the AC will always be cleared. 4981 06200 1377 OUTSTR: TAD [-1] ; auto index registers pre-increment 4982 06201 3010 DCA X1 ; ... 4983 06202 7346 NLM3 ; load the AC with -3 4984 06203 3072 DCA DIGITS ; and initialize the character counter 4985 4986 ; Get the next character and output it... 4987 06204 6211 OUTST1: CDF 1 ; strings always live in field 1 4988 06205 2072 ISZ DIGITS ; which character are we on? 4989 06206 5227 JMP OUTST2 ; first or second - they're easy 4990 4991 ; Extract the third character from a triplet... 4992 06207 7346 NLM3 ; re-initialize the character counter 4993 06210 3072 DCA DIGITS ; ... 4994 06211 7344 NLM2 ; then load the AC with -2 4995 06212 1010 TAD X1 ; and backup the string pointer 4996 06213 3010 DCA X1 ; ... 4997 06214 1410 TAD @X1 ; get the first word of the pair 4998 06215 0142 AND ZK7400 ; get the upper four bits of the word 4999 06216 7002 BSW ; position them in the upper bits of the byte 5000 06217 7106 CLL RTL ; ... 5001 06220 7421 MQL ; save it in the MQ for a while 5002 06221 1410 TAD @X1 ; then get the second word again 5003 06222 0142 AND ZK7400 ; the upper four bits again 5004 06223 7002 BSW ; become the lower for bits of the byte 5005 06224 7112 CLL RTR ; ... 5006 06225 7501 MQA ; put the byte together 5007 06226 5230 JMP OUTST3 ; and type it normally 5008 5009 ; Here for the first or second character of a triplet... 5010 06227 1410 OUTST2: TAD @X1 ; get the character 5011 06230 0135 OUTST3: AND ZK177 ; trim it to just seven bits 5012 06231 6201 CDF 0 ; restore the original data field 5013 06232 7450 SNA ; end of string ? 5014 06233 6225 .POPJ ; yes - we can quit now 5015 06234 6205 .PUSHJ @ZOUTCHR ; nope - type this one too 06235 5476 5016 06236 5204 JMP OUTST1 ; and go do the next 5017 5018 ; This routine does exactly the same thing as OUTSTR, except that it allows 5019 ; the message pointer to be passed in line, via a JMS instruction 5020 06237 0000 INLMES: 0 ; call here via a JMS instruction 5021 06240 7200 CLA ; ... 5022 06241 1637 TAD @INLMES ; fetch the string address 5023 06242 6205 .PUSHJ OUTSTR ; type it out 06243 5200 5024 06244 2237 ISZ INLMES ; skip over the address 5025 06245 5637 JMP @INLMES ; and return 5026 5027 ; This routine will type an ASCIZ string, packed one character per word and 5028 ; terminated with a null character, on the terminal. The address of the 5029 ; string, -1, should be loaded into the AC before calling this routine, and 5030 ; the AC will always be cleared on return. 5031 06246 3010 TASCIZ: DCA X1 ; save the pointer to the string 5032 06247 1410 TASCI1: TAD @X1 ; and get the first character 5033 06250 7450 SNA ; is this the end of the string ?? 5034 06251 6225 .POPJ ; yes -- quit now 5035 06252 6205 .PUSHJ @ZOUTCHR ; no -- type this character 06253 5476 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 121 Type ASCII Strings bts6120.plx 5036 06254 5247 JMP TASCI1 ; and then loop until the end 5037 5038 ; This routine is identical to TASCIZ, except that the string is stored in 5039 ; field 1, rather than field 0... 5040 06255 3010 TASZF1: DCA X1 ; save the pointer to the string 5041 06256 6211 CDF 1 ; the string is in field 1 5042 06257 1410 TAD @X1 ; and get the next character 5043 06260 6201 CDF 0 ; back to our field 5044 06261 7450 SNA ; is this the end of the string ?? 5045 06262 6225 .POPJ ; yes -- quit now 5046 06263 6205 .PUSHJ @ZOUTCHR ; no -- type this character 06264 5476 5047 06265 5256 JMP TASZF1+1 ; and then loop until the end PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 122 Type SIXBIT Words, and Characters bts6120.plx 5048 .TITLE Type SIXBIT Words, and Characters 5049 5050 5051 ; This routine will type the two character SIXBIT word contained in the AC. 5052 ; It always types exactly two characters, so if the second character is a null 5053 ; (00), then a trailing blank appears. The AC is cleared on return. 5054 06266 3067 TSIXW: DCA WORD ; Save the 2 characters 5055 06267 1067 TAD WORD ; And get them back 5056 06270 7002 BSW ; Position the first one 5057 06271 6205 .PUSHJ TSIXC ; And type it out 06272 5274 5058 06273 1067 TAD WORD ; No -- get the second character 5059 ; And fall into the TSIXC routine 5060 5061 ; This routine will type a single SIXBIT character from the right 5062 ; byte of the AC. The AC will be cleared on return. 5063 06274 0376 TSIXC: AND [77] ; Trim the character to just 6 bits 5064 06275 1375 TAD [" "] ; No -- convert the character to ASCII 5065 06276 5774 JMP @[THCHAR] ; And type it out PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 123 Type Decimal Numbers bts6120.plx 5066 .TITLE Type Decimal Numbers 5067 5068 5069 ; This routine will type the contents of the AC in decimal. It always 5070 ; treats the AC as an unsigned quantity and will type numbers from 0 to 4095. 5071 ; It uses locations WORD and COUNT and the AC is always cleared on return. 5072 06277 3067 TDECNW: DCA WORD ; remember the number to be typed 5073 06300 3072 DCA DIGITS ; and clear the quotient 5074 06301 1067 TAD WORD ; get the dividend back again 5075 5076 ; Divide by 10 via repeated subtraction... 5077 06302 7100 TDECN1: CLL ; make sure the LINK is clear 5078 06303 1373 TAD [-10.] ; subtract 10 from the dividend 5079 06304 7420 SNL ; did it fit ??? 5080 06305 5310 JMP TDECN2 ; no -- go get the remainder 5081 06306 2072 ISZ DIGITS ; yes -- increment the quotient 5082 06307 5302 JMP TDECN1 ; and keep dividing 5083 5084 ; Now figure the remainder... 5085 06310 1372 TDECN2: TAD [10.] ; correct the remainder 5086 06311 6215 .PUSH ; and save it on the stack 5087 06312 7200 CLA ; get the quotient 5088 06313 1072 TAD DIGITS ; ... 5089 06314 7450 SNA ; is it zero ??? 5090 06315 5320 JMP TDECN3 ; yes -- proceed 5091 06316 6205 .PUSHJ TDECNW ; no type that part first 06317 5277 5092 5093 ; Here to type the digit and return... 5094 06320 6235 TDECN3: .POP ; restore the remainder 5095 06321 5771 JMP @[TDIGIT] ; type it in ASCII and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 124 Type Octal Numbers bts6120.plx 5096 .TITLE Type Octal Numbers 5097 5098 5099 ; This routine will type a 4 digit octal number passed in the AC. It always 5100 ; prints exactly four digits, with leading zeros added as necessary. The AC 5101 ; will be cleared on return. 5102 06322 3067 TOCT4: DCA WORD ; save the number to type 5103 06323 1370 TAD [-4] ; and get the number of iterations 5104 06324 3072 TOCTN: DCA DIGITS ; ... 5105 5106 ; Extract one digit and print it... 5107 06325 1067 TOCTL: TAD WORD ; get the remaining bits 5108 06326 7106 CLL RTL ; shift them left 2 bits 5109 06327 7006 RTL ; and then 2 more (remember the link!) 5110 06330 3052 DCA SAVCHR ; remember that for a later 5111 06331 1052 TAD SAVCHR ; and we also need it now 5112 06332 7010 RAR ; restore the extra bit (in the link) 5113 06333 3067 DCA WORD ; then remember the remaining bits 5114 06334 1052 TAD SAVCHR ; get the digit back 5115 06335 0137 AND ZK7 ; trim it to just 3 bits 5116 06336 6205 .PUSHJ @[TDIGIT] ; type it out 06337 5771 5117 5118 ; Here after we have typed another digit... 5119 06340 2072 ISZ DIGITS ; is this enough ?? 5120 06341 5325 JMP TOCTL ; no -- keep typing 5121 06342 6225 .POPJ ; yes -- quit now 5122 5123 ; This routine is identical to TOCT4, except that it types only three digits 5124 ; with leading zeros. It's useful for printing eight bit quantities... 5125 06343 7014 TOCT3: R3L ; throw away the most significant digit 5126 06344 3067 DCA WORD ; save the value to be typed 5127 06345 7346 NLM3 ; get the number of iterations 5128 06346 5324 JMP TOCTN ; and join the regular code 5129 5130 ; This small routine will type an octal number in the AC followed by a space. 5131 06347 6205 TOCT4S: .PUSHJ TOCT4 ; then type the data in octal 06350 5322 5132 06351 5477 JMP @ZTSPACE ; finally type a space and return 5133 5134 ; This small routine will type an octal number from the AC followed by a CRLF. 5135 06352 6205 TOCT4C: .PUSHJ TOCT4 ; and type that in octal 06353 5322 5136 06354 5510 JMP @ZCRLF ; finish with a CRLF 5137 5138 06355 6205 TOCT4M: .PUSHJ TOCT4 ; and type that in octal 06356 5322 5139 06357 6205 .PUSHJ @ZCRLF ; finish with a CRLF 06360 5510 5140 06361 5527 JMP @ZRESTA 5141 06370 7774 06371 7102 06372 0012 06373 7766 06374 7427 06375 0040 06376 0077 06377 7777 5142 06400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 125 Type Table of Messages bts6120.plx 5143 .TITLE Type Table of Messages 5144 5145 ; This routine will type a "text table" - a whole block of several lines of 5146 ; text. The text is specified by passing a table pointer, where each entry 5147 ; in the table is the address of an ordinary text message. Each message is 5148 ; printed as a single line, and all the lines in the table are printed as a 5149 ; block of text. The text table ends with a zero pointer. 5150 ; 5151 ; It sounds arcane, but it's used to type the help messages and that's about 5152 ; all. BTW, all text tables and text messages are assumed to live in field 1. 5153 ; 5154 ; For example - 5155 ; 5156 ; .FIELD 0 5157 ; ... 5158 ; JMS @[TTEXTT] 5159 ; HLPTBL 5160 ; ... 5161 ; 5162 ; .FIELD 1 5163 ;HLPTBL:MSG1 5164 ; MSG2 5165 ; 0 5166 ; ... 5167 ;MSG1: .TEXT /line 1/ 5168 ;MSG2: .TEXT /line 2/ 5169 ; ... 5170 ; 5171 ; Simple, no? 5172 06400 0000 TTEXTT: 0 ; notice that we're called by a JMS! 5173 06401 7240 STA ; (AI registers pre-increment!) 5174 06402 1600 TAD @TTEXTT ; get the address of the text table -1 5175 06403 3012 DCA X3 ; and save in an auto index register 5176 06404 2200 ISZ TTEXTT ; be sure to skip over the argument on return 5177 06405 6211 TTEXT1: CDF 1 ; the help text and table lives in field 1 5178 06406 1412 TAD @X3 ; get the next help message 5179 06407 6201 CDF 0 ; back to our field 5180 06410 7450 SNA ; end of list? 5181 06411 5600 JMP @TTEXTT ; yep - we can quit now 5182 06412 6205 .PUSHJ @[OUTSTR] ; nope - type this string 06413 5777 5183 06414 6205 .PUSHJ @ZCRLF ; and finish the line 06415 5510 5184 06416 5205 JMP TTEXT1 ; keep typing until we run out of strings PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 126 Type 15 Bit Addresses bts6120.plx 5185 .TITLE Type 15 Bit Addresses 5186 5187 5188 ; This routine will type a 15 bit address, passed in location ADDR, and with 5189 ; the field is in location ADRFLD. The address will be typed as a 5 digit 5190 ; octal number, and then followed by a "/" character and a space. The initial 5191 ; contents of the AC are ignored and the AC is always cleared on return. 5192 06417 7200 TADDR: CLA ; ... 5193 06420 1040 TAD ADRFLD ; get the high 3 bits of the address 5194 06421 6205 .PUSHJ @[TFIELD] ; type that out 06422 5776 5195 06423 1037 TAD ADDR ; then get the address 5196 06424 6205 .PUSHJ @ZTOCT4 ; and type all 12 bits of that 06425 5501 5197 06426 6205 .PUSHJ @[TSLASH] ; type a slash as a separator 06427 5775 5198 06430 5477 JMP @ZTSPACE ; finish with a space 5199 5200 ; This routine will type a single octal digit which represents a memory 5201 ; field. The field should be passed in the AC. 5202 06431 7010 TFIELD: RAR ; right justify the field number 5203 06432 7012 RTR ; ... 5204 06433 0137 AND ZK7 ; trim it to just 3 bits 5205 06434 5774 JMP @[TDIGIT] ; and fall into TDIGIT... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 127 Scan Addresses bts6120.plx 5206 .TITLE Scan Addresses 5207 5208 5209 ; This routine will read a 15 bit address into registers ADDR and ADRFLD. 5210 06435 6205 RDADDR: .PUSHJ @[OCTNF] ; read the 15 bit address 06436 5773 5211 06437 1067 TAD WORD ; get the low order bits 5212 06440 3037 DCA ADDR ; and put them in ADDR 5213 06441 6225 .POPJ ; that's it... 5214 5215 ; This routine will read a 15 bit address into registers HIGH and HGHFLD. 5216 06442 6205 RDHIGH: .PUSHJ RDADDR ; read a 15 bit address 06443 5235 5217 06444 1037 TAD ADDR ; get the low order bits 5218 06445 3042 DCA HIGH ; into HIGH 5219 06446 1040 TAD ADRFLD ; get the field 5220 06447 3044 DCA HGHFLD ; into HGHFLD 5221 06450 6225 .POPJ ; and that's all 5222 5223 ; This routine will read a 15 bit address into registers LOW AND LOWFLD. 5224 06451 6205 RDLOW: .PUSHJ RDADDR ; the same thing as before 06452 5235 5225 06453 1037 TAD ADDR ; ... 5226 06454 3043 DCA LOW ; only the names have changed 5227 06455 1040 TAD ADRFLD ; ... 5228 06456 3045 DCA LOWFLD ; ... 5229 06457 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 128 Scan an Address Range bts6120.plx 5230 .TITLE Scan an Address Range 5231 5232 5233 ; This routine will read either one or two octal numbers which describe a 5234 ; range of memory addresses. A range may be a single number (in which case 5235 ; the starting and ending values are the same) or two numbers with a space 5236 ; character between them (in which case the first number is the starting value 5237 ; and the last is the ending value). The starting value is always returned in 5238 ; locations LOW/LOWFLD and ADDR/ADRFLD, and the ending value is placed in 5239 ; HIGH/HGHFLD. If two addresses were seen, the LINK will be set upon return; 5240 ; it is cleared if only one address was found. 5241 06460 6205 RANGE: .PUSHJ RDLOW ; first read the low part of the range 06461 5251 5242 06462 6205 .PUSHJ @ZSPACM0 ; get the next non-space character 06463 5514 5243 06464 1372 TAD [-"-"] ; is it a range delimiter ?? 5244 06465 7640 SZA CLA ; ??? 5245 06466 5304 JMP RANGE1 ; no -- this must be the single address type 5246 5247 ; Here for a two address range... 5248 06467 6205 .PUSHJ RDHIGH ; go read the high order part of the range 06470 5242 5249 06471 1043 TAD LOW ; make ADDR point to the starting point 5250 06472 3037 DCA ADDR ; ... 5251 06473 1045 TAD LOWFLD ; ... 5252 06474 3040 DCA ADRFLD ; ... 5253 06475 6205 .PUSHJ TSTADR ; then be sure the numbers are in order 06476 5325 5254 06477 7020 CML ; ... 5255 06500 7630 SZL CLA ; ??? 5256 06501 6225 .POPJ ; yes -- return with the link set 5257 06502 4531 JMS @ZERROR ; no -- this isn't legal 5258 06503 3455 ERRRAN ; ?WRONG ORDER 5259 5260 ; Here for a single address range... 5261 06504 1043 RANGE1: TAD LOW ; set the high equal to the low 5262 06505 3042 DCA HIGH ; ... 5263 06506 1045 TAD LOWFLD ; ... 5264 06507 3044 DCA HGHFLD ; ... 5265 06510 7100 CLL ; Then return with the link cleared 5266 06511 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 129 Address Arithmetic bts6120.plx 5267 .TITLE Address Arithmetic 5268 5269 5270 ; This routine will increment the 15 bit address contained in registers 5271 ; ADDR and ADRFLD. If the address increments past 77777, the link will be 5272 ; 1 on return; otherwise it is always 0. 5273 06512 7300 NXTADR: CLA CLL ; ... 5274 06513 2037 ISZ ADDR ; increment the address 5275 06514 6225 .POPJ ; no wrap around -- leave the field alone 5276 06515 1040 TAD ADRFLD ; wrap around -- increment the field too 5277 06516 1371 TAD [-70] ; are we already in field 7 ?? 5278 06517 7510 SPA ; ??? 5279 06520 7020 CML ; no -- make the LINK be cleared on return 5280 06521 1370 TAD [70+10] ; restore and increment the field 5281 06522 0136 AND ZK70 ; only allow these bits in the result 5282 06523 3040 DCA ADRFLD ; and put it back 5283 06524 6225 .POPJ ; ... 5284 5285 ; This routine will compare the 15 bit address in registers ADDR and 5286 ; ADRFLD to the address in registers HIGH and HGHFLD. If ADDR/ADRFLD 5287 ; is less than HIGH/HGHFLD, the link will be zero on return. If ADDR/ADRFLD 5288 ; is greater then or equal to HIGH/HGHFLD, the link will be one. 5289 06525 7300 TSTADR: CLA CLL ; clear the AC and set L = 0 5290 06526 1040 TAD ADRFLD ; get the field 5291 06527 7061 CMA IAC CML ; negate the field and set L = 1 5292 06530 1044 TAD HGHFLD ; compare to the high field 5293 06531 7640 SZA CLA ; are they equal ?? 5294 06532 6225 .POPJ ; no -- the LINK has the correct status 5295 06533 1042 TAD HIGH ; yes -- compare the addresses 5296 06534 7041 CMA CIA ; L = 0 now 5297 06535 1037 TAD ADDR ; ... 5298 06536 7200 CLA ; clear the AC 5299 06537 6225 .POPJ ; but return the status in the LINK 5300 5301 ; This routine will swap the 15 bit address in ADDR/ADRFLD with the the 5302 ; 15 bit address in LOW/LOWFLD. The AC is always cleared. 5303 06540 7200 SWPADR: CLA ; ... 5304 06541 1043 TAD LOW ; get one value 5305 06542 7421 MQL ; and save it in the MQ 5306 06543 1037 TAD ADDR ; then get the other 5307 06544 3043 DCA LOW ; move it to the other place 5308 06545 7501 MQA ; and get the original one back 5309 06546 3037 DCA ADDR ; it goes in the second location 5310 06547 1045 TAD LOWFLD ; now do the same thing for fields 5311 06550 7421 MQL ; ... 5312 06551 1040 TAD ADRFLD ; ... 5313 06552 3045 DCA LOWFLD ; ... 5314 06553 7501 MQA ; ... 5315 06554 3040 DCA ADRFLD ; ... 5316 06555 6225 .POPJ ; that's all there is to it 5317 06570 0100 06571 7710 06572 7723 06573 7004 06574 7102 06575 7074 06576 6431 06577 6200 5318 06600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 130 Scan a Command Name bts6120.plx 5319 .TITLE Scan a Command Name 5320 5321 5322 ; This routine will scan a command or register name for the monitor. Names 5323 ; are always alphabetic, may not contain any digits, and are limited to one or 5324 ; two letters. The result is stored, in SIXBIT, in location NAME. One letter 5325 ; commands are left justified and padded on the right with zeros. If the end 5326 ; of line is the next character, then this routine will return with NAME set 5327 ; to zero and no error. If, however, there is a least one character out there 5328 ; and it is not a letter, then COMERR will be called... 5329 06600 7200 NAMENW: CLA ; be sure the AC is zero 5330 06601 3047 DCA NAME ; and clear the resulting name 5331 06602 6205 .PUSHJ @ZSPACMP ; get the next character, whatever it is 06603 5513 5332 06604 7450 SNA ; is there anything there ?? 5333 06605 6225 .POPJ ; no -- just give up now 5334 06606 6205 .PUSHJ ALPHA ; see if it is a letter 06607 5227 5335 06610 7420 SNL ; was it a letter ?? 5336 06611 5530 JMP @ZCOMERR ; no -- this isn't legal 5337 06612 1140 TAD ZMSPACE ; yes -- convert it to SIXBIT 5338 06613 7002 BSW ; left justify it 5339 06614 3047 DCA NAME ; and store it in word 5340 5341 ; Check for a second letter in the name... 5342 06615 6205 .PUSHJ @ZGET ; get the next character 06616 5520 5343 06617 6205 .PUSHJ ALPHA ; is this a letter ?? 06620 5227 5344 06621 7420 SNL ; ??? 5345 06622 5515 JMP @ZBACKUP ; no -- put it back and return 5346 06623 1140 TAD ZMSPACE ; yes -- convert it to SIXBIT too 5347 06624 1047 TAD NAME ; put both letters together 5348 06625 3047 DCA NAME ; ... 5349 06626 6225 .POPJ ; then that's all 5350 5351 ; This routine will return with the LINK bit set if the AC holds a letter, 5352 ; and with the LINK reset if it does not. In either case the AC is not 5353 ; disturbed... 5354 06627 7120 ALPHA: STL ; be sure the link starts in a known state 5355 06630 1377 TAD [-"A"] ; compare it to the first letter 5356 06631 7500 SMA ; skip if it isn't a letter 5357 06632 5235 JMP ALPHA1 ; it might be -- look further 5358 06633 1376 TAD ["A"] ; it's not a letter -- restore the AC 5359 06634 6225 .POPJ ; and quit (the link is zero now !!) 5360 5361 ; Here if it might be a letter (the link is also zero now)... 5362 06635 1375 ALPHA1: TAD ["A"-"Z"-1] ; now compare it to the other end 5363 06636 7500 SMA ; skip if it is a letter 5364 06637 7020 CML ; it isn't a letter -- set the link to a 0 5365 06640 1374 TAD ["Z"+1] ; restore the character and the link 5366 06641 6225 .POPJ ; then that's all PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 131 Command Lookup and Dispatch bts6120.plx 5367 .TITLE Command Lookup and Dispatch 5368 5369 5370 ; This routine will lookup a command or register name in a table and then 5371 ; dispatch to the corresponding routine. The address of the table, should 5372 ; be passed in the AC. The table is formatted as two word entries - the first 5373 ; word of a pair is the SIXBIT name of the command or register, and the second 5374 ; word is the address of the routine to call. As soon as this routine finds a 5375 ; first word that matches the value currently in NAME, it will jump to the 5376 ; routine indicated by the second word. The table ends with a zero word 5377 ; followed by the address of an error routine - the zero word always matches 5378 ; the current name and the error routine will be called. 5379 ; 5380 ; NOTE: Command tables are always stored in field one, however the addresses 5381 ; of all the routines they reference are always in field zero! 5382 ; 5383 ; NOTE: Auto index registers pre-decrement, so the address -1 of the table 5384 ; must be passed in the AC! 5385 06642 3010 MATCH: DCA X1 ; save the pointer to the table 5386 06643 6211 CDF 1 ; command tables are stored in field 1 5387 5388 ; Search for a name which matches... 5389 06644 1410 MATCH1: TAD @X1 ; pick up the name (from field 1) 5390 06645 7450 SNA ; is this the end of the table ?? 5391 06646 5255 JMP MATCH2 ; yes -- this always matches 5392 06647 7041 CIA ; make the word negative 5393 06650 1047 TAD NAME ; and compare it to the desired value 5394 06651 7650 SNA CLA ; ??? 5395 06652 5255 JMP MATCH2 ; a match !! 5396 06653 2010 ISZ X1 ; no match -- skip over the address 5397 06654 5244 JMP MATCH1 ; and keep looking 5398 5399 ; Here when we find a match... 5400 06655 1410 MATCH2: TAD @X1 ; get the address of the routine 5401 06656 3261 DCA MATCH3 ; put that in a safe place 5402 06657 6201 CDF 0 ; change back to the usual data field 5403 06660 5661 JMP @MATCH3 ; then branch to the right routine 5404 5405 ; Temporary storage for MATCH... 5406 06661 MATCH3: .BLOCK 1 ; address of the matching routine PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 132 Scan Decimal Numbers bts6120.plx 5407 .TITLE Scan Decimal Numbers 5408 5409 5410 ; This routine will read a decimal number from the command line and return 5411 ; its value in location WORD. The value is limited to 12 bits and overflows 5412 ; are not detected. At least one decimal digit must be found on the command 5413 ; line or COMERR will be called, and the first non-digit character found will 5414 ; be returned in location SAVCHR. 5415 06662 7200 DECNW: CLA ; ignore the AC initially 5416 06663 3067 DCA WORD ; clear the total 5417 06664 3072 DCA DIGITS ; and the digit counter 5418 06665 6205 .PUSHJ @ZSPACMP ; ignore any leading blanks 06666 5513 5419 5420 ; Check for a decimal digit... 5421 06667 1373 DECNW1: TAD [-"0"] ; compare it to zero 5422 06670 7510 SPA ; ??? 5423 06671 5313 JMP DECNW2 ; it's not a digit -- quit 5424 06672 1372 TAD [-9.] ; then compare it to the other end 5425 06673 7740 SMA SZA CLA ; ??? 5426 06674 5313 JMP DECNW2 ; still not a digit 5427 5428 ; Accumulate another decimal digit... 5429 06675 1067 TAD WORD ; get the old total 5430 06676 7104 CLL RAL ; multiply it by two 5431 06677 3067 DCA WORD ; and save that 5432 06700 1067 TAD WORD ; ... 5433 06701 7104 CLL RAL ; then multiply it by 4 more 5434 06702 7104 CLL RAL ; (for a total of 8) 5435 06703 1067 TAD WORD ; because 8x + 2x = 10x 5436 06704 1052 TAD SAVCHR ; then add the new digit 5437 06705 1373 TAD [-"0"] ; and correct for ASCII characters 5438 06706 3067 DCA WORD ; remember that for next time 5439 5440 ; Read the next digit and proceed... 5441 06707 2072 ISZ DIGITS ; remember one more digit processed 5442 06710 6205 .PUSHJ @ZGET ; get the next character 06711 5520 5443 06712 5267 JMP DECNW1 ; then keep trying 5444 5445 ; Here when we find something which isn't a digit... 5446 06713 7200 DECNW2: CLA ; ... 5447 06714 1072 TAD DIGITS ; get the digit count 5448 06715 7650 SNA CLA ; it has to be at least one 5449 06716 5530 JMP @ZCOMERR ; that's an error if it isn't 5450 06717 6225 .POPJ ; and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 133 Scan Octal Numbers bts6120.plx 5451 .TITLE Scan Octal Numbers 5452 5453 5454 ; This routine will read an octal number from the command line and return 5455 ; its value in location WORD. The value is usually limited to twelve bits, 5456 ; however any overflow bits will be left in location WORDH. This is intended 5457 ; for use by the OCTNF routine to extract the field from a 15 bit address. 5458 ; At least one octal digit must be found on the command line or COMERR will be 5459 ; called, and the first non-digit character found will be returned in location 5460 ; SAVCHR. 5461 06720 7200 OCTNW: CLA ; remove any junk 5462 06721 3067 DCA WORD ; clear the partial total 5463 06722 3072 DCA DIGITS ; we haven't read any digits yet 5464 06723 6205 .PUSHJ @ZSPACMP ; ignore any leading spaces 06724 5513 5465 5466 ; Check for an octal digit next... 5467 06725 1373 OCTN1: TAD [-"0"] ; compare it to a zero 5468 06726 7510 SPA ; ??? 5469 06727 5350 JMP OCTN2 ; this one isn't a digit 5470 06730 1371 TAD [-7] ; now compare to the high end of the range 5471 06731 7740 SMA SZA CLA ; ??? 5472 06732 5350 JMP OCTN2 ; still not a digit 5473 5474 ; Now accumulate another digit. 5475 06733 1067 TAD WORD ; get the previous total 5476 06734 3070 DCA WORDH ; and remember that for OCTNF 5477 06735 1067 TAD WORD ; then again 5478 06736 7006 RTL ; shift it left 3 bits 5479 06737 7004 RAL ; ... 5480 06740 0370 AND [7770] ; then insure that no junk has wrapped around 5481 06741 1052 TAD SAVCHR ; add the next digit 5482 06742 1373 TAD [-"0"] ; and correct for ASCII values 5483 06743 3067 DCA WORD ; remember the new total 5484 06744 2072 ISZ DIGITS ; also remember how many digits we read 5485 06745 6205 .PUSHJ @ZGET ; read the next character 06746 5520 5486 06747 5325 JMP OCTN1 ; then go look for more 5487 5488 ; Here when we find something which isn't a digit... 5489 06750 7200 OCTN2: CLA ; ... 5490 06751 1072 TAD DIGITS ; see how many digits we've read 5491 06752 7650 SNA CLA ; there must be at least one 5492 06753 5530 JMP @ZCOMERR ; nope -- this isn't legal 5493 06754 6225 .POPJ ; and return that in the AC 5494 06770 7770 06771 7771 06772 7767 06773 7720 06774 0133 06775 7746 06776 0101 06777 7677 5495 07000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 134 Scan 15 Bit Addresses bts6120.plx 5496 .TITLE Scan 15 Bit Addresses 5497 5498 5499 ; This routine will read a 15 bit address from the command. The lower 12 5500 ; bits of the address are always left in location WORD, and the upper 3 bits 5501 ; will be in location ADRFLD, properly justified. If the user types 5 or more 5502 ; digits in the octal address, the lower 12 bits becomes the address, and the 5503 ; next 3 most significant bits are the field. If his octal number has 4 or 5504 ; fewer digits, the field will be the current data field instead. For example, 5505 ; (assume that the current DF is 3): 5506 ; 5507 ; 1234 --> Location 1234, field 3 5508 ; 01234 --> Location 1234, field 0 5509 ; 41234 --> Location 1234, field 4 5510 ; 5641234 --> Location 1234, field 4 5511 ; 5512 ; Like the OCTNW routine, this routine will return the low order 12 bits 5513 ; in location WORD. There is an alternate entry point at location OCTNI; this 5514 ; is identical to OCTNF, except that the instruction field, not the data field, 5515 ; provides the default field number... 5516 5517 ; Here to read an address in the instruction field... 5518 07000 7200 OCTNI: CLA ; ... 5519 07001 1002 TAD UFLAGS ; use the instruction field as default 5520 07002 0136 AND ZK70 ; ... 5521 07003 5210 JMP OCTNF1 ; then proceed normally 5522 5523 ; Here to read an address in the data field... 5524 07004 7200 OCTNF: CLA ; ... 5525 07005 1002 TAD UFLAGS ; use the data field as the default 5526 07006 7014 R3L ; ... 5527 07007 0136 AND ZK70 ; ... 5528 07010 3040 OCTNF1: DCA ADRFLD ; and save the default for later 5529 07011 6205 .PUSHJ @ZOCTNW ; read a normal octal number 07012 5521 5530 07013 7200 CLA ; we don't care about this part 5531 07014 1072 TAD DIGITS ; see how many digits there were 5532 07015 1377 TAD [-5] ; we need at least 5 5533 07016 7710 SPA CLA ; ??? 5534 07017 6225 .POPJ ; there weren't that many -- use the default 5535 5536 ; Extract the upper 3 bits of the address... 5537 07020 1070 TAD WORDH ; get the high order bits 5538 07021 7002 BSW ; then put the upper 3 bits in the right place 5539 07022 0136 AND ZK70 ; trim it to just the important bits 5540 07023 3040 DCA ADRFLD ; then that is the new data field (temporarily) 5541 07024 6225 .POPJ ; that's all folks PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 135 Ask For Confirmation bts6120.plx 5542 .TITLE Ask For Confirmation 5543 5544 5545 ; This routine will type a question mark and then wait for the operator to 5546 ; enter a "Y" (or "y") to confirm. It's used by exceptionally dangerous 5547 ; commands, like FORMAT, and normally the caller will type a short string 5548 ; (e.g. "Format unit 0" before actually calling this function. If the 5549 ; operator does confirm, it will return with the link set. If the operator 5550 ; types anything other than "Y" or "y", it will return with the link clear. 5551 ; Note that it's also acceptable to just type Control-C to abort! 5552 07025 6205 CONFRM: .PUSHJ @[TQUEST] ; type a question mark 07026 5776 5553 07027 6205 CONF1: .PUSHJ @ZINCHRS ; go get a character of input 07030 5512 5554 07031 7450 SNA ; did we get anything ? 5555 07032 5227 JMP CONF1 ; nope - keep waiting 5556 07033 3052 DCA SAVCHR ; we got a real character - save it 5557 07034 1052 TAD SAVCHR ; and echo it back to the terminal 5558 07035 6205 .PUSHJ @ZOUTCHR ; ... 07036 5476 5559 07037 6205 .PUSHJ @ZCRLF ; followed by a CRLF 07040 5510 5560 5561 ; See what his answer was... 5562 07041 1052 TAD SAVCHR ; get the answer once more 5563 07042 1375 TAD [-"Y"] ; is it a "Y" 5564 07043 7450 SNA ; ??? 5565 07044 5252 JMP CONF2 ; yes - return with the link set 5566 07045 1374 TAD ["Y"-"y"] ; or a "y"? 5567 07046 7450 SNA ; ??? 5568 07047 5252 JMP CONF2 ; yes - same thing 5569 07050 7300 CLA CLL ; nope - return FALSE 5570 07051 6225 .POPJ 5571 5572 ; Here if he answered "Y" or "y"... 5573 07052 7320 CONF2: CLA STL ; return TRUE 5574 07053 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 136 Type Special Characters bts6120.plx 5575 .TITLE Type Special Characters 5576 5577 5578 ; This routine will simulate a TAB on the terminal, which it does by typing 5579 ; spaces until the horizontal position reaches a multiple of 8 characters. 5580 ; Note that this routine will always type at least one space. The AC is 5581 ; always cleared by this routine. 5582 07054 6205 TTABC: .PUSHJ TSPACE ; Always type at least one space 07055 5263 5583 07056 1055 TAD HPOS ; Get the current horizontal position 5584 07057 0137 AND ZK7 ; Is it a multiple of 8 ?? 5585 07060 7640 SZA CLA ; ??? 5586 07061 5254 JMP TTABC ; No -- keep typing 5587 07062 6225 .POPJ ; Yes -- we can stop now 5588 5589 ; This routine will type a space on the terminal. 5590 07063 7200 TSPACE: CLA ; Clear the AC 5591 07064 1373 TAD [" "] ; And load a space character 5592 07065 5772 JMP @[THCHAR] ; Then type it and return 5593 5594 ; This routine will type a question mark on the terminal. 5595 07066 7200 TQUEST: CLA ; ... 5596 07067 1371 TAD ["?"] ; ... 5597 07070 5772 JMP @[THCHAR] ; ... 5598 5599 ; This routine will type a BELL character on the terminal. 5600 07071 7200 TBELL: CLA ; ... 5601 07072 1370 TAD [CHBEL] ; Get a bell character 5602 07073 5767 JMP @[TFCHAR] ; Then type it out 5603 5604 ; Type a slash (used as an address separator) on the terminal. 5605 07074 7200 TSLASH: CLA ; ... 5606 07075 1366 TAD ["/"] ; ... 5607 07076 5772 JMP @[THCHAR] ; ... 5608 5609 ; Type a dot (used for decimal numbers and disk addresses) on the terminal. 5610 07077 7200 TDOT: CLA ; ... 5611 07100 1365 TAD ["."] ; ... 5612 07101 5772 JMP @[THCHAR] ; ... 5613 5614 ; Convert the value in the AC to a decimal digit and type it... 5615 07102 1364 TDIGIT: TAD ["0"] ; make it ASCII 5616 07103 5772 JMP @[THCHAR] ; type it and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 137 Type Carriage Return, Line Feed and Backspace bts6120.plx 5617 .TITLE Type Carriage Return, Line Feed and Backspace 5618 5619 5620 ; This routine will type a carriage return, line feed pair on the terminal 5621 ; and it will correctly update HPOS to show that the cursor is now at the left 5622 ; margin. In addition, it will keep count of the number of CRLFs output in 5623 ; location VPOS, and when the terminal's screen is full (as indicated by VPOS 5624 ; equals LENGTH) it will cause an automatic XOFF. The AC is always cleared 5625 ; on return. 5626 07104 7200 CRLF: CLA ; be sure the AC is cleared 5627 07105 1363 TAD [CHCRT] ; get a return character 5628 07106 6205 .PUSHJ @[TFCHAR] ; and type that out 07107 5767 5629 07110 3055 DCA HPOS ; remember that the cursor is in column zero 5630 5631 ; Now check the vertical position of the cursor... 5632 07111 2056 ISZ VPOS ; increment the current position 5633 07112 7000 NOP ; ... 5634 07113 1031 TAD LENGTH ; get the size of the screen 5635 07114 7450 SNA ; is it zero ?? 5636 07115 5327 JMP CRLF1 ; yes -- never stop 5637 07116 7041 CIA ; no -- make it negative 5638 07117 1056 TAD VPOS ; and compare it to the current location 5639 07120 7710 SPA CLA ; is the screen full ?? 5640 07121 5327 JMP CRLF1 ; no -- proceed 5641 07122 3056 DCA VPOS ; yes -- clear the vertical position 5642 07123 6205 .PUSHJ @[TBELL] ; type a bell character 07124 5762 5643 07125 7240 STA ; then load a -1 into the AC 5644 07126 3054 DCA XOFF ; and cause an automatic XOFF 5645 5646 ; Type the line feed next... 5647 07127 1361 CRLF1: TAD [CHLFD] ; now get a line feed 5648 07130 5767 JMP @[TFCHAR] ; type that and return 5649 5650 ; This routine will type a BACKSPACE character on the terminal and update 5651 ; HPOS to show the new cursor position. It will not allow you to backspace 5652 ; beyond the left margin of the temrinal. The AC is always cleared on return. 5653 07131 7240 TBACKS: STA ; load the AC with -1 5654 07132 1055 TAD HPOS ; and decrement HPOS 5655 07133 7510 SPA ; are we going to pass the left margin ?? 5656 07134 5341 JMP BACKS1 ; yes -- don't type anything 5657 07135 3055 DCA HPOS ; no -- update HPOS 5658 07136 1360 TAD [CHBSP] ; then get a backspace character 5659 07137 6205 .PUSHJ @[TFCHAR] ; and type that out 07140 5767 5660 07141 7200 BACKS1: CLA ; clear the AC 5661 07142 6225 .POPJ ; and that's all 5662 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 10-MAY-18 23:00:32 Page 138 Type Carriage Return, Line Feed and Backspace bts6120.plx 5663 07200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 139 Read Command Lines bts6120.plx 5664 .TITLE Read Command Lines 5665 5666 5667 ; This routine will read a single command line from the user and store the 5668 ; text of the line, one character per word and terminated by a null character, 5669 ; in the array at CMDBUF. The size of CMDBUF, and therefore the maximum 5670 ; length of a command, is given by MAXCMD and is normally a page (128 words). 5671 ; An auto-index register, L, is set aside just for the purpose of indexing the 5672 ; command buffer and when it returns this routine will always leave L set up 5673 ; to point to the beginning of the command. 5674 ; 5675 ; While it is reading the command, this routine will recognize these control 5676 ; characters: 5677 ; 5678 ; Control-C --> Abort the command 5679 ; Control-R --> Retype the current line, including corrections 5680 ; Control-U --> Erase the current line and start over again 5681 ; DELETE --> Erase the last character (echos the last character typed) 5682 ; BACKSPACE --> Erase the last character on a CRT 5683 ; Return --> Terminates the current command 5684 ; Line Feed --> " " " " 5685 ; ESCAPE --> " " " " 5686 ; 5687 ; When this routine is called, the AC should contain the prompting 5688 ; character. 5689 ; 5690 ; The calling sequence for INCHWL goes something like this: 5691 ; 5692 ; TAD ["x"] ; load the prompting character 5693 ; .PUSHJ @[INCHWL] ; and initialize the command scanner 5694 ; NXTCHR: .PUSHJ @[INCHW1] ; read and process the next character 5695 ; SNA CLA ; did we find the EOL? 5696 ; JMP NEXT ; no - keep processing 5697 ; 5698 ; 5699 ; The reason for this rather awkward sequence is that it allows the caller 5700 ; to add background processing to the character input loop (by inserting 5701 ; it at NXTCHR:). The main command scanner, for example, uses this to 5702 ; poll the front panel switches while we're waiting for input. 5703 5704 ; Call here first to initialize the scanner... 5705 07200 3144 INCHWL: DCA PROMPT ; remember the prompt character 5706 07201 1377 TAD [CMDBUF-1] ; point to the line buffer 5707 07202 3013 DCA L ; and initialize the pointer 5708 07203 3143 DCA CMDLEN ; say that this command is zero characters 5709 07204 3054 DCA XOFF ; clear the XOFF and 5710 07205 3053 DCA CTRLO ; control-O flags... 5711 07206 1144 TAD PROMPT ; get the prompting address back again 5712 07207 5476 JMP @ZOUTCHR ; type the prompt and return 5713 5714 ; Then call here to read and process the next character... 5715 07210 6205 INCHW1: .PUSHJ @ZINCHRS ; try to read something from the console 07211 5512 5716 07212 7450 SNA ; did we get anything ?? 5717 07213 6225 .POPJ ; no - return with the AC cleared 5718 07214 3052 DCA SAVCHR ; save this character for a while 5719 07215 3054 DCA XOFF ; then clear the XOFF, 5720 07216 3053 DCA CTRLO ; control-O, and 5721 07217 3056 DCA VPOS ; automatic XOFF flags 5722 07220 1052 TAD SAVCHR ; get the character back 5723 07221 1140 TAD ZMSPACE ; compare this to a space 5724 07222 7510 SPA ; ??? 5725 07223 5242 JMP INCHW3 ; this is a control character 5726 07224 1376 TAD [" "-177] ; is this a DELETE character ? 5727 07225 7650 SNA CLA ; ??? PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 140 Read Command Lines bts6120.plx 5728 07226 5335 JMP INCHW8 ; yes -- go do that 5729 5730 ; Here to process a normal character... 5731 07227 1143 INCHW2: TAD CMDLEN ; get the length of this line 5732 07230 1375 TAD [-MAXCMD] ; and compare to the maximum 5733 07231 7700 SMA CLA ; are we already full ?? 5734 07232 5356 JMP INCH10 ; yes -- don't store this character 5735 07233 1052 TAD SAVCHR ; get the character back 5736 07234 6205 .PUSHJ @ZOUTCHR ; and echo it to the terminal 07235 5476 5737 07236 1052 TAD SAVCHR ; get the character again 5738 07237 3413 DCA @L ; store it in the line 5739 07240 2143 ISZ CMDLEN ; the command is one character longer now 5740 07241 5210 JMP INCHW1 ; and go get the next one 5741 5742 ; Here to handle a control-R command... 5743 07242 1374 INCHW3: TAD [" "-CHCTR] ; is this really a control-R ?? 5744 07243 7440 SZA ; ??? 5745 07244 5264 JMP INCHW4 ; no -- Proceed 5746 07245 3413 DCA @L ; yes -- close the command buffer 5747 07246 1373 TAD [CHCTR] ; get the control-R character back 5748 07247 6205 .PUSHJ @ZOUTCHR ; and echo that to the terminal 07250 5476 5749 07251 6205 .PUSHJ @ZCRLF ; start a new line 07252 5510 5750 07253 1144 TAD PROMPT ; get the prompt character first 5751 07254 6205 .PUSHJ @ZOUTCHR ; and always type that too 07255 5476 5752 07256 1377 TAD [CMDBUF-1] ; point to the current command 5753 07257 6205 .PUSHJ @[TASCIZ] ; and echo the entire line back 07260 5772 5754 07261 6205 .PUSHJ @ZBACKUP ; backup L over the null we put there 07262 5515 5755 07263 5210 JMP INCHW1 ; finally continue typing 5756 5757 ; Here to handle a Control-U character... 5758 07264 1371 INCHW4: TAD [CHCTR-CHCTU] ; is this really a Control-U character ?? 5759 07265 7440 SZA ; ??? 5760 07266 5275 JMP INCHW5 ; no -- keep trying 5761 07267 1370 TAD [CHCTU] ; yes -- get the character back again 5762 07270 6205 .PUSHJ @ZOUTCHR ; and echo that to the operator 07271 5476 5763 07272 6205 .PUSHJ @ZCRLF ; then start on a new line 07273 5510 5764 07274 5201 JMP INCHWL+1 ; and go start all over again 5765 5766 ; Here to handle a BACKSPACE character... 5767 07275 1367 INCHW5: TAD [CHCTU-CHBSP] ; is that what this is ?? 5768 07276 7440 SZA ; ??? 5769 07277 5312 JMP INCHW6 ; nope, not yet 5770 07300 1143 INCHBS: TAD CMDLEN ; yes -- get the length of this command 5771 07301 7650 SNA CLA ; is it a null line ?? 5772 07302 5210 JMP INCHW1 ; yes -- there's nothing to delete 5773 07303 6205 .PUSHJ @ZBACKS ; yes, type a backspace 07304 5500 5774 07305 6205 .PUSHJ @ZTSPACE ; then type a space 07306 5477 5775 07307 6205 .PUSHJ @ZBACKS ; and another backspace 07310 5500 5776 07311 5350 JMP INCHW9 ; finally join with the DELETE code 5777 5778 ; Here to check for line terminators... 5779 07312 1366 INCHW6: TAD [CHBSP-CHCRT] ; is this a return ?? 5780 07313 7450 SNA ; ??? 5781 07314 5326 JMP INCHW7 ; yes -- this line is done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 141 Read Command Lines bts6120.plx 5782 07315 1365 TAD [CHCRT-CHLFD] ; no -- Is it a line feed then ? 5783 07316 7450 SNA ; ??? 5784 07317 5326 JMP INCHW7 ; yes -- That's just as good 5785 07320 1364 TAD [CHLFD-CHESC] ; no -- How about an escape ? 5786 07321 7640 SZA CLA ; ??? 5787 07322 5227 JMP INCHW2 ; no -- just store this control character 5788 5789 ; Here to finish a command... 5790 07323 1363 TAD [CHESC] ; get the ESCAPE code back 5791 07324 6205 .PUSHJ @ZOUTCHR ; and echo that to the terminal 07325 5476 5792 07326 6205 INCHW7: .PUSHJ @ZCRLF ; then close the input line 07327 5510 5793 07330 3413 DCA @L ; end the command with a null byte 5794 07331 1377 TAD [CMDBUF-1] ; and then backup the pointer 5795 07332 3013 DCA L ; to the start of the command 5796 07333 7240 STA ; return with the AC non-zero 5797 07334 6225 .POPJ ; that's all there is to it 5798 5799 ; Here to process a DELETE character... 5800 07335 1032 INCHW8: TAD SCOPE ; is the scope flag set? 5801 07336 7640 SZA CLA 5802 07337 5300 JMP INCHBS ; yes - treat as a backspace 5803 07340 1143 TAD CMDLEN ; get the command length 5804 07341 7650 SNA CLA ; is this a null command ?? 5805 07342 5210 JMP INCHW1 ; yes -- there's nothing to delete 5806 07343 6205 .PUSHJ @ZBACKUP ; decrement the line pointer 07344 5515 5807 07345 1413 TAD @L ; get the last character stored 5808 07346 6205 .PUSHJ @ZOUTCHR ; and echo that for the DELETE 07347 5476 5809 5810 ; Now delete the last character typed... 5811 07350 6205 INCHW9: .PUSHJ @ZBACKUP ; decrement the line pointer 07351 5515 5812 07352 7240 STA ; then fix the command length too 5813 07353 1143 TAD CMDLEN ; ... 5814 07354 3143 DCA CMDLEN ; ... 5815 07355 5210 JMP INCHW1 ; finally go get the next character 5816 5817 ; Here if the command line is full -- echo a bell instead... 5818 07356 6205 INCH10: .PUSHJ @[TBELL] ; go type a bell character 07357 5762 5819 07360 5210 JMP INCHW1 ; then go wait for something to do 5820 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 5821 07400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 142 Terminal Output Primitives bts6120.plx 5822 .TITLE Terminal Output Primitives 5823 5824 5825 ; This routine will type the character in the AC on on the terminal. If the 5826 ; character is a printing character, it will be typed normally. If this 5827 ; character is happens to be a DELETE or NULL code (ASCII codes 00 and 7F), 5828 ; it will be ignored. If the character is a TAB, it is simulated by calling 5829 ; the TTABC routine. Finally, if it is any other control character, it is 5830 ; converted to the familiar ^x representation (unless it is an ESCAPE code, 5831 ; which, by tradition, is typed as $). This routine cannot be used to type 5832 ; carriage returns, line feeds, bells, or other control characters that are 5833 ; to be output literally. The AC is always cleared on return. 5834 07400 7450 OUTCHR: SNA ; first see if this character is a null 5835 07401 6225 .POPJ ; just drop it if it is 5836 07402 1140 TAD ZMSPACE ; see if this is a control character 5837 07403 7500 SMA ; skip if it is a control code 5838 07404 5226 JMP OUTCH3 ; just type a normal character 5839 5840 ; Here to type a TAB character... 5841 07405 1377 TAD [" "-CHTAB] ; is this really a TAB character at all ?? 5842 07406 7440 SZA ; ??? 5843 07407 5211 JMP OUTCH1 ; no -- check further 5844 07410 5776 JMP @[TTABC] ; yes -- type a TAB and return 5845 5846 ; Here to print an ESCAPE character... 5847 07411 1375 OUTCH1: TAD [CHTAB-CHESC] ; is this an ESCAPE character ?? 5848 07412 7440 SZA ; ??? 5849 07413 5216 JMP OUTCH2 ; no -- go type the ^x form instead 5850 07414 1374 TAD ["$"] ; yes -- type a dollar sign for an ESCAPE 5851 07415 5227 JMP THCHAR ; then type it and return 5852 5853 ; Here to print a control character... 5854 07416 6215 OUTCH2: .PUSH ; save the character for a while 5855 07417 7200 CLA ; and get the flag character 5856 07420 1373 TAD ["^"] ; ... 5857 07421 6205 .PUSHJ TFCHAR ; type that first 07422 5244 5858 07423 6235 .POP ; then get the character back 5859 07424 1372 TAD [CHESC+"@"] ; convert it to a printing character 5860 07425 5227 JMP THCHAR ; type that and return 5861 5862 ; Here to print a normal character... 5863 07426 1371 OUTCH3: TAD [" "] ; restore the original character 5864 ; and fall into THCHAR 5865 5866 5867 ; This routine will type a printing character and, while doing this, it will 5868 ; keep track of the horizontal position of the cursor. If it passes the line 5869 ; length of the terminal, a free carriage return is also typed. The terminal's 5870 ; horizontal position (HPOS) is also used for the tab simulation. The 5871 ; character to be typed should be in the AC, the AC will be cleared on return. 5872 07427 6215 THCHAR: .PUSH ; save the character for a while 5873 07430 2055 ISZ HPOS ; and incrment the horizontal position 5874 07431 7200 CLA ; get the maximum width allowed 5875 07432 1030 TAD WIDTH ; ... 5876 07433 7450 SNA ; is it zero ?? 5877 07434 5243 JMP THCHA1 ; yes -- no automatic carriage returns, then 5878 07435 7041 CMA CIA ; make it negative 5879 07436 1055 TAD HPOS ; and compare to the terminal cursor position 5880 07437 7710 SPA CLA ; have we reached the end of the line ?? 5881 07440 5243 JMP THCHA1 ; no -- proceed normally 5882 07441 6205 .PUSHJ @ZCRLF ; yes -- force a carriage return first 07442 5510 5883 07443 6235 THCHA1: .POP ; then get the character back 5884 ; and fall into TFCHAR PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 143 Terminal Output Primitives bts6120.plx 5885 5886 5887 ; This routine will type a single character from the AC on the terminal. 5888 ; Before it types the character, this routine will check the state of the 5889 ; CNTRLO and XOFF flags. If a Control-O has been typed, the character is 5890 ; discarded and not typed on the terminal. If an XOFF has been typed, the 5891 ; output will be suspended until the user types an XON character (or a 5892 ; Control-O or Control-C). 5893 07444 6215 TFCHAR: .PUSH ; save the character for a while 5894 07445 6205 TFCHA1: .PUSHJ INCHRS ; check the operator for input 07446 5277 5895 07447 7200 CLA ; we don't care if anything was typed 5896 07450 1053 TAD CTRLO ; get the Control-O flag byte 5897 07451 7640 SZA CLA ; is it zero ?? 5898 07452 5260 JMP TFCHA2 ; no -- just throw this character away 5899 07453 1054 TAD XOFF ; now test the XOFF flag 5900 07454 7640 SZA CLA ; is the output suspended ?? 5901 07455 5245 JMP TFCHA1 ; wait for something to happen if we are XOFFed 5902 5903 ; Here when it is OK to type the character... 5904 07456 6235 .POP ; get the character back 5905 07457 5263 JMP CONOUT ; and send it to the UART 5906 5907 ; Here to return without typing anything... 5908 07460 6235 TFCHA2: .POP ; clean up the stack 5909 07461 7200 CLA ; but always return zero 5910 07462 6225 .POPJ ; and just quit 5911 5912 ; This routine will output a character from the AC to the terminal, with no 5913 ; no special processing of any kind. It simply waits for the console flag to 5914 ; set and then send the character. However, If the flag does not set in a 5915 ; reasonable amount of time then this routine will force the character out 5916 ; anyway. This prevents the monitor from hanging if the terminal flag is 5917 ; cleared by the user's program. 5918 ; 5919 ; The timeout loop requires 26 minor cycles which, with a 4.9152Mhz clock, 5920 ; takes 10.5 microseconds. If we simply clear the timeout counter when we 5921 ; start we'll get a timeout after 4096 counts, or about 43 milliseconds. 5922 ; If we assume that 300 baud is the slowest console we'll ever use, then 5923 ; that's just about right (at 300 baud a character takes about 33 milliseconds 5924 ; to transmit!). 5925 ; 5926 07463 3276 CONOUT: DCA CONCHR ; remember the character to send 5927 07464 3057 DCA IRMA ; and clear the timeout timer 5928 5929 ; See if the flag is set and send the character if so... 5930 07465 6041 CONOU1: TSF ; [9] is the flag set ??? 5931 07466 5273 JMP CONOU3 ; [4] no -- go check the timeout 5932 07467 1276 CONOU2: TAD CONCHR ; yes -- get the character 5933 07470 6046 TLS ; and send it to the console 5934 07471 7200 CLA ; a _real_ TLS doesn't clear the AC!! 5935 ;; .POPJ ; ... 5936 07472 5770 JMP @[UPDISI] ; keep the front panel display alive and exit 5937 5938 ; Here if the flag is not yet set... 5939 07473 2057 CONOU3: ISZ IRMA ; [9] have we waited long enough ??? 5940 07474 5265 JMP CONOU1 ; [4] no -- wait a little longer 5941 07475 5267 JMP CONOU2 ; yes -- force the character out anyway 5942 5943 ; Temporary storage for the CONOUT routine... 5944 07476 CONCHR: .BLOCK 1 ; a place to save the console character PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 144 Terminal Input Primitives bts6120.plx 5945 .TITLE Terminal Input Primitives 5946 5947 5948 ; This routine is called to check for operator input. It will test to see 5949 ; if the operator has typed a character. If he has not, this routine returns 5950 ; with the AC cleared and nothing else happens. If he has, this routine checks 5951 ; to see if the character is one of Control-C, Control-O, Control-S or 5952 ; Control-Q because these characters have special meaning and are acted upon 5953 ; immediately. If the input character is anything else, the character is 5954 ; returned in the AC. 5955 07477 6205 INCHRS: .PUSHJ @[UPDISI] ; keep the front panel display alive 07500 5770 5956 07501 6205 .PUSHJ CONIN ; try to read a character from the terminal 07502 5352 5957 07503 0135 AND ZK177 ; ignore the parity bit here 5958 07504 7450 SNA ; is this a null character ?? 5959 07505 6225 .POPJ ; yes -- just ignore it 5960 5961 ; Here process a control-C character -- restart the monitor... 5962 07506 1367 TAD [-CHCTC] ; is this really a control-C ?? 5963 07507 7440 SZA ; ??? 5964 07510 5317 JMP INCHR1 ; no -- proceed 5965 07511 3053 DCA CTRLO ; yes -- clear the control-O 5966 07512 3054 DCA XOFF ; and XOFF flags 5967 07513 1366 TAD [CHCTC] ; get another control-C character 5968 07514 6205 .PUSHJ @ZOUTCHR ; echo it to the terminal 07515 5476 5969 07516 5527 JMP @ZRESTA ; and go restart the monitor 5970 5971 ; Here to check for a control-O character... 5972 07517 1365 INCHR1: TAD [CHCTC-CHCTO] ; compare to a control-O character 5973 07520 7440 SZA ; is this it ?? 5974 07521 5334 JMP INCHR2 ; no -- keep checking 5975 07522 3054 DCA XOFF ; control-O always clears the XOFF flag 5976 07523 1364 TAD [CHCTO] ; get another control-O character 5977 07524 6205 .PUSHJ @ZOUTCHR ; and echo that 07525 5476 5978 07526 6205 .PUSHJ @ZCRLF ; then close the line 07527 5510 5979 07530 1053 TAD CTRLO ; get the current state of the control-O flag 5980 07531 7040 CMA ; and complement it 5981 07532 3053 DCA CTRLO ; that's the new value 5982 07533 6225 .POPJ ; return with the AC cleared 5983 5984 ; Here to check for a control-S character... 5985 07534 1363 INCHR2: TAD [CHCTO-CHXOF] ; is this a control-S ?? 5986 07535 7440 SZA ; ??? 5987 07536 5342 JMP INCHR3 ; nope, try again 5988 07537 7240 STA ; yes -- get a -1 into the AC 5989 07540 3054 DCA XOFF ; and set the XOFF flag 5990 07541 6225 .POPJ ; return with the AC cleared 5991 5992 ; Here to check for a control-Q character... 5993 07542 1362 INCHR3: TAD [CHXOF-CHXON] ; is this a control-Q ?? 5994 07543 7440 SZA ; ??? 5995 07544 5350 JMP INCHR4 ; no -- just give up 5996 07545 3054 DCA XOFF ; yes -- clear the XOFF flag 5997 07546 3056 DCA VPOS ; also clear the automatic XOFF counter 5998 07547 6225 .POPJ ; return with the AC cleared 5999 6000 ; Here if the character is nothing special... 6001 07550 1361 INCHR4: TAD [CHXON] ; restore the state of the AC 6002 07551 6225 .POPJ ; and return the character in the AC 6003 6004 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 145 Terminal Input Primitives bts6120.plx 6005 ; This routine will read a single character from the console UART. If no 6006 ; character is currently ready, it will return a null (zero) byte in the AC, 6007 ; but otherwise the character read is left in the AC... 6008 07552 7200 CONIN: CLA ; be sure the AC is cleared 6009 07553 6031 KSF ; is a character ready ?? 6010 07554 6225 .POPJ ; no -- just return zero 6011 07555 6036 KRB ; yes -- read it into the AC 6012 07556 6225 .POPJ ; then return that in the AC 6013 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 6014 07600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 146 Control Panel Entry Points bts6120.plx 6015 .TITLE Control Panel Entry Points 6016 6017 07600 .ORG 7600 6018 6019 ; There's a little bit of chicanery that goes on here (when have you seen 6020 ; a PDP-8 program without that???). After a power on clear or a hard reset, 6021 ; the HM6120 starts executing at location 7777 of panel memory which, in 6022 ; the case of the SBC6120, is part of the EPROM. The EPROM code at this 6023 ; location always jumps to the system initialization routine without even 6024 ; trying to figure out why we entered panel mode. 6025 ; 6026 ; The system initialization code copies all of the EPROM contents to panel 6027 ; RAM and then disables the EPROM forever. After that it actually changes 6028 ; the vector at location 7777 to point to the CPSAVE routine, which is the 6029 ; normal panel entry point for traps, halts, etc. 6030 7600 .VECTOR CPBOOT ; set the 6120 start up vector at 7777 6031 07600 6213 CPBOOT: CXF 1 ; the startup code lives in field 1 6032 07601 5776 JMP @[SYSINI] ; and away we go! 6033 6034 6035 ; Excluding a hardware reset, the 6120 will enter control panel mode for any 6036 ; of three other reasons: 6037 ; 6038 ; * any of the PR0..PR3 instructions were executed in main memory 6039 ; * the CPU was halted, either by a HLT instruction or by the RUN/HLT input 6040 ; * a panel interrupt was requested by the CPREQ pin 6041 ; 6042 ; In all the these cases, the 6120 was presumably executing some important 6043 ; program in main memory before it was interrupted, and we need to save the 6044 ; state of that program before doing anything else. When the 6120 enters 6045 ; panel mode it saves the last main memory PC in panel memory location 0 and 6046 ; then starts executing instructions in panel memory at 7777. The remainder of 6047 ; the main memory context (e.g. AC, MQ, flags, etc) we have to save manually. 6048 07602 3001 CPSAVE: DCA UAC ; save the AC 6049 07603 6256 GCF ; and the flags (including LINK, IF and DF) 6050 07604 3002 DCA UFLAGS ; ... 6051 07605 7501 MQA ; the MQ 6052 07606 3003 DCA UMQ ; ... 6053 07607 6207 RSP1 ; 6120 stack pointer #1 6054 07610 3004 DCA USP1 ; ... 6055 07611 6227 RSP2 ; " " " #2 6056 07612 3005 DCA USP2 ; .. 6057 6058 ; Now set up enough context so that this monitor can run. The CONT routine 6059 ; has saved in location STKSAV our last stack pointer before the main memory 6060 ; program was started and, if we're single stepping the main memory program, 6061 ; we're going to need that so that we can continue what we were doing. In 6062 ; the case of other traps the RESTA routine gets called which will reset the 6063 ; stack pointer. 6064 07613 1145 TAD STKSAV ; get the monitor's last known stack pointer 6065 07614 6217 LSP1 ; and restore that 6066 07615 6203 CXF 0 ; set both DF and IF to field zero 6067 07616 5775 JMP @[.+1] ; update the IF and clear the FZ flag 6068 07617 6276 SPD ; make indirect cycles access panel memory 6069 07620 3056 DCA VPOS ; reset the automatic XOFF line counter 6070 07621 6441 POST+1 ; show post code #1 6071 6072 ; Finally, we can determine the exact reason for entry into panel mode by 6073 ; reading the panel status flags with the PRS instruction, and that will tell 6074 ; us where to go next. Be careful, though, because executing PRS clears the 6075 ; flags so we only get to do it once! This code kind of assumes that only one 6076 ; of these flags can be set at any time - I believe that's true for the 6120. 6077 07622 6000 PRS ; get the reason for panel entry 6078 07623 7004 RAL ; BTSTRP -> LINK, PNLTRP -> AC0 6079 07624 7510 SPA ; test PNLTRP first PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 147 Control Panel Entry Points bts6120.plx 6080 07625 5253 JMP PNLTRP ; yes - a PRn instruction was trapped 6081 07626 7430 SZL ; next check BTSTRP 6082 07627 5236 JMP BTSTRP ; yes - an external CPREQ occurred 6083 07630 7004 RAL ; skip the next bit 6084 07631 7006 RTL ; put PWRON -> LINK, and HLTFLG -> AC0 6085 07632 7510 SPA ; test the HLTFLG bit 6086 07633 5311 JMP HALTED ; yes - a HLT instruction was trapped 6087 ; fall thru if PWRON (or none!) is set 6088 6089 ; If we get here, none of the known panel status bits are set. I don't 6090 ; know what this means, but it can't be good! We also jump here if the 6091 ; PWRON status bit is set. Since this bit can only be set by a hardware 6092 ; reset, and since in the SBC6120 this automatically maps EPROM instead 6093 ; of RAM, we should never see this happen. 6094 07634 4320 PWRON: JMS TRAP ; print a generic 6095 07635 3640 TRPMSG ; "% UNKNOWN TRAP AT ..." message 6096 6097 ; The BTSTRP flag indicates a transition of the CPREQ line, which could 6098 ; indicate that a break was typed on the console terminal, or it could 6099 ; indicate that the front panel (if one is installed) requires service. 6100 07636 BTSTRP: 6101 ; We get a CPREQ if the front panel HALT switch is flipped down (i.e. it 6102 ; makes the RUN -> HALT transition). We treat this case just as we would 6103 ; if a HLT instruction were executed - say "%HALTED AT ..." and start the 6104 ; BTS6120 command scanner. Note that if no front panel hardware is 6105 ; installed the SHSW IOT is a NOP and never skips! 6106 07636 6431 SHSW ; skip on halt switch transition 6107 07637 7410 SKP ; nope... 6108 07640 5311 JMP HALTED ; jump to the halt switch code 6109 ; The SCPT IOT will skip if the 30Hz front panel timer has ticked, which 6110 ; would mean that it's time to update the front panel display. Once again, 6111 ; remember that if no front panel is installed the SCPT IOT is a NOP and 6112 ; never skips, which is fine with us. 6113 07641 6433 SCPT ; skip on 30Hz timer 6114 07642 5246 JMP BTSTR1 ; nope - try something else 6115 07643 6205 .PUSHJ @[UPDISP] ; yes - update the display 07644 5774 6116 07645 5773 JMP @[CONT1] ; and then return to the main program 6117 6118 ; Here for an unknown CPREQ. This could be caused by a framing error 6119 ; (i.e. a BREAK) from the console terminal, or it could be caused by 6120 ; some other (optional) piece or hardware... 6121 07646 7000 BTSTR1: NOP ; patch space for a ROM patch 6122 07647 7000 NOP ; ... 6123 07650 7000 NOP ; ... 6124 07651 4320 JMS TRAP ; print 6125 07652 3604 BRKMSG ; "% BREAK AT ..." and restart 6126 6127 ; The PNLTRP flag indicates that one of the PR0 thru PR3 instructions has 6128 ; been executed, but unfortunately the only way to find out which is to 6129 ; use the last main memory PC to fetch the instruction from memory. Remember 6130 ; that the 6120 will have already incremented the PC by the time we get here, 6131 ; so it's actually one _more_ than the location we want. Currently the PR3 6132 ; instruction is used as a breakpoint trap and PR0 is a generic ROM "monitor 6133 ; call". The other two, PR1 and PR2, are unused. 6134 07653 7240 PNLTRP: STA ; decrement the PC 6135 07654 1000 TAD UPC ; so it points at the actual instruction 6136 07655 3000 DCA UPC ; that caused the trap 6137 07656 1002 TAD UFLAGS ; get the IF at the time of the trap 6138 07657 0136 AND ZK70 ; ... 6139 07660 1271 TAD PNLCDF ; make a CDF instruction out of that 6140 07661 3262 DCA .+1 ; and execute it 6141 07662 7000 NOP ; ... gets overwritten with a CDF ... 6142 07663 6266 CPD ; address main memory with indirect cycles 6143 07664 1000 TAD UPC PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 148 Control Panel Entry Points bts6120.plx 6144 07665 3006 DCA UIRPC 6145 07666 1400 TAD @UPC ; get the opcode that caused the trap 6146 07667 3007 DCA UIR ; and save it for later 6147 07670 6276 SPD ; back to panel memory 6148 07671 6201 PNLCDF: CDF 0 ; always field zero 6149 6150 ; See which instruction it was... 6151 07672 1007 TAD UIR ; get the opcode 6152 07673 1372 TAD [-BPT] ; is it PR3 ?? 6153 07674 7450 SNA ; ??? 6154 07675 5305 JMP BPTTRP ; yes - handle a break point trap 6155 07676 1371 TAD [BPT-PR0] ; no - is it PR0? 6156 07677 6213 CXF 1 ; (the ROM call handler lives in field 1) 6157 07700 7450 SNA ; ??? 6158 07701 5770 JMP @[MCALL] ; yes - handle a monitor call 6159 07702 6203 CXF 0 ; ... 6160 07703 4320 JMS TRAP ; for any others just print a generic 6161 07704 3614 PRNMSG ; "% PANEL TRAP AT ..." message 6162 6163 ; Here for a breakpoint trap... 6164 07705 4320 BPTTRP: JMS TRAP ; print 6165 07706 3547 BPTMSG ; "% BREAKPOINT AT ..." and proceed 6166 6167 ; Here (from field 1) for an illegal PR0 call... 6168 07707 4320 ILLPR0: JMS TRAP ; say 6169 07710 3562 PR0MSG ; "? ILLEGAL PR0 FUNCTION AT ..." 6170 6171 ; We get here when the 6120 halts, but unfortunately there are no less than 6172 ; three different reasons why it night have done this. The first is that the 6173 ; main memory program has executed a HLT (7402, or any microcoded combination 6174 ; there of) instruction. Or, it could be that the 6120 was halted externally 6175 ; by a transition on the HLTREQ input pin, however the SBC6120 has no hardware 6176 ; to do this. Lastly, it could be that the HALT flag was already set when 6177 ; we restarted the main memory program - in this case the 6120 will execute 6178 ; one instruction and trap back here. 6179 ; 6180 ; We use this situation intentionally to single step main memory programs, 6181 ; and we can tell when this happens by checking the SIMFLG flag in memory. 6182 ; This flag is normally cleared, but will be set by the SINGLE routine when we 6183 ; want to single step. In that case the monitor's stack is valid (it was 6184 ; saved to STKSAV by the CONT routine before switching context) and all we 6185 ; have to do is execute a .POPJ to return to the routine that originally 6186 ; called SINGLE. Keep your fingers crossed. 6187 07711 6435 HALTED: RLOF ; turn the RUN LED off 6188 07712 7200 CLA ; ... 6189 07713 1051 TAD SIMFLG ; did we execute a single instruction? 6190 07714 7640 SZA CLA ; ??? 6191 07715 6225 .POPJ ; yes - return from the SINGLE routine now! 6192 07716 4320 JMS TRAP ; otherwise just say 6193 07717 3627 HLTMSG ; "% HALTED AT ..." and restart 6194 6195 ; This routine does most of the generic work of handling traps to panel 6196 ; memory. It prints a message, which is passed inline via a JMS instruction, 6197 ; prints the PC, removes any breakpoints from the program and then restarts 6198 ; the monitor... 6199 07720 0000 TRAP: 0 ; call here with a JMS instruction 6200 07721 6435 RLOF ; turn the RUN LED off 6201 07722 6205 .PUSHJ @ZCRLF ; be sure we start on a new line 07723 5510 6202 07724 1720 TAD @TRAP ; get the address of the message 6203 07725 6205 .PUSHJ @[OUTSTR] ; and print that 07726 5767 6204 07727 1002 TAD UFLAGS ; then get the field of the trap 6205 07730 0136 AND ZK70 ; ... 6206 07731 6205 .PUSHJ @[TFIELD] ; and type that PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 149 Control Panel Entry Points bts6120.plx 07732 5766 6207 07733 1000 TAD UPC ; then the PC too 6208 07734 6205 .PUSHJ @ZTOCT4C ; type that and a CRLF 07735 5502 6209 07736 6205 .PUSHJ @[REGLSC] ; type the registers on the next line 07737 5765 6210 07740 6205 .PUSHJ @[BPTRMV] ; remove any breakpoints 07741 5764 6211 07742 6205 .PUSHJ @[EXMEM] ; sync the ADDRESS and DATA displays 07743 5763 6212 07744 5527 JMP @ZRESTA ; and restart the monitor 6213 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 6214 10200 .FIELD 1 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 150 Field 1 Variables bts6120.plx 6215 .TITLE Field 1 Variables 6216 6217 6218 ; This page defines all the page zero variables used by the code in field 6219 ; one. The system initialization code, part 1, at SYSINI: also lives in page 6220 ; zero of field one, and then is overwritten by these variables after init- 6221 ; ialization is completed. As a consequence, none of these variables can 6222 ; have initial values the way their field zero counter parts do! 6223 6224 10000 .ORG 0000 6225 6226 10000 F1X0: .BLOCK 1 6227 6228 ; Auto index registers... 6229 10010 .ORG 0010 6230 10010 RAMPTR: .BLOCK 1 ; address, within the RAM disk, for I/O 6231 10011 BUFPTR: .BLOCK 1 ; address of the caller's buffer for I/O 6232 10012 XX1: .BLOCK 1 ; generic auto index register for field 1 6233 10013 XX2: .BLOCK 1 ; " " " " " " 6234 10020 .ORG 0020 6235 6236 ; IDE Disk I/O routine storage... 6237 10020 DKPART: .BLOCK 1 ; 12 bit disk partition number 6238 10021 DKRBN: .BLOCK 1 ; 12 bit sector relative block number 6239 10022 DKSIZE: .BLOCK 1 ; size of attached drive, in MB, or 0 if no drive 6240 10023 DKUNIT: .BLOCK 1 ; logical unit (partition) number for OS/8 6241 6242 ; RAM Disk I/O routine storage... 6243 10024 RDUNIT: .BLOCK 1 ; currently selected RAM disk unit for I/O 6244 10025 RDPAGE: .BLOCK 1 ; " " " " " " page number 6245 10026 RCPAGE: .BLOCK 1 ; adjusted RAM disk page number for RC model 6246 10027 RAMBUF: .BLOCK 3 ; a three byte "mini buffer" for 3 <-> 2 packing 6247 10032 RAMDAR: .BLOCK 1 ; RAM disk address register (written to LDAR) 6248 10033 BATTOK: .BLOCK 1 ; -1 -> battery good, 1 -> battery bad, 0 -> unknown 6249 10034 RDSIZE: .BLOCK 10 ; size of each RAM disk unit, in KB, or 0 if none 6250 10044 RAMSIZ: .BLOCK 1 ; total size of all RAM disks, in KB 6251 10045 SIZPTR: .BLOCK 1 ; pointer to the RDSIZE array 6252 10046 RAMUSZ: .BLOCK 1 ; - size of selected RAM disk chip 6253 10047 RDTYPE: .BLOCK 1 ; 0 -> no RAM disk, -1 -> original (DS1221) RAM disk 6254 ; +1 -> new (DS1231) RAM disk, -2 -> IOB6120 RAM disk 6255 ; +2 -> SBC6120-RC model RAM disk 6256 6257 ; ROM call arguments 6258 10050 MUUO: .BLOCK 1 ; ROM MCALL function code 6259 10051 ARGPTR: .BLOCK 1 ; pointer to MCALL (PR0) argument list 6260 10052 XFRCNT: .BLOCK 1 ; word count for I/O 6261 10053 BUFPNL: .BLOCK 1 ; -1 if the user buffer is in panel memory 6262 10054 BUFSIZ: .BLOCK 1 ; actual buffer size for RDIBUF/WRIBUF 6263 10055 RWCNT: .BLOCK 1 ; number of pages to be transferred 6264 6265 10200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 151 ROM Calls (PR0 Instructions) bts6120.plx 6266 .TITLE ROM Calls (PR0 Instructions) 6267 6268 10200 .ORG 0200 6269 6270 ; The PDP2HEX program (which converts BIN files into ROM images in Intel 6271 ; HEX format) stores a checksum of ROM field 1 in location 10200. This is 6272 ; used by the POST and the VE (version) command. 6273 10200 ROMCK1: .BLOCK 1 6274 6275 ; This routine is called by CPSAVE when it detects a panel entry caused by 6276 ; a PR0 instruction. Main memory programs can use this instruction to 6277 ; communicate with the ROM firmware and, in particular, the OS/8 device driver 6278 ; for the RAM disk uses PR0 to transfer data. At this point all of the main 6279 ; memory program's registers have been saved and our original monitor stack 6280 ; has been restored. The data and instruction field are both one and the 6281 ; 6120 panel data flag is set (so indirect references go to panel memory). 6282 ; That's about all we can depend on. 6283 ; 6284 ; There are a couple of subtle points to watch out for here. One simple 6285 ; one is that, to save time, break points are not removed from the caller's 6286 ; program while we interpret a PR0. That means we have to be sure and return 6287 ; to main memory by jumping to CONT1, not CONT, since the latter will attempt 6288 ; to reinstall breakpoints _again_ and forever loose the original contents 6289 ; of those locations. 6290 ; 6291 ; The other thing to remember is that CONT and CPSAVE conspire to preserve 6292 ; the monitor's stack, so that it can return to the correct place while single 6293 ; stepping. That means we want to be sure and JMP to CONT1, not .PUSHJ to it, 6294 ; because otherwise it'll just return back to us the next time we enter panel 6295 ; mode! 6296 ; 6297 ; The convention is that the first word after PR0 is a function code to 6298 ; select the firmware routine. This routine also preserves the contents of 6299 ; the AC both ways - that is, whatever was in the user's AC when the PR0 was 6300 ; executed will be in the AC when our monitor call function is invoked, and 6301 ; whatever our monitor call function returns in the AC will be placed in the 6302 ; user's AC when control returns from the PR0. Anything more than that is up 6303 ; to the specific function invoked. 6304 6305 ; Get the first agument (the function code) and use it to determine the 6306 ; address of a ROM routine to handle it... 6307 10201 6205 MCALL: .PUSHJ GETARG ; CPSAVE leaves the PC pointing at the PR0 10202 5241 6308 ; so do a dummy GETARG to skip it 6309 10203 6205 .PUSHJ GETARG ; then get a real PR0 argument from main memory 10204 5241 6310 10205 3050 DCA MUUO ; this is always the function code 6311 10206 1050 TAD MUUO ; see if it's in range 6312 10207 7100 CLL ; be sure the link is in a known state 6313 10210 1377 TAD [-MAXFUN-1] ; check against the maximum function 6314 10211 7630 SZL CLA ; if it's legal, skip 6315 10212 5237 JMP MCALL2 ; nope - go print an error message... 6316 10213 1050 TAD MUUO ; it's legal - use it 6317 10214 1376 TAD [FUNTBL] ; index into the function dispatch table 6318 10215 3050 DCA MUUO ; ... 6319 10216 1450 TAD @MUUO ; get the address of the function routine 6320 10217 3050 DCA MUUO ; finally - that's what we wanted to know! 6321 6322 ; Invoke the monitor routine, preserving the AC in both directions. In 6323 ; addition, the LINK bit is commonly used as an error flag (i.e. the LINK 6324 ; set on return indicates an error), so it is preserved on return only. 6325 10220 6201 CDF 0 ; the user's context lives in field 0 6326 10221 1775 TAD @[UAC] ; get the user's AC 6327 10222 6211 CDF 1 ; all ROM call routines live in field 1 6328 10223 6205 .PUSHJ @MUUO ; call routine to execute the ROM call PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 152 ROM Calls (PR0 Instructions) bts6120.plx 10224 5450 6329 10225 6201 MCALL1: CDF 0 ; address the user's context again 6330 10226 3775 DCA @[UAC] ; return whatever's in the AC 6331 10227 7010 RAR ; put the link bit in AC0 6332 10230 3050 DCA MUUO ; save it for a minute 6333 10231 7350 NL3777 ; then mask off the LINK bit 6334 10232 0774 AND @[UFLAGS] ; in the user's flags 6335 10233 1050 TAD MUUO ; and put ours in there instead 6336 10234 3774 DCA @[UFLAGS] ; ... 6337 10235 6203 CXF 0 ; CONT2 lives in field 0 6338 10236 5773 JMP @[CONT2] ; and then return to main memory 6339 6340 ; Here when an illegal PR0 function is invoked. 6341 10237 6203 MCALL2: CXF 0 ; say 6342 10240 5772 JMP @[ILLPR0] ; "?Illegal PR0 function at ..." PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 153 Fetch PR0 Arguments bts6120.plx 6343 .TITLE Fetch PR0 Arguments 6344 6345 6346 ; This routine fetches an argument for PR0 from the main memory program. 6347 ; Since arguments are always stored in line after the PR0, the next argument 6348 ; is in the instruction field and pointed to by the last main memory PC. 6349 ; After the argument is fetched the main memory PC is always incremented so 6350 ; that we'll skip over the argument when we return - you have to be careful 6351 ; about this, since it means this routine can only be called ONCE to fetch 6352 ; any given argument! The PR0 argument is returned in the AC. 6353 10241 7200 GETARG: CLA 6354 10242 6201 CDF 0 ; BEWARE - UFLAGS and UPC are both in field 0! 6355 10243 1771 TAD @[UPC] ; get the user's PC from field 0 6356 10244 3051 DCA ARGPTR ; save it in field 1 for a moment 6357 10245 2771 ISZ @[UPC] ; and increment it to skip over the argument 6358 10246 7000 NOP ; this really shouldn't ever happen! 6359 10247 1774 TAD @[UFLAGS] ; get the last known user (main memory) flags 6360 10250 0370 AND [70] ; then get the IF at the time of the trap 6361 10251 1367 TAD [CDF 0] ; make a CDF instruction 6362 10252 3253 DCA .+1 ; change to the correct field 6363 10253 7000 NOP ; ... gets overwritten with a CDF ... 6364 10254 6266 CPD ; always fetch from main memory 6365 10255 1451 TAD @ARGPTR ; get the next word from user program space 6366 10256 6276 SPD ; back to panel memory 6367 10257 6211 CDF 1 ; and back to our field 6368 10260 6225 .POPJ ; return the PR0 argument in the AC PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 154 ROM Call Table bts6120.plx 6369 .TITLE ROM Call Table 6370 6371 6372 ; This is what you've really been waiting for - the table of ROM firmware 6373 ; function codes and routine addresses. 6374 6375 0237 BADFUN=MCALL2 ; illegal function call 6376 6377 10261 0303 FUNTBL: GETVER ; 0 - get ROM version 6378 10262 0310 RAMDRW ; 1 - read/write RAM disk 6379 10263 1000 GETRDS ; 2 - return RAM disk size 6380 10264 0544 GETBAT ; 3 - return RAM disk battery status 6381 10265 2017 DISKRW ; 4 - read/write IDE disk 6382 10266 1136 GETDKS ; 5 - return IDE disk size 6383 10267 1732 SETPMP ; 6 - set disk partition mapping 6384 10270 2000 GETPMP ; 7 - get disk partition mapping 6385 10271 2230 MEMMOV ; 10 - copy memory 6386 10272 2306 MEMMVX ; 11 - copy memory extended 6387 10273 2442 LIGHTS ; 12 - control the DATA LEDs 6388 6389 ; The following six locations are reserved for ROM calls added by the 6390 ; IOB6120 extension ROM. The first three are used by the GETCFS and R/STODC 6391 ; calls, and the remaining four are held for future expansion. If you add 6392 ; more ROM monitor calls the BTS6120, add them _after_ these six! 6393 10274 0237 BADFUN ; 13 - get CompactFlash card size 6394 10275 0237 BADFUN ; 14 - read Time of Day Clock (RTODC) 6395 10276 0237 BADFUN ; 15 - set Time of Day Clock (STODC) 6396 10277 0237 BADFUN ; 16 - (reserved for IOB6120) 6397 10300 0237 BADFUN ; 17 - (reserved for IOB6120) 6398 10301 0237 BADFUN ; 20 - (reserved for IOB6120) 6399 6400 ; Add new BTS6120 calls here... 6401 10302 2456 RDROM ; 21 - read Flash ROM (RDROM) 6402 6403 0021 MAXFUN=.-FUNTBL-1 6404 6405 6406 ; PR0 function zero returns the current firmware version in the AC... 6407 10303 7300 GETVER: CLA CLL ; ... 6408 10304 1366 TAD [VERSION] ; get our version number 6409 10305 6225 .POPJ ; MCALL will store it in the caller's AC 6410 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 155 Return from Routines in Field 1 bts6120.plx 6411 .TITLE Return from Routines in Field 1 6412 6413 6414 ; This routine is the other half of the code at PUSHJ1:, and it allows 6415 ; routines in field one which were called from field zero to return to 6416 ; field zero. It only needs to do two instructions, but those instructions 6417 ; have to be somewhere in field one! 6418 10306 6203 POPJ1: CXF 0 ; return to field zero 6419 10307 6225 .POPJ ; the address is already on the stack PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 156 RAM Disk support bts6120.plx 6420 .TITLE RAM Disk support 6421 6422 6423 ; The SBC6120 contains a DS1321 SRAM controller with Li battery backup and 6424 ; sockets for up to eight byte wide SRAM chips. Each socket can contain either 6425 ; a HM628512 512Kx8 SRAM or a HM628128 128Kx8 SRAM or, of course, nothing. 6426 ; Additionally, the last socket has two jumpers which permit a 512K byte 6427 ; CMOS EPROM to be used if desired. The maximum capacity of the RAM disk 6428 ; array is thus 2Mb - a pretty respectable sized disk (almost as big as a 6429 ; RK05J!) for OS/8. 6430 ; 6431 ; The SBC6120 maps these RAM chips into panel memory via the memory decode 6432 ; GAL and, when memory map 3 (MM3) is enabled, all indirect references to panel 6433 ; memory will access the RAM disk array. Since the RAM disk is only a byte 6434 ; wide, write operations discard the upper four bits of a twelve bit word, and 6435 ; when reading these bits are undefined and should be masked off by the 6436 ; software. 6437 ; 6438 ; Addressing the RAM disk is a little tricky, since a 2Mb memory requires 6439 ; a total of 21 address bits - quite a bit more than a PDP-8 can manage. 6440 ; RAM disk address bits 0..11 (the low order bits, contrary to the PDP-8 6441 ; convention) are supplied by the HM6120 MA11-0. The remaining 7 bits needed 6442 ; by each 512K SRAM come from a special register, the Disk Address Register, 6443 ; which can be loaded via the LDAR IOT. The final two bits needed by the 6444 ; DS1321 to select one of the four SRAM chips come from DF0 and DF1. 6445 ; 6446 ; DF2 is used as a "board select" to allow up to two SRAM boards to be 6447 ; installed. Since DF2 is actually the LSB of the data field, the board 6448 ; select is a little wierd - RAM disk units 0..3 are on the first RAM disk 6449 ; board and map to the even fields, 0, 2, 4 and 6. RAM disk units 4..7 are 6450 ; on the second RAM disk board and map to the odd fields - 1, 3, 5 and 7. 6451 ; 6452 ; Put more simply, the DF selects the SRAM chip used, the DAR selects the 6453 ; 4K byte "bank" within the chip, and the normal memory address selects the 6454 ; individual byte within the bank. 6455 ; 6456 ; For the purposes of writing an OS/8 device handler, each 4K RAM disk bank 6457 ; contains 21 pages of 128 twelve bit words, packed using the standard OS/8 6458 ; "three for two" scheme. A 512K SRAM chip can hold 128 of these banks, 6459 ; corresponding to DAR addresses 0..127, for a total capacity of 2688 PDP-8 6460 ; pages or 1344 OS/8 blocks. A 128K SRAM would contain only 32 banks, for a 6461 ; total of 672 PDP-8 pages or 336 OS/8 blocks. 6462 ; 6463 ; Sixty-four bytes are wasted in each bank by this packing scheme, which 6464 ; works out to about 21 OS/8 blocks lost in a 512K SRAM. More clever software 6465 ; could reclaim these, but it would require that the three-for-two packing 6466 ; algorithm split PDP-8 pages across RAM disk banks. 6467 ; 6468 ; The SRAMs are optional, and this SBC6120 may have all, only some, or even 6469 ; none installed. Since each SRAM chip is treated as a separate OS/8 unit, 6470 ; this makes it easy to handle the situation where some chips are not missing - 6471 ; these units are simply "off line". 6472 6473 ; RAM disk "geometry" constants... 6474 5200 RAM512=2688. ; size of a 512K RAM disk, in pages 6475 1240 RAM128=672. ; " " " 128K " " " " 6476 0025 BANKSZ=21. ; pages per bank of RAM disk memory 6477 6478 ; Special IOTs for the RAM disk hardware... 6479 6410 LDAR=6410 ; Load RAM disk address register 6480 6415 SBBLO=6415 ; Skip on backup battery low (DS1321 only!) 6481 6436 SBBLO2=6436 ; " " " " " " " (SBC6120-RC only!) PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 157 RAM Disk Read/Write ROM Call bts6120.plx 6482 .TITLE RAM Disk Read/Write ROM Call 6483 6484 6485 ; The calling sequence for the PR0 RAM disk R/W function is: 6486 ; 6487 ; PR0 6488 ; 0001 / panel function code for RAMDISK I/O 6489 ; / R/W bit, page count, buffer field and unit 6490 ; / buffer address 6491 ; / starting page number (not block number!) 6492 ; / AC == 0 if success; AC != 0 if error 6493 ; 6494 ; The error codes currently returned by RAMDRW are: 6495 ; 6496 ; 0001 - unit > 3 or SRAM chip not installed 6497 ; 0002 - page number > 2688 6498 ; 6499 ; If this looks a lot like an OS/8 handler call, that's no accident! 6500 10310 6205 RAMDRW: .PUSHJ @[SETBUF] ; set up MUUO, BUFPTR, BUFCDF and RWCNT 10311 5765 6501 10312 6205 .PUSHJ GETARG ; and lastly get the disk page number 10313 5241 6502 10314 3025 DCA RDPAGE ; ... 6503 6504 ; Select (after first ensuring that it exists!) the correct unit... 6505 10315 1050 TAD MUUO ; next get the unit number 6506 10316 0364 AND [7] ; ... 6507 10317 3024 DCA RDUNIT ; ... 6508 10320 6205 .PUSHJ @[RAMSEL] ; setup RAMCDF to select the correct "unit" 10321 5763 6509 10322 7630 SZL CLA ; was the unit number illegal ? 6510 10323 5762 JMP @[RAMER1] ; yes - give the error return 6511 6512 ; This loop reads or writes pages 'till we've done all we're supposed to... 6513 10324 6205 RDRW1: .PUSHJ @[SETDAR] ; calculate the RAM disk address and bank 10325 5761 6514 10326 7630 SZL CLA ; was the page number valid? 6515 10327 5760 JMP @[RAMER2] ; nope - give the bad page error return 6516 10330 1050 TAD MUUO ; get the function code again 6517 10331 7700 SMA CLA ; should we read (0) or write (1) ? 6518 10332 5336 JMP RDRW2 ; ... read 6519 10333 6205 .PUSHJ @[RAMDW1] ; transfer a page from memory to RAM disk 10334 5757 6520 10335 5340 JMP RDRW3 ; and continue 6521 10336 6205 RDRW2: .PUSHJ @[RAMDR1] ; transfer a page from RAM disk to memory 10337 5756 6522 10340 2025 RDRW3: ISZ RDPAGE ; if we need more, continue on the next page 6523 10341 2055 ISZ RWCNT ; have we done enough pages? 6524 10342 5324 JMP RDRW1 ; nope - keep going 6525 10343 7200 CLA ; all done with the RAMDRW call 6526 10344 6225 .POPJ ; return status code zero (no error) 6527 10356 0417 10357 0432 10360 0437 10361 0661 10362 0435 10363 0722 10364 0007 10365 2123 10366 0320 10367 6201 10370 0070 10371 0000 10372 7707 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 158 RAM Disk Read/Write ROM Call bts6120.plx 10373 2225 10374 0002 10375 0001 10376 0261 10377 7756 6528 10400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 159 RAM Disk Primary Bootstrap bts6120.plx 6529 .TITLE RAM Disk Primary Bootstrap 6530 6531 ; This routine will read page zero from RAM disk unit zero into page 6532 ; zero of field zero of main memory. The next step in the usual boot 6533 ; sequence would be to start the secondary bootstrap, but that's up to 6534 ; the caller... 6535 10400 7240 RDBOOT: STA ; point the buffer to page 0 6536 10401 3011 DCA BUFPTR ; ... 6537 10402 1377 TAD [CDF 0] ; of field zero 6538 10403 3776 DCA @[BUFCDF+1] ; ... 6539 10404 3053 DCA BUFPNL ; of main memory 6540 10405 3024 DCA RDUNIT ; read RAM disk unit zero 6541 10406 3025 DCA RDPAGE ; page zero 6542 ; JMP RAMDRD ; ... 6543 ; ** fall through into RAMDRD *** 6544 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 160 Read and Write RAM Disk Pages bts6120.plx 6545 .TITLE Read and Write RAM Disk Pages 6546 6547 6548 ; This routine will read a single page from RAM disk to a buffer in memory. 6549 ; The caller must set up RDUNIT and RDPAGE with the desired RAM disk unit 6550 ; and page, and BUFPTR, BUFCDF and BUFPNL with the address of a 128 word 6551 ; buffer in 6120 memory. If any errors are encountered, this routine will 6552 ; return with the LINK set and an error status in the AC. 6553 10407 6205 RAMDRD: .PUSHJ @[RAMSEL] ; select the unit in RDUNIT 10410 5775 6554 10411 7430 SZL ; was it invalid?? 6555 10412 5235 JMP RAMER1 ; yes - return error code 1 6556 10413 6205 .PUSHJ @[SETDAR] ; calculate the necessary disk address 10414 5774 6557 10415 7430 SZL ; is the page number invalid? 6558 10416 5237 JMP RAMER2 ; yes - return error code 2 6559 10417 4773 RAMDR1: JMS @[CHKRC] ; test for the SBC6120-RC model 6560 10420 5772 JMP @[RCRDRD] ; yes - call the RC model read routine 6561 10421 5771 JMP @[UNPACK] ; unpack RAM disk data to the buffer and return 6562 6563 6564 ; This routine will write a single page from 6120 memory to RAM disk. Except 6565 ; for the direction of data flow, it's identical to RAMDRD, including all the 6566 ; parameters and error returns. 6567 10422 6205 RAMDWR: .PUSHJ @[RAMSEL] ; select the unit 10423 5775 6568 10424 7430 SZL ; was it invalid?? 6569 10425 5235 JMP RAMER1 ; yes - return error code 1 6570 10426 6205 .PUSHJ @[SETDAR] ; calculate the disk address 10427 5774 6571 10430 7430 SZL ; invalid page number?? 6572 10431 5237 JMP RAMER2 ; yes - return error code 2 6573 10432 4773 RAMDW1: JMS @[CHKRC] ; test for the SBC6120-RC model 6574 10433 5770 JMP @[RCRDWR] ; yes - call the RC model write routine 6575 10434 5767 JMP @[PACK] ; pack buffer data into the RAM disk and return 6576 6577 6578 ; Here if the unit number is invalid... 6579 10435 7321 RAMER1: CLA CLL CML IAC ; return LINK = 1 and AC = 1 6580 10436 6225 .POPJ ; ... 6581 6582 ; Here if the page number is invalid... 6583 10437 7326 RAMER2: NL0002 ; return AC = 2 6584 10440 7120 STL ; and LINK = 1 6585 10441 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 161 Unpack RAM Disk Pages bts6120.plx 6586 .TITLE Unpack RAM Disk Pages 6587 6588 6589 ; This routine will read one page (aka a sector) of 128 PDP-8 words from 6590 ; the RAM disk to a buffer anywhere in main memory or panel memory. The 6591 ; address of the disk page read is selected by the RAMCDF and RAMPTR locations 6592 ; and the DAR register, which should be set up by prior calls to the RAMUNIT 6593 ; and SETDAR routines. The address of the buffer written is selected by the 6594 ; BUFPTR, BUFCDF and BUFPNL locations, which must be set up by the caller 6595 ; before invoking this routine. Exactly 128 words are always transferred, 6596 ; without fail! 6597 10442 7200 UNPACK: CLA ; ... 6598 10443 1366 TAD [-64.] ; one page is 128 words, or 64 word pairs 6599 10444 3052 DCA XFRCNT ; ... 6600 6601 ; Fetch the next three bytes (two words) from the SRAM chip. Note that 6602 ; the SRAMs are only eight bits wide, so we'll read indeterminate garbage for 6603 ; the upper four bits of each word. Those have to be masked off on the first 6604 ; two bytes, but for the third one it doesn't matter - it gets masked to two 6605 ; four bit pieces later anyway... 6606 10445 4765 UNPAC1: JMS @[RAMCDF] ; change the DF to the RAM disk unit 6607 10446 6403 MM3 ; and enable the RAM disk chips 6608 10447 1410 TAD @RAMPTR ; fetch three bytes from RAM disk 6609 10450 0364 AND [377] ; eight bits only, please 6610 10451 3027 DCA RAMBUF ; ... 6611 10452 1410 TAD @RAMPTR ; ... 6612 10453 0364 AND [377] ; ... 6613 10454 3030 DCA RAMBUF+1 ; ... 6614 10455 1410 TAD @RAMPTR ; ... 6615 10456 3031 DCA RAMBUF+2 ; ... 6616 10457 6402 MM2 ; restore the default memory map 6617 10460 6211 CDF 1 ; and field 6618 6619 ; Pack the three bytes into two words and store them in main/panel memory... 6620 10461 4763 JMS @[BUFCDF] ; change DF to the buffer field 6621 10462 1031 TAD RAMBUF+2 ; the upper 4 bits of the first word are here 6622 10463 7002 BSW ; shift them left six 6623 10464 7106 CLL RTL ; ... then eight bits 6624 10465 0362 AND [7400] ; and isolate just those four bits 6625 10466 1027 TAD RAMBUF ; assemble the first word 6626 10467 3411 DCA @BUFPTR ; and store it in main memory 6627 10470 1031 TAD RAMBUF+2 ; now do the upper 4 bits of the second word 6628 10471 7106 CLL RTL ; shift them left two 6629 10472 7106 CLL RTL ; ... then four bits 6630 10473 0362 AND [7400] ; and isolate just those four bits 6631 10474 1030 TAD RAMBUF+1 ; reassemble the second word 6632 10475 3411 DCA @BUFPTR ; store that in main memory too 6633 10476 6276 SPD ; return to panel memory 6634 10477 6211 CDF 1 ; and our own memory field 6635 10500 2052 ISZ XFRCNT ; have we done a full page? 6636 10501 5245 JMP UNPAC1 ; nope - keep copying 6637 10502 7100 CLL ; be sure the LINK is cleared for success 6638 10503 6225 .POPJ ; yes - we're outta here! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 162 Pack RAM Disk Pages bts6120.plx 6639 .TITLE Pack RAM Disk Pages 6640 6641 6642 ; This routine will write one page of 128 PDP-8 words from a buffer anywhere 6643 ; in either panel or main memory to RAM disk. It's the exact complement of 6644 ; UNPACK, and expects exactly the same things to be set up. 6645 10504 7200 PACK: CLA ; don't assume anything! 6646 10505 1366 TAD [-64.] ; do 64 word pairs, or 128 words 6647 10506 3052 DCA XFRCNT ; ... 6648 6649 ; Grab the next two twelve bit words from the buffer... 6650 10507 4763 PACK1: JMS @[BUFCDF] ; change DF to the buffer's field 6651 10510 1411 TAD @BUFPTR ; get a word from the buffer 6652 10511 3027 DCA RAMBUF ; save it for the computation of byte 3 6653 10512 1411 TAD @BUFPTR ; do the same with the second word 6654 10513 3030 DCA RAMBUF+1 ; ... 6655 10514 6276 SPD ; back to panel memory addressing 6656 6657 ; Store bytes 1 and 2 (they're easy) and calculate byte three. Note that 6658 ; the SRAM will ignore the upper four bits when writing (there's no hardware 6659 ; there!) so there's no need to worry about masking them out first... 6660 10515 4765 JMS @[RAMCDF] ; select the correct SRAM "unit" 6661 10516 6403 MM3 ; and enable the SRAM chips 6662 10517 1027 TAD RAMBUF ; store byte 1 6663 10520 3410 DCA @RAMPTR ; ... 6664 10521 1030 TAD RAMBUF+1 ; and byte 2 6665 10522 3410 DCA @RAMPTR ; ... 6666 10523 1027 TAD RAMBUF ; byte 3 has the top four bits of word 1 6667 10524 0362 AND [7400] ; ... 6668 10525 7002 BSW ; ... in bits 8..11 of the byte 6669 10526 7112 CLL RTR ; ... 6670 10527 3027 DCA RAMBUF ; save that for a moment 6671 10530 1030 TAD RAMBUF+1 ; and the top four bits of word 2 6672 10531 0362 AND [7400] ; ... 6673 10532 7112 CLL RTR ; in bits 4..7 6674 10533 7112 CLL RTR ; ... 6675 10534 1027 TAD RAMBUF ; ... 6676 10535 3410 DCA @RAMPTR ; ... 6677 10536 6402 MM2 ; return to the default memory map 6678 10537 6211 CDF 1 ; and field 6679 10540 2052 ISZ XFRCNT ; have we done a whole page? 6680 10541 5307 JMP PACK1 ; nope - keep going 6681 10542 7100 CLL ; be sure the LINK is cleared for success 6682 10543 6225 .POPJ ; all done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 163 Get Battery Status ROM Call bts6120.plx 6683 .TITLE Get Battery Status ROM Call 6684 6685 6686 ; The Get Battery Status ROM call will return the status of the RAM disk 6687 ; lithium backup batteries. As long as either battery has sufficient 6688 ; voltage, -1 will be return in the AC. If both batteries have failed, then 6689 ; zero is returned. 6690 ; 6691 ; PR0 / call the SBC6120 ROM firmware 6692 ; 0003 / get backup battery status function code 6693 ; / return with AC == -1 if batteries are OK 6694 ; / AC == +1 if batteries are bad 6695 ; / AC == 0 if battery status unknown 6696 ; 6697 ; NOTE: Because of the way the DS1221 works, the battery status can only 6698 ; be tested after power up. It isn't possible to monitor the battery status 6699 ; in real time! 6700 10544 7300 GETBAT: CLA CLL ; ... 6701 10545 1033 TAD BATTOK ; return the battery status in the AC 6702 10546 6225 .POPJ ; and that's it 6703 10562 7400 10563 2221 10564 0377 10565 0753 10566 7700 10567 0504 10570 3110 10571 0442 10572 3067 10573 2742 10574 0661 10575 0722 10576 2222 10577 6201 6704 10600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 164 Determine RAM Disk Model bts6120.plx 6705 .TITLE Determine RAM Disk Model 6706 6707 ; This routine will determine the type of the RAM disk installed and sets 6708 ; the RDTYPE variable accordingly: 6709 ; 6710 ; -2 -> IOB6120 RAM disk 6711 ; -1 -> original (DS1221) RAM disk 6712 ; 0 -> no RAM disk 6713 ; +1 -> new (DS1231) RAM disk 6714 ; +2 -> new SBC6120-RC model RAM disk 6715 ; 6716 ; Each of these implementations has slightly different characteristics (sigh!) 6717 ; and so it's important to know which one we've got. Note that this routine 6718 ; is called only once, during phase 2 of system initialization. 6719 10600 7200 RDCHK1: CLA 6720 10601 4777 JMS @[CHKRC] ; is this the SBC6120-RC model? 6721 10602 5253 JMP RDCH20 ; yep - go handle that case 6722 6723 ; If the IOB6120 is in use, then we've obviously got the IOB6120 style 6724 ; RAM disk. Also, since the IOB6120 doesn't support any low battery detection 6725 ; for the RAM disk backup battery, we'll take this chance to set BATTOK to 6726 ; zero (unknown battery status). 6727 10603 6201 CDF 0 ; the EXTFLG lives in field 0 6728 10604 1776 TAD @[EXTFLG] ; get the IOB6120 status 6729 10605 6211 CDF 1 ; ... 6730 10606 7650 SNA CLA ; is there one? 6731 10607 5213 JMP RDCH10 ; no - go check for a DS1221 RAMdisk card 6732 10610 3033 DCA BATTOK ; yes - set the battery status to unknown 6733 10611 7344 NLM2 ; and set RDTYPE to -2 (IOB6120 RAM disk) 6734 10612 5250 JMP RDCH12 ; .... 6735 6736 ; The original RAMdisk card (the one with the DS1221 chip) didn't decode 6737 ; EMA2 and so the even and odd fields select the same SRAM chip. This code 6738 ; does a very simple test to detect that case (remember that we aren't even 6739 ; sure _any_ RAMdisk exists at this point!) and sets the maximum unit to 4 6740 ; if it detects this duplication. Note that this assumes that if any 6741 ; RAMdisk chip is installed, the first one is! 6742 10613 1375 RDCH10: TAD [32.] ; test bank 32 so A17 will be set 6743 10614 6410 LDAR ; ... 6744 10615 6403 MM3 ; address the RAMdisk map 6745 10616 6201 CDF 0 ; select the first chip 6746 10617 1374 TAD [252] ; put a test pattern in one location 6747 10620 3773 DCA @[7776] ; ... 6748 10621 1372 TAD [125] ; and a different one in the next 6749 10622 3771 DCA @[7777] ; ... 6750 10623 1773 TAD @[7776] ; add them up 6751 10624 1771 TAD @[7777] ; ... 6752 10625 7040 CMA ; the result should be 377 6753 10626 0370 AND [377] ; remember that only 8 bits exist 6754 10627 7640 SZA CLA ; skip if any RAM disk exists? 6755 10630 5250 JMP RDCH12 ; none - set RDTYPE to zero and exit 6756 10631 6211 CDF 1 ; address an odd numbered chip 6757 10632 3773 DCA @[7776] ; clear this location in chip #1 6758 10633 6201 CDF 0 ; read the original chip again 6759 10634 1773 TAD @[7776] ; ... 6760 10635 0370 AND [377] ; the RAMdisk array is only 8 bits 6761 10636 1367 TAD [-252] ; if this is now zero 6762 10637 7650 SNA CLA ; ... we can be pretty sure it's an old card 6763 10640 5243 JMP RDCH11 ; nope - modern DS1231 card 6764 6765 ; Here for the old stype (DS1221) card... 6766 10641 7240 NLM1 ; set RDTYPE to -1 6767 10642 5250 JMP RDCH12 ; store it and return... 6768 6769 ; Here for a modern (DS1231) card... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 165 Determine RAM Disk Model bts6120.plx 6770 10643 7201 RDCH11: NL0001 ; set the AC to +1 6771 10644 6415 SBBLO ; skip of the DS1231 battery is low 6772 10645 7240 NLM1 ; not low - set BATTOK to -1 6773 10646 3033 DCA BATTOK ; update the battery status flag 6774 10647 7201 NL0001 ; and finally set RDTYPE to 1 6775 10650 3047 RDCH12: DCA RDTYPE ; ... 6776 10651 6402 MM2 ; return to the normal memory map 6777 10652 6225 .POPJ ; and we're all done 6778 6779 ; Here for a SBC6120-RC model ... 6780 10653 6436 RDCH20: SBBLO2 ; skip if the backup battery is low 6781 10654 7344 NLM2 ; set AC = -2 if battery is OK 6782 10655 7001 IAC ; +1 -> battery bad, -1 -> battery good 6783 10656 3033 DCA BATTOK ; set the battery flag 6784 10657 7326 NL0002 ; set RDTYPE = 2 6785 10660 5250 JMP RDCH12 ; and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 166 Calculate RAM Disk Addresses bts6120.plx 6786 .TITLE Calculate RAM Disk Addresses 6787 6788 6789 ; This routine will calculate the RAM disk bank number and the relative 6790 ; offset within that bank, corresponding to a disk page number passed in 6791 ; location RDPAGE. The resulting bank number is simply loaded directly into 6792 ; the DAR via the LDAR IOT, and the offset is left in auto index location 6793 ; RAMPTR, where it can be used by the UNPACK and PACK routines. If the page 6794 ; number passed is illegal (i.e. greater than the size of the selected RAM 6795 ; disk unit) then the link will be set when this routine returns. 6796 10661 7300 SETDAR: CLA CLL ; make sure the link is in a known state 6797 10662 1025 TAD RDPAGE ; get the desired page 6798 10663 1046 TAD RAMUSZ ; compare it to the size of this unit 6799 10664 7630 SZL CLA ; is the page number legal? 6800 10665 6225 .POPJ ; no - return with the LINK set 6801 6802 ; If this is the RC model, then we'll need a different algorithm ... 6803 10666 4777 JMS @[CHKRC] ; test for the SBC6120-RC model 6804 10667 5766 JMP @[RCSDAR] ; yep - go handle that case instead 6805 6806 ; Divide the page number by 21, the number of pages per bank, by repeated 6807 ; subtraction. This is kind of crude, but it only has to iterate 127 times, 6808 ; worst case, so the performance hit isn't that bad. We do have to be careful, 6809 ; though, because the largest legal page number is 2688, which is bigger than 6810 ; 2048. That means we have to treat the whole AC as a 12 bit UNSIGNED value! 6811 10670 3032 DCA RAMDAR ; clear the disk address (quotient) 6812 10671 1025 TAD RDPAGE ; get the selected RAM disk page number 6813 10672 7100 SETDA1: CLL ; make sure the link is clear before starting 6814 10673 1365 TAD [-BANKSZ] ; try to subtract another 21 6815 10674 7420 SNL ; did it fit? 6816 10675 5300 JMP SETDA2 ; nope - we can stop now 6817 10676 2032 ISZ RAMDAR ; yes - increment the disk address 6818 10677 5272 JMP SETDA1 ; and keep subtracting 6819 6820 ; We get here when we're done dividing, with the quotient in RAMDAR and the 6821 ; remainder in the AC. To calculate the byte offset within a bank, we need 6822 ; to multiply the remainder by 192 (the number of bytes per 128 word page). 6823 10700 1364 SETDA2: TAD [BANKSZ] ; restore the remainder 6824 10701 7002 BSW ; then multiply by 64 6825 10702 3010 DCA RAMPTR ; save offset*64 for a moment 6826 10703 1010 TAD RAMPTR ; ... 6827 10704 7104 CLL RAL ; then multiply by two again 6828 10705 1010 TAD RAMPTR ; 192*x = 128*x + 64*x 6829 10706 6201 CDF 0 ; adjust by base offset, default 0 - 1 6830 10707 1763 TAD @[RAMBAS] ; (auto index registers pre-increment) 6831 10710 6211 CDF 1 6832 10711 3010 DCA RAMPTR ; that's the final offset 6833 6834 ; Set up the DAR with the bank number, from RAMDAR. Remember that for the 6835 ; 128K chips, we must always set A17 to enable the alternate chip select! 6836 10712 1046 TAD RAMUSZ ; get the size of the selected unit 6837 10713 1362 TAD [RAM128] ; ... 6838 10714 7650 SNA CLA ; is this a 128K ram chip ? 6839 10715 1375 TAD [32.] ; yes - always set A17 6840 10716 1032 TAD RAMDAR ; get the quotient from the division 6841 10717 6410 LDAR ; and load the disk address register 6842 10720 7100 CLL ; indicate success 6843 10721 6225 .POPJ ; and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 167 Select RAM Disk Unit bts6120.plx 6844 .TITLE Select RAM Disk Unit 6845 6846 6847 ; This routine will set up the RAMCDF routine to select the desired RAM 6848 ; disk "unit". The unit number, 0..7, should be passed in RDUNIT. If the 6849 ; unit number given is illegal (i.e. greater than seven) OR if there is no 6850 ; SRAM chip installed in the selected position, this routine will return 6851 ; with the link set. 6852 ; 6853 ; Note that this routine works, more or less, with the SBC6120-RC RAM disk 6854 ; as is. "More or less" because the CDF value that's computed here is useless 6855 ; for the RC RAM disk, but there's no harm in that. Besides, this routine will 6856 ; still correctly range check the unit number and check for an installed SRAM 6857 ; chip correctly, and those functions are still useful. In the case of the RC 6858 ; RAM disk, the CDF instruction we leave in RAMCDF is later overwritten with a 6859 ; correct one by the SETDAR function. 6860 10722 7300 RAMSEL: CLL CLA ; make sure the link is in a known state 6861 10723 1024 TAD RDUNIT ; get the desired unit number 6862 10724 1361 TAD [-10] ; see if the unit is legal 6863 10725 7630 SZL CLA ; it must be less than 8 6864 10726 6225 .POPJ ; no - return with the link set 6865 ; The mapping of RAMdisk units to data fields is a little obscure - units 6866 ; 0..3 map to fields 0, 2, 4, and 6 (i.e. the even fields). RAMdisk units 6867 ; 4..7 map to the odd fields (1, 3, 5, 7)... 6868 10727 1024 TAD RDUNIT ; restore the original unit 6869 10730 7104 CLL RAL ; shift the unit number left once 6870 10731 1361 TAD [7770] ; if the unit is 4..7 then set the link 6871 10732 7430 SZL ; skip if the unit is 0..3 6872 10733 7001 IAC ; make the field odd for units 4..7 6873 10734 7114 CLL R3L ; and position it for a CDF instruction 6874 10735 0360 AND [70] ; ... 6875 10736 1357 TAD [CDF 0] ; make a CDF to the corresponding field 6876 10737 3354 DCA RAMCDF+1 ; and store that in the unit select routine 6877 6878 ; Now that we know the unit number is valid, verify that this chip is really 6879 ; installed by checking the RDSIZE array for a non-zero value. As a side 6880 ; effect of this, we always leave the size of the currently selected unit in 6881 ; location RAMUSZ, where it's used by SETDAR to determine whether the page 6882 ; addressed is actually legal. We always want to update RAMUSZ, even if the 6883 ; chip is not installed, because this will also cause SETDAR to fail if the 6884 ; caller ignores the our error return and attempts a read or write anyway. 6885 10740 1024 TAD RDUNIT ; get the unit number again 6886 10741 1363 TAD [RDSIZE] ; index into the RDSIZE array 6887 10742 3045 DCA SIZPTR ; ... 6888 10743 1445 TAD @SIZPTR ; to get the size of this chip 6889 10744 7041 CIA ; make it negative 6890 10745 3046 DCA RAMUSZ ; and save that for SETDAR 6891 10746 1046 TAD RAMUSZ ; ... 6892 10747 7100 CLL ; make sure the link is in a known state 6893 10750 7650 SNA CLA ; is this chip installed ? 6894 10751 7020 CML ; nope - give the error return 6895 10752 6225 .POPJ ; ... 6896 6897 ; This little routine can be called, via a JMS instruction (not a .PUSHJ!) 6898 ; to change the DF and select the last RAM disk unit set by a call to RAMSEL. 6899 10753 0000 RAMCDF: 0 ; call here via a JMS! 6900 10754 7000 NOP ; gets overwritten with a CDF instruction 6901 10755 5753 JMP @RAMCDF ; return... 6902 10757 6201 10760 0070 10761 7770 10762 1240 10763 0034 10764 0025 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 168 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 2742 6903 11000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 169 Get RAM Disk Size ROM Call bts6120.plx 6904 .TITLE Get RAM Disk Size ROM Call 6905 6906 6907 ; PR0 function 2 will return the size of a RAM disk chip, in 128 word pages, 6908 ; in the AC. The AC should be loaded with the desired unit number, 0..7, 6909 ; before invoking PD0. If no chip is installed in the selected unit, zero 6910 ; will be returned in the AC. If the unit number is not in the range 0..7, 6911 ; then on return the LINK will be set to indicate an error. 6912 ; 6913 ; For example: 6914 ; TAD (unit / load the desired RAM disk unit, 0..7 6915 ; PR0 / call the ROM software 6916 ; 0002 / function code for Get RAM Disk Status 6917 ; / return the RAM disk size in the AC 6918 6919 ; It's tempting to use the RAMSEL routine here to save some steps, but be 6920 ; careful - RAMSEL will return with the LINK set (an error condition) if a 6921 ; valid unit number is selected but there is no SRAM chip installed there. 6922 ; That's not what we want for this ROM call, which should return an error only 6923 ; if the selected unit is > 7! 6924 11000 3024 GETRDS: DCA RDUNIT ; save the unit number 6925 11001 1024 TAD RDUNIT ; and get it back 6926 11002 7100 CLL ; be sure the link is in a known state 6927 11003 1377 TAD [-10] ; is it a legal unit number ? 6928 11004 7630 SZL CLA ; skip if so 6929 11005 6225 .POPJ ; no - return with the LINK set and AC clear 6930 11006 1024 TAD RDUNIT ; one more time 6931 11007 1376 TAD [RDSIZE] ; index the RDSIZE array 6932 11010 3045 DCA SIZPTR ; ... 6933 11011 1445 TAD @SIZPTR ; get the size of this disk 6934 11012 6225 .POPJ ; and return it with the LINK cleared PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 170 ATA Disk Support bts6120.plx 6935 .TITLE ATA Disk Support 6936 6937 6938 ; BTS6120 supports any standard ATA hard disk connected to the SBC6120 IDE 6939 ; interface. Nearly all hard disks with IDE interfaces are ATA; conversely, 6940 ; nearly all non-hard disk devices (e.g. CDROMs, ZIP drives, LS-120s, etc) 6941 ; with IDE interfaces are actually ATAPI and not ATA. ATAPI requires a 6942 ; completely different protocol, which BTS6120 does not support, and BTS6120 6943 ; will simply ignore any ATAPI devices connected to the IDE interface. 6944 ; BTS6120 supports only a single physical drive, which must be set up as the 6945 ; IDE master, and any IDE slave device will be ignored. 6946 ; 6947 ; Since BTS6120 does not support cylinder/head/sector (C/H/S) addressing, 6948 ; the hard disk used must support logical block addressing (LBA) instead. 6949 ; All modern IDE/ATA drives support LBA, as do most drives manufactured in the 6950 ; last five or six years, however some very old drives may not. If BTS6120 6951 ; detects an ATA drive that does not support LBA it will display the message 6952 ; "IDE: Not supported" during startup and there after ignore the drive. 6953 ; 6954 ; All IDE devices, regardless of vintage, transfer data in sixteen bit words 6955 ; and each sector on an ATA disk contains 512 bytes, or 256 sixteen bit words. 6956 ; When writing to the disk, BTS6120 converts twelve bit PDP-8 words to sixteen 6957 ; bits by adding four extra zero bits to the left and, when reading from the 6958 ; disk, BTS6120 converts sixteen bit words to twelve bits by simply discarding 6959 ; the most significant four bits. No packing is done. This conveniently 6960 ; means that each ATA sector holds 256 PDP-8 words, or exactly one OS/8 block. 6961 ; It also means that one quarter of the disk space is wasted, in this era of 6962 ; multi-gigabyte disks that hardly seems like an issue. 6963 ; 6964 ; OS/8 handlers and the OS/8 file system use a single twelve bit word to hold 6965 ; block numbers, which means that OS/8 mass storage devices are limited to a 6966 ; maximum of 4096 blocks . Using the BTS6120 non-packing scheme for storing 6967 ; data, 4096 PDP-8 blocks are exactly 2Mb. Clearly, if a single OS/8 device 6968 ; corresponds to an entire hard disk then nearly all of the disk space would 6969 ; be wasted. The normal solution is to partition the hard disk into many OS/8 6970 ; units, with each unit representing only a part of the entire disk. Since 6971 ; OS/8 cannot support a single unit larger than 2Mb there isn't any point in 6972 ; allowing partitions to be larger than that, and since the smallest drives 6973 ; available today can hold hundreds if not thousands of 2Mb partitions, there 6974 ; isn't much point in allowing a partition to be smaller than that, either. 6975 ; 6976 ; Because of this, BTS6120 supports only fixed size partitions of 2Mb each. 6977 ; This greatly simplifies the software since a twenty four bit disk sector 6978 ; number can now be calculated simply by concatenating a twelve bit partition 6979 ; number with the twelve bit OS/8 relative block number (RBN). No "super 6980 ; block" with a partition table is needed to keep track of the sizes and 6981 ; positions of each partition, and the OS/8 handler is simplified since each 6982 ; disk partition is always the same size. A twenty four bit sector address 6983 ; permits disks of up to 8Gb to be fully used, which seems more than enough 6984 ; for a PDP-8. 6985 ; 6986 ; Once again, in BTS6120 the partition number simply refers to the most 6987 ; significant twelve bits of a twenty-four bit disk address, and the OS/8 6988 ; block number is the least significant twelve bits. It's no more complicated 6989 ; than that! 6990 ; 6991 ; The ID01 is the OS/8 handler for the SBC6120 IDE/ATA disk. It supports 6992 ; eight units, IDA0 through IDA7, in a single page and may be assembled as 6993 ; either a system (IDSY) or non-system (IDNS) handler. The system handler 6994 ; version of the ID01 contains a secondary bootstrap that can be booted by 6995 ; the BTS6120 Boot command. The ID01 is a simple handler that uses HD-6120 6996 ; PR0 instruction to invoke BTS6120 functions for low level IDE disk access 6997 ; and data transfer. 6998 ; 6999 ; BTS6120 implements a partition map which defines the partition number PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 171 ATA Disk Support bts6120.plx 7000 ; corresponding to each OS/8 ID01 unit, and when an OS/8 program accesses an 7001 ; ID01 unit BTS6120 uses this table to determine the upper twelve bits of the 7002 ; LBA. At power on or after a MR command, BTS6120 initializes this partition 7003 ; map so that unit 0 accesses partition 0, unit 1 accesses partition 1, and 7004 ; so on up through unit 7 and partition 7. This mapping remains in effect 7005 ; until it is changed by either the PM command, or the Set IDE Disk Partition 7006 ; Mapping PR0 function. 7007 ; 7008 ; The largest mass storage device supported by OS/8 is actually only 4095 7009 ; blocks, not 4096, and so the last block of every 2Mb partition is never 7010 ; used by OS/8. This block can, however, be accessed via the Read/Write IDE 7011 ; disk PR0 function (section 6.5), and it can be used to store the name, 7012 ; creation date, and other information about that partition. The OS/8 PART 7013 ; program uses this to allow partitions to be mounted on ID01 logical units 7014 ; by name rather than partition number. Named partitions are strictly a 7015 ; function of the OS/8 PART program and BTS6120 knows nothing about them. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 172 IDE Disk Interface bts6120.plx 7016 .TITLE IDE Disk Interface 7017 7018 7019 ; In the SBC6120, the IDE interface is implemented via a standard 8255 PPI, 7020 ; which gives us 24 bits of general purpose parallel I/O. Port A is connected 7021 ; the high byte (DD8..DD15) of the IDE data bus and port B is connected to 7022 ; the low byte (DD0..DD7). Port C supplies the IDE control signals as follow: 7023 ; 7024 ; C0..C2 -> DA0 .. 2 (i.e. device address select) 7025 ; C.3* -> DIOR L (I/O read) 7026 ; C.4* -> DIOW L (I/O write) 7027 ; C.5* -> RESET L 7028 ; C.6* -> CS1Fx L (chip select for the 1Fx register space) 7029 ; C.7* -> CS3Fx L ( " " " " 3Fx " " ) 7030 ; 7031 ; * These active low signals (CS1Fx, CS3Fx, DIOR, and DIOW) are inverted in 7032 ; the hardware so that writing a 1 bit to the register asserts the signal. 7033 ; 7034 ; One nice feature of the 8255 is that it allows bits in port C to be 7035 ; individually set or reset simply by writing the correct command word to the 7036 ; control register - it's not necessary to read the port, do an AND or OR, 7037 ; and write it back. We can use this feature to easily toggle the DIOR and 7038 ; DIOW lines with a single PWCR IOT. 7039 0222 IDEINP=222 ; set ports A and B as inputs, C as output 7040 0200 IDEOUT=200 ; set ports A and B (and C too) as outputs 7041 0007 SETDRD=007 ; assert DIOR L (PC.3) in the IDE interface 7042 0006 CLRDRD=006 ; clear " " " " " " " " 7043 0011 SETDWR=011 ; assert DIOW L (PC.4) in the IDE interface 7044 0010 CLRDWR=010 ; clear " " " " " " " " 7045 0013 SETDRE=013 ; assert DRESET L (PC.5) in the IDE interface 7046 0012 CLRDRE=012 ; clear " " " " " " " " 7047 7048 ; Standard IDE registers... 7049 ; (Note that these are five bit addresses that include the two IDE CS bits, 7050 ; CS3Fx (AC4) and CS1Fx (AC5). The three IDE register address bits, DA2..DA0 7051 ; correspond to AC9..AC11. 7052 0100 CS1FX=100 ; PC.6 selects the 1Fx register space 7053 0200 CS3FX=200 ; PC.7 " " 3Fx " " " 7054 0100 REGDAT=CS1FX+0 ; data (R/W) 7055 0101 REGERR=CS1FX+1 ; error (R/O) 7056 0102 REGCNT=CS1FX+2 ; sector count (R;W) 7057 0103 REGLB0=CS1FX+3 ; LBA byte 0 (or sector number) R/W 7058 0104 REGLB1=CS1FX+4 ; LBA byte 1 (or cylinder low) R/W 7059 0105 REGLB2=CS1FX+5 ; LBA byte 2 (or cylinder high) R/W 7060 0106 REGLB3=CS1FX+6 ; LBA byte 3 (or device/head) R/W 7061 0107 REGSTS=CS1FX+7 ; status (R/O) 7062 0107 REGCMD=CS1FX+7 ; command (W/O) 7063 7064 ; IDE status register (REGSTS) bits... 7065 0200 STSBSY=0200 ; busy 7066 0100 STSRDY=0100 ; device ready 7067 0040 STSDF= 0040 ; device fault 7068 0020 STSDSC=0020 ; device seek complete 7069 0010 STSDRQ=0010 ; data request 7070 0004 STSCOR=0004 ; corrected data flag 7071 0001 STSERR=0001 ; error detected 7072 7073 ; IDE command codes (or at least the ones we use!)... 7074 0220 CMDEDD=220 ; execute device diagnostic 7075 0354 CMDIDD=354 ; identify device 7076 0040 CMDRDS=040 ; read sectors with retry 7077 0060 CMDWRS=060 ; write sectors with retry 7078 0341 CMDSUP=341 ; spin up 7079 0340 CMDSDN=340 ; spin down PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 173 Initialize IDE Drive and Interface bts6120.plx 7080 .TITLE Initialize IDE Drive and Interface 7081 7082 7083 ; This routine will initialize the IDE interface by configuring the 8255 7084 ; PPI and then asserting the IDE RESET signal to the drive. It then selects 7085 ; the master drive and waits for it to become ready, after which it returns. 7086 ; If there is no drive attached, or if the hardware is broken, then we'll time 7087 ; out after approximately 30 seconds of waiting for the drive to signal a 7088 ; ready status. 7089 ; 7090 ; Normally this routine will return with the AC and LINK both cleared, but 7091 ; if the drive reports an error then on return the LINK will be set and the 7092 ; drive's error status will be in the AC. In the case of a timeout, the 7093 ; LINK will be set and the AC will be -1 on return. 7094 11013 7200 IDEINI: CLA ; ... 7095 11014 3022 DCA DKSIZE ; zero means no disk is installed 7096 11015 6201 CDF 0 ; are we running on the SBC6120-RC model 7097 11016 1775 TAD @[RCFLAG] ; (get the flag that will tell us) 7098 11017 6211 CDF 1 ; ... 7099 11020 7640 SZA CLA ; ??? 7100 11021 5245 JMP IDEIN1: ; yep - the RC model never has an IDE drive 7101 11022 1374 TAD [IDEINP] ; PPI ports A and B are input and C is output 7102 11023 6477 PWCR ; ... 7103 11024 6476 PWPC ; clear all port C control lines 7104 11025 1373 TAD [SETDRE] ; set RESET L 7105 11026 6477 PWCR ; ... 7106 11027 1377 TAD [-10] ; according to the ATA specification, 7107 11030 7001 IAC ; ... we must leave RESET asserted for at 7108 11031 7440 SZA ; ... least 25 microseconds 7109 11032 5230 JMP .-2 ; 7110 11033 1372 TAD [CLRDRE] ; deassert RESET L 7111 11034 6477 PWCR ; ... 7112 7113 11035 1371 TAD [345] ; select the master drive, 512 byte sectors, 7114 11036 4770 JMS @[IDEWRR] ; ... and logical block addressing (LBA) mode 7115 11037 0106 REGLB3 ; ... 7116 7117 11040 4767 JMS @[IDERDR] ; quick check: read status reg 7118 11041 0107 REGSTS ; ... 7119 11042 1366 TAD [-345] ; if it's the same value as the last write, 7120 11043 7440 SZA ; there is almost certainly nothing there 7121 11044 5765 JMP @[WREADY] ; something... do a more complete check 7122 7123 11045 7360 IDEIN1: CLA CLL CML CMA ; return with AC = -1 and the LINK set 7124 11046 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 174 Identify IDE/ATA Device bts6120.plx 7125 .TITLE Identify IDE/ATA Device 7126 7127 7128 ; This routine will execute the ATA IDENTIFY DEVICE command and store the 7129 ; first 256 bytes of the result, in byte mode, in the panel memory buffer at 7130 ; DSKBUF. One thing to keep in mind is that ATAPI devices (e.g. CDROMs, ZIP 7131 ; disks, etc) ignore this command completely and respond to the ATAPI IDENTIFY 7132 ; PACKET DEVICE command instead. This means that if there are any ATAPI 7133 ; devices attached we'll never see them, which is fine since we don't 7134 ; understand how to talk to ATAPI devices anyway! 7135 ; 7136 ; The drive's response to IDENTIFY DEVICE will be 256 words of sixteen bit 7137 ; data full of device specific data - model number, manufacturer, serial 7138 ; number, drive geometry, maximum size, access time, and tons of other cool 7139 ; stuff. The RDIBUF routine would pack this sixteen bit data into twelve bit 7140 ; words by throwing away the upper four bits of each word, but that doesn't 7141 ; make sense in this case since we'd be destroying most of the useful 7142 ; information. Instead, this routine reads the data in an unpacked format and 7143 ; stores one eight bit byte per PDP-8 word. 7144 ; 7145 ; Unfortunately this would mean that we need a 512 word buffer to store the 7146 ; response, which is too big for our DSKBUF in panel memory. We're in luck, 7147 ; however, because of the 256 words (512 bytes) returned by this command the 7148 ; ATA specification only defines the first 128 - the remaining half of the 7149 ; data is "vendor specific" and undefined. This routine simply throws this 7150 ; part away, and only the first 128 words (256 bytes) of the drive's response 7151 ; are actually returned in the buffer. 7152 ; 7153 ; Like all the disk I/O routines, in the case of an error the LINK will 7154 ; be set and the contents of the drive's error register returned in the AC. 7155 11047 6205 DISKID: .PUSHJ @[WREADY] ; (just in case the drive is busy now) 11050 5765 7156 11051 7430 SZL ; any errors? 7157 11052 6225 .POPJ ; yes - we can go home early! 7158 11053 1364 TAD [CMDIDD] ; send the ATA identify device command 7159 11054 4770 JMS @[IDEWRR] ; by writing it to the command register 7160 11055 0107 REGCMD ; ... 7161 11056 6205 .PUSHJ @[WDRQ] ; the drive should ask to transfer data next 11057 5763 7162 11060 7430 SZL ; any errors? 7163 11061 6225 .POPJ ; yes - just give up 7164 7165 ; Get ready to ready to transfer data from the drive to our buffer... 7166 11062 1362 TAD [DSKBUF-1] ; setup BUFPTR to point to DSKBUF 7167 11063 3011 DCA BUFPTR ; ... 7168 11064 1361 TAD [-128.] ; transfer 128 words this time 7169 11065 3052 DCA XFRCNT ; ... 7170 11066 1374 TAD [IDEINP] ; set PPI ports A and B to input mode 7171 11067 6477 PWCR ; ... 7172 11070 1360 TAD [REGDAT] ; make sure the IDE data register is selected 7173 11071 6476 PWPC ; ... 7174 7175 ; Read 256 bytes into the caller's buffer, one byte per word. Big endian 7176 ; ordering (i.e. high byte first) is defined by the ATA specification to give 7177 ; the correct character order for ASCII strings in the device data (e.g. model 7178 ; number, serial number, manufacturer, etc). 7179 11072 1357 IDDEV1: TAD [SETDRD] ; assert DIOR 7180 11073 6477 PWCR ; ... 7181 11074 6470 PRPA ; read port A (the high byte) first 7182 11075 0356 AND [377] ; only eight bits are valid 7183 11076 3411 DCA @BUFPTR ; and store it in the buffer 7184 11077 6471 PRPB ; then read port B (the low byte) 7185 11100 0356 AND [377] ; ... 7186 11101 3411 DCA @BUFPTR ; ... 7187 11102 1355 TAD [CLRDRD] ; deassert DIOR PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 175 Identify IDE/ATA Device bts6120.plx 7188 11103 6477 PWCR ; ... 7189 11104 2052 ISZ XFRCNT ; have we done all 256 bytes? 7190 11105 5272 JMP IDDEV1 ; nope - keep reading 7191 7192 ; We've read our 256 bytes, but the drive still has another 256 more waiting 7193 ; in the buffer. We need to read those and throw them away... 7194 11106 1361 TAD [-128.] ; we still need to read 128 more words 7195 11107 3052 DCA XFRCNT ; ... 7196 11110 1357 IDDEV2: TAD [SETDRD] ; assert DIOR 7197 11111 6477 PWCR ; ... 7198 11112 7000 NOP ; make sure the DIOR pulse is wide enough 7199 11113 7000 NOP ; ... 7200 11114 1355 TAD [CLRDRD] ; and then clear DIOR 7201 11115 6477 PWCR ; ... 7202 11116 2052 ISZ XFRCNT ; have we done all 128? 7203 11117 5310 JMP IDDEV2 ; nope - keep reading 7204 7205 ; Drives report the total number of LBA addressable sectors in words 7206 ; 60 and 61. Sectors are 512 bytes, so simply dividing this value by 2048 7207 ; gives us the total drive size in Mb. This code patches together twelve 7208 ; bits out of the middle of this doubleword, after throwing away the least 7209 ; significant 11 bits to divide by 2048. This allows us to determine the 7210 ; size of drives up to 4Gb in a single 12 bit word. 7211 11120 1754 TAD @[DSKBUF+170] ; get the high byte of the low word 7212 11121 7010 RAR ; throw away the 3 least significant 7213 11122 7012 RTR ; ... 7214 11123 0353 AND [37] ; keep just 5 bits from this byte 7215 11124 3022 DCA DKSIZE ; save it for a minute 7216 11125 1752 TAD @[DSKBUF+173] ; get the low byte of the high word 7217 11126 7006 RTL ; left justify the seven MSBs of it 7218 11127 7006 RTL ; ... 7219 11130 7004 RAL ; ... 7220 11131 0351 AND [7740] ; ... 7221 11132 1022 TAD DKSIZE ; put together all twelve bits 7222 11133 3022 DCA DKSIZE ; ... 7223 7224 ; All done - return success... 7225 11134 7300 CLA CLL ; return with the AC and LINK clear 7226 11135 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 176 Get IDE Disk Size ROM Call bts6120.plx 7227 .TITLE Get IDE Disk Size ROM Call 7228 7229 7230 ; The get IDE disk size call will return the size of the attached IDE/ATA 7231 ; disk, in megabytes. This call never fails - if no disk is attached it 7232 ; simply returns zero... 7233 ; 7234 ;CALL: 7235 ; PR0 / call SBC6120 ROM firmware 7236 ; 5 / subfunction for get disk size 7237 ; 7238 ; 7239 11136 7300 GETDKS: CLA CLL ; ignore anything in the AC 7240 11137 1022 TAD DKSIZE ; and return the disk size 7241 11140 6225 .POPJ ; that's all there is to it! 7242 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 7243 11200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 177 IDE Disk Primary Bootstrap bts6120.plx 7244 .TITLE IDE Disk Primary Bootstrap 7245 7246 ; This routine will read block zero from IDE disk unit zero into page 7247 ; zero of field zero of main memory. The next step in the usual boot sequence 7248 ; would be to start the secondary bootstrap, but that's up to the caller... 7249 11200 7240 IDBOOT: STA ; point the buffer to page 0 7250 11201 3011 DCA BUFPTR ; ... 7251 11202 1377 TAD [CDF 0] ; of field zero 7252 11203 3776 DCA @[BUFCDF+1] ; ... 7253 11204 3053 DCA BUFPNL ; of main memory 7254 11205 6201 CDF 0 ; PARMAP lives in field 0 7255 11206 1775 TAD @[PARMAP] ; get partition number of unit 0 7256 11207 6211 CDF 1 7257 11210 3020 DCA DKPART ; ... 7258 11211 3021 DCA DKRBN ; block zero 7259 11212 1374 TAD [-128.] ; we only need the first 1/2 of the block 7260 11213 5773 JMP @[DISKRD] ; ... 7261 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 178 Read and Write IDE Sectors bts6120.plx 7262 .TITLE Read and Write IDE Sectors 7263 7264 ; This routine will read a single sector from the attached IDE drive. 7265 ; The caller should set up DKPART and DKRBN with the disk partition and 7266 ; sector number, and BUFPTR, BUFCDF and BUFPNL with the address of a 7267 ; buffer in 6120 memory. If any errors are encountered, this routine will 7268 ; return with the LINK set and the drive's error status in the AC... 7269 ; side effect: BUFPTR is advanced by the read size 7270 ; HOOK: this function can be intercepted in order to connect a different 7271 ; device interface to all the commands and functions that use the disk 7272 11214 7000 DISKRD: NOP ; HOOK: disk read 7273 11215 7000 NOP 7274 11216 7000 NOP 7275 11217 3054 DCA BUFSIZ ; save the buffer size 7276 7277 ; See if there really is a hard disk attached. If not, then immediately 7278 ; take the error return with the AC set to -1. 7279 11220 1022 TAD DKSIZE ; if there is a disk attached 7280 11221 7640 SZA CLA ; then DKSIZE will be non-zero 7281 11222 5225 JMP DRD1 ; it is - it's safe to proceed 7282 11223 7360 CLA CLL CML CMA ; no disk - return LINK = 1 and AC = -1 7283 11224 6225 .POPJ ; and quit now 7284 7285 11225 6205 DRD1: .PUSHJ @[WREADY] ; wait for the drive to become ready 11226 5772 7286 11227 7430 SZL ; any errors detected?? 7287 11230 6225 .POPJ ; yes - quit now 7288 11231 6205 .PUSHJ SETLBA ; set up the disk's LBA registers 11232 5310 7289 11233 1371 TAD [CMDRDS] ; read sector with retry command 7290 11234 4770 JMS @[IDEWRR] ; write that to the command register 7291 11235 0107 REGCMD ; ... 7292 11236 6205 .PUSHJ @[WDRQ] ; now wait for the drive to finish 11237 5767 7293 11240 7430 SZL ; any errors detected? 7294 11241 6225 .POPJ ; yes - quit now 7295 11242 1054 TAD BUFSIZ ; no - transfer data 7296 11243 5766 JMP @[RDIBUF] ; ... from the sector buffer to memory 7297 7298 7299 ; This routine will write a single sector to the attached IDE drive. Except 7300 ; for the direction of data transfer, it's basically the same as DISKRD, 7301 ; including all parameters and error returns. 7302 ; HOOK: this function can be intercepted in order to connect a different 7303 ; device interface to all the commands and functions that use the disk 7304 11244 7000 DISKWR: NOP ; HOOK: disk write 7305 11245 7000 NOP 7306 11246 7000 NOP 7307 11247 3054 DCA BUFSIZ ; save the caller's record size 7308 7309 ; See if there really is a hard disk attached. If not, then immediately 7310 ; take the error return with the AC set to -1. 7311 11250 1022 TAD DKSIZE ; if there is a disk attached 7312 11251 7640 SZA CLA ; then DKSIZE will be non-zero 7313 11252 5255 JMP DWR1 ; it is - it's safe to proceed 7314 11253 7360 CLA CLL CML CMA ; no disk - return LINK = 1 and AC = -1 7315 11254 6225 .POPJ ; and quit now 7316 7317 11255 6205 DWR1: .PUSHJ @[WREADY] ; wait for the drive to become ready 11256 5772 7318 11257 7430 SZL ; did we encounter an error ? 7319 11260 6225 .POPJ ; yes - just give up now 7320 11261 6205 .PUSHJ SETLBA ; set up the disk address registers 11262 5310 7321 11263 1365 TAD [CMDWRS] ; write sector with retry command PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 179 Read and Write IDE Sectors bts6120.plx 7322 11264 4770 JMS @[IDEWRR] ; write that to the command register 7323 11265 0107 REGCMD ; ... 7324 11266 6205 .PUSHJ @[WDRQ] ; wait for the drive to request data 11267 5767 7325 11270 7430 SZL ; did the drive detect an error instead? 7326 11271 6225 .POPJ ; yes - just give up 7327 11272 1054 TAD BUFSIZ ; nope - transfer the data 7328 11273 6205 .PUSHJ @[WRIBUF] ; ... to the sector buffer from memory 11274 5764 7329 7330 ; There's a subtle difference in the order of operations between reading and 7331 ; writing. In the case of writing, we send the WRITE SECTOR command to the 7332 ; drive, transfer our data to the sector buffer, and only then does the 7333 ; drive actually go out and access the disk. This means we have to wait 7334 ; one more time for the drive to actually finish writing, because only then 7335 ; can we know whether it actually worked or not! 7336 11275 5772 JMP @[WREADY] ; wait for the drive to finish writing PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 180 Spin Up and Spin Down IDE Drive bts6120.plx 7337 .TITLE Spin Up and Spin Down IDE Drive 7338 7339 7340 ; This routine will send a spin up command to the IDE drive and then wait 7341 ; for it to finish. This command will take a fairly long time under normal 7342 ; conditions. Worse, since this is frequently the first command we send to 7343 ; a drive, if there's no drive attached at all we'll have to wait for it 7344 ; to time out. If any errors are encountered then the LINK will be set on 7345 ; return and the contents of the drive's error register will be in the AC. 7346 11276 7200 SPINUP: CLA ; ... 7347 11277 1363 TAD [CMDSUP] ; send the spin up command to the drive 7348 11300 4770 JMS @[IDEWRR] ; by writing it to the command register 7349 11301 0107 REGCMD ; ... 7350 11302 5772 JMP @[WREADY] ; wait for the drive to become ready 7351 7352 7353 ; This routine will send a spin down command. Drives are not required by 7354 ; the standard to implement this command, so there's no guarantee that any 7355 ; thing will actually happen! 7356 11303 7200 SPINDN: CLA ; ... 7357 11304 1362 TAD [CMDSDN] ; send the spin down command to the drive 7358 11305 4770 JMS @[IDEWRR] ; ... 7359 11306 0107 REGCMD ; ... 7360 11307 5772 JMP @[WREADY] ; and wait for it to finish PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 181 Setup IDE Unit, LBA and Sector Count Registers bts6120.plx 7361 .TITLE Setup IDE Unit, LBA and Sector Count Registers 7362 7363 7364 ; This routine will set up the IDE logical block address (LBA) registers 7365 ; according to the current disk address in locations DKPART and DKRBN. On IDE 7366 ; drives the sector number is selected via the cylinder and sector registers in 7367 ; the register file, but in the case of LBA mode these registers simply form a 7368 ; 24 bit linear sector number. In this software the disk partition number, in 7369 ; DKPART, gives the upper twelve bits of the address and the current sector 7370 ; number, in DKRBN, gives the lower twelve bits. 7371 ; 7372 ; This routine does not detect any error conditions... 7373 11310 7200 SETLBA: CLA ; just in case! 7374 11311 1021 TAD DKRBN ; get the lower 12 bits of of the LBA 7375 11312 4770 JMS @[IDEWRR] ; and write the lowest 8 bits to LBA0 7376 11313 0103 REGLB0 ; (the upper 4 bits are ignored) 7377 11314 1021 TAD DKRBN ; now get the upper 4 bits of the sector number 7378 11315 7002 BSW ; shift right eight bits 7379 11316 7012 RTR ; ... 7380 11317 0361 AND [17] ; get rid of the extra junk 7381 11320 3344 DCA LBATMP ; ... 7382 11321 1020 TAD DKPART ; get the disk partition number 7383 11322 7006 RTL ; shift them left four bits 7384 11323 7006 RTL ; ... 7385 11324 0360 AND [360] ; and isolate just four bits of that 7386 11325 1344 TAD LBATMP ; and build the middle byte of the LBA 7387 11326 4770 JMS @[IDEWRR] ; set that register next 7388 11327 0104 REGLB1 ; ... 7389 11330 1020 TAD DKPART ; get the partition one more time 7390 11331 7012 RTR ; shift it right four more bits 7391 11332 7012 RTR ; ... 7392 11333 4770 JMS @[IDEWRR] ; to make the upper byte of the 24 bit LBA 7393 11334 0105 REGLB2 ; ... 7394 7395 ; Note that the final four bits of the LBA are in LBA3 (the head and drive 7396 ; select register). Since we can only support 24 bit LBAs, these are unused. 7397 ; The IDEINI routine initializes them to zero at the same time it selects the 7398 ; master drive, and we never change 'em after that. At the same time, IDEINI 7399 ; also selects LBA addressing mode (which is obviously very important to us!) 7400 ; and 512 byte sectors. 7401 11335 1362 TAD [340] ; select the master drive, 512 byte sectors, 7402 11336 4770 JMS @[IDEWRR] ; ... and logical block addressing (LBA) mode 7403 11337 0106 REGLB3 ; ... 7404 7405 ; Always load the sector count register with one... 7406 11340 7201 NL0001 ; write 1 7407 11341 4770 JMS @[IDEWRR] ; ... 7408 11342 0102 REGCNT ; to the sector count register 7409 11343 6225 .POPJ ; that's all we have to do 7410 7411 ; Temporary storage for SETLBA... 7412 11344 LBATMP: .BLOCK 1 11360 0360 11361 0017 11362 0340 11363 0341 11364 1600 11365 0060 11366 1646 11367 1426 11370 2061 11371 0040 11372 1400 11373 1214 11374 7600 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 182 Setup IDE Unit, LBA and Sector Count Registers bts6120.plx 11375 0020 11376 2222 11377 6201 7413 11400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 183 Wait for IDE Drive Ready bts6120.plx 7414 .TITLE Wait for IDE Drive Ready 7415 7416 7417 ; This routine tests for the DRIVE READY bit set in the status register and 7418 ; at the same time for the DRIVE BUSY bit to be clear. READY set means that 7419 ; the drive has power and is spinning, and BUSY clear means that it isn't 7420 ; currently executing a command. The combination of these two conditions means 7421 ; that the drive is ready to accept another command. Normally this routine 7422 ; will return with both the AC and the LINK cleared, however if the drive sets 7423 ; the ERROR bit in its status register then it will return with the LINK set 7424 ; and the contents of the drive's error register in the AC. 7425 ; 7426 ; If there is no drive connected, or if the drive fails for some reason, 7427 ; then there is the danger that this routine will hang forever. To avoid 7428 ; that it also implements a simple timeout, and if the drive doesn't become 7429 ; ready within a certain period of time it will return with the LINK set and 7430 ; the AC equal to -1. If the system has just been powered up, then we'll 7431 ; have to wait for the drive to spin up before it becomes ready, and that can 7432 ; take a fairly long time. To be safe, the timeout currently stands at a 7433 ; full 30 seconds! 7434 11400 1377 WREADY: TAD [7550] ; initialize the outer timeout counter 7435 11401 3225 DCA RDYTMO+1 ; ... 7436 11402 3224 DCA RDYTMO ; and the inner counter is always cleared 7437 11403 4776 WREAD1: JMS @[IDERDR] ; go read the status register 7438 11404 0107 REGSTS ; (register to read) 7439 11405 7110 CLL RAR ; test the error bit first (AC11) 7440 11406 7430 SZL ; ??? 7441 11407 5775 JMP @[DRVERR] ; give up now if the drive reports an error 7442 11410 7004 RAL ; restore the original status 7443 11411 0374 AND [STSBSY+STSRDY] ; test both the READY and BUSY bits 7444 11412 1373 TAD [-STSRDY] ; is READY set and BUSY clear? 7445 11413 7020 CML ; (the last TAD will have set the link!) 7446 11414 7650 SNA CLA ; ??? 7447 11415 6225 .POPJ ; yes - return now with the AC and LINK clear 7448 11416 2224 ISZ RDYTMO ; increment the inner timeout counter 7449 11417 5203 JMP WREAD1 ; no overflow yet 7450 11420 2225 ISZ RDYTMO+1 ; when the inner counter overflows, increment 7451 11421 5203 JMP WREAD1 ; ... the outer counter too 7452 7453 ; Here in the case of a drive time out... 7454 11422 7360 CLA CLL CML CMA ; return with AC = -1 and the LINK set 7455 11423 6225 .POPJ ; ... 7456 7457 ; Temporary storage for WREADY... 7458 11424 RDYTMO: .BLOCK 2 ; a double word time out counter 7459 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 184 Wait for IDE Data Request bts6120.plx 7460 .TITLE Wait for IDE Data Request 7461 7462 ; This routine will wait for the DRQ bit to set in the drive status register. 7463 ; This bit true when the drive is ready to load or unload its sector buffer, 7464 ; and normally a call to this routine will be immediately followed by a call 7465 ; to ether RDIBUF or WRIBUF. Normally this routine will return with both the 7466 ; LINK and the AC cleared, however if the drive sets its error bit then the 7467 ; LINK will be 1 on return and the drive's error status will be in the AC. 7468 ; 7469 ; WARNING - unlike WREADY, this routine does not have a timeout! 7470 11426 4776 WDRQ: JMS @[IDERDR] ; read the drive status register 7471 11427 0107 REGSTS ; ... 7472 11430 7110 CLL RAR ; test the error bit (AC11) 7473 11431 7430 SZL ; is it set? 7474 11432 5242 JMP DRVERR ; yes - give the error return 7475 11433 7004 RAL ; no - restore the original status value 7476 11434 0372 AND [STSBSY+STSDRQ] ; and test the BUSY and DRQ flags 7477 11435 1371 TAD [-STSDRQ] ; wait for BUSY clear and DRQ set 7478 11436 7020 CML ; (the last TAD will have set the link!) 7479 11437 7640 SZA CLA ; well? 7480 11440 5226 JMP WDRQ ; nope - keep waiting 7481 11441 6225 .POPJ ; yes - return with AC and LINK cleared! 7482 7483 ; We get here if the drive sets the error flag in the status register. In 7484 ; this case we return with the link bit set and the contents of the drive 7485 ; error register in the AC. 7486 11442 4776 DRVERR: JMS @[IDERDR] ; read the drive error register 7487 11443 0101 REGERR ; ... 7488 11444 7120 STL ; and be sure the link is set 7489 11445 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 185 RAM Disk Diagnostics bts6120.plx 7490 .TITLE RAM Disk Diagnostics 7491 7492 ; This routine will do a simple test of the RAM disk array to determine 7493 ; whether each SRAM chip, from 0 to 7, is installed. If a given chip is 7494 ; installed, then we do another simple test to determine whether it is a 7495 ; 512K or 128K device, and then update the RDSIZE array accordingly. 7496 ; Because of the way disk sectors are laid out, only the first 4032 bytes 7497 ; (21 * 192) of every 4Kb bank are actually used. The last 64 bytes of each 7498 ; bank are available to us to use any way we like, including as a RAM test. 7499 ; 7500 ; There's one nasty complication here - the pin that corresponds to A17 on 7501 ; the 512K SRAM chips is actually an alternate chip enable on the 128K chips. 7502 ; Worse, this alternate enable is active HIGH, which means that A17 must be 7503 ; one or 128K chips won't talk at all. Fortunately, the pin that corresponds 7504 ; to A18 is a no connect on the 128K chips, so we can safely leave it zero. 7505 ; This explains the strange bank numbers selected in this test! 7506 ; 7507 11446 3044 RDTEST: DCA RAMSIZ ; clear the total RAM size 7508 7509 ; Clear the entire RDSIZE array, even if we have fewer than 8 SRAMs... 7510 11447 1371 TAD [-10] ; RDZISE always holds 8 units 7511 11450 3024 DCA RDUNIT ; count them here 7512 11451 1370 TAD [RDSIZE-1] ; and point to the RDSIZE array 7513 11452 3012 DCA XX1 ; (an auto-index register) 7514 11453 3412 DCA @XX1 ; clear another entry 7515 11454 2024 ISZ RDUNIT ; have we done them all 7516 11455 5253 JMP .-2 ; no - keep clearing 7517 ; yes - start testing with RDUNIT = 0 ! 7518 7519 ; If this is the RC model, then we'll need a different algorithm ... 7520 11456 4767 JMS @[CHKRC] ; test for the SBC6120-RC model 7521 11457 5766 JMP @[RCTEST] ; yep - go handle that case instead 7522 ; this is the original model 7523 7524 ; First test to see if this chip is even installed by writing alternating 7525 ; bit patterns to the last two locations and reading them back. If that works, 7526 ; then there must be something there! 7527 11460 6205 RDTES0: .PUSHJ @[RAMSEL] ; and set up RAMCDF and SIZPTR 11461 5765 7528 11462 1364 TAD [32.] ; test bank 32 so that A17 will be set 7529 11463 6410 LDAR ; ... 7530 11464 4763 JMS @[RAMCDF] ; change the DF to select the unit 7531 11465 6403 MM3 ; and enable the SRAM array 7532 11466 1362 TAD [252] ; write alternating bits to the last two bytes 7533 11467 3761 DCA @[7776] ; ... 7534 11470 1360 TAD [125] ; ... 7535 11471 3757 DCA @[7777] ; ... 7536 11472 1761 TAD @[7776] ; now read 'em back 7537 11473 1757 TAD @[7777] ; and add them up 7538 11474 7001 IAC ; the sum should be 377, so make it 400 7539 11475 0356 AND [377] ; and remember RAM disk is only 8 bits wide 7540 11476 7640 SZA CLA ; did it work?? 7541 11477 5312 JMP RDTES1 ; no - this chip doesn't exist 7542 7543 ; Some kind of SRAM chip is installed, and now we need to decide whether its 7544 ; 128K or 512K. The 128K chips ignore A18, so one easy test is to select 7545 ; bank 96 (which, to a 128K chip is the same as bank 32), zero out a location 7546 ; that we just tested, and then go back to bank 32 to see if it changed. 7547 11500 1355 TAD [96.] ; select bank 96 7548 11501 6410 LDAR ; which doesn't exist in a 128K chip 7549 11502 3757 DCA @[7777] ; this location in bank 0 used to hold 125 7550 11503 1364 TAD [32.] ; back to bank 32 7551 11504 6410 LDAR ; ... 7552 11505 1757 TAD @[7777] ; and see what we've got 7553 11506 0356 AND [377] ; remember RAM disk is only 8 bits wide PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 186 RAM Disk Diagnostics bts6120.plx 7554 11507 7640 SZA CLA ; if it's zero, then we have a 128K chip 7555 11510 1354 TAD [RAM512-RAM128]; nope - this must be a full 512K SRAM! 7556 11511 1353 TAD [RAM128] ; only 128K, but better than nothing 7557 7558 ; Store the chip size in RDSIZE and accumulate the total size... 7559 11512 6402 RDTES1: MM2 ; return to the default memory map 7560 11513 6211 CDF 1 ; and field 7561 11514 3445 DCA @SIZPTR ; store the size in RDSIZE[unit] 7562 11515 1445 TAD @SIZPTR ; ... 7563 11516 7450 SNA ; was there any chip here at all? 7564 11517 5327 JMP RDTES2 ; no - we can skip this part 7565 11520 7710 SPA CLA ; KLUDGE - skip if this was a 128K chip 7566 11521 1352 TAD [512.-128.] ; add 512K to the total RAM size 7567 11522 1351 TAD [128.] ; add 128K " " " " " 7568 ; Now it's time for a major hack. If we have a full eight 512K SRAM chips 7569 ; installed, then RAMSIZ will be 4096KB, or zero in the twelve bit world! 7570 ; If we ever find that, after adding the size of this chip, RAMSIZ is zero 7571 ; then we know that situation has occurred. The only thing we can to is to 7572 ; set RAMSIZ to 4095 instead of 4096 - that way, at least, it doesn't look 7573 ; like we have nothing... 7574 11523 1044 TAD RAMSIZ ; ... 7575 11524 7450 SNA ; did we reach 4096K ??? 7576 11525 7240 STA ; yes - set it to 4095 instead 7577 11526 3044 DCA RAMSIZ ; ... 7578 7579 ; On to the next unit, if there are any more left... 7580 11527 2024 RDTES2: ISZ RDUNIT ; go on to the next unit 7581 11530 1047 TAD RDTYPE ; get the RAM disk type 7582 11531 7700 SMA CLA ; skip if it's a DS1221 or IOB6120 card 7583 11532 1350 TAD [-4] ; no - the DS1231 card supports 8 units 7584 11533 1350 TAD [-4] ; and the others only 4 7585 11534 1024 TAD RDUNIT ; have we done all eight ? 7586 11535 7640 SZA CLA ; ??? 7587 11536 5260 JMP RDTES0 ; no - keep checking 7588 11537 1044 TAD RAMSIZ ; yes - return the total RAM disk size 7589 11540 6225 .POPJ ; and that's it 7590 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 2742 11570 0033 11571 7770 11572 0210 11573 7700 11574 0300 11575 1442 11576 2101 11577 7550 7591 11600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 187 Write IDE Sector Buffer bts6120.plx 7592 .TITLE Write IDE Sector Buffer 7593 7594 7595 ; This routine will write PDP-8 twelve bit words to the IDE drive's sixteen 7596 ; bit data (sector) buffer. IDE drives naturally transfer data in sixteen bit 7597 ; words, and we simply store each twelve bit word zero extended. This wastes 7598 ; 25% of the drive's capacity, but in these days of multiple gigabyte disks, 7599 ; that hardly seems important. This also means that 256 PDP-8 words exactly 7600 ; fill one IDE sector, which is very convenient for OS/8! 7601 ; 7602 ; The caller is expected to set up BUFPTR, BUFCDF and BUFPNL to point to the 7603 ; buffer in 6120 memory. The negative of the buffer size should be passed in 7604 ; the AC, however we must always write exactly 256 words to the drive regard- 7605 ; less of the buffer size. If the buffer is smaller than that, then the last 7606 ; word is simply repeated until we've filled the entire sector. This is 7607 ; necessary for OS/8 handler "half block" writes. 7608 ; 7609 ; This routine does not wait for the drive to set DRQ, nor does it check the 7610 ; drive's status for errors. Those are both up to the caller. 7611 11600 3054 WRIBUF: DCA BUFSIZ ; save the actual buffer size 7612 11601 1377 TAD [-256.] ; but always transfer 256 words, regardless 7613 11602 3052 DCA XFRCNT ; ... 7614 11603 1376 TAD [IDEOUT] ; and set ports A and B to output mode 7615 11604 6477 PWCR ; ... 7616 11605 1375 TAD [REGDAT] ; make sure the IDE data register is addressed 7617 11606 6476 PWPC ; ... 7618 11607 4774 JMS @[BUFCDF] ; change to the buffer's field 7619 7620 ; Transfer 256 twelve bit words into 256 sixteen bit words... 7621 11610 1411 WRIBU1: TAD @BUFPTR ; and get the next data word 7622 11611 3312 DCA BUFTMP ; save it temporarily 7623 11612 1312 TAD BUFTMP ; ... 7624 11613 6475 PWPB ; write the lowest 8 bits to port B 7625 11614 1312 TAD BUFTMP ; then get the upper four bits 7626 11615 7002 BSW ; ... 7627 11616 7012 RTR ; ... 7628 11617 0373 AND [17] ; ensure that the extra bits are zero 7629 11620 6474 PWPA ; and write the upper four bits to port A 7630 11621 1372 TAD [SETDWR] ; assert DIOW 7631 11622 6477 PWCR ; ... 7632 11623 1371 TAD [CLRDWR] ; and then clear it 7633 11624 6477 PWCR ; ... 7634 11625 2052 ISZ XFRCNT ; have we done 256 words?? 7635 11626 7410 SKP ; no - keep going 7636 11627 5240 JMP WRIBU3 ; yes - always stop now 7637 11630 2054 ISZ BUFSIZ ; have we filled the buffer ? 7638 11631 5210 JMP WRIBU1 ; nope - keep copying 7639 7640 ; Here when we've emptied the 6120 buffer, but if we haven't done 256 words 7641 ; we have to keep going until we've filled the drive's sector buffer. All we 7642 ; need to do is to keep asserting DIOW, which simply repeats the last word 7643 ; written! 7644 11632 1372 WRIBU2: TAD [SETDWR] ; assert DIOW 7645 11633 6477 PWCR ; ... 7646 11634 1371 TAD [CLRDWR] ; and deassert DIOW 7647 11635 6477 PWCR ; ... 7648 11636 2052 ISZ XFRCNT ; have we finished the sector? 7649 11637 5232 JMP WRIBU2 ; nope 7650 7651 ; Restore the PPI ports to input mode and return. Note that some disk 7652 ; I/O routines JMP to WRIBUF as the last step, so it's important that we 7653 ; always return with the AC and LINK cleared to indicate success. 7654 11640 6211 WRIBU3: CDF 1 ; return to our field 7655 11641 6276 SPD ; and to panel memory 7656 11642 1370 TAD [IDEINP] ; reset ports A and B to input PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 188 Write IDE Sector Buffer bts6120.plx 7657 11643 6477 PWCR ; ... 7658 11644 7300 CLA CLL ; return success 7659 11645 6225 .POPJ ; all done here PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 189 Read IDE Sector Buffer bts6120.plx 7660 .TITLE Read IDE Sector Buffer 7661 7662 7663 ; This routine will read sixteen bit words from the IDE drive's sector 7664 ; buffer and store them in twelve bit PDP-8 memory words. Data is converted 7665 ; from sixteen to twelve bits by the simple expedient of discarding the upper 7666 ; four bits of each word - it can't get much easier than that! 7667 ; 7668 ; The caller is expected to set up BUFPTR, BUFCDF and BUFPNL to point to the 7669 ; buffer in 6120 memory. The negative of the buffer size should be passed in 7670 ; the AC. This is the number of words that will be stored in the buffer, 7671 ; however we'll always read exactly 256 words from the drive regardless of 7672 ; the buffer size. If the buffer is smaller than this then the extra words 7673 ; are simply discarded. This is necessary for OS/8 handler "half block" reads. 7674 ; 7675 ; Like WRIBUF, this routine does not wait for the drive to set DRQ, nor does 7676 ; it check the drive's status for errors. Those are both up to the caller. 7677 11646 3054 RDIBUF: DCA BUFSIZ ; save the actual buffer size 7678 11647 1377 TAD [-256.] ; but always transfer 256 words, regardless 7679 11650 3052 DCA XFRCNT ; ... 7680 11651 1370 TAD [IDEINP] ; and set ports A and B to input mode 7681 11652 6477 PWCR ; ... 7682 11653 1375 TAD [REGDAT] ; make sure the IDE data register is addressed 7683 11654 6476 PWPC ; ... 7684 11655 4774 JMS @[BUFCDF] ; change to the buffer's field 7685 7686 ; Transfer 256 twelve bit words... 7687 11656 1367 RDIBU1: TAD [SETDRD] ; assert DIOR 7688 11657 6477 PWCR ; ... 7689 11660 6471 PRPB ; capture the lower order byte 7690 11661 0366 AND [377] ; remove any junk bits, just in case 7691 11662 3312 DCA BUFTMP ; and save that for a minute 7692 11663 6470 PRPA ; then capture the high byte 7693 11664 0373 AND [17] ; we only want four bits from that 7694 11665 7002 BSW ; shift it left eight bits 7695 11666 7106 CLL RTL ; ... 7696 11667 1312 TAD BUFTMP ; assemble a complete twelve bit word 7697 11670 3411 DCA @BUFPTR ; and store it in the buffer 7698 11671 1365 TAD [CLRDRD] ; finally we can deassert DIOR 7699 11672 6477 PWCR ; ... 7700 11673 2052 ISZ XFRCNT ; have we done 256 words?? 7701 11674 7410 SKP ; no - keep going 7702 11675 5306 JMP RDIBU3 ; yes - always stop now 7703 11676 2054 ISZ BUFSIZ ; have we filled the buffer ? 7704 11677 5256 JMP RDIBU1 ; nope - keep copying 7705 7706 ; Here when we've filled the 6120 buffer, but if we haven't done 256 words 7707 ; we have to keep going until we've emptied the drive's sector buffer too. 7708 ; All we need to do is to keep asserting DIOR - there's no need to actually 7709 ; capture the data! 7710 11700 1367 RDIBU2: TAD [SETDRD] ; assert DIOR 7711 11701 6477 PWCR ; ... 7712 11702 1365 TAD [CLRDRD] ; and deassert DIOR 7713 11703 6477 PWCR ; ... 7714 11704 2052 ISZ XFRCNT ; have we finished the sector? 7715 11705 5300 JMP RDIBU2 ; nope 7716 7717 ; Restore the ROM field and memory space and return. Note that some disk 7718 ; I/O routines JMP to RDIBUF as the last step, so it's important that we 7719 ; always return with the AC and LINK cleared to indicate success. 7720 11706 6211 RDIBU3: CDF 1 ; ... 7721 11707 6276 SPD ; ... 7722 11710 7300 CLA CLL ; always return success 7723 11711 6225 .POPJ ; all done here 7724 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 190 Read IDE Sector Buffer bts6120.plx 7725 ; Temporary storage for RDIBUF and WRIBUF... 7726 11712 BUFTMP: .BLOCK 1 ; temporary for packing and unpacking 7727 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 191 Initialize Disk Partition Map bts6120.plx 7728 .TITLE Initialize Disk Partition Map 7729 7730 7731 ; This routine will initialize the disk partition map so that unit 0 7732 ; maps to partition 0, unit 1 maps to partition 1, etc... This is the 7733 ; default partition mapping used after a power on and remains in effect 7734 ; until changed by an OS/8 program with the "Set Partition Mapping" PR0 7735 ; subfunction. 7736 7737 11713 7200 INIPMP: CLA ; just in case... 7738 11714 1364 TAD [-8.] ; we are going to init 8 units 7739 11715 3020 DCA DKPART 7740 11716 1373 TAD [PARMAP-1] ; set up an auto index register 7741 11717 3012 DCA XX1 ; ... to address the partition map 7742 11720 6402 MM2 7743 11721 7215 INIPM1: NL0010 7744 11722 1020 TAD DKPART ; get the current partition/unit 7745 11723 6201 CDF 0 7746 11724 3412 DCA @XX1 ; and set the next entry in the map 7747 11725 6211 CDF 1 7748 11726 2020 ISZ DKPART 7749 11727 5321 JMP INIPM1 ; ... 7750 11730 7300 CLA CLL 7751 11731 6225 .POPJ 7752 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 192 Set Disk Partition Map ROM Call bts6120.plx 7753 .TITLE Set Disk Partition Map ROM Call 7754 7755 7756 ; This routine handles the "Set Disk Partition Mapping" (6) PR0 subfunction, 7757 ; which simply sets the partition number for the specified OS/8 unit. This 7758 ; change takes effect immediately, so if you've booted from the IDE disk 7759 ; you'll want to be a little careful about remapping the system partition! 7760 ; This function returns with the LINK set if an error occurs, currently the 7761 ; only failure that can happen is if the unit number is .GT. 7. Note that 7762 ; no range checking is done on the partition number to ensure that it fits 7763 ; within the disk size - if it doesn't we'll simply get I/O errors when OS/8 7764 ; attempts to access that partition. 7765 ; 7766 ;CALL: 7767 ; TAD (part / load the partition number into the AC 7768 ; PR0 / invoke the ROM monitor 7769 ; 6 / subfunction for Set disk partition 7770 ; / OS/8 unit to be changed, 0..7 7771 ; / LINK set if unit .GT. 7 7772 ; 7773 11732 3020 SETPMP: DCA DKPART ; save the partition number for a minute 7774 11733 6205 .PUSHJ @[GETARG] ; and get the unit number 11734 5763 7775 11735 3023 DCA DKUNIT ; ... 7776 11736 1023 TAD DKUNIT ; ... 7777 11737 7100 CLL ; be sure the link is in a known state 7778 11740 1364 TAD [-10] ; see if the unit number is legal 7779 11741 7630 SZL CLA ; the link will be set if it isn't 7780 11742 6225 .POPJ ; take the error return w/o changing anything 7781 11743 1023 TAD DKUNIT ; construct an index to the partition map 7782 11744 1373 TAD [PARMAP-1] ; ... 7783 11745 3012 DCA XX1 ; ... 7784 11746 1020 TAD DKPART ; then get the desired partition number 7785 11747 6201 CDF 0 ; PARAM lives in field 0 7786 11750 3412 DCA @XX1 ; and change it 7787 11751 6211 CDF 1 ; WRPSS requires DF = our IF! 7788 11752 6222 CIF 2 7789 11753 6205 .PUSHJ @[WRPSS] ; update NVRAM 11754 5762 7790 11755 7300 CLL CLA 7791 11756 6225 .POPJ ; return with the LINK and AC both clear 7792 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 7793 12000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 193 Get Disk Partition Map ROM Call bts6120.plx 7794 .TITLE Get Disk Partition Map ROM Call 7795 7796 7797 ; This routine handles the "Get Disk Partition Mapping" (7) PR0 subfunction, 7798 ; which simply returns the partition number currently associated with a 7799 ; specific OS/8 unit. The only way it can fail is if the unit number is 7800 ; greater than 7! 7801 ; 7802 ;CALL: 7803 ; PR0 / invoke the ROM monitor 7804 ; 7 / subfunction for get disk partition 7805 ; / OS/8 unit to be changed, 0..7 7806 ; / with partition number in the AC 7807 ; 7808 12000 6205 GETPMP: .PUSHJ @[GETARG] ; and get the unit number 12001 5777 7809 12002 3023 DCA DKUNIT ; ... 7810 12003 7100 CLL ; be sure the link is in a known state 7811 12004 1376 TAD [-10] ; see if the unit number is legal 7812 12005 1023 TAD DKUNIT ; ... 7813 12006 7630 SZL CLA ; the link will be set if it isn't 7814 12007 6225 .POPJ ; take the error return 7815 12010 1023 TAD DKUNIT ; construct an index to the partition map 7816 12011 1375 TAD [PARMAP-1] ; ... 7817 12012 3012 DCA XX1 ; ... 7818 12013 6201 CDF 0 ; PARMAP lives in field 0 7819 12014 1412 TAD @XX1 ; and get the current partition 7820 12015 6211 CDF 1 7821 12016 6225 .POPJ ; return with partition in the AC and LINK=0 7822 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 194 IDE Disk Read/Write ROM Call bts6120.plx 7823 .TITLE IDE Disk Read/Write ROM Call 7824 7825 7826 ; The calling sequence for the PR0 IDE disk R/W function is: 7827 ; 7828 ; PR0 7829 ; 0004 / panel function code for IDE disk I/O 7830 ; / R/W bit, page count, buffer field and unit 7831 ; / buffer address 7832 ; / starting block number 7833 ; / if any errors occur, the LINK will be set and the 7834 ; / the drive's error register are in the AC 7835 ; 7836 ; Except for the function code, the use of block numbers instead of page 7837 ; numbers, and the error codes, this calling sequence is identical to the 7838 ; RAM disk I/O PR0 subfunction! 7839 ; 7840 12017 6205 DISKRW: .PUSHJ @[SETBUF] ; set up MUUO, BUFPTR, BUFCDF and RWCNT 12020 5774 7841 12021 6205 .PUSHJ @[GETARG] ; and lastly get the disk block 12022 5777 7842 12023 3021 DCA DKRBN ; ... 7843 7844 ; The unit number is really just an index into the partition table and, 7845 ; since it's limited to three bits and eight units are supported, there's 7846 ; no need to range check it! 7847 12024 1050 DKRW0: TAD MUUO ; get the unit number 7848 12025 0373 AND [7] ; ... 7849 12026 1375 TAD [PARMAP-1] ; create an index to the partition table 7850 12027 3012 DCA XX1 ; ... 7851 12030 6201 CDF 0 ; PARMAP lives in field 0 7852 12031 1412 TAD @XX1 ; get the actual partition number 7853 12032 6211 CDF 1 7854 12033 3020 DCA DKPART ; ... that's mapped to this unit 7855 7856 ; Set up a pointer to the I/O routine. All of the rest of this code is 7857 ; independent of the direction of data flow... 7858 12034 1050 TAD MUUO ; get the function code 7859 12035 7700 SMA CLA ; should we read (0) or write (1) ? 7860 12036 1372 TAD [DISKRD-DISKWR]; ... read 7861 12037 1371 TAD [DISKWR] ; ... write 7862 12040 3260 DCA DISKIO ; save the address of the routine 7863 7864 ; We must take a minute out to share a word about pages vs blocks. An OS/8 7865 ; handler call specifies the size of the data to be read or written in pages, 7866 ; which are 128 words or exactly 1/2 of a 256 word disk block. This raises 7867 ; the unfortunate possibility that a program could ask to transfer an odd 7868 ; number of pages, which would mean that we'd need to read or write half a 7869 ; block! We can't ignore this problem because it really does happen and there 7870 ; really are OS/8 programs that attempt to transfer an odd number of pages. 7871 ; 7872 ; This is primarily an issue for reading, because if an odd number of pages 7873 ; are to be read we must be very careful to stop copying data to memory after 7874 ; 128 words. If we don't, a page of memory will be corrupted by being over 7875 ; written with the second half of the last disk block! It's also permitted in 7876 ; OS/8 to write an odd number of pages, but since many OS/8 mass storage 7877 ; devices have 256 word sectors it isn't always possible to write half a 7878 ; block. In this case it's undefined what gets written to the last half of 7879 ; the final block - it could be zeros, random garbage, or anything else. 7880 7881 ; This loop reads or writes pages 'till we've done all we're supposed to... 7882 12041 2055 DKRW1: ISZ RWCNT ; is there an odd page left over? 7883 12042 7410 SKP ; nope - it's safe to do a full block 7884 12043 5256 JMP DKRW2 ; yes - go transfer a half block and quit 7885 12044 1370 TAD [-256.] ; transfer two pages this time PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 195 IDE Disk Read/Write ROM Call bts6120.plx 7886 12045 6205 .PUSHJ @DISKIO ; either read or write 12046 5660 7887 12047 7430 SZL ; were there any errors? 7888 12050 6225 .POPJ ; yes - just abort the transfer now 7889 12051 2021 ISZ DKRBN ; increment the block number for next time 7890 12052 7000 NOP ; (this should never happen, but...) 7891 12053 2055 ISZ RWCNT ; are there more pages left to do ? 7892 12054 5241 JMP DKRW1 ; yup - keep going 7893 12055 6225 .POPJ ; all done - return AC = LINK = 0 7894 7895 ; Here to transfer one, final, half block... 7896 12056 1367 DKRW2: TAD [-128.] ; only do a single page this time 7897 12057 5660 JMP @DISKIO ; transfer it and we're done 7898 7899 ; Local storage for DISKRW... 7900 12060 DISKIO: .BLOCK 1 ; gets a pointer to either DISKRD or DISKWR 7901 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 196 Write IDE Register bts6120.plx 7902 .TITLE Write IDE Register 7903 7904 7905 ; This routine will write an eight bit value to any IDE drive register, 7906 ; except the data regsister, by toggling all the appropriate PPI port lines. 7907 ; The address of the register, which should include the CS1Fx and CS3Fx bits, 7908 ; is passed in line and the byte to be written is passed in the AC. Note that 7909 ; all IDE registers, with the exception of the data register, are eight bits 7910 ; wide so there's never a need to worry about the upper byte! 7911 ; 7912 ;CALL: 7913 ; TAD [value] ; eight bit value to write to the IDE register 7914 ; JMS IDEWRR 7915 ; xxxx ; IDE register number, plus CS1Fx and CS3Fx bits 7916 ; 7917 ; 7918 12061 0000 IDEWRR: 0 ; CALL HERE WITH A JMS!!! 7919 12062 3322 DCA IDETMP ; save the value to write for a minute 7920 12063 1366 TAD [IDEOUT] ; set ports A and B to output mode 7921 12064 6477 PWCR ; write the PPI control register 7922 12065 1661 TAD @IDEWRR ; get the IDE register address 7923 12066 2261 ISZ IDEWRR ; (skip it when we return) 7924 12067 6476 PWPC ; send the address to the drive via port C 7925 7926 ; Note that we don'e bother to drive the upper data byte (D8..D15) with any 7927 ; particular value. The PPI will have set these bits to zero when we changed 7928 ; the mode to output, but the drive will ignore them anyway. 7929 12070 1322 TAD IDETMP ; get the original data back 7930 12071 6475 PWPB ; (port B drives DD0..DD7) 7931 12072 1365 TAD [SETDWR] ; assert DIOW 7932 12073 6477 PWCR ; ... 7933 12074 1364 TAD [CLRDWR] ; and then clear it 7934 12075 6477 PWCR ; ... 7935 7936 ; We always leave our side of the PPI data bus (e.g. ports A and B) in 7937 ; input mode to avoid any accidental contention should the drive decide it 7938 ; wants to output data for some unknown reason. 7939 12076 1363 TAD [IDEINP] ; set ports A and B to input mode 7940 12077 6477 PWCR ; ... (but C is still an output) 7941 12100 5661 JMP @IDEWRR ; that's it! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 197 Read IDE Register bts6120.plx 7942 .TITLE Read IDE Register 7943 7944 7945 ; This routine will read one IDE drive register and return the value in the 7946 ; AC. all IDE registers, with the exception of the data register, are always 7947 ; eight bits wide so there's no need to worry about the upper byte here. We 7948 ; simply ignore it. The address of the register to be read should be passed 7949 ; inline, following the call to this procedure. 7950 ; 7951 ;CALL 7952 ; JMS IDERDR 7953 ; xxxx ; IDE register number, including CS1Fx and CS3Fx bits 7954 ; 7955 ; 7956 12101 0000 IDERDR: 0 ; CALL HERE WITH A JMS!! 7957 12102 7200 CLA ; just in case... 7958 12103 1363 TAD [IDEINP] ; set ports A and B to input 7959 12104 6477 PWCR ; ... (this should be unnecessary, 7960 12105 1701 TAD @IDERDR ; get the IDE register address 7961 12106 2301 ISZ IDERDR ; (and don't forget to skip it!) 7962 12107 6476 PWPC ; send it to the drive via port C 7963 12110 1373 TAD [SETDRD] ; assert DIOR 7964 12111 6477 PWCR ; ... 7965 12112 7000 NOP ; give the drive and 8255 time to settle 7966 12113 6471 PRPB ; capture D0..D7 7967 12114 0362 AND [377] ; make sure we don't get noise in DX0..DX3 7968 12115 3322 DCA IDETMP ; and save that for a minute 7969 12116 1361 TAD [CLRDRD] ; now deassert DIOR 7970 12117 6477 PWCR ; ... 7971 12120 1322 TAD IDETMP ; get the data back 7972 12121 5701 JMP @IDERDR ; and return it in the AC 7973 7974 ; Local storage for RD/IDEWRR... 7975 12122 IDETMP: .BLOCK 1 ; a temporary for saving the AC 7976 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 198 Setup Disk I/O Buffer bts6120.plx 7977 .TITLE Setup Disk I/O Buffer 7978 7979 7980 ; This routine is used parse the argument list for ROM calls that take OS/8 7981 ; handler like argument lists, primarily the RAM disk and IDE disk I/O calls. 7982 ; It will do a GETARG and store the first argument, which contains the R/W 7983 ; bit, page count, buffer field and unit number, in MUUO. It extracts the 7984 ; buffer field from this argument, builds a CDF instruction, and stores that 7985 ; at BUFCDF for later use. It also extracts the page count from this 7986 ; argument, converts it to a negative number, and stores the result at RWCNT. 7987 ; Finally, it does another GETARG to fetch the address of the caller's buffer 7988 ; and stores that at BUFPTR. 7989 12123 6205 SETBUF: .PUSHJ @[GETARG] ; get the first argument 12124 5777 7990 12125 3050 DCA MUUO ; save that - it's got lots of useful bits! 7991 12126 1050 TAD MUUO ; get the field bits from MUUO 7992 12127 0360 AND [70] ; ... 7993 12130 1357 TAD [CDF 0] ; make a CDF instruction out of them 7994 12131 3756 DCA @[BUFCDF+1] ; and save them for later 7995 12132 1050 TAD MUUO ; get the page count from the call 7996 12133 0355 AND [3700] ; ... 7997 12134 7450 SNA ; is it zero ? 7998 12135 7330 NL4000 ; yes - that means to transfer a full 32 pages 7999 12136 7002 BSW ; right justify the page count 8000 12137 7041 CIA ; make it negative for an ISZ 8001 12140 3055 DCA RWCNT ; ... 8002 12141 6205 .PUSHJ @[GETARG] ; get the buffer pointer from the argument list 12142 5777 8003 12143 1354 TAD [-1] ; correct for pre-incrementing auto-index 8004 12144 3011 DCA BUFPTR ; and save that 8005 12145 3053 DCA BUFPNL ; this buffer is always in main memory 8006 12146 6225 .POPJ ; all done for now 8007 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 8008 12200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 199 Test for IOB6120 CompactFlash Card bts6120.plx 8009 .TITLE Test for IOB6120 CompactFlash Card 8010 8011 ; This routine will see if a CompactFlash card is plugged into the IOB6120 8012 ; socket and, if it finds one, will return the size of that card in the AC. 8013 ; If no card or no IOB6120 is present, then zero is returned instead. 8014 ; 8015 ; Unfortunately this little kludge is necessary because Jim's IOB6120 firmware 8016 ; does NOT update DKSIZE to account for the compact flash card, if any. A CF 8017 ; card does, however, respond to pretty much all the same commands and functions 8018 ; as an IDE drive. 8019 12200 7200 CHKCFC: CLA ; ... 8020 12201 1777 TAD @[FUNTBL+13] ; see if the IOB6120 has hooked this mcall 8021 12202 1376 TAD [-BADFUN] ; well ??? 8022 12203 7650 SNA CLA ; skip if it has been changed 8023 12204 6225 .POPJ ; nope - no IOB6120, so return zero 8024 12205 1777 TAD @[FUNTBL+13] ; yes - it's the address of the GETCFS routine 8025 12206 3050 DCA MUUO ; ... 8026 12207 5450 JMP @MUUO ; call GETCFS in the extension ROM and return PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 200 Setup Disk I/O Buffer Field and Space bts6120.plx 8027 .TITLE Setup Disk I/O Buffer Field and Space 8028 8029 8030 ; This routine will set up BUFPTR, BUFCDF, RWCNT and BUFPNL to point to 8031 ; our own internal buffer in panel memory at DSKBUF. This is used by the 8032 ; disk dump, disk load, format and boot commands when they need to read or 8033 ; write disk blocks without distrubing main memory. 8034 12210 1375 PNLBUF: TAD [DSKBUF-1] ; point to the disk buffer 8035 12211 3011 DCA BUFPTR ; set the buffer address for DISKRD/DISKWR 8036 12212 1374 TAD [CDF 1] ; this buffer lives in our field 1 8037 12213 3222 DCA BUFCDF+1 ; ... 8038 12214 7344 NLM2 ; the buffer size is always 2 pages 8039 12215 3055 DCA RWCNT ; ... 8040 12216 7240 NL7777 ; write this data to PANEL memory! 8041 12217 3053 DCA BUFPNL ; ... 8042 12220 6225 .POPJ ; and we're done 8043 8044 8045 ; This little routine is called, via a JMS instruction (not a .PUSHJ!) to 8046 ; change the DF to the field of the user's buffer. In addition, if the 8047 ; BUFPNL flag is not set, it will execute a CPD instruction so that buffer 8048 ; data is stored in main memory. This is the usual case. 8049 12221 0000 BUFCDF: 0 ; call here with a JMS 8050 12222 7000 NOP ; gets over written with a CDF instruction 8051 12223 7200 CLA ; just in case 8052 12224 1053 TAD BUFPNL ; is the panel buffer flag set? 8053 12225 7650 SNA CLA ; ??? 8054 12226 6266 CPD ; no - address main memory now 8055 12227 5621 JMP @BUFCDF ; ... 8056 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 201 Copy Memory ROM Calls bts6120.plx 8057 .TITLE Copy Memory ROM Calls 8058 8059 8060 ; This ROM function can copy up to 4096 words from any field in either main 8061 ; or panel memory to any other address and field in either main or panel 8062 ; memory. It can be used to move data and/or code into panel memory and 8063 ; back again, or simply to move one part of main memory to another. 8064 ; 8065 ;CALL: 8066 ; PR0 8067 ; 0010 / copy memory subfunction 8068 ; p0n0 / source field and memory space 8069 ;
/ source address 8070 ; p0n0 / destination field and memory space 8071 ;
/ destination address 8072 ; / number of words to be transferred 8073 ; 8074 ; The source and destination field words each contain the field number in 8075 ; bits 6..8, and a flag in bit 0 which is one for panel memory and zero for 8076 ; main memory. The last word of the argument list is the number of words 8077 ; to be copied - a value of zero copies 4096 words. 8078 8079 ; Set up the source address... 8080 12230 6205 MEMMOV: .PUSHJ @[GETARG] ; get the source field 12231 5773 8081 12232 7100 CLL ; make sure the link is in a known state 8082 12233 1372 TAD [4000] ; put the panel/main memory flag in the LINK 8083 12234 0371 AND [70] ; make a CDF instruction 8084 12235 1370 TAD [CDF 0] ; ... 8085 12236 3272 DCA SRCCDF ; ... 8086 12237 1367 TAD [CPD] ; assume the source is in main memory 8087 12240 7430 SZL ; but is it really ? 8088 12241 1366 TAD [SPD-CPD] ; no - use panel memory 8089 12242 3273 DCA SRCSPD ; ... 8090 12243 6205 .PUSHJ @[GETARG] ; get the buffer address 12244 5773 8091 12245 1365 TAD [-1] ; correct for pre-increment auto index 8092 12246 3012 DCA XX1 ; ... 8093 8094 ; Set up the destination address... 8095 12247 6205 .PUSHJ @[GETARG] ; get the destination field 12250 5773 8096 12251 7100 CLL ; make sure the link is in a known state 8097 12252 1372 TAD [4000] ; put the panel/main memory flag in the LINK 8098 12253 0371 AND [70] ; make a CDF instruction 8099 12254 1370 TAD [CDF 0] ; ... 8100 12255 3275 DCA DSTCDF ; ... 8101 12256 1367 TAD [CPD] ; assume the destination is in main memory 8102 12257 7430 SZL ; but is it really ? 8103 12260 1366 TAD [SPD-CPD] ; no - use panel memory 8104 12261 3276 DCA DSTSPD ; ... 8105 12262 6205 .PUSHJ @[GETARG] ; get the buffer address 12263 5773 8106 12264 1365 TAD [-1] ; correct for pre-increment auto index 8107 12265 3013 DCA XX2 ; ... 8108 8109 ; And finally the word count... 8110 12266 6205 .PUSHJ @[GETARG] ; ... 12267 5773 8111 12270 7041 CIA ; make it negative for ISZ 8112 12271 3052 DCA XFRCNT ; ... 8113 8114 ; This loop does the actual work of copying data! 8115 12272 7000 SRCCDF: NOP ; over written with a CDF instruction 8116 12273 7000 SRCSPD: NOP ; over written with a SPD/CPD IOT PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 202 Copy Memory ROM Calls bts6120.plx 8117 12274 1412 TAD @XX1 ; get a word of source data 8118 12275 7000 DSTCDF: NOP ; over written with a CDF instruction 8119 12276 7000 DSTSPD: NOP ; overwritten with a SPD/CPD IOT 8120 12277 3413 DCA @XX2 ; and store the word 8121 12300 2052 ISZ XFRCNT ; have we done them all ? 8122 12301 5272 JMP SRCCDF ; no - keep copying 8123 8124 ; All done! 8125 12302 6276 SPD ; be sure the field and memory space are safe 8126 12303 6211 CDF 1 ; ... 8127 12304 7300 CLL CLA ; and always return success 8128 12305 6225 .POPJ ; ... 8129 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 203 Copy Memory Extended ROM Call bts6120.plx 8130 .TITLE Copy Memory Extended ROM Call 8131 8132 8133 ; This ROM function can copy up to 4096 words from any field in main, panel 8134 ; or ramdisk memory to any other field in main, panel or ramdisk memory. 8135 ; 8136 ;CALL: 8137 ; PR0 8138 ; 0011 / copy memory subfunction 8139 ; pddf / source DAR, field and memory space 8140 ; pddf / destination DAR, field and memory space 8141 ;
/ source address 8142 ;
/ destination address 8143 ; / number of words to be transferred 8144 ; 8145 ; The source and destination field words (pddf) each contain a flag 8146 ; in bit 0, the ramdisk Disk Address in bits 1..8 (or a flag in bit 1), 8147 ; and the field number in bits 9..11 8148 ; 8149 ; The flags are interpreted as 8150 ; bit 0 = 1 when the address is in the ramdisk, otherwise 8151 ; bit 1 = 1 when the address is in panel memory, otherwise 8152 ; the address is in main memory 8153 ; The last word of the argument list is the number of words 8154 ; to be copied - a value of zero copies 4096 words. 8155 8156 0024 SRCDAR=RDUNIT 8157 0025 DSTDAR=RDPAGE 8158 8159 12306 7200 MEMMVX: CLA ; set up source addressing 8160 12307 1364 TAD [XSRCDF-1] 8161 12310 4763 JMS @[MVXARG] 8162 12311 3024 DCA SRCDAR 8163 8164 12312 1362 TAD [XDSCDF-1] ; set up destination addressing 8165 12313 4763 JMS @[MVXARG] 8166 12314 3025 DCA DSTDAR 8167 8168 12315 6205 .PUSHJ @[GETARG] ; get the source address 12316 5773 8169 12317 1365 TAD [-1] ; correct for pre-increment auto index 8170 12320 3012 DCA XX1 ; ... 8171 8172 12321 6205 .PUSHJ @[GETARG] ; get the destination address 12322 5773 8173 12323 1365 TAD [-1] ; correct for pre-increment auto index 8174 12324 3013 DCA XX2 ; ... 8175 8176 12325 6205 .PUSHJ @[GETARG] ; get the word count 12326 5773 8177 12327 7041 CIA ; make it negative for ISZ 8178 12330 3052 DCA XFRCNT ; ... 8179 8180 12331 7000 XSRCDF: NOP ; overwritten with a CDF instruction 8181 12332 7000 NOP ; overwritten with a SPD/CPD IOT 8182 12333 7000 NOP ; overwritten with a memory map IOT 8183 12334 1024 TAD SRCDAR ; set DAR to source DAR 8184 12335 6410 LDAR ; (leaves AC clr) 8185 12336 1412 TAD @XX1 ; get a word of source data 8186 12337 7421 MQL ; save in MQ 8187 12340 7000 XDSCDF: NOP ; overwritten with a CDF instruction 8188 12341 7000 NOP ; overwritten with a SPD/CPD IOT 8189 12342 7000 NOP ; overwritten by a memory map IOT 8190 12343 1025 TAD DSTDAR ; set DAR to destination DAR 8191 12344 6410 LDAR PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 204 Copy Memory Extended ROM Call bts6120.plx 8192 12345 7521 SWP ; get back source value 8193 12346 3413 DCA @XX2 ; and store the word 8194 12347 2052 ISZ XFRCNT ; have we done them all ? 8195 12350 5331 JMP XSRCDF ; no - keep copying 8196 8197 ; All done! 8198 12351 6402 MM2 ; back to standard map 8199 12352 6276 SPD ; be sure the field and memory space are safe 8200 12353 6211 CDF 1 ; ... 8201 12354 7300 CLL CLA ; and always return success 8202 12355 6225 .POPJ ; ... 8203 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 8204 12400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 205 Get Arguments for MEMMOV Calls bts6120.plx 8205 .TITLE Get Arguments for MEMMOV Calls 8206 8207 8208 ; MVXARG: 8209 ; call: JMS MVXARG 8210 ; entry: AC points to CDF x, yPD, MMz sequence location 8211 ; function: get and interpret an addressing control argument, filling out @XX1 8212 ; exit: AC contains DAR value 8213 12400 0000 MVXARG: 0 8214 12401 3012 DCA XX1 ; Save pointer to modified code in auto-incr 8215 12402 6205 .PUSHJ @[GETARG] ; get the source field 12403 5777 8216 12404 7100 CLL ; make sure the link is in a known state 8217 12405 1376 TAD [4000] ; put the ramdisk/RAM flag in the LINK 8218 12406 7420 SNL 8219 12407 5226 JMP ADRPMM ; if b0=0, do panel/main memory addressing 8220 ; address is in ramdisk 8221 8222 12410 7014 ADRRMD: R3L ; rotate first two bits of DAR around to lsbs 8223 12411 7421 MQL ; save it; it has the field in the right position 8224 12412 7701 ACL ; get it back (AC was cleared by MQL) 8225 12413 7002 BSW ; rotate another 6 bits, AC now has DAR in b4..b11 8226 12414 7521 SWP ; save it, get back field 8227 12415 0375 AND [70] ; make a CDF instruction 8228 12416 1374 TAD [CDF 0] ; ... 8229 12417 3412 DCA @XX1 ; ... 8230 12420 1373 TAD [SPD] ; ramdisk DF must be panel 8231 12421 3412 DCA @XX1 8232 12422 1372 TAD [MM3] ; use memory map 3 (indirect panel access -> ramdisk) 8233 12423 3412 DCA @XX1 8234 12424 7521 SWP ; and return with DAR in AC 8235 12425 5600 JMP @MVXARG 8236 8237 ; address is in panel or main memory 8238 8239 12426 1371 ADRPMM: TAD [6000] ; know that b0=0, link=1; 8240 ; now link=0 if b1=1 8241 12427 7014 R3L ; bring field into position 8242 12430 0375 AND [70] ; make a CDF instruction 8243 12431 1374 TAD [CDF 0] ; ... 8244 12432 3412 DCA @XX1 ; ... 8245 12433 1370 TAD [CPD] ; assume the source is in main memory 8246 12434 7420 SNL ; but is it really ? 8247 12435 1367 TAD [SPD-CPD] ; no - use panel memory 8248 12436 3412 DCA @XX1 ; ... 8249 12437 1366 TAD [MM2] ; use memory map 2 (indirect access -> RAM) 8250 12440 3412 DCA @XX1 8251 12441 5600 JMP @MVXARG PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 206 LIGHTS Monitor Call bts6120.plx 8252 .TITLE LIGHTS Monitor Call 8253 8254 8255 ; The LIGHTS MUUO allows a program explicit control over the front panel 8256 ; DATA LEDs (providing a front panel is installed, of course!). It only 8257 ; works for the DATA LEDs - the ADDRESS LEDs always track the current memory 8258 ; address, and it only works _if_ the rotary switch is _not_ set to the MD 8259 ; position. 8260 ; 8261 ; The calling sequence for the LIGHTS MUUO is: 8262 ; 8263 ; TAD (data / desired data for the display 8264 ; PR0 / trap to panel memory 8265 ; 0012 / LIGHTS function code 8266 ; / 1 to put the DATA display under program control 8267 ; / 0 to return the display to normal use 8268 ; / if no display is present or is not 0 or 1, 8269 ; / then the LINK will be set on return. 8270 ; 8271 ; Note that a program can determine whether an FP6120 is present without 8272 ; changing anything simply by invoking the LIGHTS function with set 8273 ; to 0. If no display is present, the LINK will be set on return. 8274 ; 8275 12442 6205 LIGHTS: .PUSHJ @[GETARG] ; get the argument 12443 5777 8276 12444 6201 CDF 0 ; FP data lives in field zero 8277 12445 3765 DCA @[FPPGMM] ; set the FP program mode flag 8278 12446 1764 TAD @[UAC] ; and get the user's display data 8279 12447 3763 DCA @[FPPGMD] ; store that too 8280 8281 ; Note that we went ahead and set FPPGMM/FPPGMD even though we don't yet 8282 ; know whether the front panel is isntalled or not. That's harmless enough - 8283 ; these values are never used if the front panel is not present! 8284 12450 1762 TAD @[FPDTCT] ; is a front panel installed?? 8285 12451 6211 CDF 1 ; (back to our field) 8286 12452 7100 CLL ; assume the FP is present 8287 12453 7650 SNA CLA ; and skip if we're right 8288 12454 7020 CML ; nope - return with the link set 8289 12455 6225 .POPJ ; and that's all! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 207 Read Flash ROM Call bts6120.plx 8290 .TITLE Read Flash ROM Call 8291 8292 8293 ; The Read Flash ROM call reads the last 384K bytes of the IOB6120 8294 ; flash ROM in twelve bit word mode. It's essentially the same as the 8295 ; RAM disk read function and for practical purposes treats the flash ROM 8296 ; as a read only RAM disk. 8297 ; 8298 ; The calling sequence for the PR0 Read Flash ROM call is: 8299 ; 8300 ; PR0 8301 ; 0016 / panel function code for read flash ROM 8302 ; / page count, buffer field 8303 ; / buffer address 8304 ; / starting page number (not block number!) 8305 ; / AC == 0 if success; AC != 0 if error 8306 ; 8307 ; The error return is taken if a) the Write bit is set in the function 8308 ; word (arg 1), or if b) the unit number in the unction word is not zero, 8309 ; or c) the page number is greater than 2016. 8310 ; 8311 ; One might reasonably question whether this code belongs here or in 8312 ; IOB6120 - after all, it's completely useless unless an IOB is installed. 8313 ; The answer is that of course it belongs in the IOB6120 code, but it 8314 ; shares so many routines with RAMDRW that it would have required another 8315 ; dozen or so vectors to make it work. It's easier just to give up a few 8316 ; more words of BTS6120 code space to handle it. 8317 12456 6205 RDROM: .PUSHJ @[SETBUF] ; set up MUUO, BUFPTR, BUFCDF and RWCNT 12457 5761 8318 12460 6205 .PUSHJ @[GETARG] ; and lastly get the disk page number 12461 5777 8319 8320 ; The first 128K bytes of the flash are used to hold the IOB6120 code and 8321 ; the FPGA bitstream, and actual ROM disk data doesn't start until bank 32. 8322 ; There are a couple of ways to handle this, but the easiest is to offset 8323 ; the starting page number by 32*21=672 pages. 8324 12462 1360 TAD [672.] ; offset the ROM disk addresses 8325 12463 3025 DCA RDPAGE ; ... 8326 8327 ; Make sure that an IOB6120 is installed in the first place... 8328 12464 6201 CDF 0 ; the EXTFLG lives in field 0 8329 12465 1757 TAD @[EXTFLG] ; get the IOB6120 status 8330 12466 6211 CDF 1 ; ... 8331 12467 7650 SNA CLA ; is there one? 8332 12470 5756 JMP @[RAMER1] ; no - give the "bad unit" return 8333 8334 ; Make sure that the unit number is zero and that the R/W bit is clear 8335 ; (for reading). Take the error return if not. 8336 12471 1050 TAD MUUO ; get the function word 8337 12472 0355 AND [4007] ; these bits must be zero! 8338 12473 7640 SZA CLA ; skip if error 8339 12474 5756 JMP @[RAMER1] ; no - take the "bad unit" return 8340 8341 ; Note that we never call RAMSEL here to select the RAM disk unit, so we 8342 ; must ensure that a) the RAMCDF gets set up correctly (CDF 1 for the flash), 8343 ; and b) the RAMUSZ parameter gets set to the size of this RAM disk unit. 8344 ; The size would be 384K / 4K = 96 banks * 21 pages per bank = 2016 pages, 8345 ; EXCEPT that we've already offset the starting page by 672 and so the 8346 ; size has to be offset too, giving 2688 pages. Not coincidentally, that's 8347 ; exactly the same size as a regular 512K SRAM RAM disk unit! 8348 12475 1354 TAD [CDF 1] ; flash is always selected by field 1 8349 12476 3753 DCA @[RAMCDF+1] ; initialize the RAMcdf routine 8350 12477 1352 TAD [-2688.] ; and set the size of this unit 8351 12500 3046 DCA RAMUSZ ; ... 8352 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 208 Read Flash ROM Call bts6120.plx 8353 ; Read pages until we're done... 8354 12501 6205 ROMR1: .PUSHJ @[SETDAR] ; calculate the RAM disk address and bank 12502 5751 8355 12503 7630 SZL CLA ; was the page number valid? 8356 12504 5750 JMP @[RAMER2] ; nope - give the bad page error return 8357 12505 6205 .PUSHJ @[UNPACK] ; transfer a page from RAM disk to memory 12506 5747 8358 12507 2025 ISZ RDPAGE ; if we need more, continue on the next page 8359 12510 2055 ISZ RWCNT ; have we done enough pages? 8360 12511 5301 JMP ROMR1 ; nope - keep going 8361 12512 7300 CLA CLL ; all done - return status code 0 (no errors) 8362 12513 6225 .POPJ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 209 Field 1 Vector Table bts6120.plx 8363 .TITLE Field 1 Vector Table 8364 8365 8366 12514 6223 RET1F2: CXF 2 ; return to field 2 8367 12515 6225 .POPJ ; the address is already on the stack 8368 8369 12516 6233 RET1F3: CXF 3 ; return to field 3 8370 12517 6225 .POPJ ; the address is already on the stack 8371 8372 8373 ; variable and functions that we may want to access or hook in this field 8374 ; codes: I=instruction pointer, V=variable, H=hook (CIF n, JMP @.+1, V) 8375 ; Add only to the *end* of this list, please! 8376 ; n.b. JMS linkage functions generally cannot be used here 8377 12520 F1VECTOR: 8378 12520 2516 RET1F3 ; I utility - return to field 2 (must be first) 8379 12521 0261 FUNTBL ; V table of ROM functions 8380 12522 3200 CMDTBL ; V table of monitor commands 8381 12523 1213 DISKRD-1 ; H read IDE 8382 12524 1243 DISKWR-1 ; H write IDE 8383 12525 0000 0 8384 12526 0020 DKPART ; V partition number for DISKRD/WR 8385 12527 0021 DKRBN ; V block number for DISKRD/WR 8386 12530 0011 BUFPTR ; V offset for DISKRD/WR 8387 12531 2222 BUFCDF+1 ; V field for DISKRD/WR 8388 12532 0053 BUFPNL ; V memory space for DISKRD/WR 8389 12533 0022 DKSIZE ; V size of IDE attached drive, or 0 if none 8390 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 8391 12600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 210 Flash ROM erasure and writing bts6120.plx 8392 .TITLE Flash ROM erasure and writing 8393 8394 8395 ; write block to Flash ROM. Since Flash requires an erasure step, and we 8396 ; don't know how big the file will be, a slightly risky heuristic is used 8397 ; to determine when to issue an erase command. What it does is, whenever the 8398 ; current address is on a 4KB boundary, the next 4KB is scanned. If any bytes 8399 ; there are not 377, an erase command is issued. 4KB is convenient not just 8400 ; because of the PDP-8 pointer size, but because most if not all flash ROMs 8401 ; allocate blocks in multiples of this size (note that in a device blocks 8402 ; may vary in size). 8403 ; 8404 ; There are simple cases that will confuse this, but we will just have to 8405 ; specify that no 4KB block should be filled with 377s in a download image. 8406 ; 8407 ; The incoming data file must be in the Flash download format: 8408 ; byte data 8409 ; 256 words per block (therefore 256 bytes) 8410 ; starting at 0000 with monotonically increasing block numbers 8411 ; 8412 8413 ; N.b. there're a number of places in this routine where the fact that 8414 ; the ROM is in field 1 of the ramdisk memory while this code is in 8415 ; field 1 of the RAM is taken advantage of. 8416 8417 12600 3054 ROMWR: DCA BUFSIZ ; save the passed size (= -256) 8418 8419 12601 1021 TAD DKRBN ; DAR is set to the upper 8 bits of the 8420 12602 7012 RTR ; block number 8421 12603 7012 RTR 8422 12604 6410 LDAR 8423 8424 12605 6403 MM3 ; access the ramdisk area 8425 8426 12606 1377 TAD [FCMDCS] ; issue "clear status register" command 8427 12607 3400 DCA @0 8428 12610 1376 TAD [FCMDRA] ; issue "read array" command 8429 12611 3400 DCA @0 8430 8431 12612 1021 TAD DKRBN 8432 12613 0375 AND [17] ; check for multiple of 4KB (16*256) 8433 12614 7640 SZA CLA 8434 12615 5246 JMP NOERA 8435 8436 ; We're on a 4KB boundary, check the next 4KB for non-377 bytes 8437 8438 12616 3341 DCA NX1 ; starting at 0 8439 12617 1741 CHKERA: TAD @NX1 8440 12620 1374 TAD [-377] 8441 12621 7640 SZA CLA 8442 12622 5226 JMP ERABLK ; need to erase 8443 12623 2341 ISZ NX1 8444 12624 5217 JMP CHKERA 8445 12625 5246 JMP NOERA 8446 8447 ; Erase block. We don't know how far this erase will extend, but we will 8448 ; only erase again when we reach some unerased ROM, so it's not an issue. 8449 8450 12626 1373 ERABLK: TAD [FCMDERA1] ; issue "erase block 1" command 8451 12627 3400 DCA @0 8452 12630 1372 TAD [FCMDERA2] ; issue "erase block 2" command 8453 12631 3400 DCA @0 8454 12632 7200 WFRDY1: CLA ; get the status byte 8455 12633 1400 TAD @0 8456 12634 0371 AND [200] ; check the ready bit PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 211 Flash ROM erasure and writing bts6120.plx 8457 12635 7450 SNA 8458 12636 5232 JMP WFRDY1 ; no, not ready yet 8459 12637 7200 CLA 8460 12640 1400 TAD @0 ; get the status again to check for errors 8461 12641 0370 AND [177] 8462 12642 7450 SNA 8463 12643 5246 JMP NOERA 8464 12644 1367 TAD [1000] ; Error 1xxx - bad erase; xxx is status code 8465 12645 5336 JMP BADFL 8466 8467 ; now program the block 8468 8469 12646 1021 NOERA: TAD DKRBN ; form the offset by taking the lower 4 8470 12647 7002 BSW ; bits of the block number and using that 8471 12650 7006 RTL ; to address a 256-byte sector 8472 12651 0366 AND [7400] 8473 12652 3341 DCA NX1 ; destination address 8474 8475 12653 1365 TAD [DSKBUF-1] ; source buffer (field 1) 8476 12654 3012 DCA XX1 ; save in autoincr 8477 8478 12655 6403 PROGLP: MM3 8479 12656 1364 TAD [FCMDPROG] ; issue the write byte command 8480 12657 3741 DCA @NX1 8481 12660 6402 MM2 8482 12661 1412 TAD @XX1 8483 12662 6403 MM3 8484 12663 3741 DCA @NX1 ; and write it 8485 8486 12664 7200 WFRDY2: CLA ; get the status byte 8487 12665 1400 TAD @0 8488 12666 0371 AND [200] ; check the ready bit 8489 12667 7450 SNA 8490 12670 5264 JMP WFRDY2 ; no, not ready yet 8491 12671 7200 CLA 8492 12672 1400 TAD @0 ; b8=1, b6-b0=status bits 8493 12673 0370 AND [177] 8494 12674 7450 SNA 8495 12675 5300 JMP FLNXT 8496 12676 1363 TAD [2000] ; Error 2xxx - bad write; xxx is status code 8497 12677 5336 JMP BADFL 8498 8499 12700 2341 FLNXT: ISZ NX1 ; increment write address 8500 12701 7000 NOP ; may be at end of field 8501 8502 12702 2054 ISZ BUFSIZ ; done with block? 8503 12703 5255 JMP PROGLP ; no, write another byte 8504 8505 12704 1376 TAD [FCMDRA] ; flash back into read array mode 8506 12705 3400 DCA @0 8507 8508 ; now verify the data in ROM against the RAM buffer 8509 8510 12706 1365 TAD [DSKBUF-1] ; compare the disk buffer 8511 12707 3012 DCA XX1 8512 8513 12710 1341 TAD NX1 ; to the ROM, and 8514 12711 1365 TAD [-256.-1] 8515 12712 3013 DCA XX2 8516 8517 12713 1366 TAD [-256.] ; check 256 bytes 8518 12714 3054 DCA BUFSIZ 8519 12715 5316 JMP CHKLP 8520 8521 12716 6402 CHKLP: MM2 ; note that comparison will fail if PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 212 Flash ROM erasure and writing bts6120.plx 8522 12717 1412 TAD @XX1 ; data in DSKBUF has any of the upper 4 bits 8523 12720 7041 CIA ; set, since the ROM is an 8-bit device 8524 12721 6403 MM3 8525 12722 1413 TAD @XX2 8526 12723 7440 SZA 8527 12724 5332 JMP BADCHK 8528 12725 2054 ISZ BUFSIZ 8529 12726 5316 JMP CHKLP 8530 8531 12727 6402 MM2 8532 12730 7300 CLA CLL 8533 12731 6225 .POPJ 8534 8535 12732 7200 BADCHK: CLA 8536 12733 1013 TAD XX2 8537 12734 0362 AND [0777] ; Error 3xxx - compare mismatch; xxx is offs. 8538 12735 1361 TAD [3000] 8539 8540 12736 6402 BADFL: MM2 8541 12737 7120 STL 8542 12740 6225 .POPJ 8543 8544 ; Flash ROM routine storage.. 8545 12741 NX1: .BLOCK 1 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 213 Test for SBC6120-RC bts6120.plx 8546 .TITLE Test for SBC6120-RC 8547 8548 ; This routine will take the skip return if this is the original SBC6120 8549 ; model. If, however, we're running on the SBC6120-RC model it will take the 8550 ; non-skip return instead. Note that it works by testing RC flag stored in 8551 ; field 0 by the SYSINI startup code and NOT by actually testing the hardware 8552 ; right now. It'd be easy enough to just test the hardware directly, but we 8553 ; do it this way to ensure that the actual RC/not RC determination is made in 8554 ; one place and at one time only. 8555 ; 8556 ; BTW, this routine is called by a JMS rather than the usual PUSHJ/POPJ 8557 ; mechanism. And it's really only callable from field 1! 8558 12742 0000 CHKRC: 0 ; JMS entry point 8559 12743 7200 CLA ; ... 8560 12744 6201 CDF 0 ; RCFLAG lives in field zero 8561 12745 1760 TAD @[RCFLAG] ; get the flag 8562 12746 6213 CXF 1 ; and return to field 1 8563 12747 7650 SNA CLA ; skip on the RC model 8564 12750 2342 ISZ CHKRC ; original SBC6120 - take the skip return 8565 12751 5742 JMP @CHKRC ; we're outta here 8566 12760 0035 12761 3000 12762 0777 12763 2000 12764 0100 12765 7377 12766 7400 12767 1000 12770 0177 12771 0200 12772 0320 12773 0040 12774 7401 12775 0017 12776 7777 12777 0120 8567 13000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 214 SBC6120-RC RAM Disk support bts6120.plx 8568 .TITLE SBC6120-RC RAM Disk support 8569 8570 8571 ; Remember all that stuff you read a few pages back about the SBC6120 RAM 8572 ; disk ? What, you didn't read that?? It's back there, so go look - I'll 8573 ; wait ... 8574 ; 8575 ; Did you read it? Good... Now forget all that because the RAM disk 8576 ; implementation in the RC model is completely different from the original 8577 ; SBC6120. The main difference is that in the RC model the RAM used for main 8578 ; and panel memory is actually 512KW or 1024KW, rather than the 64KW that's 8579 ; used in the original SBC6120. Bytewide SRAM chips of 512KB are easy to come 8580 ; by where as the 4 bit wide SRAMs used in the original SBC6120 are nearly 8581 ; impossible to find so this was an obvious change to make. 8582 ; 8583 ; Panel memory and main memory still only need 64KW total, so the remaining 8584 ; part of RC memory is used as the RAM disk. If one bank of 512K byte SRAMs 8585 ; are installed, then the SBC6120-RC has 512K words of twelve bit wide memory 8586 ; (four bits being wasted, just as with the two EPROMs) and if two banks of 8587 ; SRAM chips are installed then 1024K words are available. In either case, 8588 ; the first 32K words of bank 0 are used for main memory and the second 32K 8589 ; words for panel memory. The remainder, either 448K or 960K words, is used 8590 ; as the RAM disk. 8591 ; 8592 ; Right away this means that the RC model RAM disk is twelve bits wide, not 8593 ; eight bits as it is in the original SBC6120. This means that none of that 8594 ; fancy 8 to 12 bit packing and unpacking is required for the RC RAM disk - 8595 ; we can just copy entire words directly between RAM disk and main memory. 8596 ; This alone is a huge change from the original RAM disk implementations. 8597 ; 8598 ; The DAR ("disk address register") still exists in the SBC6120-RC, and it 8599 ; is still loaded via the LDAR IOT. 1024K of memory requires 20 address bits 8600 ; and the HD6120 supplies only 15, so the DAR contains 5 more bits, DAR7..11, 8601 ; which are loaded from AC7..11 by LDAR. DAR7 is the "bank select" bit which 8602 ; selects between the two banks of SRAM chips, bank 1 being optional, and the 8603 ; other four bits of the DAR supply the upper address bits to each SRAM chip. 8604 ; This is unlike the original SBC6120 RAM disk, which used the EMA bits as a 8605 ; chip select for up to 8 SRAM chips - in the case of the RC RAM disk the EMA 8606 ; bits (you know, the data field from the CDF instruction) are simply three 8607 ; more address bits to each SRAM. Since the RC model uses the same SRAM chips 8608 ; for both main/panel memory and the RAM disk, we were pretty much forced to do 8609 ; it this way. 8610 ; 8611 ; Memory map 3 still exists in the SBC6120-RC, and it's used for pretty much 8612 ; the same purpose. If you access memory in any map other than 3 then the DAR 8613 ; contents will be ignored by the hardware and you'll be accessing either the 8614 ; first 32K (for main memory) or the second 32K (for panel memory) of SRAM bank 8615 ; zero. In map 3, however, indirect references to panel memory allow the DAR 8616 ; to pass thru and you'll be accessing whatever memory the DAR selects. Map 3 8617 ; only applies to indirect references to panel memory, however - main memory 8618 ; is never affected by the memory map in use. 8619 ; 8620 ; And it's worth pointing out again that accessing RAM disk with DAR=0 will 8621 ; access the same physical chunk of SRAM that's actually being used for main 8622 ; memory. Likewise, DAR=1 would access the same physical memory that's being 8623 ; used for panel memory. Nothing in the hardware prevents this, and it's up 8624 ; to the firmware to prevent Bad Things from happening this way. 8625 ; 8626 ; Since the second bank of SRAM chips is optional on the SBC6120-RC, the 8627 ; firmware treats this RAM disk as if it has two units. The first unit is the 8628 ; remainder of the first bank of SRAM after main and panel memory is subtracted. 8629 ; This works out to 448KW, 1792 OS/8 disk blocks or 3584 pages of 128 words. 8630 ; The second RAM disk unit, which is present only if the second bank of SRAMs 8631 ; is installed, is slightly larger at 512KW, 2048 blocks or 4096 pages. 8632 ; Unfortunately, the latter is a problem for us because 4096 pages looks like PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 215 SBC6120-RC RAM Disk support bts6120.plx 8633 ; zero (which means no RAM disk installed!) so we're forced to lie and say that 8634 ; the second bank is only 4094 pages instead. We can't even use 4095 because 8635 ; we have to have an even number of pages for mapping exactly onto OS/8 disk 8636 ; blocks. This means that two pages (256 words) of the second RAM bank are 8637 ; wasted... 8638 ; 8639 ; Oh - and I almost forgot - the backup battery low detection for the RC RAM 8640 ; disk is different, too. In the case of the SBC6120-RC we need to use the 8641 ; SBBLO2 IOT (6436) to test the backup battery - this is an IOT in the panel 8642 ; memory space which is unused on the original SBC6120. 8643 8644 ; SBC6120-RC RAM disk "geometry" constants... 8645 7000 RC0PAG=3584. ; size of the first RAM disk unit, in pages 8646 7776 RC1PAG=4094. ; " " " second " " " " " 8647 0700 RC0KW=448. ; size of the first RAM disk unit, in KW 8648 1000 RC1KW=512. ; " " " second " " " " " 8649 1000 RC0OFF=512. ; main and panel memory offset for unit 0 8650 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 216 SBC6120-RC RAM Disk Diagnostic bts6120.plx 8651 .TITLE SBC6120-RC RAM Disk Diagnostic 8652 8653 ; WARNING!!! MAJOR KLUDGE ALERT!!!!! 8654 ; The IOB6120 ROM requires a free page in field 1 that it can use as patch 8655 ; space. Fine, but after adding the code to support the SBC6120-RC RAM disk 8656 ; there is no longer a free page anywhere in field 1. Nope, not even one, not 8657 ; anywhere! 8658 ; 8659 ; So, lacking any better plan, we continue to let the IOB1260 extension ROM 8660 ; use this same page, which now contains the SBC6120-RC RAM disk code, as patch 8661 ; space. This is probably OK because the SBC6120-RC and IOB6120 are mutually 8662 ; exclusive, so it's not possible that both could ever be used at the same time. 8663 ; "Probably ...." It's not the best plan, I'll admit, but it's all we've got. 8664 13000 F1PATCH: 8665 8666 8667 ; This routine will do a simple test of the SBC6120-RC RAM disk and determine 8668 ; whether one or two banks of RAM are installed. The RDSIZE array is updated 8669 ; accordingly and the total size of the RAM disk will be returned in the AC and 8670 ; in RAMSIZ. There is one subtle difference here, though - in the case of the 8671 ; original SBC120, RAMSIZ and the value returned in the AC is in KB (_bytes!_) 8672 ; but in the case of the RC model the value is in KW (_words_!) As it turns 8673 ; out this value isn't really used for anything except to tell the user, so it's 8674 ; not a problem. The RDSIZE array is always kept in 12 bit equivalent pages 8675 ; regardless of the RAM disk type, so there's no problem there. 8676 ; 8677 ; Note that we get here via RDTEST, and we can assume that the RDSIZE array 8678 ; and RAMSIZ have already been zeroed. 8679 ; 8680 ; And remember that RAM bank 0 is always present on the SBC6120-RC, so RAM 8681 ; disk unit 0 always exists - that's a done deal and there's no need to even 8682 ; check. The only question is whether the second bank of SRAMs is installed 8683 ; and whether RAM disk unit 1 should exist too. 8684 13000 1377 RCTEST: TAD [RC0PAG] ; set the size of unit 0 8685 13001 3034 DCA RDSIZE+0 ; ... 8686 13002 1376 TAD [RC0KW] ; ... 8687 13003 3044 DCA RAMSIZ ; ... 8688 8689 ; Figure out if the second bank of SRAMs is installed. This is fairly easy - 8690 ; if DAR7 is a 1 and there is no second bank, then nothing is selected and 8691 ; writes are ignored and reads return random garbage. Better yet, the upper 8692 ; 256 words of the second bank are never used by OS/8, so we're free to trash 8693 ; these in testing RAM. It doesn't get much easier than that! 8694 13004 7240 STA ; load the DAR with 11111 8695 13005 6410 LDAR ; ... 8696 13006 6271 CDF 7 ; more ones for the address bits 8697 13007 6403 MM3 ; and enable the RAM disk 8698 13010 6276 SPD 8699 13011 1375 TAD [2525] ; write alternating 1s and 0s to the last 8700 13012 3774 DCA @[7776] ; ... two words 8701 13013 1373 TAD [5252] ; ... 8702 13014 3772 DCA @[7777] ; ... 8703 13015 1774 TAD @[7776] ; now add 'em up 8704 13016 1772 TAD @[7777] ; ... 8705 13017 6402 MM2 ; back to normal addressing 8706 13020 6211 CDF 1 ; ... 8707 13021 7040 CMA ; if memory is working the result should 8708 13022 7640 SZA CLA ; be exactly 7777 8709 13023 5231 JMP RCTES1 ; no memory there 8710 8711 ; The second bank exists, so adjust RDSIZE+1 and RAMSIZ ... 8712 13024 1374 TAD [RC1PAG] ; set the size of unit 1 8713 13025 3035 DCA RDSIZE+1 ; ... 8714 13026 1371 TAD [RC1KW] ; and adjust RAMSIZ 8715 13027 1044 TAD RAMSIZ ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 217 SBC6120-RC RAM Disk Diagnostic bts6120.plx 8716 13030 3044 DCA RAMSIZ ; ... 8717 8718 ; Return the total RAM disk size and we're done... 8719 13031 1044 RCTES1: TAD RAMSIZ ; return the total size of RAM disk 8720 13032 6225 .POPJ ; and we're done PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 218 Set SBC6120-RC RAM Disk Address Register bts6120.plx 8721 .TITLE Set SBC6120-RC RAM Disk Address Register 8722 8723 ; This is the version of the SETDAR routine for the SBC6120-RC RAM disk. 8724 ; Like SETDAR, it assumes that the desired RAM disk page number is passed in 8725 ; location RDPAGE, and it will load the resulting bank number directly into 8726 ; the DAR via the LDAR IOT. The offset of the desired page within the 4K 8727 ; field will be left in RAMPTR where it is used by the RCRDRD and RCRDWR 8728 ; routines. 8729 ; 8730 ; This routine should never be called directly but instead is always called 8731 ; via SETDAR, which will figure out that we're running on the SBC6120-RC model 8732 ; and then jump here. This is because it depends on the SETDAR code to range 8733 ; check the page number against the size of the selected RAM disk unit first. 8734 ; If the page number passed is illegal then the link will be set when this 8735 ; routine returns. 8736 ; 8737 ; In the original RAM disk implementations, the data field selects the RAM 8738 ; disk chip (aka unit) and the remainder of the extended address comes from the 8739 ; DAR. In the RC implementation, bit 7 of the DAR selects the unit (there are 8740 ; only two RAM disk units possible on the SBC6120-RC), the remainder of the DAR 8741 ; is the high order extended address. In the RC model, the data field is just 8742 ; part of the disk address and has nothing to do with selecting the unit. 8743 ; 8744 ; Because of that, this routine also uses RDUNIT to DAR7 and IT OVERWRITES 8745 ; THE CDF INSTRUCTION AT RAMCDF! That means that in the case of the RC model 8746 ; SETDAR can only be called AFTER RAMSEL is called - that's the usual case 8747 ; anyway, though, and shouldn't be a problem for anybody. The end result of 8748 ; all this is that when we're done here, RAMCDF, RAMPTR and the DAR all contain 8749 ; the values needed to access the right RAM disk page. 8750 13033 RCSDAR: 8751 8752 ; First problem - the first 64KW of RAM disk unit 0 are actually used for main 8753 ; and panel memory. This means that any RAM disk addresses for unit 0 have to 8754 ; be offset by 512 pages (64KW * 8 pages/KW)... 8755 13033 1024 TAD RDUNIT ; get the unit number 8756 13034 7650 SNA CLA ; skip on unit #1 8757 13035 1371 TAD [RC0OFF] ; nope - offset unit zero addresses 8758 13036 1025 TAD RDPAGE ; adjust the page number 8759 13037 3026 DCA RCPAGE ; and save it temporarily 8760 8761 ; The upper for bits of the RAM disk page number get loaded into DAR8..11 8762 ; and DAR7 is set or cleared according to the unit number... 8763 13040 1026 TAD RCPAGE ; get the desired RAM disk page number 8764 13041 7002 BSW ; right justify the upper four bits 8765 13042 7012 RTR ; ... 8766 13043 0370 AND [17] ; ... 8767 13044 7421 MQL ; save that for a minute 8768 13045 1024 TAD RDUNIT ; get the unit number again 8769 13046 7640 SZA CLA ; skip if unit 0 is selected 8770 13047 1367 TAD [20] ; nope - set DAR7 to select unit 1 8771 13050 7501 MQA ; combine the upper address with the unit select 8772 13051 6410 LDAR ; and load that into the DAR 8773 8774 ; Next, bits 4..6 of the RAM disk page number get made into a CDF instruction 8775 ; and stored at RAMCDF ... 8776 13052 1026 TAD RCPAGE ; get the page number back again 8777 13053 7012 RTR ; put bits 4..6 in into bits 6..8 8778 13054 0366 AND [70] ; clear out the junk 8779 13055 1365 TAD [CDF 0] ; and make a CDF instruction 8780 13056 3764 DCA @[RAMCDF+1] ; store that in the RAMCDF routine for later 8781 8782 ; And finally, bits 7..11 (the lower five bits) of the RAM disk page number 8783 ; become the upper bits of RAMPTR. That leaves the lower seven bits of RAMPTR 8784 ; to select one of 128 words within this RAM disk page - whew! It works out... 8785 13057 1026 TAD RCPAGE ; one more time PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 219 Set SBC6120-RC RAM Disk Address Register bts6120.plx 8786 13060 7002 BSW ; and shift it left by a total of 8787 13061 7004 RAL ; .... seven bits 8788 13062 0363 AND [7600] ; make sure the low seven bits are zeros 8789 13063 1372 TAD [-1] ; adjust for PRE-incrementing auto index ... 8790 13064 3010 DCA RAMPTR ; and set RAMPTR 8791 13065 7100 CLL ; link clear for no errors 8792 13066 6225 .POPJ ; Bingo - we're ready to go! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 220 Read or Write SBC6120-RC RAM Disk bts6120.plx 8793 .TITLE Read or Write SBC6120-RC RAM Disk 8794 8795 ; This routine will read one page (128 words) from the SBC6120-RC RAM disk 8796 ; and transfer them to a buffer in main or panel memory. It assumes that 8797 ; RAMCDF, RAMPTR and the DAR have been set up to point to the correct physical 8798 ; RAM disk page by first calling the RAMSEL and SETDAR routines, and that the 8799 ; BUFPTR, BUFCDF and BUFPNL locations point to the correct destination for 8800 ; the data. By the time we get here we assume that all error checking has 8801 ; already been done and this routine never "fails" ! 8802 13067 7200 RCRDRD: CLA ; just in case 8803 13070 1363 TAD [-128.] ; always transfer exactly 1 page 8804 13071 3052 DCA XFRCNT ; ... 8805 13072 4762 RCRDR1: JMS @[RAMCDF] ; CDF to the correct RAM disk field 8806 13073 6403 MM3 ; and address RAM disk memory 8807 13074 1410 TAD @RAMPTR ; get a word from extended memory 8808 13075 3027 DCA RAMBUF ; and save it temporarily 8809 13076 6402 MM2 ; back to normal addressing 8810 13077 4761 JMS @[BUFCDF] ; now address the destination field 8811 13100 1027 TAD RAMBUF ; get the data word back again 8812 13101 3411 DCA @BUFPTR ; and store that in the buffer 8813 13102 6276 SPD ; back to normal addressing 8814 13103 6211 CDF 1 ; ... 8815 13104 2052 ISZ XFRCNT ; have we done all 128 words ? 8816 13105 5272 JMP RCRDR1 ; nope - keep going 8817 13106 7100 CLL ; always return "success" 8818 13107 6225 .POPJ ; and we're done! 8819 8820 8821 ; And this routine will write one page from a buffer in either main or panel 8822 ; memory to the SBC6120-RC RAM disk. It's pretty much the complement of the 8823 ; previous routine, and makes all the same assumptions! 8824 13110 7200 RCRDWR: CLA ; just in case 8825 13111 1363 TAD [-128.] ; always transfer exactly 1 page 8826 13112 3052 DCA XFRCNT ; ... 8827 13113 4761 RCRDW1: JMS @[BUFCDF] ; get a word from the buffer 8828 13114 1411 TAD @BUFPTR ; ... 8829 13115 3027 DCA RAMBUF ; and save it for a moment 8830 13116 6276 SPD ; back to panel memory addressing 8831 13117 4762 JMS @[RAMCDF] ; now select the RAM disk field 8832 13120 6403 MM3 ; and enable RAM disk addressing 8833 13121 1027 TAD RAMBUF ; get the data word 8834 13122 3410 DCA @RAMPTR ; and store it in the RAM disk 8835 13123 6402 MM2 ; back to normal addressing 8836 13124 6211 CDF 1 ; and restore the data field 8837 13125 2052 ISZ XFRCNT ; have we done enough? 8838 13126 5313 JMP RCRDW1 ; nope - keep going 8839 13127 7100 CLL ; always return "success" 8840 13130 6225 .POPJ ; and we're done! PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 221 Test DS1221 Batteries bts6120.plx 8841 .TITLE Test DS1221 Batteries 8842 8843 8844 ; This routine will test the status of the RAM disk backup batteries on the 8845 ; original, DS1221, RAM disk card. This routine will return incorrect, but 8846 ; harmless, information if the system really has the newer DS1231 RAM disk or 8847 ; the IOB6120 RAM disk, or no RAM disk at all. 8848 ; 8849 ; The DS1221 doesn't have a status bit to give us the battery state directly, 8850 ; but it does have a clever hack to allow us to infer what we want to know. If 8851 ; the batteries have failed, then the DS1221 will inhibit all chip select 8852 ; outputs on the _second_ memory cycle (but not the first!). We can use this 8853 ; by 1) reading any location and saving its value, 2) writing any different 8854 ; value to the same location, and 3) reading it back again. If the batteries 8855 ; are dead, the second cycle will be inhibited, and the value read in step 3 8856 ; will be the same as 1. Of course, this presupposes that there's functional 8857 ; memory installed in the first place, if there isn't then this algorithm will 8858 ; erroneously report that the batteries are dead. 8859 ; 8860 ; Because of the way this works, this routine has to be called before ANY 8861 ; other access is made to MM3, including the extension ROM initialization. 8862 ; That's why the DS1221 battery test is in a routine all by itself - the 8863 ; battery test for the other two styles (DS1231 and IOB6120) is done by the 8864 ; RDCHK1 routine. 8865 ; 8866 13131 0000 CK1221: 0 8867 13132 1360 TAD [32.] ; test bank 32 to avoid A17 problem 8868 13133 6410 LDAR ; select the RAM bank for testing 8869 13134 6403 MM3 ; enable RAM disk access 8870 13135 6201 CDF 0 ; use 1st RAMdisk RAM for test 8871 13136 1772 TAD @[7777] ; (1) read the last byte of this bank 8872 13137 7421 MQL ; save it for a minute 8873 13140 7701 ACL ; .... 8874 13141 7041 CIA ; make it negative 8875 13142 3772 DCA @[7777] ; (2) and write it back 8876 13143 7701 ACL ; get the original data 8877 13144 1772 TAD @[7777] ; (3) add what should be the complement 8878 13145 0357 AND [377] ; ignore all but the bottom eight bits 8879 13146 7650 SNA CLA ; if it's not zero then the second cycle was 8880 13147 7344 NLM2 ; ... inhibited because the batteries are dead 8881 13150 7001 IAC ; AC=-1 if battery good, AC=+1 if battery bad 8882 13151 3033 DCA BATTOK ; ..... 8883 13152 6211 CDF 1 ; back to current field 8884 13153 6402 MM2 ; back to the default memory map 8885 13154 5731 JMP @CK1221 ; ... 8886 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 8887 13200 .PAGE 15 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 222 Command Names Table bts6120.plx 8888 .TITLE Command Names Table 8889 8890 8891 ; This table gives the names of all the commands known to the monitor. Each 8892 ; entry consists of a one or two letter command name, in SIXBIT, followed by 8893 ; the address of a routine to execute it. Although this table is stored in 8894 ; field 1, all the command routines are implicitly in field zero! The zero 8895 ; entry at the end is a "catch all" that is called if none of the previous 8896 ; names match, and points to an error routine. With the exception of this last 8897 ; entry, the order of the table is not significant. 8898 13200 CMDTBL: 8899 13200 .SIXBIT /H / ; Help 8900 13201 0514 HELP ; ... 8901 13202 .SIXBIT /RP/ ; RePeat 8902 13203 0610 REPEAT ; ... 8903 13204 .SIXBIT /E / ; Examine 8904 13205 1002 EMEM ; ... 8905 13206 .SIXBIT /EP/ ; Examine Panel memory 8906 13207 1000 EPMEM ; ... 8907 13210 .SIXBIT /D / ; Deposit 8908 13211 1067 DMEM ; ... 8909 13212 .SIXBIT /DP/ ; Deposit Panel memory 8910 13213 1065 DPMEM ; ... 8911 13214 .SIXBIT /ER/ ; Examine Register 8912 13215 1114 EREG ; ... 8913 13216 .SIXBIT /DR/ ; Deposit Register 8914 13217 1132 DREG ; ... 8915 13220 .SIXBIT /BM/ ; Block Move 8916 13221 1400 BMOVE ; ... 8917 13222 .SIXBIT /CK/ ; ChecKsum 8918 13223 1442 CKMEM ; ... 8919 13224 .SIXBIT /WS/ ; Word Search 8920 13225 1600 SEARCH ; ... 8921 13226 .SIXBIT /CM/ ; Clear Memory 8922 13227 1507 CMEM ; ... 8923 13230 .SIXBIT /FM/ ; Fill Memory 8924 13231 1503 FLMEM ; ... 8925 13232 .SIXBIT /BL/ ; Breakpoint List 8926 13233 1674 BLIST ; ... 8927 13234 .SIXBIT /BP/ ; BreakPoint 8928 13235 2036 BPTCOM ; ... 8929 13236 .SIXBIT /BR/ ; Breakpoint Remove 8930 13237 2000 BREMOV ; ... 8931 13240 .SIXBIT /C / ; Continue 8932 13241 2214 CONTCM ; ... 8933 13242 .SIXBIT /SI/ ; Single Instruction with no trace 8934 13243 2200 SNCOM ; ... 8935 13244 .SIXBIT /ST/ ; STart 8936 13245 2251 START ; ... 8937 13246 .SIXBIT /P / ; Proceed 8938 13247 2207 PROCEE ; ... 8939 13250 .SIXBIT /TR/ ; single instruction with TRace 8940 13251 2144 SICOM ; ... 8941 13252 .SIXBIT /VE/ ; VErsion (of monitor) 8942 13253 0707 VECOM ; ... 8943 13254 .SIXBIT /TW/ ; Terminal Width 8944 13255 0635 TWCOM ; ... 8945 13256 .SIXBIT /TP/ ; Terminal Page 8946 13257 0660 TPCOM ; ... 8947 13260 .SIXBIT /EX/ ; EXECUTE (IOT instruction) 8948 13261 2324 XCTCOM ; ... 8949 13262 .SIXBIT /MR/ ; MASTER RESET 8950 13263 2300 CLRCOM ; ... 8951 13264 .SIXBIT /LP/ ; LOAD PAPER (tape from console) 8952 13265 3200 CONLOD ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 223 Command Names Table bts6120.plx 8953 13266 .SIXBIT /DD/ ; Disk (IDE) Dump 8954 13267 3405 DDDUMP ; ... 8955 13270 .SIXBIT /RD/ ; Disk (RAM) Dump 8956 13271 3400 RDDUMP ; ... 8957 13272 .SIXBIT /DL/ ; Disk (IDE) Load 8958 13273 3520 DLLOAD ; ... 8959 13274 .SIXBIT /RL/ ; Disk (RAM) Load 8960 13275 3513 RLLOAD ; ... 8961 13276 .SIXBIT /DF/ ; Disk (IDE) Format 8962 13277 3076 DFRMAT ; ... 8963 13300 .SIXBIT /RF/ ; Disk (RAM) Format 8964 13301 3124 RFRMAT 8965 13302 .SIXBIT /B / ; Bootstrap ram disk 8966 13303 2426 BOOT 8967 13304 .SIXBIT /PM/ ; Partition Map 8968 13305 2622 PMEDIT ; ... 8969 13306 .SIXBIT /PC/ ; Partition Copy 8970 13307 4024 PCOPY ; ... 8971 13310 .SIXBIT /FL/ ; Flash Load 8972 13311 4213 FLLOAD 8973 13312 .SIXBIT /PE/ ; Partition Compare 8974 13313 4015 PCOMP ; ... 8975 13314 .SIXBIT /X / ; Disassemble Main Memory 8976 13315 1546 DISASM ; ... 8977 13316 .SIXBIT /XP/ ; Disassemble Panel Memory 8978 13317 1550 DISASMP ; ... 8979 13320 .SIXBIT /SC/ ; SCope 8980 13321 0700 SCCOM 8981 13322 .SIXBIT /SD/ ; Spin IDE disk drive UP or DOWN 8982 13323 4600 SPINCD ; ... 8983 8984 ; there are 9 copies of the end-of-command list sentinel here so that 8985 ; up to 8 commands may be added by an extension ROM 8986 13324 0000 0000 ; This must always be the last entry 8987 13325 0453 COMERR ; Where to go if none of the above matches 8988 13326 0000 0000 ; This must always be the last entry 8989 13327 0453 COMERR ; Where to go if none of the above matches 8990 13330 0000 0000 ; This must always be the last entry 8991 13331 0453 COMERR ; Where to go if none of the above matches 8992 13332 0000 0000 ; This must always be the last entry 8993 13333 0453 COMERR ; Where to go if none of the above matches 8994 13334 0000 0000 ; This must always be the last entry 8995 13335 0453 COMERR ; Where to go if none of the above matches 8996 13336 0000 0000 ; This must always be the last entry 8997 13337 0453 COMERR ; Where to go if none of the above matches 8998 13340 0000 0000 ; This must always be the last entry 8999 13341 0453 COMERR ; Where to go if none of the above matches 9000 13342 0000 0000 ; This must always be the last entry 9001 13343 0453 COMERR ; Where to go if none of the above matches 9002 13344 0000 0000 ; This must always be the last entry 9003 13345 0453 COMERR ; Where to go if none of the above matches PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 224 Argument Tables for Various Commands bts6120.plx 9004 .TITLE Argument Tables for Various Commands 9005 9006 9007 ; This table gives a list of the legal register names for the ER (Examine 9008 ; Register) command... 9009 13346 ENAMES: .SIXBIT /AC/ ; The AC 9010 13347 1252 TYPEAC 9011 13350 .SIXBIT /PC/ ; The PC 9012 13351 1255 TYPEPC 9013 13352 .SIXBIT /MQ/ ; The MQ 9014 13353 1260 TYPEMQ 9015 13354 .SIXBIT /PS/ ; The processor status 9016 13355 1265 TYPEPS 9017 13356 .SIXBIT /SR/ ; The switch register 9018 13357 1276 TYPESR 9019 13360 0000 0000 ; None of the above 9020 13361 0453 COMERR 9021 9022 ; This table gives a list of the legal register names for the DR (deposit 9023 ; register) command... 9024 13362 DNAMES: .SIXBIT /AC/ ; The AC 9025 13363 1200 DAC 9026 13364 .SIXBIT /PC/ ; The PC 9027 13365 1203 DPC 9028 13366 .SIXBIT /MQ/ ; The MQ 9029 13367 1206 DMQ 9030 13370 .SIXBIT /PS/ ; The flags 9031 13371 1211 DPS 9032 13372 .SIXBIT /SR/ ; The switch register 9033 13373 1221 DSR 9034 13374 0000 0000 ; None of the above 9035 13375 0453 COMERR 9036 9037 ; This table is a list of the arguments to the B (BOOT) command... 9038 13376 BNAMES: .SIXBIT /VM/ ; VMA0 9039 13377 2464 BTVMA0 9040 13400 .SIXBIT /ID/ ; IDA0 9041 13401 2500 BTIDA0 9042 13402 0000 0000 ; end of list 9043 13403 0453 COMERR PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 225 Messages bts6120.plx 9044 .TITLE Messages 9045 9046 ; General purpose messages... 9047 13404 CKSMSG: .TEXT /Checksum = / 9048 13415 MEMMSG: .TEXT /?Memory error at / 9049 13432 ERRILV: .TEXT /Illegal value/ 9050 13444 ERRSRF: .TEXT /Search fails/ 9051 13455 ERRRAN: .TEXT /Wrong order/ 9052 13466 ERRWRP: .TEXT /Wrap around/ 9053 13477 SKPMSG: .TEXT /Skip / 9054 13504 ERRDIO: .TEXT \?I/O Error \ 9055 13515 ERRCKS: .TEXT /Checksum error/ 9056 13530 ERRNBT: .TEXT /No bootstrap/ 9057 13541 ERRNDK: .TEXT /No disk/ 9058 9059 ; Program trap messages... 9060 13547 BPTMSG: .TEXT /%Breakpoint at / 9061 13562 PR0MSG: .TEXT /?Illegal PR0 function at / 9062 13604 BRKMSG: .TEXT /%Break at / 9063 13614 PRNMSG: .TEXT /?Panel trap at / 9064 13627 HLTMSG: .TEXT /?Halted at / 9065 13640 TRPMSG: .TEXT /?Unknown trap at / 9066 9067 ; Breakpoint messages... 9068 13655 ERRNBP: .TEXT /None set/ 9069 13664 ERRNST: .TEXT /Not set/ 9070 13672 ERRAST: .TEXT /Already set/ 9071 13703 ERRBTF: .TEXT /Table full/ 9072 9073 ; Register names... 9074 13713 ACNAME: .TEXT /AC>/ 9075 13716 PCNAME: .TEXT /PC>/ 9076 13721 MQNAME: .TEXT /MQ>/ 9077 13724 IRNAME: .TEXT /IR>/ 9078 13727 SRNAME: .TEXT /SR>/ 9079 13732 PSNAME: .TEXT /PS>/ 9080 13735 SP1NAM: .TEXT /SP1>/ 9081 13741 SP2NAM: .TEXT /SP2>/ 9082 9083 ; Disk formatting status messages... 9084 13745 FCFMSG: .TEXT \Format unit/partition \ 9085 13765 FM1MSG: .TEXT /Writing / 9086 13774 FM2MSG: .TEXT / Verifying / 9087 14005 FM3MSG: .TEXT / Done/ 9088 14012 ERRDSK: .TEXT \?Verification error, block/page \ 9089 9090 ; Partition copy messages.... 9091 14041 CCFMSG: .TEXT \Overwrite partition \ 9092 14060 CP1MSG: .TEXT /Copying / 9093 4005 CP2MSG=FM3MSG 9094 9095 ; Partition compare messages.... 9096 3774 CE1MSG=FM2MSG 9097 4012 CEEMSG=ERRDSK 9098 9099 ; Partition map messages... 9100 14067 PM1MSG: .TEXT /Unit / 9101 14074 PM2MSG: .TEXT / -> Partition / 9102 9103 ; Device names that get printed by the boot sniffer... 9104 14107 VMAMSG: .TEXT /-VMA0/ 9105 14114 IDAMSG: .TEXT /-IDA0/ 9106 9107 ; System name message... 9108 14121 SYSNM0: .TEXT /SBC6120/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 226 Messages bts6120.plx 9109 14127 SYSNM1: .TEXT / ROM Monitor V/ 9110 14142 SYSNM2: .TEXT / Checksum / 9111 14152 SYSNM3: .TEXT /\d \h/ 9112 14167 SYSNM4: .TEXT /-RC/ 9113 14172 SYSCRN: .TEXT /Copyright (C) 1983-2010 by Spare Time Gizmos. All rights reserved./ 9114 9115 ; RAM disk status message... 9116 14250 RAMMS1: .TEXT /NVR: / 9117 14255 RAMMS3: .TEXT /KB/ 9118 14260 RAMMS4: .TEXT /KW/ 9119 14263 BOKMSG: .TEXT / - Battery OK/ 9120 14275 BFAMSG: .TEXT / - Battery FAIL/ 9121 9122 ; IDE disk status message... 9123 14310 IDEMS1: .TEXT /IDE: / 9124 14315 IDEMS2: .TEXT /MB - / 9125 14322 NDETMS: .TEXT /Not detected/ 9126 14333 NSUPMS: .TEXT /Not supported/ 9127 9128 ; Extension ROM messages 9129 14345 XRMES1: .TEXT /IOB: / 9130 14352 XRMES2: .TEXT /Error / 9131 14357 XRMES3: .TEXT /OK/ 9132 9133 ; Flash messages 9134 14362 FLMSG1: .TEXT /?No Flash/ 9135 14371 FLMSG2: .TEXT /Overwrite flash/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 227 Help Text bts6120.plx 9136 .TITLE Help Text 9137 9138 9139 ; These tables are used by the HELP command to generate a page of text 9140 ; describing the monitor commands. Each word is a pointer to a text string, 9141 ; also in field 1, which contains a single line of text, usually a description 9142 ; of one command. Each table ends with a zero word. The first and last 9143 ; tables are generic and appear on all models of SBC6120, but the middle tables 9144 ; are specific to the RAM disk, IDE disk and IOB6120 options. These middle 9145 ; tables appear only if the corresponding option is present. 9146 14404 HLPP1: ; Generic help part 1 - for all models ... 9147 ; Examine/Deposit commands... 9148 .DATA HLPEDC 14404 4516 9149 .DATA HLPE, HLPEP, HLPER, HLPX, HLPXP 14405 4542 14406 4604 14407 4647 14410 4674 14411 4733 9150 .DATA HLPD, HLPDP, HLPDR 14412 4772 14413 5036 14414 5103 9151 ; Memory commands... 9152 .DATA HLPNUL, HLPMEM 14415 4442 14416 5134 9153 .DATA HLPBM, HLPCK, HLPWS, HLPFM, HLPCM 14417 5147 14420 5204 14421 5241 14422 5300 14423 5332 9154 ; Breakpoint commands... 9155 .DATA HLPNUL, HLPBPC 14424 4442 14425 5361 9156 .DATA HLPBP, HLPBR, HLPBL, HLPP 14426 5377 14427 5423 14430 5452 14431 5474 9157 ; Program control commands... 9158 .DATA HLPNUL, HLPPCC 14432 4442 14433 5522 9159 .DATA HLPST, HLPC, HLPSI, HLPTR, HLPEX, HLPMR 14434 5543 14435 5600 14436 5623 14437 5646 14440 5673 14441 5727 9160 HLPNUL: .DATA 0 14442 0000 9161 9162 14443 HLPRAM: ; Help for RAM disk commands only ... 9163 .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 10-MAY-18 23:00:32 Page 228 Help Text bts6120.plx 9164 .DATA 0 14451 0000 9165 9166 14452 HLPIDE: ; Help for IDE disk commands only ... 9167 .DATA HLPNUL, HLPIDS, HLPDD, HLPDL, HLPDF 14452 4442 14453 5763 14454 6131 14455 6170 14456 6216 9168 .DATA HLPPC, HLPPE, HLPPM, HLPSD, HLPB 14457 6275 14460 6334 14461 6243 14462 6370 14463 6421 9169 .DATA 0 14464 0000 9170 9171 14465 HLPIOB: ; Help for IOB6120 commands only ... 9172 .DATA HLPNUL, HLPJDK, HLPFL 14465 4442 14466 6450 14467 6464 9173 .DATA 0 14470 0000 9174 9175 14471 HLPP2: ; Generic help part 2 - for all models ... 9176 ; Other (miscellaneous) commands... 9177 .DATA HLPNUL, HLPMSC 14471 4442 14472 6507 9178 .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 9179 ; Special control characters... 9180 .DATA HLPNUL, HLPCTL 14503 4442 14504 7003 9181 .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 9182 .DATA 0 14515 0000 9183 9184 ; Examine/Deposit commands... 9185 14516 HLPEDC: .TEXT /EXAMINE AND DEPOSIT COMMANDS/ 9186 14542 HLPE: .TEXT /E aaaaa[-bbbbb] [, ccccc]\t-> Examine main memory/ 9187 14604 HLPEP: .TEXT /EP aaaaa[-bbbbb] [, ccccc]\t-> Examine panel memory/ 9188 14647 HLPER: .TEXT /ER [rr]\t\t\t\t-> Examine register/ 9189 14674 HLPX: .TEXT /X aaaaa[-bbbbb]\t\t-> Disassemble main memory/ 9190 14733 HLPXP: .TEXT /XP aaaaa[-bbbbb]\t\t-> Disassemble panel memory/ 9191 14772 HLPD: .TEXT /D aaaaa bbbb, [cccc, ...]\t-> Deposit in main memory/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 229 Help Text bts6120.plx 9192 15036 HLPDP: .TEXT /DP aaaaa bbbb, [cccc, ...]\t-> Deposit in panel memory/ 9193 15103 HLPDR: .TEXT /DR xx yyyy\t\t\t-> Deposit in register/ 9194 9195 ; Memory commands... 9196 15134 HLPMEM: .TEXT /MEMORY COMMANDS/ 9197 15147 HLPBM: .TEXT /BM aaaaa-bbbbb ddddd\t\t-> Move memory block/ 9198 15204 HLPCK: .TEXT /CK aaaaa-bbbbb\t\t\t-> Checksum memory block/ 9199 15241 HLPWS: .TEXT /WS vvvv [aaaaa-bbbbb [mmmm]]\t-> Search memory/ 9200 15300 HLPFM: .TEXT /FM vvvv [aaaaa-bbbbb]\t\t-> Fill memory/ 9201 15332 HLPCM: .TEXT /CM [aaaaa-bbbbb]\t\t-> Clear memory/ 9202 9203 ; Breakpoint commands... 9204 15361 HLPBPC: .TEXT /BREAKPOINT COMMANDS/ 9205 15377 HLPBP: .TEXT /BP aaaaa\t\t\t-> Set breakpoint/ 9206 15423 HLPBR: .TEXT /BR [aaaaa]\t\t\t-> Remove breakpoint/ 9207 15452 HLPBL: .TEXT /BL\t\t\t\t-> List breakpoints/ 9208 15474 HLPP: .TEXT /P\t\t\t\t-> Proceed past breakpoint/ 9209 9210 ; Program control commands... 9211 15522 HLPPCC: .TEXT /PROGRAM CONTROL COMMANDS/ 9212 15543 HLPST: .TEXT /ST [aaaaa]\t\t\t-> Start main memory program/ 9213 15600 HLPC: .TEXT /C\t\t\t\t-> Continue execution/ 9214 15623 HLPSI: .TEXT /SI\t\t\t\t-> Single instruction/ 9215 15646 HLPTR: .TEXT /TR\t\t\t\t-> Trace one instruction/ 9216 15673 HLPEX: .TEXT /EX 6xxx\t\t\t\t-> Execute an IOT instruction/ 9217 15727 HLPMR: .TEXT /MR\t\t\t\t-> Master reset/ 9218 9219 ; Disk commands... 9220 15746 HLPRDS: .TEXT /RAM DISK COMMANDS/ 9221 15763 HLPIDS: .TEXT /IDE DISK COMMANDS/ 9222 16000 HLPLP: .TEXT /LP\t\t\t\t-> Load a BIN paper tape/ 9223 16025 HLPRD: .TEXT /RD u [pppp [cccc]]\t\t-> Dump RAM disk page/ 9224 16062 HLPRL: .TEXT /RL u\t\t\t\t-> Download RAM disk/ 9225 16106 HLPRF: .TEXT /RF u\t\t\t\t-> Format RAM disk/ 9226 16131 HLPDD: .TEXT /DD pppp [bbbb [cccc]]\t\t-> Dump IDE disk block/ 9227 16170 HLPDL: .TEXT /DL pppp\t\t\t\t-> Download IDE disk/ 9228 16216 HLPDF: .TEXT /DF pppp\t\t\t\t-> Format IDE disk/ 9229 16243 HLPPM: .TEXT /PM [u] [pppp]\t\t\t-> Edit partition map/ 9230 16275 HLPPC: .TEXT /PC ssss dddd\t\t\t-> Copy partition ssss to dddd/ 9231 16334 HLPPE: .TEXT /PE aaaa bbbb\t\t\t-> Compare two partitions/ 9232 16370 HLPSD: .TEXT /SD n\t\t\t\t-> Spin IDE disk UP or DOWN/ 9233 16421 HLPB: .TEXT /B [dd]\t\t\t\t-> Boot RAM or IDE disk/ 9234 9235 ; IOB6120 specific commands ... 9236 16450 HLPJDK: .TEXT /IOB6120 COMMANDS/ 9237 16464 HLPFL: .TEXT /FL\t\t\t\t-> Download Flash ROM/ 9238 9239 ; Other (miscellaneous) commands... 9240 16507 HLPMSC: .TEXT /MISCELLANEOUS COMMANDS/ 9241 16527 HLPTW: .TEXT /TW nn\t\t\t\t-> Set the console width/ 9242 16556 HLPTP: .TEXT /TP nn\t\t\t\t-> Set the console page length/ 9243 16611 HLPSC: .TEXT /SC n\t\t\t\t-> Set console scope mode/ 9244 16640 HLPVE: .TEXT /VE\t\t\t\t-> Show firmware version/ 9245 16665 HLPSEM: .TEXT /aa; bb; cc; dd ...\t\t-> Combine commands/ 9246 16720 HLPRP: .TEXT /RP [nn]; aa; bb; cc; ...\t-> Repeat commands/ 9247 16756 HLPDOL: .TEXT /!any text...\t\t\t-> Comment text/ 9248 9249 ; Special control characters... 9250 17003 HLPCTL: .TEXT /SPECIAL CHARACTERS/ 9251 17020 HLPCTS: .TEXT /Control-S (XOFF)\t\t-> Suspend terminal output/ 9252 17057 HLPCTQ: .TEXT /Control-Q (XON)\t\t\t-> Resume terminal output/ 9253 17115 HLPCTO: .TEXT /Control-O\t\t\t-> Suppress terminal output/ 9254 17150 HLPCTC: .TEXT /Control-C\t\t\t-> Abort current operation/ 9255 17203 HLPCTH: .TEXT /Control-H\t\t\t-> Delete the last character/ 9256 17237 HLPRUB: .TEXT /RUBOUT (DELETE)\t\t\t-> Delete the last character/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 230 Help Text bts6120.plx 9257 17277 HLPCTR: .TEXT /Control-R\t\t\t-> Retype the current line/ 9258 17332 HLPCTU: .TEXT /Control-U\t\t\t-> Erase current line/ 9259 17361 HLPEND: PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 231 Temporary Disk Buffer bts6120.plx 9260 .TITLE Temporary Disk Buffer 9261 9262 9263 ; The last two pages of field 1, addresses 17400 thru 17777, are used as a 9264 ; temporary disk buffer by the disk load, disk dump, disk format and boot 9265 ; commands. 9266 17400 .PAGE 36 9267 17400 DSKBUF: .BLOCK 128. 9268 17600 .PAGE 37 9269 17600 .BLOCK 128. PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 232 Field 2 Variables bts6120.plx 9270 .TITLE Field 2 Variables 9271 9272 9273 20200 .FIELD 2 9274 20000 .PAGE 0 9275 9276 20000 MNEMP: .BLOCK 1 ; address of last mnemonic output 9277 20001 MEA: .BLOCK 1 ; effective address 9278 20002 MIA: .BLOCK 1 ; indirect address 9279 20003 XPC: .BLOCK 1 ; Program Counter 9280 20004 XIR: .BLOCK 1 ; Instruction Register 9281 20005 IFDF: .BLOCK 1 9282 20006 DPNL: .BLOCK 1 9283 9284 20010 .ORG 10 9285 20010 SCAN: .BLOCK 1 ; auto-incr ptr to OPJMP table 9286 20011 ASCAN: .BLOCK 1 ; auto-incr ptr to mnemonic table 9287 20012 MPTR: .BLOCK 1 ; auto-incr ptr for TASZF2 9288 20013 AX1: .BLOCK 1 9289 20014 AX2: .BLOCK 1 9290 9291 20020 .ORG 20 9292 9293 20020 PUSHAC2: .BLOCK 1 9294 20021 DESTA: .BLOCK 1 9295 9296 20100 .ORG 100 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 233 Field 2 Cross Field Linkages bts6120.plx 9297 .TITLE Field 2 Cross Field Linkages 9298 9299 9300 ; This two routines will allow a routine in field 2 to simulate a .PUSHJ 9301 ; to a routines in field 0 or 1. The contents of the AC are preserved both 9302 ; ways across the call. 9303 ; 9304 ;CALL: 9305 ; JMS PJ0F2 or PJ1F2 ; cross field call "PUSHJ to 0 From 2" 9306 ; ; address of a routine in field 1 9307 ; ; with the AC preserved across the call 9308 ; 9309 20100 0000 PJ0F2: 0 ; call here with a JMS instruction 9310 20101 3020 DCA PUSHAC2 ; save the caller's AC for a minute 9311 20102 6221 CDF 2 9312 20103 1500 TAD @PJ0F2 ; then get caller's argument 9313 20104 3021 DCA DESTA ; that's the address of the routine to call 9314 20105 1100 TAD PJ0F2 ; now get caller's return address 9315 20106 7001 IAC ; and skip over the argument 9316 20107 6215 .PUSH ; put that on the stack 9317 20110 7200 CLA ; (PUSH doesn't clear the AC!) 9318 20111 1177 TAD [RET0F2] ; the field 0 routine will return to 9319 20112 6215 .PUSH ; ... 9320 20113 7200 CLA ; ... 9321 20114 1020 TAD PUSHAC2 ; restore the original AC contents 9322 20115 6203 CXF 0 ; call with IF = DF = 0 9323 20116 5421 JMP @DESTA ; and go to the code in field 0 9324 9325 20117 0000 PJ1F2: 0 ; call here with a JMS instruction 9326 20120 3020 DCA PUSHAC2 ; save the caller's AC for a minute 9327 20121 6221 CDF 2 9328 20122 1517 TAD @PJ1F2 ; then get caller's argument 9329 20123 3021 DCA DESTA ; that's the address of the routine to call 9330 20124 1117 TAD PJ1F2 ; now get caller's return address 9331 20125 7001 IAC ; and skip over the argument 9332 20126 6215 .PUSH ; put that on the stack 9333 20127 7200 CLA ; (PUSH doesn't clear the AC!) 9334 20130 1176 TAD [RET1F2] ; the field 1 routine will return to 9335 20131 6215 .PUSH ; ... 9336 20132 7200 CLA ; ... 9337 20133 1020 TAD PUSHAC2 ; restore the original AC contents 9338 20134 6213 CXF 1 ; call with IF = DF = 1 9339 20135 5421 JMP @DESTA ; and go to the code in field 1 9340 9341 ; This routine is identical to TASCIZ, except that the string is stored in 9342 ; field 2, rather than field 0... 9343 20136 3012 TASZF2: DCA MPTR ; save the pointer to the string 9344 20137 1412 TAD @MPTR ; and get the next character 9345 20140 7450 SNA ; is this the end of the string ?? 9346 20141 6225 .POPJ ; yes -- quit now 9347 20142 4100 JMS PJ0F2 9348 20143 7400 OUTCHR 9349 20144 5137 JMP TASZF2+1 ; and then loop until the end 9350 9351 20176 2514 20177 4305 9352 20200 .ORG 0200 9353 9354 ; The PDP2HEX program (which converts BIN files into ROM images in Intel 9355 ; HEX format) stores a checksum of ROM field 2 in location 20200. This is 9356 ; used by the POST and the VE (version) command. 9357 20200 ROMCK2: .BLOCK 1 9358 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 234 Persistent setting support (NVRAM) bts6120.plx 9359 .TITLE Persistent setting support (NVRAM) 9360 9361 9362 7700 RDPMLOC = 4032. ; 21*128*1.5 = first free byte in ramdisk 0 DAR 0 9363 ; note: maximum storage is (4096.-4032.-2)/2 words = 31. 9364 0136 RDPMS1 = 0136 ; signature 1 (byte) 9365 0266 RDPMS2 = 0266 ; signature 2 (byte) 9366 9367 20201 7200 RDPSS: CLA 9368 20202 6214 RDF 9369 20203 1377 TAD [CXF 0] 9370 20204 3240 DCA RDPSX 9371 9372 20205 1376 TAD [FIRSTPSS-1] ; set up an auto index register 9373 20206 3013 DCA AX1 ; ... to address the persistent vars 9374 9375 20207 6201 CDF 0 9376 20210 1775 TAD @[RAMBAS] 9377 20211 1374 TAD [RDPMLOC] ; 21*128*1.5 = first free byte in ramdisk field 9378 20212 3014 DCA AX2 ; auto-incr to address NVRAM 9379 9380 20213 6410 LDAR ; set DAR to 0 9381 9382 20214 6403 MM3 ; address the ramdisk memory 9383 ;CDF 0 ; 1st NVRAM 9384 20215 1414 TAD @AX2 ; are the two signature bytes there? 9385 20216 1373 TAD [-RDPMS1] 9386 20217 7640 SZA CLA 9387 20220 5240 JMP RDPSX ; no - exit 9388 20221 1414 TAD @AX2 9389 20222 1372 TAD [-RDPMS2] 9390 20223 7640 SZA CLA 9391 20224 5240 JMP RDPSX ; no - exit 9392 9393 20225 1414 TAD @AX2 ; get the number of words 9394 20226 7041 CIA ; make neg. counter for ISZ 9395 20227 3001 DCA MEA 9396 9397 20230 6403 RDPS0: MM3 9398 ;CDF 0 ; source field 9399 20231 1414 TAD @AX2 ; get the next byte 9400 20232 7002 BSW ; take it as the upper 6 bits 9401 20233 1414 TAD @AX2 ; add in the lower 6 bits 9402 20234 6402 MM2 9403 ;CDF 0 ; destination field 9404 20235 3413 DCA @AX1 ; and store it 9405 20236 2001 ISZ MEA 9406 20237 5230 JMP RDPS0 ; next 9407 9408 20240 0000 RDPSX: 0 9409 20241 6402 MM2 9410 20242 6225 .POPJ 9411 9412 20243 6214 WRPSS: RDF 9413 20244 1377 TAD [CXF 0] 9414 20245 3303 DCA WRPSX 9415 9416 20246 6201 CDF 0 9417 20247 1775 TAD @[RAMBAS] ; starting just after 1st RAM disk page 9418 20250 1374 TAD [RDPMLOC] ; 21*128*1.5 = first free byte in ramdisk field 9419 20251 3014 DCA AX2 ; auto-incr to address NVRAM 9420 9421 20252 1376 TAD [FIRSTPSS-1] ; set up an auto index register 9422 20253 3013 DCA AX1 ; ... to address the persistent vars 9423 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 235 Persistent setting support (NVRAM) bts6120.plx 9424 20254 6410 LDAR ; set DAR to 0 9425 9426 20255 6403 MM3 ; address the ramdisk memory 9427 ;CDF 0 9428 9429 20256 1371 TAD [RDPMS1] ; store the signature 9430 20257 3414 DCA @AX2 9431 20260 1370 TAD [RDPMS2] 9432 20261 3414 DCA @AX2 9433 9434 20262 1367 TAD [LASTPSS-FIRSTPSS] ; store the number of words written 9435 20263 3414 DCA @AX2 9436 9437 20264 1366 TAD [FIRSTPSS-LASTPSS] ; -number of words to write 9438 20265 3001 DCA MEA 9439 9440 20266 6402 WRPS0: MM2 9441 ;CDF 0 ; source field 9442 20267 1413 TAD @AX1 ; get a word 9443 20270 6403 MM3 9444 ;CDF 0 ; destination field 9445 20271 6215 .PUSH ; save it for splitting 9446 20272 7002 BSW 9447 20273 0365 AND [77] ; get the upper 6 bits in a byte 9448 20274 3414 DCA @AX2 ; save it 9449 20275 6235 .POP 9450 20276 0365 AND [77] ; get the lower 6 bits in a byte 9451 20277 3414 DCA @AX2 ; save it 9452 9453 20300 2001 ISZ MEA 9454 20301 5266 JMP WRPS0 ; next 9455 9456 20302 6402 MM2 9457 9458 20303 0000 WRPSX: 0 9459 20304 6225 .POPJ 9460 20365 0077 20366 7765 20367 0013 20370 0266 20371 0136 20372 7512 20373 7642 20374 7700 20375 0034 20376 0017 20377 6203 9461 20400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 236 Extension ROM management bts6120.plx 9462 .TITLE Extension ROM management 9463 9464 9465 ; check for an extension ROM in ramdisk memory at 100000000. 9466 ; The check looks for a signature of 'SB' 'C6' at the start, and a valid 9467 ; checksum. 9468 9469 20400 7200 EXTROM: CLA 9470 20401 6201 CDF 0 9471 20402 3777 DCA @[EXTFLG] ; initialize status to "no extension ROM" 9472 9473 ; Reset the console to the serial port just in case, before 9474 ; the extension ROM is loaded 9475 9476 20403 6412 PRISLU 9477 9478 ; If the extension ROM contains code that prevents the SBC from starting up, 9479 ; there needs to be a way to prevent from being called. So a check is made 9480 ; for an ESC character coming in the serial port, and loading is cancelled 9481 ; if it's found. 9482 9483 20404 6031 KSF ; is there a key in the UART buffer? 9484 20405 5212 JMP EXTRO2 ; no, skip check 9485 20406 6036 KRB ; fetch it 9486 20407 1376 TAD [-33] ; compare to ESC 9487 20410 7450 SNA 9488 20411 5277 JMP NOXROM ; was ESC - abort ROM check 9489 9490 ;*** This section of code downloads the first 4KB of the extension ROM 9491 ;*** into field 3 of RAM. For debugging purposes (using an EPROM emulator), 9492 ;*** or if no extension ROM is installed, this may be commented out so 9493 ;*** that what's currently in field 3 is left alone. Since the initial 9494 ;*** EPROM-to-RAM copy copied field 3, the effect is that field 3 of the 9495 ;*** EPROM is used as the extension ROM code. 9496 ;*** !!! important: also disable the memory check of field 3 !!! 9497 20412 7240 EXTRO2: NL7777 ; point the buffer to offset 0 9498 20413 6211 CDF 1 9499 20414 3775 DCA @[BUFPTR] ; ... 9500 20415 1374 TAD [CDF 3] ; of field 3 9501 20416 3773 DCA @[BUFCDF+1] ; ... 9502 20417 7240 NL7777 9503 20420 3772 DCA @[BUFPNL] ; of panel memory 9504 20421 1371 TAD [CDF 1] 9505 20422 3770 DCA @[RAMCDF+1] ; of RAM disk unit 1 (hopefully a ROM) 9506 20423 7240 NL7777 9507 20424 3767 DCA @[RAMPTR] ; beginning of the memory space 9508 20425 6410 LDAR ; and in the first chunk (DAR=0) 9509 20426 1366 TAD [-21.] ; and we'll do it 21 times, for a full 9510 20427 3002 DCA MIA ; field of 2688 words 9511 20430 4117 UNPLP: JMS PJ1F2 9512 20431 0442 UNPACK ; unpack RAM disk data to the buffer 9513 20432 2002 ISZ MIA 9514 20433 5230 JMP UNPLP 9515 ;*** to here 9516 9517 20434 7240 NL7777 9518 20435 3010 DCA SCAN ; check for the two word signature 9519 20436 6231 CDF 3 9520 20437 1410 TAD @SCAN 9521 20440 1365 TAD [-6342] ; 'SB' 9522 20441 7440 SZA 9523 20442 5277 JMP NOXROM ; nope, not there 9524 20443 1410 TAD @SCAN 9525 20444 1364 TAD [-4326] ; 'C6' 9526 20445 7440 SZA PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 237 Extension ROM management bts6120.plx 9527 20446 5277 JMP NOXROM ; nope, not there 9528 9529 ; so far so good... checksum it 9530 9531 20447 7240 NL7777 ; starting at beginning of field 9532 20450 3011 DCA ASCAN 9533 20451 1363 TAD [-2688.] ; check the whole downloaded code area 9534 20452 3002 DCA MIA 9535 20453 1411 XRCHECK: TAD @ASCAN ; accumulate checksum 9536 20454 2002 ISZ MIA ; done yet? 9537 20455 5253 JMP XRCHECK ; nope 9538 9539 20456 7450 SNA ; is the checksum 0000? 9540 20457 5262 JMP STARTXROM ; yes, continue the process 9541 9542 20460 7326 NL0002 9543 20461 5275 JMP XROMERR ; no, return error code 0002 9544 9545 ; the extension ROM is present, copied into field 3 and its checksum is valid. 9546 ; Let's call it! 9547 9548 0007 NUMXRARGS=7 ; number of parameters following 9549 9550 20462 STARTXROM: 9551 20462 1362 TAD [NUMXRARGS] 9552 20463 6221 CDF 2 9553 20464 6232 CIF 3 9554 20465 4410 JMS @SCAN 9555 ; parameters passed to Extension ROM entry 9556 20466 0320 VERSION ; BTS6120 ROM version 9557 20467 4311 F0VECTOR ; table of pointers in field 0 9558 20470 4777 F0PATCH-1 ; page that we can use in f0 if needed 9559 20471 2520 F1VECTOR ; table of pointers in field 1 9560 20472 2777 F1PATCH-1 ; page that we can use in f1 if needed 9561 20473 0503 F2VECTOR ; table of pointers in field 1 9562 20474 2577 F2PATCH-1 ; page that we can use in f1 if needed 9563 9564 ; and it returns here with AC=0 for no error, otherwise a code from 0003 up 9565 9566 20475 XROMERR: 9567 20475 6201 CDF 0 9568 20476 3777 DCA @[EXTFLG] ; save AC as status 9569 20477 6203 NOXROM: CXF 0 9570 20500 6225 .POPJ ; continue initialization process PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 238 Field 2 Vector Table bts6120.plx 9571 .TITLE Field 2 Vector Table 9572 9573 9574 20501 6233 RET2F3: CXF 3 ; return to field 3 9575 20502 6225 .POPJ ; the address is already on the stack 9576 9577 9578 ; variable and functions that we may want to access or hook in this field 9579 ; codes: I=instruction pointer, V=variable, H=hook (CIF n, JMP @.+1, V) 9580 ; Add only to the *end* of this list, please! 9581 ; n.b. JMS linkage functions generally cannot be used here 9582 20503 F2VECTOR: 9583 20503 0501 RET2F3 ; I utility - return to field 2 (must be first) 9584 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 9585 20600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 239 X / XP Commands -- Disassemble memory bts6120.plx 9586 .TITLE X / XP Commands -- Disassemble memory 9587 9588 9589 ; CMDX / CMDXP: the disassembler commands. They share an implementation, 9590 ; since the only difference between them is whether main or panel memory is 9591 ; read. 9592 9593 20600 7200 CMDX: CLA 9594 20601 1377 TAD [CPD] ; access main memory 9595 20602 5205 JMP XCOMM 9596 9597 20603 7200 CMDXP: CLA 9598 20604 1376 TAD [SPD] ; access panel memory 9599 20605 3006 XCOMM: DCA DPNL 9600 9601 20606 4100 JMS PJ0F2 ; get the next command character 9602 20607 4617 SPACMP 9603 9604 20610 7450 SNA ; is it an eol? 9605 20611 5270 JMP DFLTX ; yes, goto special handling 9606 9607 20612 4100 JMS PJ0F2 ; no, throw it back in 9608 20613 4647 BACKUP 9609 9610 20614 4100 JMS PJ0F2 9611 20615 6460 RANGE ; and try getting range from input buffer 9612 9613 20616 6201 DA1L: CDF 0 9614 20617 7300 CLA CLL ; for L/LP commands, assume DF=IF 9615 20620 1775 TAD @[ADRFLD] 9616 20621 7012 RTR 9617 20622 7010 RAR 9618 20623 6215 .PUSH ; save the field for later printing 9619 20624 1775 TAD @[ADRFLD] 9620 20625 3005 DCA IFDF ; the two lower digits of IFDF are the same 9621 9622 20626 1774 TAD @[ADDR] ; get the address from RANGE 9623 20627 3003 DCA XPC 9624 9625 20630 1775 TAD @[ADRFLD] ; get the field from RANGE and make a CDF 9626 20631 1373 TAD [CDF 0] 9627 20632 3235 DCA DAF ; self-modify for memory space and field 9628 20633 1006 TAD DPNL 9629 20634 3236 DCA DAP 9630 20635 0000 DAF: 0 9631 20636 0000 DAP: 0 9632 20637 1403 TAD @XPC ; get the code word at the current address 9633 20640 3004 DCA XIR 9634 20641 6201 CDF 0 9635 20642 6276 SPD 9636 9637 20643 6235 .POP ; get back the field number 9638 20644 6205 .PUSHJ DISA2 ; and disassemble the instruction 20645 5331 9639 9640 20646 6201 CDF 0 9641 20647 7200 CLA ; are we at the end of the range? 9642 20650 1775 TAD @[ADRFLD] ; get the field 9643 20651 7041 CIA ; negate the field 9644 20652 1772 TAD @[HGHFLD] ; compare to the high field 9645 20653 7640 SZA CLA 9646 20654 5262 JMP INCR ; no -- continue 9647 20655 1771 TAD @[HIGH] ; yes -- compare the addresses 9648 20656 7041 CIA ; 9649 20657 1774 TAD @[ADDR] ; ... PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 240 X / XP Commands -- Disassemble memory bts6120.plx 9650 20660 7650 SNA CLA ; are they equal ?? 9651 20661 5310 JMP XCMDDN ; yes -- stop 9652 9653 20662 2774 INCR: ISZ @[ADDR] ; increment address/field 9654 20663 7410 SKP 9655 20664 1370 TAD [10] 9656 20665 1775 TAD @[ADRFLD] 9657 20666 3775 DCA @[ADRFLD] 9658 20667 5216 JMP DA1L 9659 9660 20670 6201 DFLTX: CDF 0 9661 20671 7301 CLL CLA IAC ; AC=0001 L=0 9662 20672 1771 TAD @[HIGH] 9663 20673 3774 DCA @[ADDR] 9664 20674 7430 SZL 9665 20675 1370 TAD [10] 9666 20676 1772 TAD @[HGHFLD] 9667 20677 3775 DCA @[ADRFLD] 9668 20700 7315 CLL CLA IAC R3L ; AC=0010 L=0 9669 20701 1774 TAD @[ADDR] 9670 20702 3771 DCA @[HIGH] 9671 20703 7430 SZL 9672 20704 1370 TAD [10] 9673 20705 1775 TAD @[ADRFLD] 9674 20706 3772 DCA @[HGHFLD] 9675 20707 5216 JMP DA1L 9676 9677 20710 6203 XCMDDN: CXF 0 ; done, 9678 20711 6225 .POPJ ; return to monitor 9679 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 241 Disassemble Current Trace Location bts6120.plx 9680 .TITLE Disassemble Current Trace Location 9681 9682 9683 ; XTYPIR: prints a disassembly of the current trace location 9684 9685 20712 1767 XTYPIR: TAD @[UIRPC] ; get the current user environment 9686 20713 3003 DCA XPC ; into our local copies 9687 20714 1766 TAD @[UFLAGS] ; [RLA] UFLAGS is in field zero! 9688 20715 3005 DCA IFDF 9689 20716 1765 TAD @[UIR] 9690 20717 3004 DCA XIR 9691 20720 1377 TAD [CPD] ; a TR always happens in main memory (?) 9692 20721 3006 DCA DPNL 9693 9694 20722 1005 TAD IFDF ; get the IF for printing 9695 20723 7012 RTR 9696 20724 7010 RAR 9697 20725 6205 .PUSHJ DISA2 ; and print the line 20726 5331 9698 9699 20727 6203 CXF 0 ; return to TR 9700 20730 6225 .POPJ 9701 9702 ; DISA2: disassemble a line with all the trimmin's. Displays code address, 9703 ; instruction value, and decoded instruction. Enter with AC=field number. 9704 9705 20731 0365 DISA2: AND [7] ; turn field into ASCII 9706 20732 1364 TAD ["0"] 9707 20733 4100 JMS PJ0F2 ; and print it 9708 20734 7400 OUTCHR 9709 20735 1003 TAD XPC ; print the PC 9710 20736 4100 JMS PJ0F2 9711 20737 6322 TOCT4 9712 20740 1363 TAD [DS4MSG-1] ; say "/ " 9713 20741 6205 .PUSHJ TASZF2 20742 5136 9714 20743 1004 TAD XIR ; print the IR (instruction) 9715 20744 4100 JMS PJ0F2 9716 20745 6322 TOCT4 9717 20746 1362 TAD [DS5MSG-1] ; say "\t" 9718 20747 6205 .PUSHJ TASZF2 20750 5136 9719 20751 6221 CDF 2 9720 20752 5761 JMP @[DISA1] ; and print the disassembled line 9721 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 9722 21000 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 242 Disassembler Top Level bts6120.plx 9723 .TITLE Disassembler Top Level 9724 9725 21000 7200 DISA1: CLA 9726 21001 3000 DCA MNEMP ; no mnemonics output yet 9727 9728 21002 1004 TAD XIR ; get instruction 9729 21003 7002 BSW 9730 21004 7012 RTR ; extract upper digit 9731 21005 0377 AND [16] 9732 21006 1376 TAD [OPJMP-1] ; and make into table ptr 9733 21007 3010 DCA SCAN 9734 9735 21010 1410 TAD @SCAN ; get pointer to mnemonic list for this group 9736 21011 3011 DCA ASCAN ; SCAN now points to post-mnemonic routine (-1) 9737 9738 21012 1004 TAD XIR ; do 1st mnemonic without sentinel check 9739 21013 0411 AND @ASCAN ; so that opcode 0000 works 9740 21014 5221 JMP MAT0B 9741 9742 21015 1004 AMTCH0: TAD XIR ; get instruction 9743 21016 0411 AND @ASCAN ; AND with mask 9744 21017 7450 SNA ; 0 mask at end of list 9745 21020 5252 JMP AMTCH8 ; no more possible matches 9746 21021 7041 MAT0B: CIA 9747 21022 1411 TAD @ASCAN ; compare masked IR with value 9748 21023 7450 SNA 9749 21024 5232 JMP AMTCH2 ; matched! 9750 9751 ; didn't match, skip over variable-length text to next entry 9752 21025 1411 AMTCH1: TAD @ASCAN ; because all strings are odd length 9753 21026 0375 AND [77] ; just look at the even character 9754 21027 7650 SNA CLA ; for termination symbol (00) 9755 21030 5215 JMP AMTCH0 ; yes, end of text, continue searching 9756 21031 5225 JMP AMTCH1 ; no, skip another word 9757 9758 ; did match, output the mnemonic and go back for more (for case of Operate) 9759 21032 1011 AMTCH2: TAD ASCAN ; save the location for later use in OPRGRP 9760 21033 3000 DCA MNEMP 9761 21034 1411 AMTCH3: TAD @ASCAN ; get the packed 6-bit 9762 21035 6215 .PUSH ; save a couple of copies for later use 9763 21036 6215 .PUSH 9764 21037 7002 BSW ; print the first char 9765 21040 6205 .PUSHJ TSIXB 21041 5262 9766 21042 6235 .POP ; print the second char 9767 21043 6205 .PUSHJ TSIXB 21044 5262 9768 21045 6235 .POP 9769 21046 0375 AND [77] ; was it a space? (n.b. space will have printed) 9770 21047 7640 SZA CLA 9771 21050 5234 JMP AMTCH3 ; no, print next two 9772 21051 5215 JMP AMTCH0 ; look for another mnemonic on this line 9773 9774 ; done with mnemonic part of line 9775 21052 1410 AMTCH8: TAD @SCAN ; call post-mnemonic routine for this group 9776 21053 3001 DCA MEA ; (Bad Things seem to happen when you .PUSHJ 9777 21054 6205 .PUSHJ @MEA ; indirect through an auto-increment location) 21055 5401 9778 21056 7200 CLA 9779 21057 4100 JMS PJ0F2 ; print newline 9780 21060 7104 CRLF 9781 21061 6225 .POPJ 9782 9783 21062 0375 TSIXB: AND [77] ; print a single 6bit character 9784 21063 1374 TAD [" "] PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 243 Disassembler Top Level bts6120.plx 9785 21064 4100 JMS PJ0F2 9786 21065 7400 OUTCHR 9787 21066 6225 .POPJ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 244 Disassemble EA For MRIs bts6120.plx 9788 .TITLE Disassemble EA For MRIs 9789 9790 9791 ; EAIGRP / EADGRP: post-mnemonic routines for memory reference instructions. 9792 ; prints the effective address (EA) and indirect data values. 9793 9794 21067 1005 EAIGRP: TAD IFDF ; for JMS/JMP, the final destination is in IF 9795 21070 5273 JMP EA2 9796 9797 21071 1005 EADGRP: TAD IFDF ; for AND/TAD/ISZ/DCA, the final value in DF 9798 21072 7114 CLL R3L 9799 21073 0373 EA2: AND [0070] 9800 21074 1372 TAD [CDF 0] ; make into a CDF 9801 21075 3771 DCA @[EA3D] 9802 9803 21076 1005 TAD IFDF ; The initial fetch is always from the IF field 9804 21077 0373 AND [0070] 9805 21100 1372 TAD [CDF 0] ; make into a CDF 9806 21101 3770 DCA @[EA3I] ; and modify the fetch code 9807 9808 21102 1006 TAD DPNL ; get the CPD/SPD and modify the fetch code 9809 21103 3767 DCA @[EA4] 9810 9811 21104 1004 TAD XIR ; get in-page offset from the instruction 9812 21105 0366 AND [177] 9813 21106 7421 MQL ; save it 9814 9815 21107 1004 TAD XIR ; get ZP bit from instruction into Link 9816 21110 7014 R3L 9817 21111 7006 RTL 9818 9819 21112 7200 CLA 9820 21113 1003 TAD XPC ; get current instruction page 9821 21114 0365 AND [7600] 9822 9823 21115 7420 SNL ; test ZP bit in instruction 9824 21116 7200 CLA ; if ZP=0, clear page, otherwise keep PC page 9825 21117 7501 MQA ; combine with offset from instruction 9826 9827 21120 3001 DCA MEA ; now have effective addr 9828 9829 21121 6205 .PUSHJ @[EA3I] ; get value at that address in IF field 21122 5770 9830 21123 3002 DCA MIA 9831 9832 21124 1004 TAD XIR ; get IA bit 9833 21125 7014 R3L 9834 21126 7004 RAL 9835 21127 7620 SNL CLA ; check if IA=0 (not indirect) 9836 21130 5344 JMP EA6 ; yes, do direct directly 9837 9838 21131 1364 TAD [DS2MSG-1] ; Say "@" 9839 21132 6205 .PUSHJ TASZF2 21133 5136 9840 21134 6205 .PUSHJ EA6 ; print " [value]" 21135 5344 9841 21136 1002 TAD MIA ; get double indirect value 9842 21137 3001 DCA MEA 9843 21140 6205 .PUSHJ @[EA3D] ; in correct field (IF if JMP/JMS, else DF) 21141 5771 9844 21142 3002 DCA MIA 9845 21143 5347 JMP EA7 ; print " [value]" and return 9846 9847 21144 1001 EA6: TAD MEA ; print the memory address 9848 21145 4100 JMS PJ0F2 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 245 Disassemble EA For MRIs bts6120.plx 9849 21146 6322 TOCT4 9850 21147 1363 EA7: TAD [DS1MSG-1] ; print the indirect (or double-indirect) 9851 21150 6205 .PUSHJ TASZF2 ; value, in format "\t[xxxx]" 21151 5136 9852 21152 1002 TAD MIA 9853 21153 4100 JMS PJ0F2 9854 21154 6322 TOCT4 9855 21155 1362 TAD [DS6MSG-1] 9856 21156 5136 JMP TASZF2 9857 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 9858 21200 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 246 Disassemble OPR and IOT instructions bts6120.plx 9859 .TITLE Disassemble OPR and IOT instructions 9860 9861 9862 ; OPRGRP: called to finish up a mnemonic Operate instruction. 9863 ; It checks for instructions that have a parameter and also for unknown 9864 ; opcodes. 9865 9866 21200 7300 OPRGRP: CLA CLL 9867 21201 1000 TAD MNEMP ; get last mnemonic output 9868 21202 7450 SNA ; was there one? 9869 21203 5222 JMP NOMNEM ; no - print "?" and return 9870 21204 1377 TAD [-OP6NOCF] ; was it a CDF/CIF/CXF/PR? 9871 21205 7630 SZL CLA 9872 21206 6225 .POPJ ; no - return w/o printing anything 9873 21207 1004 TAD XIR ; get instruction 9874 21210 7012 RTR ; and extract and print field number 9875 21211 7010 RAR 9876 21212 0376 AND [7] 9877 21213 1375 TAD ["0"] 9878 21214 4100 JMS PJ0F2 9879 21215 7400 OUTCHR 9880 21216 6225 .POPJ 9881 9882 ; IOTGRP: called to finish up a mnemonic IOT instruction 9883 ; Since IOTs are hardware defined, we have only a small standard set 9884 ; of them in the tables; so we see if anything useful was printed and, 9885 ; if not, print a '?' 9886 9887 21217 1000 IOTGRP: TAD MNEMP ; any mnemonics output? 9888 21220 7640 SZA CLA 9889 21221 6225 .POPJ ; yes - return w/o printing anything 9890 21222 1374 NOMNEM: TAD [DS3MSG-1] ; Say "?" 9891 21223 5136 JMP TASZF2 9892 9893 ; EA3: fetch word @MEA in correct memory space and field 9894 ; part of EAxGRP, and modifiied by that code 9895 9896 21224 6201 EA3I: CDF 0 ; in field IF (modifed) 9897 21225 7410 SKP 9898 21226 6201 EA3D: CDF 0 ; in field DF (modified) 9899 21227 6266 EA4: CPD ; main or panel memory (modified) 9900 21230 1401 TAD @MEA ; get value at that address 9901 21231 6221 CDF 2 9902 21232 6276 SPD 9903 21233 6225 .POPJ 9904 9905 21374 2461 21375 0060 21376 0007 21377 6310 9906 21400 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 247 Disassembler Tables (MRIs) bts6120.plx 9907 .TITLE Disassembler Tables (MRIs) 9908 9909 ; Opcode group tables. For each group (upper digit), this 9910 ; table has a mnemonic table pointer and a pointer to a function 9911 ; that prints the parameters (e.g. effective address for AND) 9912 9913 OPJMP: .DATA OP0-1, EADGRP, OP1-1, EADGRP 21400 1417 21401 1071 21402 1423 21403 1071 9914 .DATA OP2-1, EADGRP, OP3-1, EADGRP 21404 1427 21405 1071 21406 1433 21407 1071 9915 .DATA OP4-1, EAIGRP, OP5-1, EAIGRP 21410 1437 21411 1067 21412 1443 21413 1067 9916 .DATA OP6-1, OPRGRP, OP7-1, IOTGRP 21414 1447 21415 1200 21416 2147 21417 1217 9917 9918 ; Mnemonic table. Each entry consists of a mask, a match value, 9919 ; and a text string in sixbit. In order to detect the end of the 9920 ; string, it must be an odd number of characters long so that the 9921 ; last word is xx00. .TEXT could have been used, but 9922 ; it always emits a full word of 0000 and so would have taken more space. 9923 9924 ; the first 6 groups will always match, so no sentinels are necessary 9925 ; The Effective Address will be displayed for these 9926 OP0: .DATA 7000, 0000 21420 7000 21421 0000 9927 21422 .SIXBIT /AND/ 9928 OP1: .DATA 7000, 1000 21424 7000 21425 1000 9929 21426 .SIXBIT /TAD/ 9930 OP2: .DATA 7000, 2000 21430 7000 21431 2000 9931 21432 .SIXBIT /ISZ/ 9932 OP3: .DATA 7000, 3000 21434 7000 21435 3000 9933 21436 .SIXBIT /DCA/ 9934 OP4: .DATA 7000, 4000 21440 7000 21441 4000 9935 21442 .SIXBIT /JMS/ 9936 OP5: .DATA 7000, 5000 21444 7000 21445 5000 9937 21446 .SIXBIT /JMP/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 248 Disassembler Tables (IOTs) bts6120.plx 9938 .TITLE Disassembler Tables (IOTs) 9939 9940 21450 OP6: ; mnemonics from here to OP6NOCF will have their 3rd digit 9941 .DATA 7707, 6201 ; printed as the parameter 21450 7707 21451 6201 9942 21452 .SIXBIT /CDF/ 9943 .DATA 7707, 6202 21454 7707 21455 6202 9944 21456 .SIXBIT /CIF/ 9945 .DATA 7707, 6203 21460 7707 21461 6203 9946 21462 .SIXBIT /CXF/ 9947 .DATA 7747, 6206 21464 7747 21465 6206 9948 21466 .SIXBIT /PR / 9949 21470 OP6NOCF: 9950 .DATA 7777, 6214 21470 7777 21471 6214 9951 21472 .SIXBIT /RDF/ 9952 .DATA 7777, 6224 21474 7777 21475 6224 9953 21476 .SIXBIT /RIF/ 9954 .DATA 7777, 6234 21500 7777 21501 6234 9955 21502 .SIXBIT /RIB/ 9956 .DATA 7777, 6244 21504 7777 21505 6244 9957 21506 .SIXBIT /RMF/ 9958 .DATA 7777, 6246 21510 7777 21511 6246 9959 21512 .SIXBIT /WSR/ 9960 .DATA 7777, 6256 21514 7777 21515 6256 9961 21516 .SIXBIT /GCF/ 9962 .DATA 7777, 6266 21520 7777 21521 6266 9963 21522 .SIXBIT /CPD/ 9964 .DATA 7777, 6276 21524 7777 21525 6276 9965 21526 .SIXBIT /SPD/ 9966 .DATA 7777, 6205 21530 7777 21531 6205 9967 21532 .SIXBIT /PPC1 / 9968 .DATA 7777, 6245 21535 7777 21536 6245 9969 21537 .SIXBIT /PPC2 / 9970 .DATA 7777, 6215 21542 7777 21543 6215 9971 21544 .SIXBIT /PAC1 / 9972 .DATA 7777, 6255 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 249 Disassembler Tables (IOTs) bts6120.plx 21547 7777 21550 6255 9973 21551 .SIXBIT /PAC2 / 9974 .DATA 7777, 6225 21554 7777 21555 6225 9975 21556 .SIXBIT /RTN1 / 9976 .DATA 7777, 6265 21561 7777 21562 6265 9977 21563 .SIXBIT /RTN2 / 9978 .DATA 7777, 6235 21566 7777 21567 6235 9979 21570 .SIXBIT /POP1 / 9980 .DATA 7777, 6275 21573 7777 21574 6275 9981 21575 .SIXBIT /POP2 / 9982 .DATA 7777, 6207 21600 7777 21601 6207 9983 21602 .SIXBIT /RSP1 / 9984 .DATA 7777, 6227 21605 7777 21606 6227 9985 21607 .SIXBIT /RSP2 / 9986 .DATA 7777, 6217 21612 7777 21613 6217 9987 21614 .SIXBIT /LSP1 / 9988 .DATA 7777, 6237 21617 7777 21620 6237 9989 21621 .SIXBIT /LSP2 / 9990 ;;RLA .DATA 7777, 6207 9991 ;;RLA .SIXBIT /RSP1 / 9992 9993 .DATA 7777, 6000 21624 7777 21625 6000 9994 21626 .SIXBIT "SKON/PRS " 9995 .DATA 7777, 6001 21633 7777 21634 6001 9996 21635 .SIXBIT /ION/ 9997 .DATA 7777, 6002 21637 7777 21640 6002 9998 21641 .SIXBIT /IOF/ 9999 .DATA 7777, 6003 21643 7777 21644 6003 10000 21645 .SIXBIT "SRQ/PGO" 10001 .DATA 7777, 6004 21651 7777 21652 6004 10002 21653 .SIXBIT "GTF/PEX" 10003 .DATA 7777, 6005 21657 7777 21660 6005 10004 21661 .SIXBIT /RTF/ 10005 .DATA 7777, 6006 21663 7777 21664 6006 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 250 Disassembler Tables (IOTs) bts6120.plx 10006 21665 .SIXBIT /SGT/ 10007 .DATA 7777, 6007 21667 7777 21670 6007 10008 21671 .SIXBIT /CAF/ 10009 10010 ; console IOTs 10011 .DATA 7777, 6030 21673 7777 21674 6030 10012 21675 .SIXBIT /KCF/ 10013 .DATA 7777, 6031 21677 7777 21700 6031 10014 21701 .SIXBIT /KSF/ 10015 .DATA 7777, 6032 21703 7777 21704 6032 10016 21705 .SIXBIT /KCC/ 10017 .DATA 7777, 6034 21707 7777 21710 6034 10018 21711 .SIXBIT /KRS/ 10019 .DATA 7777, 6035 21713 7777 21714 6035 10020 21715 .SIXBIT /KIE/ 10021 .DATA 7777, 6036 21717 7777 21720 6036 10022 21721 .SIXBIT /KRB/ 10023 .DATA 7777, 6040 21723 7777 21724 6040 10024 21725 .SIXBIT /SPF/ 10025 .DATA 7777, 6041 21727 7777 21730 6041 10026 21731 .SIXBIT /TSF/ 10027 .DATA 7777, 6042 21733 7777 21734 6042 10028 21735 .SIXBIT /TCF/ 10029 .DATA 7777, 6044 21737 7777 21740 6044 10030 21741 .SIXBIT /TPC/ 10031 .DATA 7777, 6045 21743 7777 21744 6045 10032 21745 .SIXBIT /TSK/ 10033 .DATA 7777, 6046 21747 7777 21750 6046 10034 21751 .SIXBIT /TLS/ 10035 10036 ; SBC6120 IOTs (model 2 and model RC) .... 10037 .DATA 7777, PRPA 21753 7777 21754 6470 10038 21755 .SIXBIT /PRPA / 10039 .DATA 7777, PRPB 21760 7777 21761 6471 10040 21762 .SIXBIT /PRPB / PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 251 Disassembler Tables (IOTs) bts6120.plx 10041 .DATA 7777, PRPC 21765 7777 21766 6472 10042 21767 .SIXBIT /PRPC / 10043 .DATA 7777, PWPA 21772 7777 21773 6474 10044 21774 .SIXBIT /PWPA / 10045 .DATA 7777, PWPB 21777 7777 22000 6475 10046 22001 .SIXBIT /PWPB / 10047 .DATA 7777, PWPC 22004 7777 22005 6476 10048 22006 .SIXBIT /PWPV / 10049 .DATA 7777, PWCR 22011 7777 22012 6477 10050 22013 .SIXBIT /PWCR / 10051 .DATA 7777, MM0 22016 7777 22017 6400 10052 22020 .SIXBIT /MM0/ 10053 .DATA 7777, MM1 22022 7777 22023 6401 10054 22024 .SIXBIT /MM1/ 10055 .DATA 7777, MM2 22026 7777 22027 6402 10056 22030 .SIXBIT /MM2/ 10057 .DATA 7777, MM3 22032 7777 22033 6403 10058 22034 .SIXBIT /MM3/ 10059 .DATA 7777, LDAR 22036 7777 22037 6410 10060 22040 .SIXBIT /LDAR / 10061 .DATA 7777, 6411 22043 7777 22044 6411 10062 22045 .SIXBIT /SDASP/ 10063 .DATA 7777, PRISLU 22050 7777 22051 6412 10064 22052 .SIXBIT /PRISLU / 10065 .DATA 7777, 6413 22056 7777 22057 6413 10066 22060 .SIXBIT /SECSLU / 10067 .DATA 7777, SBBLO 22064 7777 22065 6415 10068 22066 .SIXBIT /SBBLO/ 10069 .DATA 7777, SBBLO2 22071 7777 22072 6436 10070 22073 .SIXBIT /SBBLO2 / 10071 .DATA 7777, CCPR 22077 7777 22100 6430 10072 22101 .SIXBIT /CCPR / 10073 .DATA 7777, SHSW PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 252 Disassembler Tables (IOTs) bts6120.plx 22104 7777 22105 6431 10074 22106 .SIXBIT /SHSW / 10075 .DATA 7777, SPLK 22111 7777 22112 6432 10076 22113 .SIXBIT /SPLK / 10077 .DATA 7777, SCPT 22116 7777 22117 6433 10078 22120 .SIXBIT /SCPT / 10079 .DATA 7777, RFNS 22123 7777 22124 6434 10080 22125 .SIXBIT /RFNS / 10081 .DATA 7777, RLOF 22130 7777 22131 6435 10082 22132 .SIXBIT /RLOF / 10083 .DATA 7777, RLON 22135 7777 22136 6437 10084 22137 .SIXBIT /RLON / 10085 .DATA 7770, POST 22142 7770 22143 6440 10086 22144 .SIXBIT /POST / 10087 10088 22147 0000 0 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 253 Disassembler Tables (OPRs) bts6120.plx 10089 .TITLE Disassembler Tables (OPRs) 10090 10091 22150 OP7: 10092 ; Group 1 10093 GRP1: .DATA 7600, 7200 22150 7600 22151 7200 10094 22152 .SIXBIT /CLA/ 10095 .DATA 7500, 7100 22154 7500 22155 7100 10096 22156 .SIXBIT /CLL/ 10097 .DATA 7440, 7040 22160 7440 22161 7040 10098 22162 .SIXBIT /CMA/ 10099 .DATA 7420, 7020 22164 7420 22165 7020 10100 22166 .SIXBIT /CML/ 10101 .DATA 7401, 7001 22170 7401 22171 7001 10102 22172 .SIXBIT /IAC/ 10103 .DATA 7416, 7002 22174 7416 22175 7002 10104 22176 .SIXBIT /BSW/ 10105 .DATA 7416, 7004 22200 7416 22201 7004 10106 22202 .SIXBIT /RAL/ 10107 .DATA 7416, 7006 22204 7416 22205 7006 10108 22206 .SIXBIT /RTL/ 10109 .DATA 7416, 7010 22210 7416 22211 7010 10110 22212 .SIXBIT /RAR/ 10111 .DATA 7416, 7012 22214 7416 22215 7012 10112 22216 .SIXBIT /RTR/ 10113 .DATA 7416, 7014 22220 7416 22221 7014 10114 22222 .SIXBIT /R3L/ 10115 .DATA 7777, 7000 22224 7777 22225 7000 10116 22226 .SIXBIT /NOP/ 10117 ; Group 1 composite 10118 .DATA 7777, 7240 22230 7777 22231 7240 10119 22232 .SIXBIT /(STA)/ 10120 .DATA 7777, 7041 22235 7777 22236 7041 10121 22237 .SIXBIT /(CIA)/ 10122 .DATA 7777, 7120 22242 7777 22243 7120 10123 22244 .SIXBIT /(STL)/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 254 Disassembler Tables (OPRs) bts6120.plx 10124 .DATA 7777, 7204 22247 7777 22250 7204 10125 22251 .SIXBIT /(GLK)/ 10126 .DATA 7777, 7300 22254 7777 22255 7300 10127 22256 .SIXBIT /(NL0000) / 10128 .DATA 7777, 7301 22263 7777 22264 7301 10129 22265 .SIXBIT /(NL0001) / 10130 .DATA 7777, 7326 22272 7777 22273 7326 10131 22274 .SIXBIT /(NL0002) / 10132 .DATA 7777, 7325 22301 7777 22302 7325 10133 22303 .SIXBIT /(NL0003) / 10134 .DATA 7777, 7307 22310 7777 22311 7307 10135 22312 .SIXBIT /(NL0004) / 10136 .DATA 7777, 7327 22317 7777 22320 7327 10137 22321 .SIXBIT /(NL0006) / 10138 .DATA 7777, 7340 22326 7777 22327 7340 10139 22330 .SIXBIT /(NLM1) / 10140 .DATA 7777, 7344 22334 7777 22335 7344 10141 22336 .SIXBIT /(NLM2) / 10142 .DATA 7777, 7346 22342 7777 22343 7346 10143 22344 .SIXBIT /(NLM3) / 10144 22350 GRP2: 10145 .DATA 7511, 7500 22350 7511 22351 7500 10146 22352 .SIXBIT /SMA/ 10147 .DATA 7451, 7440 22354 7451 22355 7440 10148 22356 .SIXBIT /SZA/ 10149 .DATA 7431, 7420 22360 7431 22361 7420 10150 22362 .SIXBIT /SNL/ 10151 .DATA 7511, 7510 22364 7511 22365 7510 10152 22366 .SIXBIT /SPA/ 10153 .DATA 7451, 7450 22370 7451 22371 7450 10154 22372 .SIXBIT /SNA/ 10155 .DATA 7431, 7430 22374 7431 22375 7430 10156 22376 .SIXBIT /SZL/ PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 255 Disassembler Tables (OPRs) bts6120.plx 10157 .DATA 7601, 7600 22400 7601 22401 7600 10158 22402 .SIXBIT /CLA/ 10159 .DATA 7405, 7404 22404 7405 22405 7404 10160 22406 .SIXBIT /OSR/ 10161 .DATA 7403, 7402 22410 7403 22411 7402 10162 22412 .SIXBIT /HLT/ 10163 .DATA 7777, 7400 22414 7777 22415 7400 10164 22416 .SIXBIT /NOP/ 10165 .DATA 7777, 7410 22420 7777 22421 7410 10166 22422 .SIXBIT /SKP/ 10167 22424 GRP3: 10168 .DATA 7601, 7601 22424 7601 22425 7601 10169 22426 .SIXBIT /CLA/ 10170 .DATA 7501, 7501 22430 7501 22431 7501 10171 22432 .SIXBIT /MQA/ 10172 .DATA 7421, 7421 22434 7421 22435 7421 10173 22436 .SIXBIT /MQL/ 10174 .DATA 7777, 7521 22440 7777 22441 7521 10175 22442 .SIXBIT /SWP/ 10176 .DATA 7777, 7621 22444 7777 22445 7621 10177 22446 .SIXBIT /CAM/ 10178 .DATA 7777, 7701 22450 7777 22451 7701 10179 22452 .SIXBIT /ACL/ 10180 10181 22454 0000 0 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 256 Disassembler Messages bts6120.plx 10182 .TITLE Disassembler Messages 10183 10184 ; Disassembler messages 10185 10186 22455 DS1MSG: .ASCIZ "\t[" 10187 22460 DS2MSG: .ASCIZ "@" 10188 22462 DS3MSG: .ASCIZ "?" 10189 22464 DS4MSG: .ASCIZ "/ " 10190 22467 DS5MSG: .ASCIZ "\t" 10191 22471 DS6MSG: .ASCIZ "]" 10192 10193 22600 .PAGE PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 257 Free Space for Future Expansion! bts6120.plx 10194 .TITLE Free Space for Future Expansion! 10195 10196 ; space to put any patch code for this field 10197 22600 F2PATCH: 10198 10199 .END PALX - Program break is 22600 PALX - No errors detected PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 258 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 11110000 00000000 00001111 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 11111100 00000000 00000000 01111111 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 10-MAY-18 23:00:32 Page 259 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 10000000 00001111 11111111 04400/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 04500/ 11111111 11111111 11111111 11111111 11111111 11111110 00000000 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 10-MAY-18 23:00:32 Page 260 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 11110000 00000001 11111111 11111111 11111111 12600/ 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 12700/ 11111111 11111111 11111111 11111111 11111111 11000000 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 10-MAY-18 23:00:32 Page 261 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 10-MAY-18 23:00:32 Page 262 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 10-MAY-18 23:00:32 Page 263 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 10-MAY-18 23:00:32 Page 264 Symbol Table bts6120.plx .ASCIZ -POP- 3021 10186 10187 10188 10189 10190 10191 .BLOCK -POP- 1289 1429 1430 1431 1432 1433 1434 1435 1436 1440 1441 1442 1443 1449 1450 1451 1452 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1479 1480 1481 1482 1483 1486 1487 1488 1489 1490 1493 1494 1497 1498 1499 1500 1503 1504 1505 1553 1554 1557 1560 1571 1575 1576 1577 1582 2177 2413 2414 3297 3345 3601 3602 3717 3797 3866 3985 4494 4495 5406 5944 6226 6230 6231 6232 6233 6237 6238 6239 6240 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6258 6259 6260 6261 6262 6263 6273 7412 7458 7726 7900 7975 8545 9267 9269 9276 9277 9278 9279 9280 9281 9282 9285 9286 9287 9288 9289 9293 9294 9357 .DATA -POP- 1457 1458 1461 1462 9148 9149 9150 9152 9153 9155 9156 9158 9159 9160 9163 9164 9167 9168 9169 9172 9173 9177 9178 9180 9181 9182 9913 9914 9915 9916 9926 9928 9930 9932 9934 9936 9941 9943 9945 9947 9950 9952 9954 9956 9958 9960 9962 9964 9966 9968 9970 9972 9974 9976 9978 9980 9982 9984 9986 9988 9993 9995 9997 9999 10001 10003 10005 10007 10011 10013 10015 10017 10019 10021 10023 10025 10027 10029 10031 10033 10037 10039 10041 10043 10045 10047 10049 10051 10053 10055 10057 10059 10061 10063 10065 10067 10069 10071 10073 10075 10077 10079 10081 10083 10085 10093 10095 10097 10099 10101 10103 10105 10107 10109 10111 10113 10115 10118 10120 10122 10124 10126 10128 10130 10132 10134 10136 10138 10140 10142 10145 10147 10149 10151 10153 10155 10157 10159 10161 10163 10165 10168 10170 10172 10174 10176 10178 .END -POP- 10199 .FIELD -POP- 1042 1283 6214 9273 .HM6120 -POP- 56 .NOWARN -POP- 58 .ORG -POP- 1428 1439 1445 1566 6017 6224 6229 6234 6268 9284 9291 9296 9352 .PAGE -POP- 1043 1266 1284 1413 1585 1719 1856 2003 2178 2336 2500 2674 2921 3147 3323 3478 3640 3802 3987 4134 4303 4504 4586 4593 4780 4973 5142 5318 5495 5663 5821 6014 6265 6528 6704 6903 7243 7413 7591 7793 8008 8204 8391 8567 8887 9266 9268 9274 9461 9585 9722 9858 9906 10193 .POP -POP- 5094 5858 5883 5904 5908 9449 9637 9766 9768 .POPJ -POP- 1686 1717 1766 1919 1964 2010 2020 2035 2116 2128 2141 2152 2165 2220 2324 2408 2445 2466 2491 2498 2527 2540 2591 2620 2646 2868 3009 3017 3080 3085 3093 3098 3127 3143 3237 3305 3373 3626 3728 3978 4089 4113 4132 4260 4263 4320 4467 4523 4528 4545 4560 4576 4584 4616 4631 4647 4654 4683 4710 4778 4792 4813 4829 4888 4896 4949 4967 4971 5014 5034 5045 5121 5213 5221 5229 5256 5266 5275 5283 5294 5299 5316 5333 5349 5359 5366 5450 5493 5534 5541 5570 5574 5587 5661 5717 5797 5835 5910 5959 5982 5990 5998 6002 6010 6012 6191 6368 6409 6419 6526 6580 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 265 Symbol Table bts6120.plx 6585 6638 6682 6702 6777 6800 6843 6864 6895 6929 6934 7124 7157 7163 7226 7241 7283 7287 7294 7315 7319 7326 7409 7447 7455 7481 7489 7589 7659 7723 7751 7780 7791 7814 7821 7888 7893 8006 8023 8042 8128 8202 8289 8362 8367 8370 8533 8542 8720 8792 8818 8840 9346 9410 9459 9570 9575 9678 9700 9781 9787 9872 9880 9889 9903 .PUSH -POP- 4486 4489 5086 5854 5872 5893 9316 9319 9332 9335 9445 9618 9762 9763 .PUSHJ -POP- 1322 1363 1366 1369 1370 1373 1376 1394 1599 1604 1605 1606 1612 1617 1645 1647 1648 1699 1733 1735 1746 1749 1750 1751 1772 1773 1796 1797 1814 1815 1824 1835 1839 1843 1847 1850 1853 1882 1896 1897 1898 1899 1902 1907 1911 1915 1916 1917 1927 1928 1954 1955 1958 1960 1961 1962 1980 1983 1984 1985 1987 1996 1997 1998 1999 2044 2045 2046 2047 2048 2052 2060 2134 2135 2146 2147 2160 2161 2170 2172 2173 2174 2197 2200 2201 2205 2206 2207 2211 2212 2214 2215 2239 2242 2252 2255 2258 2267 2288 2300 2312 2315 2316 2317 2321 2322 2325 2355 2372 2376 2379 2389 2390 2395 2396 2399 2402 2424 2425 2436 2437 2475 2510 2513 2514 2521 2534 2557 2562 2565 2572 2600 2609 2612 2628 2638 2653 2664 2668 2671 2683 2705 2706 2723 2733 2799 2804 2805 2806 2807 2818 2830 2833 2885 2892 2893 3043 3046 3047 3048 3052 3057 3063 3066 3078 3083 3091 3096 3112 3113 3122 3123 3194 3197 3198 3207 3210 3211 3212 3231 3243 3312 3320 3380 3388 3393 3399 3414 3415 3426 3432 3446 3464 3473 3504 3510 3518 3541 3553 3570 3588 3597 3637 3668 3675 3687 3690 3691 3702 3705 3706 3710 3721 3736 3761 3768 3769 3785 3832 3833 3835 3836 3837 3848 3856 3901 3902 3917 3931 3944 3957 3966 4004 4005 4008 4009 4014 4021 4027 4028 4055 4068 4093 4108 4115 4121 4141 4142 4242 4330 4368 4440 4444 4513 4514 4515 4536 4553 4557 4567 4722 4723 4737 4738 4745 4760 4766 4772 4807 5015 5023 5035 5046 5057 5091 5116 5131 5135 5138 5139 5182 5183 5194 5196 5197 5210 5216 5224 5241 5242 5248 5253 5331 5334 5342 5343 5418 5442 5464 5485 5529 5552 5553 5558 5559 5582 5628 5642 5659 5715 5736 5748 5749 5751 5753 5754 5762 5763 5773 5774 5775 5791 5792 5806 5808 5811 5818 5857 5882 5894 5955 5956 5968 5977 5978 6115 6201 6203 6206 6208 6209 6210 6211 6307 6309 6328 6500 6501 6508 6513 6519 6521 6553 6556 6567 6570 7155 7161 7285 7288 7292 7317 7320 7324 7328 7527 7774 7789 7808 7840 7841 7886 7989 8002 8080 8090 8095 8105 8110 8168 8172 8176 8215 8275 8317 8318 8354 8357 9638 9697 9713 9718 9765 9767 9777 9829 9839 9840 9843 9851 .SIXBIT -POP- 8899 8901 8903 8905 8907 8909 8911 8913 8915 8917 8919 8921 8923 8925 8927 8929 8931 8933 8935 8937 8939 8941 8943 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 266 Symbol Table bts6120.plx 8945 8947 8949 8951 8953 8955 8957 8959 8961 8963 8965 8967 8969 8971 8973 8975 8977 8979 8981 9009 9011 9013 9015 9017 9024 9026 9028 9030 9032 9038 9040 9927 9929 9931 9933 9935 9937 9942 9944 9946 9948 9951 9953 9955 9957 9959 9961 9963 9965 9967 9969 9971 9973 9975 9977 9979 9981 9983 9985 9987 9989 9994 9996 9998 10000 10002 10004 10006 10008 10012 10014 10016 10018 10020 10022 10024 10026 10028 10030 10032 10034 10038 10040 10042 10044 10046 10048 10050 10052 10054 10056 10058 10060 10062 10064 10066 10068 10070 10072 10074 10076 10078 10080 10082 10084 10086 10094 10096 10098 10100 10102 10104 10106 10108 10110 10112 10114 10116 10119 10121 10123 10125 10127 10129 10131 10133 10135 10137 10139 10141 10143 10146 10148 10150 10152 10154 10156 10158 10160 10162 10164 10166 10169 10171 10173 10175 10177 10179 .STACK -POP- 57 .TEXT -POP- 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9060 9061 9062 9063 9064 9065 9068 9069 9070 9071 9074 9075 9076 9077 9078 9079 9080 9081 9084 9085 9086 9087 9088 9091 9092 9100 9101 9104 9105 9108 9109 9110 9111 9112 9113 9116 9117 9118 9119 9120 9123 9124 9125 9126 9129 9130 9131 9134 9135 9185 9186 9187 9188 9189 9190 9191 9192 9193 9196 9197 9198 9199 9200 9201 9204 9205 9206 9207 9208 9211 9212 9213 9214 9215 9216 9217 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9236 9237 9240 9241 9242 9243 9244 9245 9246 9247 9250 9251 9252 9253 9254 9255 9256 9257 9258 .TITLE -POP- 1 59 140 850 934 983 1020 1267 1414 1583 1636 1650 1687 1720 1737 1767 1819 1857 1930 1969 2004 2037 2102 2179 2225 2274 2327 2337 2416 2467 2501 2541 2592 2621 2647 2675 2708 2785 2820 2869 2922 2993 3022 3099 3148 3179 3251 3324 3401 3438 3479 3603 3641 3738 3803 3867 3988 4135 4149 4253 4304 4344 4397 4468 4505 4529 4587 4594 4632 4714 4781 4793 4830 4855 4939 4974 5048 5066 5096 5143 5185 5206 5230 5267 5319 5367 5407 5451 5496 5542 5575 5617 5664 5822 5945 6015 6215 6266 6343 6369 6411 6420 6482 6529 6545 6586 6639 6683 6705 6786 6844 6904 6935 7016 7080 7125 7227 7244 7262 7337 7361 7414 7460 7490 7592 7660 7728 7753 7794 7823 7902 7942 7977 8009 8027 8057 8130 8205 8252 8290 8363 8392 8546 8568 8651 8721 8793 8841 8888 9004 9044 9136 9260 9270 9297 9359 9462 9571 9586 9680 9723 9788 9859 9907 9938 10089 10182 10194 .VECTOR -POP- 6030 ACDISP 06073 4906 4922* ACL 7701 4681 4694 8224 8873 8876 ACNAME 13713 2067 2917 9074* ADDR 00037 1465* 1889 1903 2136 2149 2303 2358 2430 2433 2482 2518 2525 2526 2561 2585 2606 2634 2660 3528 3571 3577 4018 4036 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 267 Symbol Table bts6120.plx 4055 4295 4762 5195 5212 5217 5225 5250 5274 5297 5306 5309 9622 9649 9653 9663 9669 ADRFLD 00040 1466* 2111 2304 2359 2432 2487 2589 2608 2636 2658 2810 2813 3529 3587 4296 4765 5193 5219 5227 5252 5276 5282 5290 5312 5315 5528 5540 9615 9619 9625 9642 9656 9657 9667 9673 ADRPMM 12426 8219 8239* ADRRMD 12410 8222* ALPHA 06627 5334 5343 5354* ALPHA1 06635 5357 5362* AMTCH0 21015 9742* 9755 9772 AMTCH1 21025 9752* 9756 AMTCH2 21032 9749 9759* AMTCH3 21034 9761* 9771 AMTCH8 21052 9745 9775* AND 0000 1132 1257 1888 1891 1904 2024 2027 2112 2384 2391 2657 3013 3200 3317 3385 3534 3544 3548 3564 3582 3586 3851 3954 4064 4649 4673 4677 4731 4734 4764 4788 4825 4850 4961 4998 5003 5011 5063 5115 5204 5281 5480 5520 5527 5539 5584 5957 6138 6205 6334 6360 6506 6609 6612 6624 6630 6667 6672 6753 6760 6874 7182 7185 7214 7220 7380 7385 7443 7476 7539 7553 7628 7690 7693 7848 7967 7992 7996 8083 8098 8227 8242 8337 8432 8456 8461 8472 8488 8493 8537 8766 8778 8788 8878 9447 9450 9705 9731 9739 9743 9753 9769 9783 9799 9804 9812 9821 9876 ARGPTR 10051 6259* 6356 6365 ASCAN 20011 9286* 9532 9535 9736 9739 9743 9747 9752 9759 9761 AX1 20013 9288* 9373 9404 9422 9442 AX2 20014 9289* 9378 9384 9388 9393 9399 9401 9419 9430 9432 9435 9448 9451 BACKS1 07141 5656 5660* BACKUP 04647 1525 4283 4581* 9608 BADCHK 12732 8527 8535* BADFL 12736 8465 8497 8540* BADFLR 04265 4173 4210 4225 4233* BADFUN 0237 6375* 6393 6394 6395 6396 6397 6398 8021 BADIDE 04526 4439 4449* BANKSZ 0025 6476* 6814 6823 BATTOK 10033 4380 6248* 6701 6732 6773 6783 8882 BFAMSG 14275 4390 9120* BINCH1 03323 3540 3543 3560 3563 3601* BINCH2 03324 3542 3547 3561 3602* BINLO1 03203 3508* 3513 3598 BINLO2 03205 3510* 3515 BINLO3 03214 3518* 3521 BINLO5 03227 3532* 3573 3578 3590 BINLO6 03276 3566 3576* BINLO7 03301 3536 3581* BINLO8 03314 3558 3584 3593* BLIST 01674 2424* 8926 BLIST1 01701 2429* 2440 BLIST2 01715 2435 2439* BLOWR1 06117 4951 4966* BLOWR2 06121 4963 4970* BLOWRN 06104 4947* BLTIME 00036 1462* 4958 4960 BMOVE 01400 2197* 8916 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 268 Symbol Table bts6120.plx BNAMES 13376 3051 9038* BOKMSG 14263 4387 9119* BOOKEY 02421 3002 3021* BOOT 02426 3043* 8966 BOOT1 02452 3045 3063* 4808 BOOTGO 02445 3057* 3065 3068 BOOTS 00412 1602* 1631 BOOTS0 00416 1605* 1608 BOOTS1 00425 1612* 1625 1635 BOOTS2 00435 1615 1620* BPT 6236 896* 2611 6152 6155 BPTADR 00201 1575* 1578 2457 BPTCL2 02030 2535* 2539 BPTCLR 02026 2512 2534* 4142 BPTCO1 02054 2567 2572* BPTCO2 02056 2573* 2578 BPTCO3 02066 2576 2583* BPTCOM 02036 2557* 8928 BPTDAT 00221 1577* 2461 BPTEND 0210 1578* BPTFLD 00211 1576* 2459 BPTFN1 01741 2478* 2496 BPTFN2 01757 2480 2484 2494* BPTFN3 01760 2489 2495* BPTFND 01737 2475* 2521 2565 BPTIN1 02101 2603* 2619 BPTIN2 02116 2605 2616* BPTIN3 02120 2613 2618* BPTINS 02077 2600* 2733 BPTMSG 13547 6165 9060* BPTRM1 02125 2631* 2645 BPTRM2 02137 2633 2642* BPTRM3 02141 2639 2644* BPTRMV 02123 2628* 6210 BPTTRP 07705 6154 6164* BREMO1 02024 2523 2530* BREMOV 02000 2510* 8930 BRKMSG 13604 6125 9062* BSETUP 01724 2425 2456* 2475 2534 2572 2600 2628 BSW 7002 932 3545 4189 4197 4205 4216 4999 5004 5056 5338 5538 6622 6668 6824 7378 7626 7694 7999 8225 8470 8764 8786 9400 9446 9729 9764 BTIDA0 02500 3066 3089* 9041 BTSTR1 07646 4299 6114 6121* BTSTRP 07636 6082 6100* BTSWCN 00062 1488* 4603 4693 4805 4812 BTVMA0 02464 3063 3076* 9039 BUFCDF 12221 6538 6620 6650 7252 7618 7684 7994 8037 8049* 8055 8387 8810 8827 9501 BUFPNL 10053 6261* 6539 7253 8005 8041 8052 8388 9503 BUFPTR 10011 6231* 6536 6626 6632 6651 6653 7167 7183 7186 7250 7621 7697 8004 8035 8386 8812 8828 9499 BUFSIZ 10054 6262* 7275 7295 7307 7327 7611 7637 7677 7703 8417 8502 8518 8528 BUFTMP 11712 7622 7623 7625 7691 7696 7726* CAF 6007 2847 4828 CAM 7621 3532 CCFMSG 14041 4025 9091* CCPR 6430 881* 2765 4611 4889 10071 CDF 6201 1131 1134 1167 1180 1239 1840 1842 1844 1846 2113 2140 2151 3154 3173 3272 3282 3290 3306 3310 3335 3338 3355 3368 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 269 Symbol Table bts6120.plx 3374 3378 3392 3396 3398 3416 3418 3447 3449 3458 3461 3467 3470 3676 3683 3692 3697 3722 3725 3731 3770 3775 3786 3792 3829 3831 3840 3842 3946 3951 4038 4040 4046 4048 4058 4065 4072 4081 4083 4099 4101 4118 4120 4127 4131 4183 4220 4379 4381 4434 4437 4777 4789 4987 5012 5041 5043 5177 5179 5386 5402 6148 6325 6327 6329 6354 6361 6367 6537 6617 6634 6678 6727 6729 6745 6756 6758 6829 6831 6875 7096 7098 7251 7254 7256 7560 7654 7720 7745 7747 7785 7787 7818 7820 7851 7853 7993 8036 8084 8099 8126 8200 8228 8243 8276 8285 8328 8330 8348 8560 8696 8706 8779 8814 8836 8870 8883 9311 9327 9375 9416 9470 9498 9500 9504 9519 9552 9567 9613 9626 9634 9640 9660 9719 9800 9805 9896 9898 9901 CE1MSG 3774 4016 9096* CEEMSG 4012 9097* CFIELD 01301 2110* 2134 2146 CHBEL 0007 901* 5601 CHBSP 0010 902* 5658 5767 5779 CHCRT 0015 905* 5627 5779 5782 CHCTC 0003 900* 5962 5967 5972 CHCTO 0017 906* 5972 5976 5985 CHCTR 0022 908* 5743 5747 5758 CHCTU 0025 910* 5758 5761 5767 CHDEL 0177 912* CHESC 0033 911* 5785 5790 5847 5859 CHKCFC 12200 3170 8019* CHKERA 12617 8439* 8444 CHKHL1 06042 4848 4853* CHKHLT 06031 2728 2745 4844* 4853 4854 CHKID1 02620 3172 3177* CHKIDE 02607 1706 3141 3168* 3177 3178 CHKLP 12716 8519 8521* 8529 CHKRAM 02600 1702 3153* 3158 3159 CHKRC 12742 6559 6573 6720 6803 7520 8558* 8564 8565 CHKSUM 00050 1474* 2244 2247 2251 2253 2254 2264 2272 3526 3559 3562 3595 3596 3826 3845 3846 3861 3897 3949 3950 3969 4094 4111 CHLFD 0012 904* 5647 5782 5785 CHNUL 0000 899* CHTAB 0011 903* 1665 1667 1668 5841 5847 CHXOF 0023 909* 5985 5993 CHXON 0021 907* 5993 6001 CIA 7041 1249 2162 2385 2481 2486 3010 3357 3594 3708 3919 3933 3968 4110 4207 4222 4228 4650 5296 5392 5637 5878 6889 8000 8111 8177 8523 8874 9394 9643 9648 9746 CIF 6202 1321 1785 2080 3220 4145 7788 9553 CK1221 13131 1226 8866* 8885 CKBOO1 02404 3006* 3018 CKBOOT 02400 3002* 3078 3091 CKMEM 01442 2239* 8918 CKMEM1 01452 2247* 2259 CKSMSG 13404 2271 9047* CLA 7200 915 916 917 918 919 920 921 922 924 926 928 929 930 931 932 933 1052 1063 1120 1168 1173 1295 1311 1330 1596 1602 1607 1614 1624 1643 1658 1711 1732 1747 1764 1828 1878 1905 1921 1950 1966 1981 2043 2110 2123 2126 2164 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 270 Symbol Table bts6120.plx 2208 2265 2301 2313 2370 2374 2393 2407 2434 2444 2456 2483 2488 2511 2566 2575 2767 2800 2859 2890 2898 2912 3016 3044 3115 3124 3157 3171 3176 3195 3201 3208 3235 3270 3302 3318 3359 3364 3386 3452 3512 3535 3557 3565 3583 3617 3624 3688 3703 3779 3852 3859 3903 3907 3921 3929 3935 3939 3955 3958 3970 3973 4029 4066 4172 4243 4317 4319 4334 4371 4384 4420 4422 4432 4487 4490 4517 4539 4542 4558 4571 4574 4601 4615 4646 4653 4708 4775 4786 4845 4847 4852 4895 4898 4917 4922 4927 4937 4948 4962 5021 5087 5192 5244 5255 5273 5289 5293 5298 5303 5329 5394 5415 5425 5446 5448 5461 5471 5489 5491 5518 5524 5530 5533 5569 5573 5585 5590 5595 5600 5605 5610 5626 5639 5660 5727 5733 5771 5786 5801 5804 5855 5874 5880 5895 5897 5900 5909 5934 6008 6188 6190 6314 6353 6407 6509 6514 6517 6525 6579 6597 6645 6700 6719 6730 6754 6762 6796 6799 6838 6860 6863 6893 6928 7094 7099 7123 7225 7239 7280 7282 7312 7314 7346 7356 7373 7446 7454 7479 7540 7554 7565 7582 7586 7658 7722 7737 7750 7779 7790 7813 7859 7957 8019 8022 8051 8053 8127 8159 8201 8287 8331 8338 8355 8361 8433 8441 8454 8459 8486 8491 8532 8535 8559 8563 8708 8756 8769 8802 8824 8879 9317 9320 9333 9336 9367 9386 9390 9469 9593 9597 9614 9641 9645 9650 9661 9668 9725 9754 9770 9778 9819 9824 9835 9866 9871 9888 CLL 7100 917 918 919 920 921 922 924 929 2248 2497 2811 2812 3006 3084 3097 3278 3351 4845 4937 5000 5005 5077 5108 5265 5273 5289 5430 5433 5434 5569 6312 6407 6579 6623 6628 6629 6637 6669 6673 6674 6681 6700 6796 6813 6827 6842 6860 6869 6873 6892 6926 7123 7225 7239 7282 7314 7439 7454 7472 7658 7695 7722 7750 7777 7790 7810 8081 8096 8127 8201 8216 8286 8361 8532 8791 8817 8839 9614 9661 9668 9798 9866 CLRCOM 02300 2830* 8950 CLRCPU 02312 2807 2818 2833 2859* 3057 4141 CLRDRD 0006 7042* 7187 7200 7698 7712 7969 CLRDRE 0012 7046* 7110 CLRDWR 0010 7044* 7632 7646 7933 CMA 7040 919 921 922 924 926 1070 1313 3286 3316 3384 4063 4612 4676 5291 5296 5878 5980 6752 7123 7282 7314 7454 8707 CMDBUF 00231 1582* 1646 5706 5752 5794 CMDEDD 0220 7074* CMDIDD 0354 7075* 7158 CMDLEN 00143 1553* 5708 5731 5739 5770 5803 5813 5814 CMDRDS 0040 7076* 7289 CMDSDN 0340 7079* 7357 CMDSUP 0341 7078* 7347 CMDTBL 13200 1616 8380 8898* CMDWRS 0060 7077* 7321 CMDX 20600 2331 9593* CMDXP 20603 2334 9597* CMEM 01507 2300* 8922 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 271 Symbol Table bts6120.plx CMEM0 01512 2290 2302* CMEM1 01534 2314 2320* 2326 CML 7020 917 918 920 3278 3351 5254 5279 5291 5364 6579 6894 7123 7282 7314 7445 7454 7478 8288 COMERR 00453 1536 1643* 4290 8987 8989 8991 8993 8995 8997 8999 9001 9003 9020 9035 9043 CONCHR 07476 5926 5932 5944* CONF1 07027 5553* 5555 CONF2 07052 5565 5568 5573* CONFRM 07025 3123 4028 4242 5552* CONGE1 03330 3622* 3633 3635 CONGE2 03335 3623 3631* CONGET 03325 3510 3518 3541 3553 3588 3617* CONIN 07552 4276 5956 6008* CONLOD 03200 3504* 8952 CONOU1 07465 5930* 5940 CONOU2 07467 5932* 5941 CONOU3 07473 5931 5939* CONOUT 07463 4275 5905 5926* CONT 02216 2707 2728* 2815 2819 3060 4704 CONT1 02227 2698 2736 2761* 6116 CONT2 02225 2745* 6338 CONTCM 02214 2723* 8932 COUNT 00071 1499* 2210 2218 2382 2398 2406 2439 2464 2495 2538 2577 2618 2644 2904 2907 2911 3204 3215 3230 3232 3233 3242 3246 3279 3288 3352 3366 3509 3514 3823 3834 3849 3850 3857 3894 3905 3934 3952 3953 4126 4129 CP1MSG 14060 4034 9092* CP2MSG 4005 4074 9093* CPANEL 01310 2123* 2135 2147 CPBOOT 07600 6030 6031* CPD 6266 1198 1206 2127 3011 4626 4746 4773 6142 6364 8054 8086 8088 8101 8103 8245 8247 9594 9691 9899 CPSAVE 07602 1359 6048* CPYDST 0043 1507* 4011 4026 4080 4098 CPYSRC 0042 1506* 4007 4045 CRLF 07104 1520 4280 5626* 9780 CRLF1 07127 5636 5640 5647* CS1FX 0100 7052* 7054 7055 7056 7057 7058 7059 7060 7061 7062 CS3FX 0200 7053* CTRLO 00053 1479* 5710 5720 5896 5965 5979 5981 CXF 6203 1231 1263 1293 2330 2333 3156 3175 4259 4262 4492 6031 6066 6156 6159 6337 6341 6418 8366 8369 8562 9322 9338 9369 9413 9569 9574 9677 9699 DA1L 20616 9613* 9658 9675 DAC 01200 2008* 9025 DAF 20635 9627 9630* DANDV 01342 1534 2158* DAP 20636 9629 9631* DBCHKS 04155 4093 4108 4123* DCA 3000 1065 1067 1079 1081 1083 1085 1087 1089 1121 1125 1133 1169 1179 1197 1199 1240 1242 1244 1247 1314 1360 1609 1621 1632 1634 1644 1684 1758 1762 1765 1784 1808 1817 1879 1889 1893 1951 2009 2014 2019 2029 2058 2114 2137 2145 2149 2158 2202 2210 2243 2244 2251 2254 2302 2303 2304 2306 2308 2309 2357 2358 2359 2361 2363 2365 2366 2378 2382 2386 2398 2426 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 272 Symbol Table bts6120.plx 2430 2432 2458 2460 2462 2464 2465 2518 2525 2526 2535 2536 2537 2561 2584 2586 2588 2590 2606 2608 2610 2634 2636 2658 2660 2662 2663 2665 2697 2734 2762 2809 2814 2860 2861 2862 2863 2864 2865 2867 2887 2888 2904 2908 3003 3005 3059 3120 3204 3217 3219 3230 3248 3271 3273 3274 3279 3281 3284 3287 3311 3336 3337 3352 3354 3379 3417 3420 3423 3425 3429 3431 3448 3455 3460 3463 3469 3472 3505 3509 3523 3526 3528 3529 3540 3542 3550 3554 3562 3577 3587 3589 3596 3619 3662 3664 3670 3672 3678 3680 3681 3682 3684 3694 3696 3699 3709 3732 3755 3757 3763 3765 3772 3774 3780 3781 3787 3789 3791 3822 3823 3825 3826 3843 3846 3891 3893 3894 3896 3897 3926 3947 3950 4007 4011 4018 4036 4039 4047 4082 4094 4100 4124 4126 4139 4140 4186 4191 4194 4199 4202 4213 4238 4249 4251 4435 4481 4483 4583 4602 4603 4604 4613 4628 4674 4680 4693 4721 4736 4748 4762 4765 4790 4812 4820 4821 4822 4823 4826 4827 4982 4984 4993 4996 5031 5040 5054 5072 5073 5102 5104 5110 5113 5126 5175 5212 5218 5220 5226 5228 5250 5252 5262 5264 5282 5307 5309 5313 5315 5330 5339 5348 5385 5401 5416 5417 5431 5438 5462 5463 5476 5483 5528 5540 5556 5629 5641 5644 5657 5705 5707 5708 5709 5710 5718 5719 5720 5721 5738 5746 5793 5795 5814 5926 5927 5965 5966 5975 5981 5989 5996 5997 6048 6050 6052 6054 6056 6069 6136 6140 6144 6146 6310 6318 6320 6330 6332 6336 6356 6362 6502 6507 6536 6538 6539 6540 6541 6599 6610 6613 6615 6626 6632 6647 6652 6654 6663 6665 6670 6676 6732 6747 6749 6757 6773 6775 6783 6811 6825 6832 6876 6887 6890 6924 6932 7095 7167 7169 7183 7186 7195 7215 7222 7250 7252 7253 7257 7258 7275 7307 7381 7435 7436 7507 7511 7513 7514 7533 7535 7549 7561 7577 7611 7613 7622 7677 7679 7691 7697 7739 7741 7746 7773 7775 7783 7786 7809 7817 7842 7850 7854 7862 7919 7968 7990 7994 8001 8004 8005 8025 8035 8037 8039 8041 8085 8089 8092 8100 8104 8107 8112 8120 8162 8166 8170 8174 8178 8193 8214 8229 8231 8233 8244 8248 8250 8277 8279 8325 8349 8351 8417 8427 8429 8438 8451 8453 8473 8476 8480 8484 8506 8511 8515 8518 8685 8687 8700 8702 8713 8716 8759 8780 8790 8804 8808 8812 8826 8829 8834 8875 8882 9310 9313 9326 9329 9343 9370 9373 9378 9395 9404 9414 9419 9422 9430 9432 9435 9438 9448 9451 9471 9499 9501 9503 9505 9507 9510 9518 9532 9534 9568 9599 9620 9623 9627 9629 9633 9657 9663 9667 9670 9674 9686 9688 9690 9692 9726 9733 9736 9760 9776 9801 9806 9809 9827 9830 9842 9844 DDBUF 03600 3721 3822* DDBUF2 03605 3829* 3860 DDBUF3 03623 3840* 3853 DDCNT 03652 3822 3858 3866* 3891 3906 DDDUMP 03405 3668* 8954 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 273 Symbol Table bts6120.plx DDUMP1 03463 3689 3704 3713* 3727 DECNW 06662 1750 1772 1796 1814 4513 5415* DECNW1 06667 5421* 5443 DECNW2 06713 5423 5426 5446* DERCKS 03766 3971 3981* DESTA 20021 9294* 9313 9323 9329 9339 DFLTX 20670 9605 9660* DFRMAT 03076 3414* 8962 DIGITS 00072 1500* 4984 4988 4993 5073 5081 5088 5104 5119 5417 5441 5447 5463 5484 5490 5531 DIOERR 03504 3299 3347 3719 3731* 3799 4053 4088 4106 DISA1 21000 9720 9725* DISA2 20731 9638 9697 9705* DISASM 01546 2330* 8976 DISASMP 01550 2333* 8978 DISKID 11047 4431 7155* DISKIO 12060 7862 7886 7897 7900* DISKRD 11214 3430 3669 4051 4104 7260 7272* 7860 8381 DISKRW 12017 6381 7840* DISKWR 11244 3424 3762 4086 7304* 7860 7861 8382 DKPART 10020 3417 3678 3774 4047 4082 4100 6237* 7257 7382 7389 7739 7744 7748 7773 7784 7854 8384 DKRBN 10021 1540 6238* 7258 7374 7377 7842 7889 8385 8419 8431 8469 DKRW0 12024 7847* DKRW1 12041 7882* 7892 DKRW2 12056 7884 7896* DKSIZE 10022 3174 4436 6239* 7095 7215 7221 7222 7240 7279 7311 8389 DKUNIT 10023 6240* 7775 7776 7781 7809 7812 7815 DLLOAD 03520 3761* 8958 DLOAD 03526 3758 3768* DLOAD1 03543 3784* 3800 4252 DMEM 01067 1950* 8908 DMEM1 01075 1958* 1968 DMQ 01206 2018* 9029 DNAMES 13362 2000 9024* DPC 01203 2013* 9027 DPMEM 01065 1947* 8910 DPNL 20006 9282* 9599 9628 9692 9808 DPS 01211 2023* 9031 DRD1 11225 7281 7285* DREG 01132 1996* 8914 DRVERR 11442 7441 7474 7486* DS1MSG 22455 9850 10186* DS2MSG 22460 9838 10187* DS3MSG 22462 9890 10188* DS4MSG 22464 9712 10189* DS5MSG 22467 9717 10190* DS6MSG 22471 9855 10191* DSKBUF 17400 3280 3353 3824 3892 4123 4435 4443 7166 7211 7216 8034 8475 8510 9267* DSR 01221 2033* 9033 DSTCDF 12275 8100 8118* DSTDAR 0025 8157* 8166 8190 DSTSPD 12276 8104 8119* DWR1 11255 7313 7317* EA2 21073 9795 9799* EA3D 21226 9801 9843 9898* EA3I 21224 9806 9829 9896* EA4 21227 9809 9899* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 274 Symbol Table bts6120.plx EA6 21144 9836 9840 9847* EA7 21147 9845 9850* EADGRP 21071 9797* 9913 9914 EAIGRP 21067 9794* 9915 EMEM 01002 1878* 8904 EMEM0 01004 1882* 1923 EMEM1 01017 1896* 1908 EMEM2 01021 1897* 1906 EMEM3 01044 1901 1915* ENAMES 13346 1986 9009* EOLNXT 04630 1527 4285 4553* EOLTST 04632 1526 4284 4557* EONE 01042 1884 1911* EPMEM 01000 1875* 8906 ERABLK 12626 8442 8450* EREG 01114 1980* 8912 ERRAST 13672 2569 9070* ERRBTF 13703 2580 9071* ERRCKS 13515 3982 9055* ERRDIO 13504 3734 9054* ERRDSK 14012 3395 4117 9088* 9097 ERRILV 13432 1791 2901 3131 3226 9049* ERRNBP 13655 2447 9068* ERRNBT 13530 3072 9056* ERRNDK 13541 3145 9057* ERRNST 13664 2531 9069* ERROR 00600 1537 1731* 1734 ERRRAN 13455 5258 9051* ERRSRF 13444 2410 9050* ERRWRP 13466 2224 9052* EXMEM 05751 2015 2030 2854 4722 4737 4760 4772* 6211 EXTFLG 00033 1457* 1710 4324 4329 6728 8329 9471 9568 EXTRO2 20412 9484 9497* EXTROM 20400 1322 9469* F0PATCH 05000 4591* 9558 F0VECTOR 04311 4269* 9557 F1ADDR 04555 4483 4494* F1PATCH 13000 8664* 9560 F1VECTOR 12520 8377* 9559 F1X0 10000 6226* F2PATCH 22600 9562 10197* F2VECTOR 20503 9561 9582* FCFMSG 13745 3118 9084* FCMDCS 0120 4156* 8426 FCMDERA1 0040 4157* 8450 FCMDERA2 0320 4158* 8452 FCMDPROG 0100 4159* 8479 FCMDRA 7777 4154* 4185 4201 4237 8428 8505 FCMDRI 0220 4155* 4193 4212 FIRSTPSS 0020 1448* 9372 9421 9434 9437 FLDTS1 10127 1243* 1246 FLDTS2 10134 1248* 1254 FLDTST 10122 1207 1215 1238* 1258 FLLOAD 04213 4165* 8972 FLMEM 01503 2288* 8924 FLMSG1 14362 4234 9134* FLMSG2 14371 4241 9135* FLNXT 12700 8495 8499* FM1MSG 13765 3269 9085* FM2MSG 13774 3334 9086* 9096 FM3MSG 14005 3436 9087* 9093 FMTAR1 02536 3116 3126* FMTARG 02514 3112* 3415 3446 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 275 Symbol Table bts6120.plx FMTCNT 00075 1505* 3283 3285 3303 3317 3356 3362 3371 3385 3423 3429 3460 3469 FMTP1 02710 3268* 3426 3464 FMTP11 02717 3277* 3319 3321 FMTP12 02725 3283* 3289 FMTP2 03000 3333* 3432 3473 FMTP21 03006 3341* 3387 3389 FMTP22 03023 3356* 3367 FMTP23 03040 3371* 3400 FMTP29 03063 3360 3365 3392* FMTRDP 03012 3345* 3431 3472 FMTWRP 02741 3297* 3425 3463 FNSTAT 00061 1487* 4602 4651 4675 4680 FPDTCT 00060 1486* 4613 4614 4645 4846 4894 8284 FPINIT 05600 1366 4601* FPPGMD 00064 1490* 3311 3379 3781 3791 4932 8279 FPPGMM 00063 1489* 2865 3271 3780 4604 4827 4897 8277 FRDONE 03121 3435* 3476 FTCONT 0310 3615* 3618 FUNTBL 10261 6317 6377* 6403 8020 8024 8379 GCF 6256 6049 GET 00465 1528 1658* 4286 GET1 00505 1662 1678* GET2 00511 1675 1684* GETARG 10241 6307 6309 6353* 6501 7774 7808 7841 7989 8002 8080 8090 8095 8105 8110 8168 8172 8176 8215 8275 8318 GETBAT 10544 6380 6700* GETDKS 11136 6382 7239* GETPMP 12000 6384 7808* GETPP 04000 4004* 4014 4021 GETRDS 11000 6379 6924* GETVER 10303 6377 6407* GOOD 01367 2158 2159 2163 2171 2177* GRP1 22150 10093* GRP2 22350 10144* GRP3 22424 10167* HALTED 07711 2746 6086 6108 6187* HELLO 00711 1370 1825* HELLO1 00720 1829 1832* HELP 00514 1699* 8900 HELP2 00524 1703 1706* HELP3 00530 1707 1710* HELP4 00535 1712 1715* HGHFLD 00044 1470* 2308 2363 4298 5220 5264 5292 9644 9666 9674 HIGH 00042 1468* 1506 1890 1893 2306 2361 4199 4223 4229 4297 5218 5262 5295 9647 9662 9670 HLPB 16421 9163 9168 9233* HLPBL 15452 9156 9207* HLPBM 15147 9153 9197* HLPBP 15377 9156 9205* HLPBPC 15361 9155 9204* HLPBR 15423 9156 9206* HLPC 15600 9159 9213* HLPCK 15204 9153 9198* HLPCM 15332 9153 9201* HLPCTC 17150 9181 9254* HLPCTH 17203 9181 9255* HLPCTL 17003 9180 9250* HLPCTO 17115 9181 9253* HLPCTQ 17057 9181 9252* HLPCTR 17277 9181 9257* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 276 Symbol Table bts6120.plx HLPCTS 17020 9181 9251* HLPCTU 17332 9181 9258* HLPD 14772 9150 9191* HLPDD 16131 9167 9226* HLPDF 16216 9167 9228* HLPDL 16170 9167 9227* HLPDOL 16756 9178 9247* HLPDP 15036 9150 9192* HLPDR 15103 9150 9193* HLPE 14542 9149 9186* HLPEDC 14516 9148 9185* HLPEND 17361 9259* HLPEP 14604 9149 9187* HLPER 14647 9149 9188* HLPEX 15673 9159 9216* HLPFL 16464 9172 9237* HLPFM 15300 9153 9200* HLPIDE 14452 1709 9166* HLPIDS 15763 9167 9221* HLPIOB 14465 1714 9171* HLPJDK 16450 9172 9236* HLPLP 16000 9178 9222* HLPMEM 15134 9152 9196* HLPMR 15727 9159 9217* HLPMSC 16507 9177 9240* HLPNUL 14442 9152 9155 9158 9160* 9163 9167 9172 9177 9180 HLPP 15474 9156 9208* HLPP1 14404 1701 9146* HLPP2 14471 1716 9175* HLPPC 16275 9168 9230* HLPPCC 15522 9158 9211* HLPPE 16334 9168 9231* HLPPM 16243 9168 9229* HLPRAM 14443 1705 9162* HLPRD 16025 9163 9223* HLPRDS 15746 9163 9220* HLPRF 16106 9163 9225* HLPRL 16062 9163 9224* HLPRP 16720 9178 9246* HLPRUB 17237 9181 9256* HLPSC 16611 9178 9243* HLPSD 16370 9168 9232* HLPSEM 16665 9178 9245* HLPSI 15623 9159 9214* HLPST 15543 9159 9212* HLPTP 16556 9178 9242* HLPTR 15646 9159 9215* HLPTW 16527 9178 9241* HLPVE 16640 9178 9244* HLPWS 15241 9153 9199* HLPX 14674 9149 9189* HLPXP 14733 9149 9190* HLT 7402 2695 HLTMSG 13627 6193 9064* HPOS 00055 1481* 5583 5629 5654 5657 5873 5879 IAC 7001 916 928 929 930 931 932 933 1052 1120 1168 1404 1408 2250 3270 3363 3631 3779 4485 4665 5291 6579 6782 6872 7107 7538 8881 9315 9331 9661 9668 IDAMSG 14114 3095 9105* IDBOOT 11200 3090 7249* IDDEV1 11072 7179* 7190 IDDEV2 11110 7196* 7203 IDEIN1 11045 7100 7123* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 277 Symbol Table bts6120.plx IDEINI 11013 4427 4466 7094* IDEINP 0222 7039* 7101 7170 7656 7680 7939 7958 IDEMS1 14310 4425 9123* IDEMS2 14315 4442 9124* IDEOUT 0200 7040* 7614 7920 IDERDR 12101 7117 7437 7470 7486 7956* 7960 7961 7972 IDETMP 12122 7919 7929 7968 7971 7975* IDEWRR 12061 7114 7159 7290 7322 7348 7358 7375 7387 7392 7402 7407 7918* 7922 7923 7941 IFDF 20005 9281* 9620 9688 9694 9794 9797 9803 ILLPR0 07707 6168* 6342 INCH10 07356 5734 5818* INCHBS 07300 5770* 5802 INCHR1 07517 5964 5972* INCHR2 07534 5974 5985* INCHR3 07542 5987 5993* INCHR4 07550 5995 6001* INCHRS 07477 1522 4278 5894 5955* INCHW1 07210 1606 3902 5715* 5740 5755 5772 5805 5815 5819 INCHW2 07227 5731* 5787 INCHW3 07242 5725 5743* INCHW4 07264 5745 5758* INCHW5 07275 5760 5767* INCHW6 07312 5769 5779* INCHW7 07326 5781 5784 5792* INCHW8 07335 5728 5800* INCHW9 07350 5776 5811* INCHWL 07200 1604 3901 5705* 5764 INCR 20662 9646 9653* INIPM1 11721 7743* 7749 INIPMP 11713 2853 4144 7737* INLMES 06237 1521 5020* 5022 5024 5025 IOTGRP 21217 9887* 9916 IRMA 00057 1483* 3619 3634 5927 5939 IRNAME 13724 9077* ISZ 2000 1126 1171 1201 1245 1253 2218 2438 2439 2494 2495 2538 2573 2577 2616 2617 2618 2642 2643 2644 2907 3158 3177 3232 3288 3303 3307 3308 3366 3371 3375 3376 3514 3571 3634 3723 3724 3726 3849 3923 3952 4059 4129 4749 4758 4805 4853 4958 4988 5024 5081 5119 5176 5274 5396 5441 5484 5632 5739 5873 5939 6357 6522 6523 6635 6679 6817 7189 7202 7448 7450 7515 7580 7634 7637 7648 7700 7703 7714 7748 7882 7889 7891 7923 7961 8121 8194 8358 8359 8443 8499 8502 8528 8564 8815 8837 9405 9453 9513 9536 9653 JMP 5000 1055 1072 1127 1130 1135 1172 1174 1177 1181 1202 1209 1217 1232 1246 1252 1254 1258 1264 1312 1315 1333 1337 1340 1349 1352 1395 1406 1410 1411 1608 1615 1625 1631 1635 1649 1662 1675 1703 1707 1712 1736 1748 1776 1779 1782 1786 1800 1803 1806 1809 1818 1829 1854 1884 1901 1906 1908 1922 1923 1929 1967 1968 1982 1988 2001 2015 2030 2049 2053 2062 2081 2199 2217 2219 2241 2257 2259 2266 2273 2290 2314 2326 2331 2334 2371 2375 2394 2401 2403 2435 2440 2480 2484 2489 2496 2512 2517 2523 2539 2560 2567 2576 2578 2605 2613 2619 2633 2639 2645 2672 2698 2707 2729 2736 2746 2778 2801 2815 2819 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 278 Symbol Table bts6120.plx 2846 2854 2891 2899 2913 2919 3018 3045 3054 3060 3065 3068 3116 3125 3159 3172 3178 3196 3202 3209 3221 3236 3250 3289 3299 3319 3321 3347 3360 3365 3367 3387 3389 3400 3437 3453 3476 3513 3515 3521 3536 3558 3566 3573 3578 3584 3590 3598 3623 3633 3635 3638 3665 3689 3704 3719 3727 3758 3799 3800 3853 3860 3862 3904 3908 3922 3924 3930 3936 3940 3956 3959 3960 3971 3974 4012 4019 4030 4053 4061 4067 4069 4075 4088 4106 4130 4146 4173 4210 4225 4231 4235 4244 4252 4326 4331 4335 4338 4343 4367 4372 4375 4383 4385 4388 4391 4396 4423 4429 4433 4439 4445 4451 4456 4493 4518 4543 4559 4575 4667 4691 4696 4699 4701 4704 4706 4709 4724 4739 4751 4767 4806 4808 4848 4854 4899 4903 4906 4909 4914 4919 4924 4929 4951 4963 4989 5007 5016 5025 5036 5047 5065 5080 5082 5090 5095 5120 5128 5132 5136 5140 5181 5184 5198 5205 5245 5336 5345 5357 5391 5395 5397 5403 5423 5426 5443 5449 5469 5472 5486 5492 5521 5555 5565 5568 5586 5592 5597 5602 5607 5612 5616 5636 5640 5648 5656 5712 5725 5728 5734 5740 5745 5755 5760 5764 5769 5772 5776 5781 5784 5787 5802 5805 5815 5819 5838 5843 5844 5849 5851 5860 5877 5881 5898 5901 5905 5931 5936 5940 5941 5964 5969 5974 5987 5995 6032 6067 6080 6082 6086 6108 6114 6116 6154 6158 6212 6315 6338 6342 6510 6515 6518 6520 6524 6555 6558 6560 6561 6569 6572 6574 6575 6636 6680 6721 6731 6734 6755 6763 6767 6785 6804 6816 6818 6901 7100 7109 7121 7190 7203 7260 7281 7296 7313 7336 7350 7360 7441 7449 7451 7474 7480 7516 7521 7541 7564 7587 7636 7638 7649 7702 7704 7715 7749 7884 7892 7897 7941 7972 8026 8055 8122 8195 8219 8235 8251 8332 8339 8356 8360 8434 8442 8444 8445 8458 8463 8465 8490 8495 8497 8503 8519 8527 8529 8565 8709 8816 8838 8885 9323 9339 9349 9387 9391 9406 9454 9484 9488 9514 9523 9527 9537 9540 9543 9595 9605 9646 9651 9658 9675 9720 9740 9745 9749 9755 9756 9771 9772 9795 9836 9845 9856 9869 9891 JMS 4000 1207 1215 1226 1700 1702 1704 1706 1708 1713 1715 1790 1825 1830 1832 1836 1848 1851 2066 2071 2076 2085 2090 2095 2100 2168 2223 2270 2409 2446 2530 2568 2579 2728 2745 2852 2900 2914 2916 3071 3076 3081 3089 3094 3117 3130 3141 3144 3169 3225 3240 3244 3268 3293 3296 3333 3341 3344 3394 3435 3450 3713 3716 3733 3793 3796 3981 4015 4024 4033 4043 4050 4073 4078 4085 4096 4103 4116 4143 4233 4240 4321 4327 4336 4341 4360 4362 4364 4373 4376 4386 4389 4394 4424 4426 4430 4441 4449 4454 4465 4521 4526 5257 6094 6124 6160 6164 6168 6192 6559 6573 6606 6620 6650 6660 6720 6803 7114 7117 7159 7290 7322 7348 7358 7375 7387 7392 7402 7407 7437 7470 7486 7520 7530 7618 7684 8161 8165 8805 8810 8827 8831 9347 9511 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 279 Symbol Table bts6120.plx 9554 9601 9607 9610 9707 9710 9715 9779 9785 9848 9853 9878 KCC 6032 861* 1347 KEY 01672 2357 2383 2386 2392 2413* KRB 6036 863* 3625 6011 9485 KRS 6034 862* KSF 6031 860* 1350 3622 6009 9483 L 00013 1443* 1620 1634 1644 1659 1761 4582 4583 5707 5738 5746 5793 5795 5807 LAS 7604 2099 4720 4730 4747 LASTPSS 0033 1453* 9434 9437 LBATMP 11344 7381 7386 7412* LDAR 6410 6479* 6743 6841 7529 7548 7551 8184 8191 8422 8695 8772 8868 9380 9424 9508 10059 LDBU20 03665 3902* 3904 LDBUF 03653 3785 3891* LDBUF2 03662 3900* 3960 LDBUF3 03710 3922 3927* LDBUF4 03727 3944* 3956 LDBUF5 03752 3908 3966* LDPAGE 03770 3896 3920 3923 3926 3977 3985* LENGTH 00031 1451* 1808 4140 5634 LIGHTS 12442 6387 8275* LOW 00043 1469* 1507 1887 2584 2586 2588 2590 4191 4208 4227 5226 5249 5261 5304 5307 LOWFLD 00045 1471* 5228 5251 5263 5310 5313 LSP1 6217 1297 1598 2769 6065 LSP2 6237 2771 MASK 01673 2365 2378 2384 2391 2414* MAT0B 21021 9740 9746* MATCH 06642 1617 1987 2001 3052 5385* MATCH1 06644 5389* 5397 MATCH2 06655 5391 5395 5400* MATCH3 06661 5401 5403 5406* MAXBPT 0010 1574* 1575 1576 1577 1578 2463 MAXCMD 0147 1581* 1582 5732 MAXFUN 0021 6313 6403* MCALL 10201 6158 6307* MCALL1 10225 6329* MCALL2 10237 6315 6341* 6375 MEA 20001 9277* 9395 9405 9438 9453 9776 9777 9827 9842 9847 9900 MEMMOV 12230 6385 8080* MEMMSG 13415 2169 9048* MEMMVX 12306 6386 8159* MEMTS1 10107 1207* 1209 MEMTS2 10114 1215* 1217 MIA 20002 9278* 9510 9513 9534 9536 9830 9841 9844 9852 MM0 6400 979* 10051 MM1 6401 980* 1122 10053 MM2 6402 981* 1124 4219 6616 6677 6776 7559 7742 8198 8249 8481 8521 8531 8540 8705 8809 8835 8884 9402 9409 9440 9456 10055 MM3 6403 982* 4182 6607 6661 6744 7531 8232 8424 8478 8483 8524 8697 8806 8832 8869 9382 9397 9426 9443 10057 MNEMP 20000 9276* 9726 9760 9867 9887 MOVE1 01411 2205* 2219 MOVE2 01440 2217 2223* MPTR 20012 9287* 9343 9344 MQA 7501 2028 3549 4735 5006 5308 5314 6051 8771 9825 MQDISP 06076 4909 4927* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 280 Symbol Table bts6120.plx MQL 7421 2025 2773 3546 4678 4692 4732 5001 5305 5311 8186 8223 8767 8872 9813 MQNAME 13721 2077 9076* MUUO 10050 6258* 6310 6311 6316 6318 6319 6320 6328 6332 6335 6505 6516 7847 7858 7990 7991 7995 8025 8026 8336 MVXARG 12400 8161 8165 8213* 8235 8251 NAME 00047 1473* 1613 5330 5339 5347 5348 5393 NAMENW 06600 1612 1984 1996 3047 5329* NDETMS 14322 4342 4395 4455 9125* NL0000 7200 915* NL0001 7201 916* 6770 6774 7406 NL0002 7326 917* 6583 6784 9542 NL0003 7325 928* 3636 NL0004 7307 929* NL0006 7327 930* NL0010 7215 933* 7743 NL0100 7203 932* NL2000 7332 918* NL3777 7350 919* 1757 6333 NL4000 7330 920* 7998 NL5777 7352 921* NL6000 7333 931* NL7775 7346 922* 923 NL7776 7344 924* 925 NL7777 7240 926* 927 3004 8040 9497 9502 9506 9517 9531 NLM1 7240 927* 3698 6766 6772 NLM2 7344 925* 4994 6733 6781 8038 8880 NLM3 7346 923* 4983 4992 5127 NOBOOT 02462 3054 3071* NODISK 02542 3138* 3414 3668 3761 4004 4292 4515 NOERA 12646 8434 8445 8463 8469* NOIDE 04531 4429 4433 4454* NOMNEM 21222 9869 9890* NONVR 04467 4367 4394* NOP 7000 1241 1310 1591 1592 1593 2906 3138 3139 3140 3572 4750 4759 4791 4959 5633 6121 6122 6123 6141 6358 6363 6900 7198 7199 7272 7273 7274 7304 7305 7306 7890 7965 8050 8115 8116 8118 8119 8180 8181 8182 8187 8188 8189 8500 NORDM 04466 4383 4388 4391* NOUNIT 02540 3130* 3453 NOXROM 20477 9488 9523 9527 9569* NSUPMS 14333 4450 9126* NUMXRARGS 0007 9548* 9551 NX1 12741 8438 8439 8443 8473 8480 8484 8499 8513 8545* NXTADR 06512 1532 5273* OCTN1 06725 5467* 5486 OCTN2 06750 5469 5472 5489* OCTNF 07004 5210 5524* OCTNF1 07010 5521 5528* OCTNI 07000 2514 2557 2805 5518* OCTNW 06720 1529 4287 5461* OKFLR 04270 4231 4237* OP0 21420 9913 9926* OP1 21424 9913 9928* OP2 21430 9914 9930* OP3 21434 9914 9932* OP4 21440 9915 9934* OP5 21444 9915 9936* OP6 21450 9916 9940* OP6NOCF 21470 9870 9949* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 281 Symbol Table bts6120.plx OP7 22150 9916 10091* OPJMP 21400 9732 9913* OPRGRP 21200 9866* 9916 OUTCH1 07411 5843 5847* OUTCH2 07416 5849 5854* OUTCH3 07426 5838 5863* OUTCHR 07400 1510 4277 5834* 9348 9708 9786 9879 OUTST1 06204 4987* 5016 OUTST2 06227 4989 5010* OUTST3 06230 5007 5011* OUTSTR 06200 1735 2060 4981* 5023 5182 6203 PAC1 6215 57 PACK 10504 6575 6645* PACK1 10507 6650* 6680 PARMAP 00020 1449* 3216 3247 4300 7255 7740 7782 7816 7849 PARSDX 03413 3665 3675* PCCHK1 04162 4128* 4130 PCNAME 13716 2072 9075* PCOMP 04015 4014* 8974 PCOPY 04024 4021* 8970 PCOPY0 04043 4019 4038* PCOPY1 04046 4043* 4067 4069 PCOPY3 04063 4058* PCOPY4 04100 4061 4072* PCOPYE 04120 4017 4093* PCOPYW 04104 4035 4078* PEX 6004 2777 PFAIL0 00267 1264 1337 1349 1352 1403* 1406 1411 PFAIL1 10147 1055 1072 1174 1202 1252 1263* PFAIL2 00273 1407* 1410 PGMDSP 06101 4899 4932* PGO 6003 2694 2735 PJ0F2 20100 9309* 9312 9314 9347 9601 9607 9610 9707 9710 9715 9779 9785 9848 9853 9878 PJ1F2 20117 9325* 9328 9330 9511 PLOF 6415 891* 1403 4970 PLON 6417 892* 1407 4966 PM1MSG 14067 3241 9100* PM2MSG 14074 3245 9101* PMALL 02663 3196 3230* 3236 PMEDI1 02661 3202 3225* PMEDIT 02622 3194* 8968 PMSHOW 02674 3209 3231 3240* PNLBUF 12210 3294 3342 3714 3794 4044 4079 4097 8034* PNLCDF 07671 6139 6148* PNLMEM 00041 1467* 1879 1951 2125 2202 2243 2309 2366 2465 2663 3505 PNLTRP 07653 6080 6134* POP1 6235 57 POPJ1 10306 4488 6418* POST 6440 895* 1051 1061 1166 1195 1320 1329 1358 2764 6070 10085 PPC1 6205 57 PR0 6206 6155 PR0MSG 13562 6169 9061* PR3 6236 896 PRCR 6473 874* PRISLU 6412 868* 9476 10063 PRNMSG 13614 6161 9063* PROCEE 02207 2705* 8938 PROGLP 12655 8478* 8503 PROMPT 00144 1554* 5705 5711 5750 PRPA 6470 871* 7181 7692 10037 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 282 Symbol Table bts6120.plx PRPB 6471 872* 7184 7689 7966 10039 PRPC 6472 873* 10041 PRS 6000 2766 6077 PSDISP 06070 4903 4917* PSNAME 13732 2086 9079* PUSHAC 04556 4481 4491 4495* PUSHAC2 20020 9293* 9310 9321 9326 9337 PUSHJ1 04537 1538 4480* 4482 4484 PWCR 6477 878* 7102 7105 7111 7171 7180 7188 7197 7201 7615 7631 7633 7645 7647 7657 7681 7688 7699 7711 7713 7921 7932 7934 7940 7959 7964 7970 10049 PWPA 6474 875* 7629 10043 PWPB 6475 876* 7624 7930 10045 PWPC 6476 877* 7103 7173 7617 7683 7924 7962 10047 PWRON 07634 6094* R3L 7014 933 1052 5125 5526 6873 8222 8241 9668 9798 9816 9833 RAL 7004 924 928 2248 4689 4707 5430 5433 5434 5479 6078 6083 6827 6869 7219 7442 7475 8787 9834 RAM128 1240 6475* 6837 7555 7556 RAM512 5200 6474* 7555 RAMBAS 00034 1458* 4301 6830 9376 9417 RAMBUF 10027 6246* 6610 6613 6615 6621 6625 6627 6631 6652 6654 6662 6664 6666 6670 6671 6675 8808 8811 8829 8833 RAMCDF 10753 6606 6660 6876 6899* 6901 7530 8349 8780 8805 8831 9505 RAMDAR 10032 6247* 6811 6817 6840 RAMDR1 10417 6521 6559* RAMDRD 10407 3471 3661 6553* RAMDRW 10310 6378 6500* RAMDW1 10432 6519 6573* RAMDWR 10422 3462 3754 6567* RAMER1 10435 6510 6555 6569 6579* 8332 8339 RAMER2 10437 6515 6558 6572 6583* 8356 RAMINIT 04200 1363 4138* RAMMS1 14250 4363 9116* RAMMS3 14255 4377 9117* RAMMS4 14260 4374 9118* RAMPTR 10010 6230* 6608 6611 6614 6663 6665 6676 6825 6826 6828 6832 8790 8807 8834 9507 RAMSEL 10722 3451 6508 6553 6567 6860* 7527 RAMSIZ 10044 6250* 7507 7574 7577 7588 8687 8715 8716 8719 RAMUSZ 10046 3459 3468 6252* 6798 6836 6890 6891 8351 RANGE 06460 1530 4288 5241* 9611 RANGE1 06504 5245 5261* RAR 7010 919 920 3278 3351 4901 4904 4907 5112 5202 6331 7212 7439 7472 9617 9696 9875 RC0KW 0700 8647* 8686 RC0OFF 1000 8649* 8757 RC0PAG 7000 8645* 8684 RC1IDE 04534 4423 4465* RC1KW 1000 8648* 8714 RC1PAG 7776 8646* 8712 RCFLAG 00035 1314 1461* 1827 4171 4318 4370 4421 4947 7097 8561 RCPAGE 10026 6245* 8759 8763 8776 8785 RCRDR1 13072 8805* 8816 RCRDRD 13067 6560 8802* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 283 Symbol Table bts6120.plx RCRDW1 13113 8827* 8838 RCRDWR 13110 6574 8824* RCSDAR 13033 6804 8750* RCTES1 13031 8709 8719* RCTEST 13000 7521 8684* RDADDR 06435 1954 2200 5210* 5216 5224 RDBFAI 04464 4385 4389* RDBOOT 10400 3077 6535* RDCH10 10613 6731 6742* RDCH11 10643 6763 6770* RDCH12 10650 6734 6755 6767 6775* 6785 RDCH20 10653 6721 6780* RDCHK1 10600 4361 6719* RDDUMP 03400 3661* 8956 RDF 6214 1128 1175 1255 9368 9412 RDHIGH 06442 5216* 5248 RDIBU1 11656 7687* 7704 RDIBU2 11700 7710* 7715 RDIBU3 11706 7702 7720* RDIBUF 11646 7296 7677* RDLOW 06451 5224* 5241 RDMEM 01316 1533 2134* 2161 RDPAGE 10025 1539 6244* 6502 6522 6541 6797 6812 8157 8325 8358 8758 RDPMLOC 7700 9362* 9377 9418 RDPMS1 0136 9364* 9385 9429 RDPMS2 0266 9365* 9389 9431 RDPS0 20230 9397* 9406 RDPSS 20201 4146 9367* RDPSX 20240 9370 9387 9391 9408* RDPTR 03467 3662 3670 3717* RDROM 12456 6401 8317* RDRW1 10324 6513* 6524 RDRW2 10336 6518 6521* RDRW3 10340 6520 6522* RDSIZE 10034 6249* 6886 6931 7512 8685 8713 RDTES0 11460 7527* 7587 RDTES1 11512 7541 7559* RDTES2 11527 7564 7580* RDTEST 11446 4365 7507* RDTYPE 10047 3155 6253* 6775 7581 RDUNIT 10024 3448 3680 3772 6243* 6507 6540 6861 6868 6885 6924 6925 6930 7511 7515 7580 7585 8156 8755 8768 RDYTMO 11424 7435 7436 7448 7450 7458* RECCNT 00074 1504* 3684 3699 3709 3726 RECSIZ 00073 1503* 3277 3295 3315 3343 3350 3383 3420 3455 3664 3672 3715 3720 3757 3765 3784 3795 4251 REGCMD 0107 7062* 7160 7291 7323 7349 7359 REGCNT 0102 7056* 7408 REGDAT 0100 7054* 7172 7616 7682 REGERR 0101 7055* 7487 REGLB0 0103 7057* 7376 REGLB1 0104 7058* 7388 REGLB2 0105 7059* 7393 REGLB3 0106 7060* 7115 7403 REGLSC 01240 1982 2052* 2672 6209 REGLST 01224 2043* 2052 REGSTS 0107 7061* 7118 7438 7471 REPCNT 00065 1493* 1609 1629 1632 1758 1765 3114 REPEA1 00625 1748 1757* REPEAT 00610 1746* 8902 REPLOC 00066 1494* 1633 1762 1763 RESTA 00400 1535 1591* 1649 4289 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 284 Symbol Table bts6120.plx RET0F2 04305 4259* 9318 RET0F3 04307 4262* 4270 RET1F2 12514 8366* 9334 RET1F3 12516 8369* 8378 RET2F3 20501 9574* 9583 RFNS 6434 885* 4648 4672 4849 4900 10079 RFRMAT 03124 3446* 8964 RLLOAD 03513 3754* 8960 RLOF 6435 886* 1595 4630 6187 6200 10081 RLON 6437 887* 2763 10083 ROMCH0 10062 1170* 1172 ROMCH1 10076 1177 1182* ROMCHK 10060 1168* 1181 ROMCK0 00200 1289* 1838 ROMCK1 10200 1841 6273* ROMCK2 20200 1845 9357* ROMCP0 10036 1120* 1135 ROMCP1 10056 1130 1136* ROMCPY 10040 1065 1067 1068 1069 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1122* 1127 ROMR1 12501 8354* 8360 ROMWR 12600 4248 8417* RSP1 6207 2761 6053 RSP2 6227 6055 RTF 6005 2775 RTL 7006 917 922 929 930 2812 4697 4702 5000 5108 5109 5478 6084 6623 6628 6629 7217 7218 7383 7384 7695 8471 9817 RTN1 6225 57 RTR 7012 918 921 931 2811 5005 5203 6669 6673 6674 7213 7379 7390 7391 7627 8420 8421 8765 8777 9616 9695 9730 9874 RWCNT 10055 6263* 6523 7882 7891 8001 8039 8359 SAVCHR 00052 1476* 1684 1685 2369 2373 2889 3927 3937 3972 4540 4544 4572 5110 5111 5114 5436 5481 5556 5557 5562 5718 5722 5735 5737 SBBLO 6415 6480* 6771 10067 SBBLO2 6436 1309 4950 6481* 6780 10069 SCAN 20010 9285* 9518 9520 9524 9554 9733 9735 9775 SCCOM 00700 1814* 8980 SCOPE 00032 1452* 1817 5800 SCPT 6433 884* 4887 6113 10077 SDNCMD 04614 4518 4526* SEAR1 01633 2371 2375 2382* SEAR2 01640 2389* 2403 SEAR3 01656 2394 2399* SEAR4 01665 2401 2406* SEARCH 01600 2355* 8920 SETBUF 12123 6500 7840 7989* 8317 SETDA1 10672 6813* 6818 SETDA2 10700 6816 6823* SETDAR 10661 6513 6556 6570 6796* 8354 SETDRD 0007 7041* 7179 7196 7687 7710 7963 SETDRE 0013 7045* 7104 SETDWR 0011 7043* 7630 7644 7931 SETLBA 11310 7288 7320 7373* SETPMP 11732 6383 7773* SHOEX1 04420 4326 4334* SHOEX2 04425 4335 4341* SHOEXT 04400 1394 4317* SHOIDE 04472 1376 4420* SHONV1 04450 4372 4376* PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 285 Symbol Table bts6120.plx SHONV2 04452 4375 4379* SHONVR 04430 1373 4360* SHSW 6431 882* 6106 10073 SICOM 02144 2653* 8940 SIMFLG 00051 1475* 2697 2734 6189 SINGLE 02202 2668 2694* 2706 SIZPTR 10045 6251* 6887 6888 6932 6933 7561 7562 SKP 7410 1336 1351 1756 1876 1948 3142 3304 3372 4060 6107 7635 7701 7883 9654 9897 SKPMSG 13477 2915 9053* SMA 7500 1661 1781 1805 2898 4384 5356 5363 5425 5471 5733 5837 6517 7582 7859 SNA 7450 1129 1176 1607 1614 1624 1666 1669 1672 1679 1711 1747 1764 1775 1799 1828 1918 1963 1981 2126 2164 2265 2313 2370 2374 2434 2479 2511 2516 2559 2575 2604 2632 2800 2890 3008 3044 3195 3208 3520 3557 3583 3688 3703 3903 3907 3921 4112 4366 4371 4382 4438 4517 4542 4615 4646 4653 4682 4847 4895 4948 4962 5013 5033 5044 5089 5180 5332 5390 5394 5448 5491 5554 5564 5567 5635 5716 5727 5771 5780 5783 5804 5834 5876 5958 6153 6157 6730 6762 6838 6893 7446 7563 7575 7997 8022 8053 8287 8331 8457 8462 8489 8494 8563 8756 8879 9345 9487 9539 9604 9650 9744 9748 9754 9868 SNCOM 02200 2683* 8934 SNL 7420 1883 2198 2240 2522 2566 3064 3067 3124 4029 4243 5079 5335 5344 6815 8218 8246 9823 9835 SP1NAM 13735 2091 9080* SP2NAM 13741 2096 9081* SPA 7510 1630 1679 1778 1802 4325 4695 4700 4705 4708 5278 5422 5468 5533 5639 5655 5724 5880 6079 6085 7565 SPACM0 04621 1524 4282 4539* SPACMP 04617 1523 4281 4536* 4543 9602 SPANXT 04637 1997 4567* SPATST 04641 1955 4008 4571* SPD 6276 1062 1200 1212 1294 1594 2124 2139 2150 3014 4629 4776 6068 6147 6366 6633 6655 7655 7721 8088 8103 8125 8199 8230 8247 8698 8813 8830 9598 9635 9902 SPINCD 04600 4513* 8982 SPINDN 11303 4527 7356* SPINUP 11276 4522 7346* SPLK 6432 883* 4652 4851 10075 SRCCDF 12272 8085 8115* 8122 SRCDAR 0024 8156* 8162 8183 SRCSPD 12273 8089 8116* SRNAME 13727 2101 9078* STA 7240 1196 1308 1346 1628 1754 1875 1947 2209 2305 2360 2364 2397 2696 2866 3895 4581 4610 4811 5173 5643 5653 5796 5812 5988 6134 6535 7249 7576 8694 STACK 0177 1296 1558* 1559 1597 START 02251 2799* 8936 START1 02275 2801 2818* STARTXROM 20462 9540 9550* STKLEN 0031 1559* 1560 STKSAV 00145 1557* 2762 6064 STL 7120 928 930 931 2490 3015 5354 5573 6584 7488 8541 STSBSY 0200 7065* 7443 7476 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 286 Symbol Table bts6120.plx STSCOR 0004 7070* STSDF 0040 7067* STSDRQ 0010 7069* 7476 7477 STSDSC 0020 7068* STSERR 0001 7071* STSRDY 0100 7066* 7443 7444 SUPCMD 04611 4521* SWBOO1 06014 4806 4811* SWBOOT 06007 4691 4805* SWCLR 06017 4701 4820* SWDEP 05725 4709 4745* SWEXA 05735 4706 4758* SWEXA1 05741 4751 4761* SWLA 05702 4696 4720* SWLXA 05711 4699 4730* SWP 7521 8192 8226 8234 SWPADR 06540 2205 2212 5303* SWSCA1 05634 4665* 4667 SWSCAN 05621 1605 4645* SWTEMP 05701 4674 4677 4679 4713* SYSCRN 14172 1852 9113* SYSI20 00216 1312 1320* SYSI21 00222 1315 1329* SYSIN2 00201 1232 1293* SYSIN3 00245 1358* SYSIN9 00264 1394* 4274 SYSINI 10001 1051* 6032 SYSNM0 14121 1826 9108* SYSNM1 14127 1833 9109* SYSNM2 14142 1837 9110* SYSNM3 14152 1849 9111* SYSNM4 14167 1831 9112* SZA 7440 1054 1071 1173 1208 1216 1251 1311 1348 1405 1409 1781 1805 1905 1921 1966 2393 2407 2444 2483 2488 2912 3016 3115 3157 3171 3176 3201 3235 3318 3359 3364 3386 3512 3535 3565 3632 3852 3859 3929 3935 3939 3955 3958 3970 3973 4066 4172 4209 4224 4230 4319 4334 4422 4558 4574 4666 4852 4898 5244 5293 5425 5471 5585 5744 5759 5768 5786 5801 5842 5848 5897 5900 5963 5973 5986 5994 6190 6754 7099 7108 7120 7280 7312 7479 7540 7554 7586 8338 8433 8441 8526 8708 8769 9386 9390 9522 9526 9645 9770 9888 SZL 7430 1900 2208 2216 2249 2256 2323 2400 3053 3079 3092 3298 3346 3452 3718 3798 4052 4087 4105 4428 4432 4690 4698 4703 4902 4905 4908 5255 6081 6314 6509 6514 6554 6557 6568 6571 6799 6863 6871 6928 7156 7162 7286 7293 7318 7325 7440 7473 7779 7813 7887 8087 8102 8355 9664 9671 9871 TAD 1000 1053 1064 1066 1068 1069 1078 1080 1082 1084 1086 1088 1123 1131 1170 1178 1214 1239 1243 1248 1250 1256 1296 1359 1597 1603 1613 1616 1620 1622 1623 1629 1633 1646 1659 1660 1665 1667 1668 1670 1671 1673 1674 1678 1680 1681 1685 1710 1734 1755 1761 1763 1774 1777 1780 1783 1798 1801 1804 1807 1816 1827 1834 1838 1841 1845 1887 1890 1892 1903 1920 1959 1965 1986 2000 2008 2013 2018 2023 2026 2033 2059 2061 2065 2070 2075 2084 2089 2094 2111 2113 2125 2136 2138 2148 2159 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 287 Symbol Table bts6120.plx 2163 2171 2213 2247 2253 2264 2272 2289 2307 2320 2356 2362 2369 2373 2377 2383 2392 2406 2429 2431 2433 2443 2457 2459 2461 2463 2478 2482 2485 2487 2515 2524 2558 2574 2583 2585 2587 2589 2603 2607 2611 2631 2635 2637 2656 2659 2661 2768 2770 2772 2774 2776 2808 2810 2813 2886 2889 2896 2897 2905 2911 2918 3002 3007 3012 3051 3058 3114 3119 3121 3126 3155 3174 3199 3203 3215 3216 3218 3233 3234 3242 3246 3247 3249 3277 3280 3283 3285 3295 3309 3315 3343 3350 3353 3356 3358 3361 3362 3377 3383 3397 3419 3424 3430 3454 3459 3462 3468 3471 3508 3511 3519 3522 3527 3533 3539 3543 3547 3555 3556 3559 3560 3561 3563 3569 3576 3581 3585 3593 3595 3618 3661 3663 3669 3671 3677 3679 3693 3695 3707 3715 3720 3735 3754 3756 3762 3764 3771 3773 3784 3788 3790 3795 3824 3830 3834 3841 3844 3845 3847 3850 3857 3858 3861 3892 3900 3905 3906 3918 3920 3925 3927 3928 3932 3934 3937 3938 3945 3948 3949 3953 3967 3969 3972 3977 4006 4010 4017 4026 4035 4045 4049 4062 4080 4084 4098 4102 4111 4119 4123 4125 4128 4138 4171 4185 4188 4190 4193 4196 4198 4201 4204 4206 4208 4212 4215 4217 4223 4227 4229 4237 4248 4250 4318 4323 4324 4329 4370 4380 4421 4436 4443 4482 4484 4488 4491 4516 4540 4541 4544 4572 4573 4582 4614 4627 4645 4651 4664 4675 4679 4733 4761 4763 4774 4787 4789 4824 4846 4894 4897 4918 4923 4928 4932 4947 4960 4981 4995 4997 5002 5010 5022 5032 5042 5055 5058 5064 5074 5078 5085 5088 5103 5107 5111 5114 5174 5178 5193 5195 5211 5217 5219 5225 5227 5243 5249 5251 5261 5263 5276 5277 5280 5290 5292 5295 5297 5304 5306 5310 5312 5337 5346 5347 5355 5358 5362 5365 5389 5393 5400 5421 5424 5429 5432 5435 5436 5437 5447 5467 5470 5475 5477 5481 5482 5490 5519 5525 5531 5532 5537 5557 5562 5563 5566 5583 5591 5596 5601 5606 5611 5615 5627 5634 5638 5647 5654 5658 5706 5711 5722 5723 5726 5731 5732 5735 5737 5743 5747 5750 5752 5758 5761 5767 5770 5779 5782 5785 5790 5794 5800 5803 5807 5813 5836 5841 5847 5850 5856 5859 5863 5875 5879 5896 5899 5932 5962 5967 5972 5976 5979 5985 5993 6001 6064 6135 6137 6139 6143 6145 6151 6152 6155 6189 6202 6204 6207 6311 6313 6316 6317 6319 6326 6335 6355 6359 6361 6365 6408 6505 6516 6537 6598 6608 6611 6614 6621 6625 6627 6631 6646 6651 6653 6662 6664 6666 6671 6675 6701 6728 6742 6746 6748 6750 6751 6759 6761 6797 6798 6812 6814 6823 6826 6828 6830 6836 6837 6839 6840 6861 6862 6868 6870 6875 6885 6886 6888 6891 6925 6927 6930 6931 6933 7097 7101 7104 7106 7110 7113 7119 7158 7166 7168 7170 7172 7179 7187 7194 7196 7200 7211 7216 7221 7240 7251 7255 7259 7279 7289 7295 7311 7321 7327 7347 7357 7374 7377 7382 7386 7389 7401 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 288 Symbol Table bts6120.plx 7434 7444 7477 7510 7512 7528 7532 7534 7536 7537 7547 7550 7552 7555 7556 7562 7566 7567 7574 7581 7583 7584 7585 7588 7612 7614 7616 7621 7623 7625 7630 7632 7644 7646 7656 7678 7680 7682 7687 7696 7698 7710 7712 7738 7740 7744 7776 7778 7781 7782 7784 7811 7812 7815 7816 7819 7847 7849 7852 7858 7860 7861 7885 7896 7920 7922 7929 7931 7933 7939 7958 7960 7963 7969 7971 7991 7993 7995 8003 8020 8021 8024 8034 8036 8052 8082 8084 8086 8088 8091 8097 8099 8101 8103 8106 8117 8160 8164 8169 8173 8183 8185 8190 8217 8228 8230 8232 8239 8243 8245 8247 8249 8278 8284 8324 8329 8336 8348 8350 8419 8426 8428 8431 8439 8440 8450 8452 8455 8460 8464 8469 8475 8479 8482 8487 8492 8496 8505 8510 8513 8514 8517 8522 8525 8536 8538 8561 8684 8686 8699 8701 8703 8704 8712 8714 8715 8719 8755 8757 8758 8763 8768 8770 8776 8779 8785 8789 8803 8807 8811 8825 8828 8833 8867 8871 8877 9312 9314 9318 9321 9328 9330 9334 9337 9344 9369 9372 9376 9377 9384 9385 9388 9389 9393 9399 9401 9413 9417 9418 9421 9429 9431 9434 9437 9442 9486 9500 9504 9509 9520 9521 9524 9525 9533 9535 9551 9594 9598 9615 9619 9622 9625 9626 9628 9632 9642 9644 9647 9649 9655 9656 9662 9665 9666 9669 9672 9673 9685 9687 9689 9691 9694 9706 9709 9712 9714 9717 9728 9732 9735 9738 9742 9747 9752 9759 9761 9775 9784 9794 9797 9800 9803 9805 9808 9811 9815 9820 9832 9838 9841 9847 9850 9852 9855 9867 9870 9873 9877 9887 9890 9900 TADDR 06417 1896 1927 2170 5192* TASCI1 06247 5032* 5036 TASCIZ 06246 1647 5031* 5753 TASZF1 06255 4444 5040* 5047 TASZF2 20136 9343* 9349 9713 9718 9839 9851 9856 9891 TBACKS 07131 1512 5653* TBELL 07071 5600* 5642 5818 TCF 6042 865* 1334 TCKSUM 01472 2264* 3597 TCKSUN 01477 2257 2266 2270* TDECN1 06302 5077* 5082 TDECN2 06310 5080 5085* TDECN3 06320 5090 5094* TDECNW 06277 1518 4291 5072* 5091 TDIGIT 07102 3243 5095 5116 5205 5615* TDOT 07077 1519 5610* TFCHA1 07445 5894* 5901 TFCHA2 07460 5898 5908* TFCHAR 07444 5602 5628 5648 5659 5857 5893* TFIELD 06431 5194 5202* 6206 TFILV 00656 1779 1782 1790* 1803 1806 THCHA1 07443 5877 5881 5883* THCHAR 07427 5065 5592 5597 5607 5612 5616 5851 5860 5872* TLS 6046 867* 1331 1338 5933 TMEM 01060 1911 1927* 2395 2436 4766 TOCT3 06343 1517 5125* TOCT4 06322 1513 4279 5102* 5131 5135 5138 9711 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 289 Symbol Table bts6120.plx 9716 9849 9854 TOCT4C 06352 1514 5135* TOCT4M 06355 1515 5138* TOCT4S 06347 1516 5131* TOCTL 06325 5107* 5120 TOCTN 06324 5104* 5128 TPC 6044 866* TPCOM 00660 1796* 8946 TPCOM1 00676 1800 1808* TQUEST 07066 1645 1648 1733 2267 5552 5595* TRACE 02146 2656* 2729 TRAP 07720 6094 6124 6160 6164 6168 6192 6199* 6202 TRPMSG 13640 6095 9065* TSF 6041 864* 1332 1335 1339 2845 5930 TSIXB 21062 9765 9767 9783* TSIXC 06274 5057 5063* TSIXW 06266 5054* TSLASH 07074 3836 5197 5605* TSPACE 07063 1511 5582 5590* TSTADR 06525 1531 5253 5289* TTABC 07054 5582* 5586 5844 TTEXT1 06405 5177* 5184 TTEXTT 06400 1700 1704 1708 1713 1715 5172* 5174 5176 5181 TWCOM 00635 1772* 8944 TWCOM1 00653 1776 1784* TWCOM2 00654 1785* 1809 1818 TYPEAC 01252 2046 2065* 9010 TYPEIR 01263 2080* 2671 4293 TYPEMQ 01260 2047 2075* 9014 TYPEPC 01255 2044 2070* 4723 9012 TYPEPS 01265 2045 2084* 4738 9016 TYPESR 01276 2099* 9018 TYPRG4 01243 2057* 2059 2066 2071 2076 2085 2090 2095 2100 TYPSP1 01270 2048 2089* TYPSP2 01273 2049 2094* UAC 00001 1430* 2009 2065 2776 2860 4272 4823 4923 6048 6326 6330 8278 UFLAGS 00002 1431* 2026 2029 2084 2656 2774 2814 2862 4273 4733 4736 4763 4787 4824 4826 4918 5519 5525 6050 6137 6204 6334 6336 6359 9687 UIR 00007 1436* 2665 4294 6146 6151 9689 UIRPC 00006 1435* 2662 6144 9685 UMQ 00003 1432* 2019 2075 2772 2861 4822 4928 6052 UNPAC1 10445 6606* 6636 UNPACK 10442 6561 6597* 8357 9512 UNPLP 20430 9511* 9514 UPC 00000 1429* 2014 2070 2659 2661 2778 2809 2867 3059 4271 4721 4748 4749 4758 4761 4774 6135 6136 6143 6145 6207 6355 6357 UPDIS1 06102 4919 4924 4929 4936* UPDIS2 06103 4914 4937* UPDISI 06044 4887* 5936 5955 UPDISP 06047 4894* 6115 USERDF 06000 4745 4772 4786* USP1 00004 1433* 2089 2768 2863 4820 6054 USP2 00005 1434* 2094 2770 2864 4821 6056 VALUE 00046 1472* 2058 2061 2137 2138 2145 2148 2213 2302 2320 2426 2438 2443 2908 2918 3120 3121 3126 3550 3569 3576 3593 3732 3735 3843 3844 3847 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 290 Symbol Table bts6120.plx VECOM 00707 1824* 8942 VERSION 0320 837* 1834 4627 6408 9556 VMAMSG 14107 3082 9104* VPOS 00056 1482* 5632 5638 5641 5721 5997 6069 WDRQ 11426 7161 7292 7324 7470* 7480 WFRDY1 12632 8454* 8458 WFRDY2 12664 8486* 8490 WIDTH 00030 1450* 1784 4139 5875 WORD 00067 1497* 1621 1622 1755 1774 1798 1816 1959 2008 2013 2018 2023 2033 2289 2356 2377 2515 2558 2808 2886 2888 2905 3119 3199 3203 3218 3523 3533 3539 3554 3555 3581 3585 3589 3677 3679 3693 3695 3707 3771 3773 3918 3925 3932 3945 3948 3967 4006 4010 4516 5054 5055 5058 5072 5074 5102 5107 5113 5126 5211 5416 5429 5431 5432 5435 5438 5462 5475 5477 5483 WORDH 00070 1498* 5476 5537 WREAD1 11403 7437* 7449 7451 WREADY 11400 7121 7155 7285 7317 7336 7350 7360 7434* WRIBU1 11610 7621* 7638 WRIBU2 11632 7644* 7649 WRIBU3 11640 7636 7654* WRIBUF 11600 7328 7611* WRMEM 01330 2145* 2160 WRPS0 20266 9440* 9454 WRPSS 20243 1786 3221 7789 9412* WRPSX 20303 9414 9458* WRPTR 03561 3755 3763 3797* 4249 WSR 6246 2034 4936 X1 00010 1440* 2429 2458 2478 2524 2535 2574 2583 2603 2631 3003 3007 3217 3219 3248 3249 3281 3284 3287 3354 3358 3361 3825 3841 3893 3947 4124 4128 4982 4995 4996 4997 5002 5010 5031 5032 5040 5042 5385 5389 5396 5400 X2 00011 1441* 2431 2460 2485 2494 2536 2573 2587 2607 2616 2635 2642 3005 3012 X3 00012 1442* 2462 2537 2610 2617 2637 2643 5175 5178 XCMDDN 20710 9651 9677* XCOMM 20605 9595 9599* XCT1 02340 2891 2896* XCT2 02346 2899 2904* XCT3 02360 2913 2916* XCTBLK 02350 2887 2896 2906* XCTCOM 02324 2885* 8948 XDSCDF 12340 8164 8187* XFRCNT 10052 6260* 6599 6635 6647 6679 7169 7189 7195 7202 7613 7634 7648 7679 7700 7714 8112 8121 8178 8194 8804 8815 8826 8837 XIR 20004 9280* 9633 9690 9714 9728 9738 9742 9811 9815 9832 9873 XOFF 00054 1480* 5644 5709 5719 5899 5966 5975 5989 5996 XPC 20003 9279* 9623 9632 9686 9709 9820 XRCHECK 20453 9535* 9537 XRMES1 14345 4322 9129* XRMES2 14352 4328 9130* XRMES3 14357 4337 9131* XROMERR 20475 9543 9566* XSRCDF 12331 8160 8180* 8195 XTYPIR 20712 2081 9685* XX1 10012 6232* 7513 7514 7741 7746 7783 7786 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 291 Symbol Table bts6120.plx 7817 7819 7850 7852 8092 8117 8170 8185 8214 8229 8231 8233 8244 8248 8250 8476 8482 8511 8522 XX2 10013 6233* 8107 8120 8174 8193 8515 8525 8536 ZBACKS 00100 1512* 5773 5775 ZBACKUP 00115 1525* 1749 1916 1983 2315 2513 2804 3046 3197 3210 3690 3705 5345 5754 5806 5811 ZCOMERR 00130 1536* 1922 1967 2199 2241 2517 2560 3924 3930 3936 3940 3959 3974 4559 4575 5336 5449 5492 ZCRLF 00110 1369 1520* 1599 1850 1853 1854 1907 1915 1988 2053 2396 2437 3083 3096 3393 3437 3856 4075 4115 4331 4338 4343 4391 4396 4445 4451 4456 4724 4739 4767 4807 5136 5139 5183 5559 5749 5763 5792 5882 5978 6201 ZDANDV 00126 1534* 1960 2214 2321 2612 2638 3570 ZDKRBN 00134 1540* 3273 3307 3336 3375 3397 3681 3694 3723 3787 3788 3790 3830 4039 4059 4064 4119 ZEOLNXT 00117 1527* 1824 1985 2424 2653 2683 2705 2723 2830 3048 3504 ZEOLTST 00116 1526* 1699 1751 1773 1797 1815 1999 2201 2242 2317 2379 2562 2806 2893 3113 3212 3710 3769 4012 4514 ZERROR 00131 1537* 1790 2223 2409 2446 2530 2568 2579 2900 3071 3130 3144 3225 3981 5257 ZGET 00120 1528* 2300 2510 2799 3957 4536 4553 4567 5342 5442 5485 ZINCHRS 00112 1522* 2389 3312 3380 5553 5715 ZINLMES 00111 1521* 1825 1830 1832 1836 1848 1851 2168 2270 2914 2916 3081 3094 3117 3240 3244 3268 3333 3394 3435 3733 4015 4024 4033 4073 4116 4233 4240 4321 4327 4336 4341 4362 4373 4376 4386 4389 4394 4424 4441 4449 4454 ZK177 00135 1543* 3013 5011 5957 ZK7 00137 1545* 1892 1904 3851 3954 5115 5204 5584 ZK70 00136 1544* 2112 2307 2362 2657 3586 4764 4788 5281 5520 5527 5539 6138 6205 ZK7400 0142 1550* 4998 5003 ZK7600 0141 1548* ZM128 00141 1547* 1548 3454 3663 3756 ZM256 00142 1549* 1550 3419 3671 3764 4049 4062 4084 4102 4250 ZMSPACE 00140 1546* 4541 4573 5337 5346 5723 5836 ZNXTADR 00124 1532* 1902 1961 2211 2215 2258 2325 2402 ZOCTNW 00121 1529* 1958 1998 2288 2355 2376 2885 2892 3112 3198 3211 3675 3691 3706 3768 3917 3931 3944 3966 4005 4009 5529 ZOUTCHR 00076 1510* 3637 5015 5035 5046 5558 5712 5736 5748 5751 5762 5791 5808 5968 5977 ZPUSHJ1 00132 1538* 2852 3076 3089 3169 3293 3296 3341 3344 3450 3713 3716 3793 3796 4043 4050 4078 4085 4096 4103 4143 4360 4364 4426 4430 4465 4521 4526 ZRANGE 00122 1530* 1882 2197 2239 2316 2372 ZRDMEM 00125 1533* 1897 1928 2173 2206 2252 2390 2609 2664 ZRDPAGE 00133 1539* 3274 3308 3309 3337 3376 3377 3682 3696 3724 3789 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 292 Symbol Table bts6120.plx ZRESTA 00127 1395 1535* 1736 3125 3638 4030 4235 4244 5140 5969 6212 ZSPACM0 00114 1524* 1962 2312 3207 3687 3702 4557 5242 ZSPACMP 00113 1523* 1746 1917 1980 3043 3194 5331 5418 5464 ZTDECNW 00106 1518* 4330 4368 4440 ZTDOT 00107 1519* 3320 3388 3833 4068 ZTOCT3 00105 1517* 1835 3835 ZTOCT4 00101 1513* 3832 5196 ZTOCT4C 00102 1514* 2273 2919 3250 3399 3862 4121 6208 ZTOCT4M 00103 1515* 2174 3736 ZTOCT4S 00104 1516* 1839 1843 1847 1898 1929 2062 2172 3122 3848 4027 ZTSPACE 00077 1511* 3837 5132 5198 5774 ZTSTADR 00123 1531* 1899 2207 2255 2322 2399 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 293 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 Deposit in Registers . . . . . . . . . . . . . . . . . . . . . 42 Examine Registers . . . . . . . . . . . . . . . . . . . . . . . 43 Read and Write Memory . . . . . . . . . . . . . . . . . . . . . 45 BM Command -- Memory Block Move . . . . . . . . . . . . . . . . 47 CK Command -- Checksum Memory . . . . . . . . . . . . . . . . . 48 CM and FM Commands -- Clear Memory and Fill Memory . . . . . . 49 X / XP Command Stubs -- Disassemble memory . . . . . . . . . . 50 WS Command -- Word Search Memory . . . . . . . . . . . . . . . 51 BL Command -- List Breakpoints . . . . . . . . . . . . . . . . 53 Search for Breakpoints . . . . . . . . . . . . . . . . . . . . 54 BR Command -- Remove Breakpoints . . . . . . . . . . . . . . . 55 BP Command -- Set Breakpoints . . . . . . . . . . . . . . . . . 56 Insert Breakpoints in Memory . . . . . . . . . . . . . . . . . 57 Remove Breakpoints from Memory . . . . . . . . . . . . . . . . 58 TR Command -- Single Instruction with Trace . . . . . . . . . . 59 SI and P Commands - Single Instruction and Proceed . . . . . . 60 C Command - Restore Main Memory Context and Continue . . . . . 61 ST Command -- Start a Main Memory Program . . . . . . . . . . . 63 MR Command - Master Reset . . . . . . . . . . . . . . . . . . . 64 EX Command - Execute IOT Instructions . . . . . . . . . . . . . 65 OS/8 Bootstrap . . . . . . . . . . . . . . . . . . . . . . . . 66 Boot Sniffer . . . . . . . . . . . . . . . . . . . . . . . . . 68 B Command - Boot Disk . . . . . . . . . . . . . . . . . . . . . 69 Parse FORMAT Unit/Partition Argument . . . . . . . . . . . . . 71 Test for RAM Disk and/or IDE Disk . . . . . . . . . . . . . . . 72 PM Command - Show and Edit Disk Partition Map . . . . . . . . . 73 Disk Formatter, Pass 1 . . . . . . . . . . . . . . . . . . . . 75 Disk Formatter, Pass 2 . . . . . . . . . . . . . . . . . . . . 77 DF Command - Format IDE Disk Partition . . . . . . . . . . . . 79 RF Command - Format a RAM Disk . . . . . . . . . . . . . . . . 80 LP Command - Load Binary Paper Tapes from the Console . . . . . 81 Paper Tape Console Input Routine . . . . . . . . . . . . . . . 84 RD and DD Commands - Dump Disk (RAM and IDE) Records . . . . . 85 RL and DL Commands - Load Disk (RAM and IDE) Records . . . . . 87 Dump Disk Buffer on Console . . . . . . . . . . . . . . . . . . 89 Load Disk Buffer from Console . . . . . . . . . . . . . . . . . 91 PC Command - Copy an IDE Disk Partition . . . . . . . . . . . . 94 Initialize Terminal, Breakpoint, Partition Map, etc . . . . . . 97 FL Command - Flash download . . . . . . . . . . . . . . . . . . 98 Field 0 Vector Table . . . . . . . . . . . . . . . . . . . . . 100 Show Extension ROM Status . . . . . . . . . . . . . . . . . . . 101 Initialize and Show RAM Disk Status . . . . . . . . . . . . . . 102 Initialize and Show IDE Disk Status . . . . . . . . . . . . . . 103 Call Routines in Field 1 . . . . . . . . . . . . . . . . . . . 105 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 294 Table of Contents bts6120.plx SD Command - Spin IDE Drives UP or DOWN . . . . . . . . . . . . 106 Simple Lexical Functions . . . . . . . . . . . . . . . . . . . 107 Free Space for Future Expansion! . . . . . . . . . . . . . . . 108 Front Panel Initialization . . . . . . . . . . . . . . . . . . 109 Scan Front Panel Switches . . . . . . . . . . . . . . . . . . . 110 FP LA, LXA, EXAMINE and DEPOSIT Switches . . . . . . . . . . . 112 Change Current DF to User's IF . . . . . . . . . . . . . . . . 114 START, CONTINUE and BOOT Switches . . . . . . . . . . . . . . . 115 HALT Switch . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Update the Front Panel Data Display . . . . . . . . . . . . . . 117 Blink Power LED for Low Battery . . . . . . . . . . . . . . . . 119 Type ASCII Strings . . . . . . . . . . . . . . . . . . . . . . 120 Type SIXBIT Words, and Characters . . . . . . . . . . . . . . . 122 Type Decimal Numbers . . . . . . . . . . . . . . . . . . . . . 123 Type Octal Numbers . . . . . . . . . . . . . . . . . . . . . . 124 Type Table of Messages . . . . . . . . . . . . . . . . . . . . 125 Type 15 Bit Addresses . . . . . . . . . . . . . . . . . . . . . 126 Scan Addresses . . . . . . . . . . . . . . . . . . . . . . . . 127 Scan an Address Range . . . . . . . . . . . . . . . . . . . . . 128 Address Arithmetic . . . . . . . . . . . . . . . . . . . . . . 129 Scan a Command Name . . . . . . . . . . . . . . . . . . . . . . 130 Command Lookup and Dispatch . . . . . . . . . . . . . . . . . . 131 Scan Decimal Numbers . . . . . . . . . . . . . . . . . . . . . 132 Scan Octal Numbers . . . . . . . . . . . . . . . . . . . . . . 133 Scan 15 Bit Addresses . . . . . . . . . . . . . . . . . . . . . 134 Ask For Confirmation . . . . . . . . . . . . . . . . . . . . . 135 Type Special Characters . . . . . . . . . . . . . . . . . . . . 136 Type Carriage Return, Line Feed and Backspace . . . . . . . . . 137 Read Command Lines . . . . . . . . . . . . . . . . . . . . . . 139 Terminal Output Primitives . . . . . . . . . . . . . . . . . . 142 Terminal Input Primitives . . . . . . . . . . . . . . . . . . . 144 Control Panel Entry Points . . . . . . . . . . . . . . . . . . 146 Field 1 Variables . . . . . . . . . . . . . . . . . . . . . . . 150 ROM Calls (PR0 Instructions) . . . . . . . . . . . . . . . . . 151 Fetch PR0 Arguments . . . . . . . . . . . . . . . . . . . . . . 153 ROM Call Table . . . . . . . . . . . . . . . . . . . . . . . . 154 Return from Routines in Field 1 . . . . . . . . . . . . . . . . 155 RAM Disk support . . . . . . . . . . . . . . . . . . . . . . . 156 RAM Disk Read/Write ROM Call . . . . . . . . . . . . . . . . . 157 RAM Disk Primary Bootstrap . . . . . . . . . . . . . . . . . . 159 Read and Write RAM Disk Pages . . . . . . . . . . . . . . . . . 160 Unpack RAM Disk Pages . . . . . . . . . . . . . . . . . . . . . 161 Pack RAM Disk Pages . . . . . . . . . . . . . . . . . . . . . . 162 Get Battery Status ROM Call . . . . . . . . . . . . . . . . . . 163 Determine RAM Disk Model . . . . . . . . . . . . . . . . . . . 164 Calculate RAM Disk Addresses . . . . . . . . . . . . . . . . . 166 Select RAM Disk Unit . . . . . . . . . . . . . . . . . . . . . 167 Get RAM Disk Size ROM Call . . . . . . . . . . . . . . . . . . 169 ATA Disk Support . . . . . . . . . . . . . . . . . . . . . . . 170 IDE Disk Interface . . . . . . . . . . . . . . . . . . . . . . 172 Initialize IDE Drive and Interface . . . . . . . . . . . . . . 173 Identify IDE/ATA Device . . . . . . . . . . . . . . . . . . . . 174 Get IDE Disk Size ROM Call . . . . . . . . . . . . . . . . . . 176 IDE Disk Primary Bootstrap . . . . . . . . . . . . . . . . . . 177 Read and Write IDE Sectors . . . . . . . . . . . . . . . . . . 178 Spin Up and Spin Down IDE Drive . . . . . . . . . . . . . . . . 180 Setup IDE Unit, LBA and Sector Count Registers . . . . . . . . 181 Wait for IDE Drive Ready . . . . . . . . . . . . . . . . . . . 183 Wait for IDE Data Request . . . . . . . . . . . . . . . . . . . 184 RAM Disk Diagnostics . . . . . . . . . . . . . . . . . . . . . 185 Write IDE Sector Buffer . . . . . . . . . . . . . . . . . . . . 187 Read IDE Sector Buffer . . . . . . . . . . . . . . . . . . . . 189 Initialize Disk Partition Map . . . . . . . . . . . . . . . . . 191 Set Disk Partition Map ROM Call . . . . . . . . . . . . . . . . 192 Get Disk Partition Map ROM Call . . . . . . . . . . . . . . . . 193 PALX - IM6100/HM6120 Assembly Language V3.32 RLA 10-MAY-18 23:00:32 Page 295 Table of Contents bts6120.plx IDE Disk Read/Write ROM Call . . . . . . . . . . . . . . . . . 194 Write IDE Register . . . . . . . . . . . . . . . . . . . . . . 196 Read IDE Register . . . . . . . . . . . . . . . . . . . . . . . 197 Setup Disk I/O Buffer . . . . . . . . . . . . . . . . . . . . . 198 Test for IOB6120 CompactFlash Card . . . . . . . . . . . . . . 199 Setup Disk I/O Buffer Field and Space . . . . . . . . . . . . . 200 Copy Memory ROM Calls . . . . . . . . . . . . . . . . . . . . . 201 Copy Memory Extended ROM Call . . . . . . . . . . . . . . . . . 203 Get Arguments for MEMMOV Calls . . . . . . . . . . . . . . . . 205 LIGHTS Monitor Call . . . . . . . . . . . . . . . . . . . . . . 206 Read Flash ROM Call . . . . . . . . . . . . . . . . . . . . . . 207 Field 1 Vector Table . . . . . . . . . . . . . . . . . . . . . 209 Flash ROM erasure and writing . . . . . . . . . . . . . . . . . 210 Test for SBC6120-RC . . . . . . . . . . . . . . . . . . . . . . 213 SBC6120-RC RAM Disk support . . . . . . . . . . . . . . . . . . 214 SBC6120-RC RAM Disk Diagnostic . . . . . . . . . . . . . . . . 216 Set SBC6120-RC RAM Disk Address Register . . . . . . . . . . . 218 Read or Write SBC6120-RC RAM Disk . . . . . . . . . . . . . . . 220 Test DS1221 Batteries . . . . . . . . . . . . . . . . . . . . . 221 Command Names Table . . . . . . . . . . . . . . . . . . . . . . 222 Argument Tables for Various Commands . . . . . . . . . . . . . 224 Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Help Text . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Temporary Disk Buffer . . . . . . . . . . . . . . . . . . . . . 231 Field 2 Variables . . . . . . . . . . . . . . . . . . . . . . . 232 Field 2 Cross Field Linkages . . . . . . . . . . . . . . . . . 233 Persistent setting support (NVRAM) . . . . . . . . . . . . . . 234 Extension ROM management . . . . . . . . . . . . . . . . . . . 236 Field 2 Vector Table . . . . . . . . . . . . . . . . . . . . . 238 X / XP Commands -- Disassemble memory . . . . . . . . . . . . . 239 Disassemble Current Trace Location . . . . . . . . . . . . . . 241 Disassembler Top Level . . . . . . . . . . . . . . . . . . . . 242 Disassemble EA For MRIs . . . . . . . . . . . . . . . . . . . . 244 Disassemble OPR and IOT instructions . . . . . . . . . . . . . 246 Disassembler Tables (MRIs) . . . . . . . . . . . . . . . . . . 247 Disassembler Tables (IOTs) . . . . . . . . . . . . . . . . . . 248 Disassembler Tables (OPRs) . . . . . . . . . . . . . . . . . . 253 Disassembler Messages . . . . . . . . . . . . . . . . . . . . . 256 Free Space for Future Expansion! . . . . . . . . . . . . . . . 257 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 Symbol Table . . . . . . . . . . . . . . . . . . . . . . . . . . 264