How to use the AMICO 2000
A keypad, six red digits, and 6502 machine code. The monitor is the small built-in program that lets you inspect memory, enter bytes, and start your own programs.
Getting started
The emulator starts running automatically with the monitor ROM already installed. You do not need to load a file to use it. Click or tap the board's keys, or use the keyboard shortcuts below.
On a phone or a tablet held upright the board is too wide to use as drawn, so the page brings its displays, lamps, NOR/SS switch and keys together in one column at the top, with keys sized for a finger, and shows a picture of the whole board beneath them. Everything works the same way. Turn it sideways to use the board as drawn.
The four digits on the left normally show an address; the two on the
right show the byte at that address. Everything is hexadecimal:
digits 0-9 and A-F. A dollar sign marks a hex
value, so $0200 is an address and $EA is a byte.
- RES (Escape or Backspace) returns to the monitor, even from a stuck program, and keeps RAM.
- HLT (H) stops a running program without resetting it, so that RUN can take it up again. See HLT, interrupts and single step.
- Cold reset clears the emulator's 2 KB of RAM. Use it when you want to start over.
- The bench Stop/Run button pauses or resumes the processor. Leave it running to use the keypad: the monitor must execute to read your keys.
- Step executes one CPU instruction while paused. The Processor state panel shows the CPU's live registers. To step through your own program, use the board's NOR/SS switch instead; see Step through a program.
- Displays: Readable / Authentic changes only how the digits are drawn. Readable, the default, keeps each segment sharp; Authentic adds the glow of a real powered board, which is truer to the machine but harder to read on a screen. The page remembers the choice.
The board's RUN key starts a user program through the monitor. The bench Run button resumes the emulator after a pause. RES and Cold reset do not resume a paused emulator.
Keypad and memory
| Board key | Keyboard shortcut |
|---|---|
| Hex digits | 0-9, A-F |
| AD (address) | Arrow Up |
| DA (data) | Arrow Down |
| Increment (up-arrow legend) | + or = |
| RUN | Enter or G |
| REG (recall the saved program counter) | R |
| HLT (interrupt the processor; see HLT, interrupts and single step) | H |
| RES | Escape or Backspace |
Inspect or change a byte
- Press RES, then AD and four
address digits, for example
0 2 0 0. - Press DA, then two digits to write a byte,
for example
E A(the 6502 NOP instruction). - Press Increment to move to the next address. Enter the next two digits; DA mode remains selected.
- To inspect another location, press AD and its four digits. Increment lets you walk through successive bytes.
Use $0000-$07FF for the board's RAM. ROM locations are
read-only; typing data there cannot modify the monitor.
Enter a small program
At $0200, enter these seven bytes, pressing Increment
between bytes:
A9 42 85 20 4C 22 FE
This program stores $42 at $0020, then jumps
back to the monitor. Select its start with AD
0 2 0 0, then press RUN. Inspect
$0020 with AD to see the result.
To load and run a program without typing it, use the console example below. RES recovers from a program that does not return.
HLT, interrupts and single step
The HLT key does one thing: it interrupts the processor. On the
board it is wired to the 6502's NMI line, the interrupt that
cannot be switched off. What the interrupt then does is up to two
bytes of RAM, $03FC and $03FD, which hold
the address the monitor jumps to when it arrives.
Halt a program and look at it
With those two bytes as the emulator starts them, HLT stops a running program without losing it:
- While the program runs, press HLT. The displays come back on showing the address of the instruction it was about to execute, and the byte there.
- Look around. The registers were saved when it stopped, and you
can read or change them like any other memory:
$00F3accumulator,$00F4Y,$00F5X,$00F6/$00F7program counter,$00FDstatus,$00FEstack pointer. - To carry on, press RUN. If you have moved to another address in the meantime, press REG first, which brings back the address it stopped at.
RES also stops a program, but it resets the processor: the registers are gone and there is nothing to resume. HLT keeps everything.
After HLT the CPU line under Processor state still reads running, and rightly: the processor has not stopped, it has gone back to running the monitor. The word halted on that line means something else, a processor that has met an instruction the emulator does not implement, and has nothing to do with this key.
On the real machine those two bytes hold whatever
the memory powered up with, and the manual has you key them in
yourself before using this: 00 at $03FC
and FE at $03FD, the address of the
monitor's own routine. The emulator starts with them already
there, so HLT works at once. RES leaves them alone; Cold reset
puts them back.
Use HLT in your own program
A program can take the interrupt for itself by storing the address
of its own routine in $03FC/$03FD and ending that
routine with RTI (40). The manual's
example does this. Key it in, then run from $0200:
0200: A9 00 8D FC 03 A9 03 8D FD 03 18 90 FD
0300: A9 88 85 FB 85 FA 85 F9 A9 10 85 00 A9 00 85 01
0310: 20 0C FF C6 01 D0 F9 C6 00 D0 F5 40
The program at $0200 points the interrupt at
$0300 and then goes round in a loop with the displays
dark. Each time you press HLT every digit shows
8 for about sixteen seconds, and then the displays go
dark again. Press RES to stop. Afterwards the two bytes still
point at $0300; key 00 and
FE back, or use Cold reset, to have HLT halt programs
again.
Step through a program
The slide switch above the RES key, marked NOR and SS, is the board's single step. At SS the board raises the same interrupt as HLT by itself, after every instruction of your program, so the program advances one instruction at a time.
- Select the program's first address with AD,
for example
0 2 0 0. - Click the switch across to SS.
- Press RUN. One instruction is executed, and the displays show the address of the next one and the byte there.
- Press RUN again for each further instruction. Calls, returns and branches are followed as they happen.
- At any stop you can read or change the registers, at the addresses listed above. If you have moved to another address, press REG before RUN.
- To let the program run on, click the switch back to NOR and press RUN.
Moving the switch to SS while a program is running stops it there.
The monitor itself is never stepped, so the keypad works as
usual. Single step needs the same two bytes at
$03FC/$03FD as HLT does; a program that has changed
them cannot be stepped until they are put back. An instant
cassette LOAD or SAVE is not stepped either: it is over in one
step.
This is the board's own single step, and it is not the Step button under Bench controls. That one belongs to the emulator: it advances a paused processor by one instruction of whatever is running, the monitor included, which is rarely what you want to watch.
The four LEDs in your own program
The manual gives the LEDs D4 to D7 one job, showing what the
cassette is doing, and you can watch them at it with
the cassette in real time. But
nothing on the board ties them to the cassette. Each one is lit
while two lines of the 8255 are both high: bit 7 of Port B at
$FD01, which all four share, and its own line of
Port A at $FD00, bit 0 for D4 up to bit 3 for D7. A
program of your own can set those lines, whatever the Cassette
setting.
Light them
Key this in at $0200 and run it from there:
0200: A9 89 8D 03 FD A9 0F 8D 00 FD A9 87 8D 01 FD 4C
0210: 0F 02
All four LEDs light and the six displays go dark. Press RES to get the monitor back, which puts them out. What the program does:
A9 89 8D 03 FDmakes Port A an output, with the same word the monitor uses.A9 0F 8D 00 FDputs the pattern on Port A. Its low four bits are the four LEDs.A9 87 8D 01 FDsets bit 7 of Port B. The rest of the87keeps the displays dark: Port A's lines are the displays' segments as well, and this value selects none of the six digits. The cassette's LOAD routine lights the LEDs with the same value.4C 0F 02goes round in a loop.
To light only some, change the pattern, the byte at
$0206: 01 for D4, 02 for
D5, 04 for D6, 08 for D7, added
together for more than one. 0A lights D5 and D7.
Count on them
0200: A9 89 8D 03 FD A9 87 8D 01 FD E6 20 A5 20 29 0F
0210: 8D 00 FD A2 00 A0 00 88 D0 FD CA D0 F8 4C 00 02
Run from $0200, this counts in binary on the four
LEDs, D4 the lowest bit, about three steps a second, keeping its
count at $0020. Press HLT and the
LEDs go out, because the monitor takes the two ports back for the
displays and never sets bit 7; press RUN and the
count carries on from where it stopped.
The manual does not describe this use. It follows from the manual's schematic of the board, and from the cassette routine, which lights the LEDs in the same way. It has not been tried on a real board.
What files can I load?
You do not need to load anything to use the emulator. Both ROMs are built in and fitted when the page opens: the monitor (IC9) and the cassette ROM (IC10). Load a ROM file only to replace one of them, for example with a modified monitor.
Choose Load ROM or tape on the home page. The picker
offers .bin, .rom, .ic9,
.ic10, .amtape, and .wav files.
ROM and program files are raw binary bytes, without
a header or an embedded load address. A text file containing
A9 42, an assembly listing, or an Intel HEX file must
be converted to raw binary first. Renaming it does not convert it.
| File | How the loader handles it |
|---|---|
.wav | Reads it as a sound recording of an AMICO 2000 cassette and imports every program it finds, for a later LOAD. It does not immediately copy a program into RAM. See Tapes as sound. |
.amtape | Imports an emulator cassette record for a later LOAD. It does not immediately copy the program into RAM. |
Name contains ic9 or monitor |
Replaces the monitor ROM at $FE00, then cold resets.
A complete image is 512 bytes; larger files are rejected. |
Name contains ic10 or cassette |
Replaces the cassette ROM in the IC10 socket at
$FB00-$FCFF, then cold resets. The file is a PROM dump in chip order, so its
first 256 bytes appear at $FC00 and its last 256 at
$FB00. A complete image is 512 bytes; larger files
are rejected. |
| Any other 512-byte file | Replaces the monitor ROM with it,
then cold resets, even if the extension is .bin. |
| Other raw binary files | Copies bytes to $0000
without resetting or starting the program. Select its entry address
and use RUN afterwards. |
Names are matched without regard to case, in the order above.
A name containing tape is also treated as a tape image
before any ROM or size checks, unless it ends in .wav. Use names such as
prom.ic9, prom.ic10, or program.bin
to avoid accidental classification. Short ROM files are accepted as
partial writes, so use a complete 512-byte dump to replace a PROM.
Loading either ROM clears RAM. For a raw program requiring another load address, or a 512-byte program that would be mistaken for a ROM, use the console method below.
Load and run at a chosen address (console)
Open your browser's developer console. This example loads and runs the
seven-byte program above at $0200:
amico.stop();
amico.res();
amico.loadProgram(new Uint8Array([0xA9, 0x42, 0x85, 0x20, 0x4C, 0x22, 0xFE]), 0x0200);
amico.cpu.PC = 0x0200;
amico.start();
Wait for the emulator to run and return to the monitor, then paste this as a separate console command to inspect the result:
debug.mem(0x0020, 1);
Expect 42. For your own program, substitute its bytes, load address,
and entry address. Do not cold reset between loading and running.
Cassette LOAD and SAVE
An .amtape is the emulator's binary cassette format,
containing a program identifier, recorded address range, program bytes,
and checksum. It is produced by this emulator; it is not a sound
recording or a raw ROM dump. A sound recording of a tape is a
.wav file, and the emulator reads and writes those too:
see Tapes as sound.
The cassette PROM is fitted when the page opens, so $FBBC
and $FC54 hold the original routines, as on a board built
with the cassette interface. How they run is your choice, with the
Cassette buttons under Bench controls:
- Instant, the default: when you RUN from either address the emulator steps in and does the routine's job at once, reading or writing its own store of programs.
- Real time: the original routines run, on an emulated recorder, and take as long as the real machine did. See The cassette in real time.
Either way the programs are the same ones, and control returns to the monitor afterwards. The steps below describe Instant.
LOAD an imported tape
- Choose the
.amtapefile, or a.wavrecording, with Load ROM or tape. Its identifier and recorded addresses are logged in the browser console. - Enter its identifier at
$0000. For the recorded load address, put00at$0001andFFat$0002. To relocate instead, put the desired address's low byte at$0001and high byte at$0002. - Select
$FC54with AD and RUN to perform LOAD. This loads bytes; start the program separately at its entry address.
For example, to LOAD tape identifier 01 at its recorded
address through the console:
amico.stop();
amico.res();
amico.writeMemory(0x0000, 0x01);
amico.writeMemory(0x0001, 0x00);
amico.writeMemory(0x0002, 0xFF);
amico.cpu.PC = 0xFC54;
amico.start();
A missing identifier or a destination overlapping ROM causes LOAD to
fail with FF at $0000, and the line beside the
Cassette buttons says why. A LOAD that works leaves $0000-$0002
as you keyed them and says where the program went. Inspect the
destination bytes before starting the program.
SAVE and download a tape
Enter the start address's low/high bytes at $0000/$0001,
the inclusive end address's low/high bytes at $0002/$0003,
and the identifier at $0004. For $0200-$0206
with identifier 01, these five bytes are
00 02 06 02 01.
RUN from $FBBC to SAVE. Once back in the monitor, execute
debug.saveTape() in the browser console to download an
.amtape file. SAVE alone keeps the record only in the
current page session; download it before closing or reloading the page.
SAVE leaves the addresses and the identifier at
$0000-$0004 as you keyed them, as the real routine
does, so you can change the program and SAVE it again without
keying them a second time.
An end address before the start address, or the whole
$0000-$FFFF range, which is more than a tape image can
hold, is not saved. The real routine has no way to say so and
neither has this one: it returns to the monitor with nothing
changed. The line beside the Cassette buttons, and the browser
console, say that nothing was saved and why.
To save the example program through the console, after loading it at
$0200:
amico.stop();
amico.res();
amico.writeMemory(0x0000, 0x00);
amico.writeMemory(0x0001, 0x02);
amico.writeMemory(0x0002, 0x06);
amico.writeMemory(0x0003, 0x02);
amico.writeMemory(0x0004, 0x01);
amico.cpu.PC = 0xFBBC;
amico.start();
Then run debug.saveTape() to download the result.
The cassette in real time
Set Cassette to Real time and LOAD and SAVE are the board's own routines, working on a tape. You key the same parameters and RUN from the same addresses. What follows is what the manual describes:
- The six displays go dark, because the routine does not refresh them, and the keypad does nothing: the monitor is not there to read it. RES abandons the routine. HLT interrupts it like any other program and brings the monitor back, but the tape goes on running until you press RES.
- The four LEDs at the top of the board show the phase. During SAVE, D6 (recording) is lit throughout, with D4 (leader) for six seconds, then D5 (text) while the program goes out, then D4 again. During LOAD it is D7 (reading), dimmer, with D4 and then D5.
- It takes time. A SAVE is about thirteen seconds for a short program, plus a second for every 41 bytes. A LOAD of the first program on the tape is quicker, about seven seconds plus the same second for every 41 bytes: it is over once the program itself has been read, and does not wait for the closing leader. LOAD always starts from the beginning of the tape and passes over every program before the one you asked for, each in its own full time.
- A line beside the Cassette buttons says what the recorder is doing. The emulator presses its keys for you: it plays when LOAD starts, records when SAVE starts, and stops when the routine hands back to the monitor.
The tape holds the programs the emulator has: everything saved or imported in this page session, in that order.
The real routines behave a little differently from the instant ones:
- LOAD for a program that is not on the tape never gives up. It waits for more tape, as the real machine does, and the status line says End of tape. Press RES.
- The only error status is
FFat$0000after a LOAD whose checksum did not match. - A LOAD aimed at a ROM stores what RAM will take and loses the rest, with no error. The instant LOAD refuses it.
- A block one byte longer than a whole number of 256-byte pages
loses its last byte; see the end of this section. A SAVE of
the whole
$0000-$FFFFrange saves only its first 256 bytes.
In everything else the two agree, including what they leave at
$0000-$0004.
RES during a SAVE abandons it: nothing is put on the tape.
Tapes as sound
The real machine kept programs on audio cassettes. The emulator can read a recording of such a cassette, and write a program out as the sound the board would have sent to the recorder.
To read a recording, choose the .wav
file with Load ROM or tape. Every program found in
it is imported, and the message lists each one's identifier,
addresses and where in the recording it starts. Then LOAD the one
you want as above. A program whose checksum does not match, or
whose recording breaks off, is listed as not read; the others are
still imported.
The file must be an uncompressed WAV, of any usual sample rate from 11 kHz up, mono or stereo, and no larger than 64 MB. Convert an MP3 or FLAC first, cut a long recording into pieces, and leave noise reduction and other processing off. Include the steady ticking before each program: that is the leader, which the reader needs.
To write one, SAVE the program as above and then run
debug.saveTapeAudio() in the browser console. It
downloads a .wav file about thirteen seconds long plus
a second for every 41 bytes. debug.saveTapeAudio(0x13)
picks a program by its identifier.
The sound format was worked out from the cassette ROM and the circuit diagram, and checked against the ROM's own routines running in the emulator. It has not yet been tried on a recording of a real tape, or played to a real AMICO 2000.
One oddity comes with the format. The board's own routines do not
record the last byte of a block that is one byte longer than a
whole number of 256-byte pages, such as $0200-$0300.
A sound file made here behaves the same way, so that it is what
the board would have written, and so does a SAVE with Cassette set
to Real time. An instant SAVE and an .amtape file
keep every byte.
If something goes wrong
- Keys do nothing: resume with the bench Run button, then press RES. On a narrow screen, scroll the board sideways to reach all keys.
- A program is stuck: press RES, or HLT to stop it and see where it was. If the monitor still fails, Cold reset restores its RAM setup and clears your program.
- HLT does nothing useful, or crashes: a program
has changed the two bytes at
$03FC/$03FDthat say where the interrupt goes. Press RES, then key00andFEback into them, or use Cold reset. - The displays went dark: a program is running that does not refresh them. The monitor lights the digits by scanning them many times a second; once your program has control, they stay dark unless it does the same, exactly as on the real board. The CPU line under Processor state still says running. Press RES to return to the monitor, or HLT to stop the program where it is.
- A file does not load: read the error alert and check
its name, byte count, and format. A 512-byte program uses the ROM
fallback; a renamed audio or text file is not a binary tape or ROM.
A sound recording must be an uncompressed
.wav. - Need to inspect memory: in the browser console, use
debug.mem(0x0200, 16)ordebug.state(). - Work disappeared after a reload: RAM and imported tapes are held in this page session. Save and download a tape to keep a program.