Driver:INTELLEC 4

From MAMEDEV Wiki

INTELLEC® 4/MOD 40

The INTELLEC 4/40 is an Intel MCS-40 (4004/4040) development system with interactive debugging features. MAME provides built-in artwork showing the state of front panel LEDs and switches. All switches are clickable. Due to the large number of switches and potential clashes with keys used for typing monitor commands into the terminal, most switches don't have keys assigned by default. However, a few switches do have default keyboard mappings.

Front Panel Controls

Emulated front panel

The front panel controls can be used for a number of debugging tasks, including stopping the CPU and stepping one instruction at a time, checking whether conditional branches are taken, and editing program storage RAM.

LEDs

  • STATUS LEDs:
    • SEARCH COMPLETE indicates that the selected address has been accessed the desired number of times and the display is frozen
    • RUN indicates that the CPU is running (i.e. not currently acknowledging stop/halt condition)
    • POINTER VALID indicates that a SRC instruction has been detected since the last time search mode was entered and the LAST RAM/ROM POINTER LEDs are valid
  • MODE LEDs: indicates the currently selected program storage - MONitor ROM, console RAM card, or PROM card
  • ADDRESS LEDs: show the opcode address accessed by the CPU, or the selected address in CMA mode
  • INSTRUCTION LEDs: show the opcode accessed by the CPU, or data at the selected address in CMA mode
  • EXECUTION LEDs: show the data on the bus during the X2 and X3 instruction phases (X2 is the value read/written for I/O instructions)
  • ACTIVE BANK LEDs: show the state of the CM-RAM chip select signals during the A3 instruction phase
  • LAST RAM/ROM POINTER LEDs: shows the address output by the most recent SRC instruction

Switches

  • ADDRESS/DATA switches: used for entering search addresses, or RAM addresses/data in CMA mode
    • All toggle switches, most significant bit on the left
    • All switches used for addresses, rightmost eight switches used for data (7-0)
  • MODE CONTROL switches: used to switch program storage and reset the system
    • All momentary switches, mapped to keypad 1, 2 and 3 by default
  • PASS COUNTER switches: used to set the number of times the selected address should be passed over before freezing the display in search mode
    • All toggle switches, most significant bit on the left
  • SEARCH ADDRESS CONTROL switches: used to select an address for search mode or CMA mode, and to control search mode features
    • RUN and NEXT INST are toggle switches
    • DECR, INCR and LOAD are momentary switches, mapped to keypad minus, plus and enter, respectively
  • STOP and SINGLE STEP switches: used to stop the CPU and step the program one instruction at a time
    • STOP is a toggle switch, mapped to keyboard left arrow by default
    • SINGLE STEP is a momentary switch, mapped to keyboard right arrow by default
  • CMA switches: used to examine/modify the content of console RAM
    • CMA ENABLE/DISABLE is a toggle switch
    • CMA WRITE is a momentary switch, mapped to keypad slash by default
  • RESET CONTROL switches: used to reset the system, and choose whether 4002 RAM memory/status is cleared on reset
    • RESET is a momentary switch, and MODE is a momentary switch

Reset Control

The RESET MODE toggle switch controls whether 4002 RAM chips are cleared (filled with zero) when the CPU (4040) and memory controller (4289) are reset. When set to CPU, only the CPU and memory controller are reset; when set to SYSTEM, the CPU and memory controller are reset, and 4002 RAM memory/status is filled with zero. This affects the front panel RESET and MODE CONTROL switches, and also the user reset line from universal cards.

When pressed, the momentary RESET switch resets the CPU and memory controller, and also cleared 4002 RAM memory/status if the RESET MODE switch is set to SYSTEM. This switch generates a pulse when pressed, holding it on will not hold the system in RESET state. This switch will not generate a reset pulse if you're holding any of the MODE CONTROL switches on, or a universal card is asserting the user reset line.

Note that the RESET switch, the MODE CONTROL switches and the user reset line from universal cards don't affect the contents of the console RAM card. Programs/data stored in the console RAM card are preserved when the CPU is reset or 4002 RAM is cleared.

Program Storage Mode Selection

The INTELLEC 4/40 has three 4KiB program storage spaces: onboard monitor PROM, 4KiB console RAM card, and PROM space. The onboard monitor PROM uses 1KiB of its 4KiB space. It's possible to install universal cards that place code in the other 3KiB, but it's practically useless because the monitor provides no way to read or jump to such code. There's nothing in the PROM space by default, but universal cards can map code here.

Pressing any of the three MODE CONTROL switches, MON, RAM or PROM, selects the respective program storage space and resets the CPU (4040) and memory controller (4289). If the RESET CONTROL MODE switch is set to SYSTEM, the 4002 RAM chips will also be cleared (filled with zero). Execution will start from address zero in the selected storage space. The front panel search/capture state is also reset, and universal cards may respond to the CPU reset signal.

The MODE CONTROL switches are all momentary, and are mapped to keypad 1 (MON), keypad 2 (RAM) and keypad 3 (PROM) by default. Pressing two MODE CONTROL switches at once will result in no program storage being mapped (the CPU will execute from unmapped reads). The switches generate a reset pulse when pressed, holding them won't hold the system in reset state. The MODE CONTROL switches won't reset the system if you're holding the RESET switch on or a universal card is asserting the user reset line.

Front Panel Debugging

Stop/Run/Single Step/Halt

Turning the STOP switch on stops the CPU, and turning it off allows the CPU to run. While the STOP switch is on, pressing the SINGLE STEP switch allows the CPU to run for a single instruction and then stops it again, allowing you to step the program one instruction at a time. By default, the STOP button is mapped to the keyboard left arrow, and the SINGLE STEP switch is mapped to the keyboard right arrow. The STOP toggles, and the SINGLE STEP switch is momentary.

If the running program stops the CPU with a HLT instruction, you can resume it from the front panel by turning the STOP switch on and then off again. Universal cards can also stop the CPU, there is no way to override this from the front panel. The RUN LED will be turned off for stop/halt conditions caused by the STOP switch, universal cards requesting stop, or the HLT instruction.

If the front panel display is not frozen and CMA mode is not selected (SEARCH COMPLETE LED off and CMA switch set to DISABLE), the ADDRESS LEDs will show the address of the next instruction to be executed, and the INSTRUCTION LEDs will show the opcode (M1 = OPR, M2 = OPA). Note that this is the next instruction that will be executed after the the CPU resumes, not the last instruction executed before the CPU stopped.

Search Mode

Search mode allows you to capture certain information when the CPU executes a selected address. This can be used to show a value read from or written to memory or I/O, show whether a conditional branch is taken, or simply to determine whether a certain address is being executed or not.

To use search mode:

  • Ensure the RUN toggle switch is off (down) and the CMA toggle switch is set to DISABLE.
  • Enter the capture address in binary using the twelve ADDRESS/DATA toggle switches, most significant bit on the left (up = 1, down = 0).
  • Enter the number of times to pass over the address before capturing and freezing the display in binary using the PASSES switches, most significant bit on the left (up = 1, down = 0). For example, if you enter 6 using the passes switches (3 off, 2 on, 1 on, 0 off), the front panel indicators will be frozen when the 7th time the selected address is executed.
  • Turn the NEXT INST toggle switch off (down) to capture the instruction cycle when the selected address is executed, or on (up) to capture the instruction cycle immediately after the selected address is executed.
  • Press the momentary LOAD switch (mapped to keypad enter by default) to load the selected address and start the search.
  • While the search is in progress:
    • SEARCH COMPLETE LED will be off
    • ADDRESS, INSTRUCTION, ACTIVE BANK and EXECUTION LEDs will update on each instruction cycle
    • LAST RAM/ROM POINTER LEDs will update each time a SRC instruction is executed
    • POINTER VALID will initially be off, and will be lit the first time a SRC instruction is executed after the search is started
  • When the search completes:
    • SEARCH COMPLETE LED will be on
    • ADDRESS LEDs will show the ROM address accessed when state was captured
    • INSTRUCTION, ACTIVE BANK, EXECUTION, LAST RAM/ROM POINTER and POINTER VALID will show the state when this address was executed

Search mode is disabled when the RUN switch is on or the CMA switch is set to ENABLE. The search will be restarted any time you change the selected address using the DECR, INCR or LOAD switches, or any time the CPU is reset using the MODE CONTROL or RESET switches, or when a universal card asserts the user reset line.

Example: showing value read/written

Search mode can show the value read from/written to RAM or I/O by an I/O group instruction (OPR = 0xE, or RPM instruction).

  • Enter the address of an I/O instruction using the ADDRESS/DATA switches.
    • For example in the monitor PROM, the RDR instruction that reads the high nybble when examining console RAM is at address 0x183
  • Enter the number of times to pass over the instruction using the PASSES switches, or turn them all off to capture the first time the instruction is executed.
  • Turn the NEXT INSTRUCTION switch off.
  • Press the LOAD switch to load the address and start the search.
  • Do whatever it is that causes the CPU to execute the selected instruction the required number of times.
    • For example the monitor program will read program memory when you use the D and S commands
  • The search will complete, showing the following information:
    • SEARCH COMPLETE LED on
    • ADDRESS LEDs showing the selected address
    • INSTRUCTION LEDs showing the OPR/OPA codes for the I/O instruction
    • EXECUTION X2 LEDs showing the 4-bit value read/written

Example: showing location/value of indirect fetch

Search mode can show the ROM location accessed by a FIN (fetch indirect) instruction, and the value read.

  • Enter the address of a FIN instruction using the ADDRESS/DATA switches.
  • Enter the number of times to pass over the instruction using the PASSES switches, or turn them all off to capture the first time the instruction is executed.
  • Turn the NEXT INSTRUCTION switch on.
  • Press the LOAD switch to load the address and start the search.
  • Do whatever it is that causes the CPU to execute the selected instruction the required number of times.
  • The search will complete, showing the following information:
    • SEARCH COMPLETE LED on
    • ADDRESS LEDs showing the ROM address the FIN instruction loaded data from (contents of R0R1 pair when FIN was executed)
    • INSTRUCTION LEDs showing the byte value loaded by the FIN instruction

Example: showing whether a conditional branch is taken

Search mode can show whether a conditional branch is taken or falls through by showing the address/opcode of the instruction executed immediately after the condition branch (JCN or ISZ) instruction.

  • Enter the address of the second byte of a conditional branch (JCN or ISZ) instruction using the ADDRESS/DATA switches.
    • For example in the monitor PROM's routine for printing a nybble as a hexadecimal digit, there is a JCN that is taken if the value is less than 0xA at location 0x0CF; to capture the result of this branch, enter the address 0x0D0 (address of the second byte of the instruction)
  • Enter the number of times to pass over the instruction using the PASSES switches, or turn them all off to capture the first time the instruction is executed.
  • Turn the NEXT INSTRUCTION switch on.
  • Press the LOAD switch to load the address and start the search.
  • Do whatever it is that causes the CPU to execute the selected instruction the required number of times.
    • For example the monitor program prints hexadecimal data when you use the D and S commands
  • The search will complete, showing the following information:
    • SEARCH COMPLETE LED on
    • ADDRESS LEDs showing the location of the next instruction executed
      • With the monitor PROM example given, this will be 0x0D1 if the value is 0xA or greater (fell through), or 0x0D3 if the value is 0x9 or less (branched)
    • INSTRUCTION LEDs showing the OPR/OPA codes of the next instruction executed
      • With the monitor PROM example given, this will be 6/2 if the value is 0xA or greater (fell through), or B/3 if the value is 0x9 or less (branched)

Console Memory Access (CMA) Mode

Console Memory Access (CMA) mode allows you to examine/edit the 4KiB of program storage on the console RAM card using the front panel switches. To use CMA mode, flip the CMA switch to ENABLE (this is a toggle switch). In CMA mode, the ADDRESS LEDs always show the currently selected address, and the INSTRUCTION LEDs show the current data at the selected address in RAM.

To set the selected address, enter it in binary on the twelve ADDRESS/DATA switches (most significant bit on the left, up = 1, down = 0), and press the LOAD switch (mapped to keypad enter by default). You can also decrement or increment the selected address by one with the DECR and INCR switches (mapped to keypad minus and keypad plus by default, respectively). The ADDRESS/DATA switches are all toggles, while the DECR, INCR and LOAD switches are momentary.

To change a value in RAM, first ensure CMA mode is enabled and the desired address has been selected. Enter the desired value on ADDRESS/DATA switches 7-0 (the eight rightmost ADDRESS/DATA switches, up = 1, down = 0), and press the CMA WRITE switch (momentary, mapped to keypad slash by default). The INSTRUCTION LEDs will update to reflect the new value.

The Monitor PROM

The INTELLEC 4/40 has a simple monitor program in onboard PROM. The monitor program is designed to to be used with a full duplex, 10 CPS, 110 Baud, ASCII teleprinter with 20mA current loop interface, like a Teletype Corporation Model 33 KSR or ASR. An output is provided for enabling the teleprinter's paper tape reader if present (e.g. on a Model 33 ASR). MAME exposes the teleprinter interface as a virtual RS-232 port (tty slot). The TxD and RxD lines are connected as you'd expect, and the output to enable the paper tape reader is connected to the RTS line; no other control lines are connected. RTS will only be asserted when the monitor wants to load data from paper tape, not when it's ready to accept command input. By default, an emulated video terminal is connected to the virtual RS-232 port, but you can connect it to other emulated peripherals, like the null_modem device that can be pass data through to a network socket on the host system.

To use the monitor, ensure local echo and auto LF on CR are off, transmit and receive rates are set to 110 Baud, and framing is set to 1 start bit, 8 data bits, no parity, and 2 stop bits (you can change serial settings for emulated serial peripherals in the Machine Configuration menu). The monitor handles serial communication in software (no hardware UART), so you can get errors if you type too fast for it to handle the characters. Flow control is only used when loading data from paper tape, not when accepting commands.

The monitor only accepts English uppercase letters A-Z, digits 0-9, comma and carriage return (CR, ASCII 0x0D, the return or enter key). Backspace is not supported and there are no line editing or command history features (line editing would be impractical on a teleprinter). The prompt is a single full stop/period ('.', ASCII 0x1E) on a line. On receiving an unexpected or invalid character, the monitor will print an asterisk, followed by a CRLF newline sequence (ASCII 0x2A, 0x0D, 0x0A) and the prompt, ready to accept a new command. This will happen as soon as the unexpected/invalid character is received and echoed, it won't wait for you to type a carriage return.

Not all monitor commands are described here, just some of the more interesting ones

Command D: Dump Human-readable Hex

The D command dumps data from the console RAM card in hexadecimal format. It takes the start and end address to dump in hexadecimal format as comma-separated arguments (one to three digits each). If the second argument is lower than the first argument, a single byte is dumped. If either argument is empty, it is treated as zero (the comma is always required). New lines are started on 16-byte boundaries.

.DA,17
00A A4 FD 23 71 0D 70
010 0D 73 0C 72 0C 64 40 0A
.D,9
000 F0 B0 F0 B1 F0 B2 F0 B3 F0 B4
.DB,
00B FD
.D,
000 F0

Command S: Show/Edit Byte

The S command shows a byte in console RAM card memory, and allows you to change its value. It takes the address of the byte as an argument in hexadecimal format (one to three digits). If the argument is empty, it is treated as zero. The current value of the byte is printed followed by a hyphen. To leave it as-is, type a CR (return/enter); to change it, type the desired value as two uppercase hexadecimal digits followed by a CR.

.S00A
C4-A4
.SA
C4-
.S0
F0-
.S
F0-

Entering and Running a Program

In this example, we'll enter a 19-instruction (24-byte) program into the console RAM card using the front panel switches, and run it. The program will count (in binary) on the LAST RAM/ROM POINTER LEDS and animate the ACTIVE BANK LEDs.

The Program

This is the program we want to enter (columns are address, assembled code, instruction, operands, and comment):

000     F0      clb             # clear R0/R1/R2/R3/R4
001     B0      xch r0
002     F0      clb
003     B1      xch r1
004     F0      clb
005     B2      xch r2
006     F0      clb
007     B3      xch r3
008     F0      clb
009     B4      xch r4
00A     A4      ld  r4          # set RAM bank to low three bits of R4
00B     FD      dcl
00C     23      src r2r3        # set pointer to value of R2R3
00D     71 0D   isz r1,000Dh    # count to 256 in R0R1 to waste time
00F     70 0D   isz r0,000Dh
011     73 0C   isz r3,000Ch    # increment address in R2R3 and...
013     72 0C   isz r2,000Ch    # ...jump back to SRC if no overflow
015     64      inc r4          # increment RAM bank in R3
016     40 0A   jun 000Ah       # jump back to setting RAM bank 

Entering the Program

We'll enter the program using the front panel switches. Note that this is a pretty inefficient way of entering code (in practice you'd load assembler output from paper tape). These instructions describe how to enter the code linearly, from first to last byte. You can do it with fewer switch toggles by relying on the similarity between some bytes (e.g. the ISZ instructions) and going back/forward by more than one byte at a time. You can also enter the code in the monitor using the S command, but that isn't very efficient, either.

  • Ensure the monitor PROM is selected (MON LED on). If it isn't, press the MON switch to select it.
  • Set the CMA switch to ENABLE, turn all ADDRESS/DATA switched off (down), and press the LOAD switch to select address 0x000. Check that the ADDRESS LEDs are all off, indicating that the address has been selected correctly.
  • Enter 0xF0 (0b11110000) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x000. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x001. Check that the ADDRESS LEDs show 0x001 (0b000000000001).
  • Enter 0xB0 (0b10110000) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x001. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x002. Check that the ADDRESS LEDs show 0x002 (0b000000000010).
  • Enter 0xF0 (0b11110000) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x002. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x003. Check that the ADDRESS LEDs show 0x003 (0b000000000011).
  • Enter 0xB1 (0b10110001) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x003. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x004. Check that the ADDRESS LEDs show 0x004 (0b000000000100).
  • Enter 0xF0 (0b11110000) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x004. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x005. Check that the ADDRESS LEDs show 0x005 (0b000000000101).
  • Enter 0xB2 (0b10110010) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x005. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x006. Check that the ADDRESS LEDs show 0x006 (0b000000000110).
  • Enter 0xF0 (0b11110000) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x006. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x007. Check that the ADDRESS LEDs show 0x007 (0b000000000111).
  • Enter 0xB3 (0b10110011) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x007. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x008. Check that the ADDRESS LEDs show 0x008 (0b000000001000).
  • Enter 0xF0 (0b11110000) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x008. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x009. Check that the ADDRESS LEDs show 0x009 (0b000000001001).
  • Enter 0xB4 (0b10110100) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x009. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x00a. Check that the ADDRESS LEDs show 0x00A (0b000000001010).
  • Enter 0xA4 (0b10100100) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x00A. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x00b. Check that the ADDRESS LEDs show 0x00B (0b000000001011).
  • Enter 0xFD (0b11111101) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x00B. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x00c. Check that the ADDRESS LEDs show 0x00C (0b000000001100).
  • Enter 0x23 (0b00100011) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x00C. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x00d. Check that the ADDRESS LEDs show 0x00D (0b000000001101).
  • Enter 0x71 (0b01110001) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x00D. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x00e. Check that the ADDRESS LEDs show 0x00E (0b000000001110).
  • Enter 0x0D (0b00001101) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x00E. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x00f. Check that the ADDRESS LEDs show 0x00F (0b000000001111).
  • Enter 0x70 (0b01110000) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x00F. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x010. Check that the ADDRESS LEDs show 0x010 (0b000000010000).
  • Enter 0x0D (0b00001101) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x010. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x011. Check that the ADDRESS LEDs show 0x011 (0b000000010001).
  • Enter 0x73 (0b01110011) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x011. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x012. Check that the ADDRESS LEDs show 0x012 (0b000000010010).
  • Enter 0x0C (0b00001100) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x012. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x013. Check that the ADDRESS LEDs show 0x013 (0b000000010011).
  • Enter 0x72 (0b01110010) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x013. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x014. Check that the ADDRESS LEDs show 0x014 (0b000000010100).
  • Enter 0x0C (0b00001100) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x014. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x015. Check that the ADDRESS LEDs show 0x015 (0b000000010101).
  • Enter 0x64 (0b01100100) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x015. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x016. Check that the ADDRESS LEDs show 0x016 (0b000000010110).
  • Enter 0x40 (0b01000000) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x016. Check that the INSTRUCTION LEDs show the new value correctly.
  • Press the INCR switch to advance the selected address to 0x017. Check that the ADDRESS LEDs show 0x017 (0b000000010111).
  • Enter 0x0A (0b00001010) on ADDRESS/DATA switches 7-0 and press the CMA WRITE switch to write it to location 0x017. Check that the INSTRUCTION LEDs show the new value correctly.

Checking the Program

It's easy to make a mistake while entering a program on the front panel, so it's a good idea to check it. You can use the D (hex dump) command in the monitor to check that you've entered the program properly.

  • Ensure monitor PROM is selected (MON LED lit). If it isn't, press the MON switch to select it.
  • Ensure the CPU is not stopped (RUN LED lit). If it isn't, turn off the STOP switch.
  • Check that you can see the monitor's dot prompt on the terminal ('.' followed by the cursor). If you don't see the prompt, enter a character the monitor doesn't expect to (e.g. any lowercase letter) to get back to the prompt.
  • Enter the command "D0,17" (without the quotes, using an uppercase D) followed by return/enter.
  • Check that the output matches the assembled code from the listing above.
  • If there are any errors, correct them:
    • Ensure CMA switch is still set to ENABLE
    • Enter address of incorrect byte using ADDRESS/DATA switches and press LOAD switch to select it. Check that ADDRESS LEDs show desired address and INSTRUCTION LEDs show incorrect value.
    • Enter correct value using ADDRESS/DATA switches 7-0 and press CMA WRITE switch to write to memory. Check that INSTRUCTION LEDs show correct value.

The dump command and output should look like this:

.D0,17
000 F0 B0 F0 B1 F0 B2 F0 B3 F0 B4 A4 FD 23 71 0D 70
010 0D 73 0C 72 0C 64 40 0A

You can also check that the program has been entered correctly using the MAME debugger, but that's cheating as you wouldn't have that in real life. The console RAM card content appears in Address Map Bank ':prgbank' program space memory addresses 0x1000-0x1FFF. You can view it in a memory window.

Running the Program

  • Ensure the STOP switch is off (down), set the CMA switch to DISABLE, turn the RUN switch on (up), and turn all the PASSES switches off (down)
  • Press the RAM switch to switch program storage to console RAM and run from address 0x000.
  • Watch the LEDs count/animate. You can also stop and single step the program, or use search mode to capture state.
  • If it doesn't work, switch back to the monitor (press the MON switch), check the program again, and correct any errors.

If you have the MAME debugger enabled, you can also observe the disassembly and register contents as the program executes.