Intel INTELLEC® 4

The INTELLEC 4 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.

There are three variants of the system: the original INTELLEC 4 with a 4004/4008/4009 chipset, the INTELLEC 4/MOD 40 with a 4040/4289 chipset and stop/single step features, and the INTELLEC 4/MOD 4 with a 4004 CPU and the control board from the MOD 40 jumpered to provide test line control rather than stop/single step features. MAME emulates the MOD 4 and MOD 40 variant as the intlc44 and intlc440 drivers, respectively.

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
    • CPU (MOD 4 only) indicates that clock phase 2 is active (power on and clock generator isn't dead)
    • RUN (MOD 40 only) 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, up = 1
    • 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
  • PRGM PROM PWR switch: must be set to ON to allow the built-in PROM programmer to apply programming voltage
    • Toggle switch
  • 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, up = 1
  • 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
  • HOLD and ONE SHOT switches (MOD 4 only): used to control the CPU's TEST input
    • HOLD is a toggle switch, mapped to keyboard left arrow by default
    • ONE SHOT is a momentary switch, mapped to keyboard right arrow by default
  • STOP and SINGLE STEP switches (MOD 40 only): 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 the imm6-26 PROM Memory Module can place code/data here (imm6_26 slot option in MAME allows loading a PROM image up to 4KiB in 256-byte increments).

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

TEST Input Control (MOD 4 only)

Turning the HOLD switch on (up) pulls the CPU's TEST input low (asserted). Pressing the ONE SHOT line pulls the CPU's TEST input low for 35.7 microseconds. The ONE SHOT switch has no observable effect if the HOLD switch is on.

The HOLD switch is a toggle, mapped to keyboard left by default. The ONE SHOT switch is momentary, mapped to keyboard right by default. Note that universal cards can also pull the TEST input low. There is no way to force the TEST input high from the front panel if a card is pulling it low.

Stop/Single Step/Halt (MOD 40 only)

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)

Run Mode

In run mode, the front panel LEDs update as the CPU executes instructions, and the system outputs pulses each time the selected address is accessed. The SEARCH COMPLETE and POINTER VALID LEDs will remain unlit. This is useful for triggering other devices like a logic analyser. MAME doesn't currently expose this output. However, run mode may still be useful if you just don't want the display to freeze.

To use run mode, turn all the PASSES toggle switches off (down), turn the RUN toggle switch on (up), and set the CMA toggle switch to DISABLE. Enter the desired address in binary using the ADDRESS/DATA switches (down = 0, up = 1, most significant bit on the left) and select it by pressing the LOAD switch. You can also decrement or increment the selected address by one by pressing the DECR or INCREMENT switches respectively. The selected address is not displayed in RUN mode. If you want to see the selected address, you can temporarily set the CMA switch to ENABLE to display the selected address on the ADDRESS LEDs.

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 correctly configured 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 0x2E) on a line. On receiving an unexpected or invalid character, the monitor will print an asterisk ('*', ASCII 0x2A), 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. If you make a mistake while typing a monitor command, just type a character that the monitor doesn't accept (backspace, escape, or any lowercase letter will do) without hitting return, and you'll be send back to the prompt.

Command B: Dump BPNF

The B command prints 64 NUL characters (ASCII 0x00), dumps data from the console RAM card in BPNF format (maximum four bytes per line), and then prints another 64 NUL characters. It takes the start address and end address of the bytes to dump in hexadecimal format as comma-separated arguments (one to three digits each). BPNF is an early binary format designed to be relatively resilient. Each byte starts with a B, followed by eight data bits represented as P or N (MSB to LSB) and ends with an F. Bytes are separated by spaces or newline characters. Intel accepted data for making ROM masks (e.g. for 4001 or 4308 ROM chips) on paper tape in BPNF format.

Assuming the teleprinter is equipped with a paper tape punch, the NUL characters feed paper tape through the punch without punching any data, clearly delimiting the memory dump and giving convenient places to cut or tear the paper tape without risk of data loss. Note that MAME's video terminal ignores the NUL characters, so you won't see any output when the NUL characters are printed, you'll just notice it taking time.

.B0,17
BNNNNPPPPF BNPNNPPPPF BNNNNPPPPF BNPNNPPPNF
BNNNNPPPPF BNPNNPPNPF BNNNNPPPPF BNPNNPPNNF
BNNNNPPPPF BNPNNPNPPF BNPNPPNPPF BNNNNNNPNF
BPPNPPPNNF BPNNNPPPNF BPPPPNNPNF BPNNNPPPPF
BPPPPNNPNF BPNNNPPNNF BPPPPNNPPF BPNNNPPNPF
BPPPPNNPPF BPNNPPNPPF BPNPPPPPPF BPPPPNPNPF

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 E: Print Empty Intel HEX Record

The E command prints an empty Intel HEX record consisting of a colon and two zeroes (":00") followed by a CRLF newline sequence and 64 NUL characters (ASCII 0x00). Accepts a single hexadecimal argument, but it isn't used for anything.

This is not a valid Intel HEX record, as it's missing the required address, record type and checksum (a valid end-of-file record with no data would be ":00000001FF" using record type 01). However, given the INTELLEC 4 monitor's simplified understanding of Intel HEX, it's sufficient to make it stop reading. See the section on the R command below.

Assuming the teleprinter is equipped with a paper tape punch, the NUL characters feed paper tape through the punch without punching any data, clearly delimiting the preceding Intel HEX records and giving a convenient place to cut or tear the paper tape without risk of data loss. Note that MAME's video terminal ignores the NUL characters, so you won't see any output when the NUL characters are printed, you'll just notice it taking time.

.E
:00

Command I: Invert

The I command inverts (ones-complements) data in console RAM. It takes the start and end address of the range to invert 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 inverted. If either argument is empty, it is treated as zero (the comma is always required).

.D0,9
000 0F 4F 0F 4E 0F 4D 0F 4C 0F 4B
.I1,8

.D0,9
000 0F B0 F0 B1 F0 B2 F0 B3 F0 4B
.I9,

.D0,9
000 0F B0 F0 B1 F0 B2 F0 B3 F0 B4
.I,

.D0,9
000 F0 B0 F0 B1 F0 B2 F0 B3 F0 B4

Command J: Select High-Speed Paper Tape Reader

The J command selects an optional high-speed paper tape reader as the data source for subsequent L and R commands. Accepts a single hexadecimal argument, but it isn't used for anything. The high-speed paper tape reader is controlled with ROM ports 4 (in/out), 6 (in) and 7 (in).

By default, a compatible 200 CPS imm4-90 High-Speed Paper Tape Reader card is installed in slot j7 (it's the imm4_90 option if you want to install it in a different slot). You can load a paper tape file through the File Manager menu or using the -punchtape (or -ptap) option on the command line.

.J

Command K: Select Teleprinter

The K command selects the teleprinter or its paper tape reader as the data source for subsequent L and R commands. Accepts a single hexadecimal argument, but it isn't used for anything. This is the default after reset. When loading from the teleprinter with the L or R command, the RTS line is asserted when the monitor is ready to accept data. This can be used to enable the teleprinter's paper tape reader motor.

.K

Command L: Load BPNF

The L command loads BPNF format data into console RAM card memory from the selected input device – either the teleprinter or its paper tape reader (default or selected with the K command), or an optional high-speed paper tape reader (selected with the J command). It accepts the start and end addresses of the range to load as comma-separated arguments (one to three hexadecimal digits each). If the second argument is less than the first, a single byte is loaded. If either argument is empty, it is treated as zero (the comma is always required). When loading from the teleprinter, the RTS line is asserted when the monitor is ready to accept data. This may be used to enable the teleprinter's paper tape reader motor.

Any characters before the leading B of the first byte, or between the terminating F of one byte and the leading B of the next byte, are ignored. This allows comments to be included, provided they don't contain capital B (ASCII 0x42). If an unexpected character is encountered within a byte, the monitor will stop accepting data input (either de-assert RTS or stop reading the high-speed paper tape), print an asterisk ('*', ASCII 0x2A) followed by a CRLF line ending, and wait for the next command. The terminating F is not actually checked, so you can substitute any character you like and loading will still succeed.

.D0,1F
000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
.L10,17
BNNPPNPNPF BNNNNNNNPF BNPNNNPNPF BNPNNNNNPF
BNNPNNNNPF BNPNPNNPNF BNPNNNNNPF BNNNPNNNNF
.D0,1F
000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
010 CA FE BA BE DE AD BE EF 00 00 00 00 00 00 00 00
.L,1
BNNNNNNNPF guess BNNNPNNPNF
.D0,1F
000 FE ED 00 00 00 00 00 00 00 00 00 00 00 00 00 00
010 CA FE BA BE DE AD BE EF 00 00 00 00 00 00 00 00
.L8,
BPNNPNPPNF
.D0,1F
000 FE ED 00 00 00 00 00 00 69 00 00 00 00 00 00 00
010 CA FE BA BE DE AD BE EF 00 00 00 00 00 00 00 00
.L12,
BPPPPPPPPX
.D0,1F
000 FE ED 00 00 00 00 00 00 69 00 00 00 00 00 00 00
010 CA FE 00 BE DE AD BE EF 00 00 00 00 00 00 00 00
.L1,
BNNNNNR*
.D0,1F
000 FE ED 00 00 00 00 00 00 69 00 00 00 00 00 00 00
010 CA FE 00 BE DE AD BE EF 00 00 00 00 00 00 00 00

Command M: Copy Memory

The M command copies data from one location to another in console RAM. It takes the start and end address of the source range and the destination as comma-separated arguments (one to three hexadecimal digits each). The data is always copied from beginning to end, so overlapping sources and destinations can be used to fill RAM with a pattern.

.D0,F
000 F0 B0 F0 B1 F0 B2 F0 B3 F0 B4 A4 FD 23 71 0D 70
.D100,10F
100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
.M2,9,104

.D100,10F
100 00 00 00 00 F0 B1 F0 B2 F0 B3 F0 B4 00 00 00 00
.S110
00-FA
.D110,117
110 FA 00 00 00 00 00 00 00
.M110,116,111
110 FA FA FA FA FA FA FA FA
.S110
FA-BA
.S111
FA-BE
.D110,11F
110 BA BE FA FA FA FA FA FA 00 00 00 00 00 00 00 00
.M,110,11E,112

.D110,11F
110 BA BE BA BE BA BE BA BE BA BE BA BE BA BE BA BE
.S110
BA-CA
.S111
BE-FE
.M110,11C,114

.D110,11F
110 CA FE BA BE CA FE BA BE CA FE BA BE CA FE BA BE

Command N: Print 64 NUL Characters

The N command prints 64 NUL characters (ASCII 0x00). It will accept a single hexadecimal argument, but doesn't use it for anything. This command can be used to feed paper tape through the punch without punching anything for 64 rows, clearly delimiting memory dumps and giving a convenient area to cut/tear the tape without damaging data. Note that MAME's video terminal ignores the NUL characters, so you won't see any output.

.N

.N123

Command P: Program PROM

The P command writes data from console RAM card memory to a 1602A or 1702A 256×8 PROM using the built-in programmer. It takes the start and end address of the source data in console RAM and the destination address in PROM as comma-separated arguments (one to three hexadecimal digits each). The monitor will always stop writing at the end of the PROM (location 0xFF), it will not wrap around to the start of the PROM. After writing a byte, the monitor program will read it back and retry the write if it doesn't match. If the byte doesn't match after three attempts, the monitor will print a space (' ', ASCII 0x20) followed by the PROM address (two hexadecimal digits) and an asterisk ('*', ASCII 0x2A).

For programming to work, a PROM image file must be loaded (either with the -prom option on the command line or through the File Manager Menu), the front panel PRGM PROM PWR toggle switch must be set to ON (up), and the rear panel PROM PROGRAMMER DATA OUT ENABLE switch must be on (set in the Machine Configuration menu). If the PRGM PROM PWR switch is off, the PROM contents will not be altered; if the PROM PROGRAMMER DATA OUT ENABLE switch is off, one byte will be written but verification fail. Note that the 1702A is not electrically erasable, so bits can only be set (erasing requires UV exposure). The 1602A is technically UV-erasable, but has an opaque metal lid making it effectively write-only.

In 4004 and 4040 systems, 1702A PROMs are written with negative logic. MAME handles this inversion internally so that PROM image files can be disassembled with conventional tools. The bytes in PROM image files are the inverse (ones-complement) of the PROM output signals. (The same is true of the 1702A PROM images in the intlc44 and intlc440 system ROM sets.)

.D0,7
000 CA FE BA BE DE AD BE EF
.P0,7,0

.P0,7,FC

.P0,7,80

.P4,7,80
 81*
.T100

.D100,1FF
100 CA FE BA BE DE AD BE EF 00 00 00 00 00 00 00 00
110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
180 DE FF BA BE DE AD BE EF 00 00 00 00 00 00 00 00
190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1F0 00 00 00 00 00 00 00 00 00 00 00 00 CA FE BA BE

Command R: Read Intel HEX

The R command reads Intel HEX format data into console RAM card memory from the selected input device – either the teleprinter or its paper tape reader (default or selected with the K command), or an optional high-speed paper tape reader (selected with the J command). It accepts a single hexadecimal argument but it isn't used for anything. When loading from the teleprinter, the RTS line is asserted when the monitor is ready to accept data. This may be used to enable the teleprinter's paper tape reader motor.

The INTELLEC 4 monitor has a somewhat simplified interpretation of Intel HEX. The record type is ignored (all records treated as data), and loading stops on encountering a 00 byte count. On encountering an invalid checksum, the monitor will stop accepting data input (either de-assert RTS or stop reading the high-speed paper tape), print an asterisk ('*', ASCII 0x2A) followed by a CRLF line ending and wait for another command.

Any characters between a checksum byte and the next colon marking the start of a record are completely ignored and may be used for comments.

.D0,1F
000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
.K

.R
Intentional checksum failure
:080010000D730C720C64409A30*
.D0,1F
000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
010 0D 73 0C 72 0C 64 40 9A 00 00 00 00 00 00 00 00
.R
For fun, load higher address first
:080010000D730C720C64400A30
Now fill in the first row
:10000000F0B0F0B1F0B2F0B3F0B4A4FD23710D7014
:00
.D0,1F
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 00 00 00 00 00 00 00 00

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 each). 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-

Command T: Load PROM

The T command loads the entire the PROM 256×8 PROM (1602/1702/1602A/1702A) in the front-panel ZIF socket into console RAM card memory at a specified address. It takes the destination address in hexadecimal format as an argument (one to three digits). If the argument is empty it will load at address zero. The rear panel PROM PROGRAMMER DATA OUT ENABLE switch (set in the Machine Configuration menu) must be on for PROM contents to be loaded; zeroes will be loaded if this switch is off. Zeroes will also be loaded if no PROM image file is loaded.

.D0,FF
000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
010 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
020 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
030 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
040 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
050 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
060 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
070 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
080 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
090 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
.D100,11F
100 F0 B0 F0 B1 21 D0 FD 11 07 D1 FD 19 0B 71 04 60
110 40 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00
.P100,11F,0

.P100,11F,F0

.T80

.D0,FF
000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
010 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
020 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
030 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
040 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
050 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
060 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
070 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
080 F0 B0 F0 B1 21 D0 FD 11 07 D1 FD 19 0B 71 04 60
090 40 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
.T

.D0,FF
000 F0 B0 F0 B1 21 D0 FD 11 07 D1 FD 19 0B 71 04 60
010 40 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00
020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0F0 F0 B0 F0 B1 21 D0 FD 11 07 D1 FD 19 0B 71 04 60

Command W: Write Intel HEX

The W command writes data from the console RAM card in Intel HEX format. It takes the start and end address to dump in hexadecimal format as comma-separated arguments (one to three digits each). A CRLF newline is printed, followed by the data (maximum sixteen bytes per line). Each line of data contains a start code, byte count, address, record type, data, and checksum.

.W0,17

:10000000F0B0F0B1F0B2F0B3F0B4A4FD23710D7014
:080010000D730C720C64400A30
.WA,17
:0E000A00A4FD23710D700D730C720C64400A7E

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 – see the J, K, L and R monitor commands). 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.
  • If you're using the MOD 40, 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 0x2000-0x2FFF. You can view it in a memory window.

Running the Program

  • If you're using the MOD 40, 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 use search mode to capture state.
    • If you're using the MOD 40, you can stop and single step the program, but this can be a bit tedious as most of the time is spent in the time-wasting loop repeating ISZ instructions.
  • 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.

Reading the Test Input

In this example, we'll enter an 14-instruction (18-byte) program that counts pulses on the TEST input, displaying the current (binary) count on the LAST RAM/ROM POINTER LEDs, and showing whether the line currently held low on the ACTIVE BANK LEDs. This program works best with the MOD 4 system (intlc44) as you can control the test line with front panel switches.

The Program

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

000     F0      club             # clear R0/R1
001     B0      xch r0
002     F0      clb
003     B1      xch r1
004     21      src r0r1         # set pointer to value of R0R1
005     D0      ldm 00h          # select RAM bank 0
006     FD      dcl
007     11 07   jcn t,0007h      # wait for test input to go low
009     D1      ldm 01h          # select RAM bank 1
00A     FD      dcl
00B     19 0B   jcn nt,000Bh     # wait for test input to go high again
00D     71 04   isz r1,0004h     # increment R1, loop if no overflow
00F     60      inc r0           # carry to R0
010     40 04   jun 0004h        # loop

Entering and Checking the Program

We'll enter this program using the monitor. If the MON LED isn't lit, press the MON switch to run the monitor. If you can't see the dot prompt, type a lowercase letter and it should appear. If it still doesn't appear, check your serial settings, ensuring it's set to 110 Baud 1/8/N/2. (As an exercise, you may want to prepare the program as a BPNF or Intel HEX file and load it as a paper tape using the J/K/L/R commands rather than entering it interactively one byte at a time.)

Use the S command to enter the program. For each byte in the program, enter S followed by the address of the byte, then press return/enter. The monitor will show the current value at that address. Type the desired byte value followed by carriage return. Remember to use uppercase letters, the monitor doesn't recognise lowercase. If you make a mistake, you can type a lowercase letter or backspace to cancel the current command and get back to the prompt. Remember you need to enter two bytes for the two-byte instructions.

Here's what entering the program looks like assuming console RAM was initially zeroed (this includes output from the monitor as well as what you would type):

.S0
00-F0
.S1
00-B0
.S2
00-F0
.S3
00-B1
.S4
00-21
.S5
00-D0
.S6
00-FD
.S7
00-11
.S8
00-07
.S9
00-D1
.SA
00-FD
.SB
00-19
.SC
00-0B
.SD
00-71
.SE
00-04
.SF
00-60
.S10
00-40
.S11
00-04

Once you've entered the program, use the D command to dump it in hexadecimal format, and check for errors:

.D0,11
000 F0 B0 F0 B1 21 D0 FD 11 07 D1 FD 19 OB 71 04 60
010 40 04

If there are errors, correct them with the S command, or using CMA mode.

Running the Program

Once you're happy that the program has been entered correctly, turn all the PASSES switches off (down), turn the RUN switch on (up), set the CMA switch to DISABLE, and press the RAM switch (if you have the MAME debugger enabled, you can see the program disassembled at this point from address 0x0000).

The CM-RAM 0 LED will be lit when the HOLD switch is off (down), and the CM-RAM 1 LED will be lit when the HOLD switch is on (up). The value displayed by the LAST RAM/ROM POINTER LEDs will increment each time the HOLD switch is turned off or the ONE SHOT switch is pressed while the HOLD switch is off. The ONE SHOT switch won't cause the value to increment when the HOLD switch is ON.

If it doesn't work, switch back to the monitor (press the MON switch), check the program again with the D command, correct any errors, and try again.