Configurable Computer Simulation. Can be used to simulate 8bit computers using the definition language to define opcodes, memory arrangement, graphics, memory mapped I/O. Included are definition files to emulate the Microtan65 computer.
The Microtan emulation contains ROM files for TANBUG (debug & monitor), XBUG (TANBUG extension) and BASIC (Microsoft Basic language).
Programs may be written in Basic which is interpreted by the BASIC interpreter running using CoCoSim interpreted definitions for the 6502 microprocessor. The CoCoSim interpreter run in Java within the JVM virtual machine. This multiple levels of interetation means that the emulation isn't as fast of the original Microtan65 machine!
Reads the specified file for commands. Includes may be nested.
Specifies a memory bank of the specified size in bytes at the givel absolute address.
Specifies a ROM at the specifies absolute address. The ROM contents is read from the binary data file. The length of the file determines the size of the ROM.
Displays the contents of a register on the simulator's UI. Format is that used in String.format().
Displays a table of memory contents on the simulator's UI. Format is x%format where rows and cols is the size of the table to be displayed and hence the number of bytes. The %format is that used in String.format().
Define a character to be displayed. Computer specific character codes are mapped to Unicode characters. For example the Commodore Pet had a character Wikipedia PETSCII 0x73 to represent a heart symbol. The following may be used to provide a mapping to heart: character,0x73,0x2665
The following creen shot hows the results of the character mapping for the Microtan65:
Define an opcode with the specified action as microcode. The actions will be appended to any existing actions defined for the opcode.
Define a function with the specified actions. Functions are used to specify what happens upon a CPU reset or interrupt. Define a function with the specified action as microcode. The actions will be appended to any existing actions defined for the function.
The following functions are used by CoCoSim:
-
power Called when the program starts and simulates power-on.
-
reset Called whenever the processor is reset. For the 6502 this loads the PC from the contents of 0xFFFC/0xFFFD, zeros the registers and sets the zero flag.
-
fetch Called whenever an instruction fetch is done to obtain the opcode. For the 6502 the ins register is loaded from the contents of memory pointed by pc and the pc is incremented.
-
interrupt Simulates a hardware interrupt. For the 6502 the if the interrupt flag is already set then do nothing otherwise PC is saved on the stack along with the PSW, the PC is then loaded from 0xFFFE/0xFFFF and the interrupt flag is set.
-
nmi Simulates a hardware non-maskable interrupt. For the 6502 the PC is saved on the stack along with the PSW, the PC is then loaded from 0xFFFE/0xFFFF.
-
read Read and Write functions may be defined to emulate memory mapped I/O capabilities. The address register is set before the read function is called. The value should be returned using the return() statement.
-
write Read and Write functions may be defined to emulate memory mapped I/O capabilities. The address register and value register are set before the write function is called.
Assign a value to a register.
Assign a value to a RAM memory location.
If the condition is true the Action is executed.
Terminates the execution of a function before the end.
###Operators
To fetch the next instruction from memory pointed at by the "pc" variable and place into the "ins" variable:
function,fetch,[pc] -> ins // Get memory pointed at by pc function,fetch,pc+1 -> pc // increment the pc
The supplied files can be used to emulate a 6502 based computer. The fupplied files contain configuration for the Tangerine Microtan65 computer Microtan website The emulation is for the
- MT65 card, with block graphics option
- Tanex expansion card,
- 48K RAM card. The emulation contains ROM files for
- TANBUG,
- XBUG,
- Microtan Basic.

