Back to the emulator Italiano

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.

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 keyKeyboard shortcut
Hex digits0-9, A-F
AD (address)Arrow Up
DA (data)Arrow Down
Increment (up-arrow legend)+ or =
RUNEnter or G
REG (recall the saved program counter)R
HLT (interrupt the processor; see HLT, interrupts and single step)H
RESEscape or Backspace

Inspect or change a byte

  1. Press RES, then AD and four address digits, for example 0 2 0 0.
  2. Press DA, then two digits to write a byte, for example E A (the 6502 NOP instruction).
  3. Press Increment to move to the next address. Enter the next two digits; DA mode remains selected.
  4. 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:

  1. 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.
  2. Look around. The registers were saved when it stopped, and you can read or change them like any other memory: $00F3 accumulator, $00F4 Y, $00F5 X, $00F6/$00F7 program counter, $00FD status, $00FE stack pointer.
  3. 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.

  1. Select the program's first address with AD, for example 0 2 0 0.
  2. Click the switch across to SS.
  3. Press RUN. One instruction is executed, and the displays show the address of the next one and the byte there.
  4. Press RUN again for each further instruction. Calls, returns and branches are followed as they happen.
  5. 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.
  6. 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:

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.

FileHow the loader handles it
.wavReads 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.
.amtapeImports 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 fileReplaces the monitor ROM with it, then cold resets, even if the extension is .bin.
Other raw binary filesCopies 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:

Either way the programs are the same ones, and control returns to the monitor afterwards. The steps below describe Instant.

LOAD an imported tape

  1. Choose the .amtape file, or a .wav recording, with Load ROM or tape. Its identifier and recorded addresses are logged in the browser console.
  2. Enter its identifier at $0000. For the recorded load address, put 00 at $0001 and FF at $0002. To relocate instead, put the desired address's low byte at $0001 and high byte at $0002.
  3. Select $FC54 with 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 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:

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