M68000 System Simulator

1. Introduction

The M68000 system simulator can be used to simulate a simple, but complete 68000 system with all importend components like CPU, RAM, ROM and some IO devices. Also the glue-logic, address decoder, and interrupt logic can be simulated.

2. Installation

The M68000 system simulator constist of one executable file   s68  and one configuration file   s68.conf.  The executable file s68 should be copied to /usr/local/bin and the configuration file may be located in the home directory or a corresponding working directory.
The configuration file describes the system which should be simulated.
Depending on which additional component are used in the simulated system, a image file for the EPROM or the IDE harddisk is needed.
An installation with all components my look as follows:
/usr/local/bin/s68     Simulator
/home/foo/s68.conf     Configuration file
/home/foo/rom.bin      Binary file with contens of EPROM
/home/foo/master.img   Contens of simulated IDE harddisk

2.1 Configuration File

The configuration file s68.conf (a different filename my be used at invokation of the simulator) describes the M68000 system to simulate. This file defines each component, its base address, its address range and optional its interrupt level and one argument. Also entries for the reset vector and commands which are executed imidiatly after start of the simulator are located in the configuration file.
This is a examle of a configuration file. The describtion follows:
# s68 configuration file
#	device	base		size		irq	argument
#	------- ---------------	---------------	-------	------------------
DEVICE  RAM     0x00000000      0x00400000
DEVICE  EPROM   0x00e00000      0x00100000      0       mv.s3
DEVICE  M68681  0x00fe0000      0x1000          4	/dev/tty7
DEVICE  M68230  0x00fe1000      0x1000          5
DEVICE  MK48T02 0x00fe3000      0x1000
DEVICE  ATA     0x00fe2000      0x1000          0       img/master.img
RSTBASE	0x00e00000
A keyword is located in the first column. Depending on the keyword one or more parameter are following. Version 1.1.0 allows the folloing keywords with their meaning:
DEVICE Device definition for address decoder.
RSTBASEAddress for reset vector
COMMANDCommand (see Command line interface)

Table 1 : Meaning of the keywords

2.1.1 DEVICE Keyword

The DEVICE keywords in the configuration file is used to contol the address decoder and the interrupt logic.
This keyword follows in the second column the device name. In the version 1.1.0 of the simulator the following device names are defined: RAM, EPROM, M68681, M68230, MK48T02, and ATA.
The third and forth column hold the base address and the size of the address range. The base address must be located on a size bondary, otherwise results are undefined. The fifth column is used for the interrupt level. If the device does not generate an interrupt a 0 is located here.
The last column holds an entry which used as an argument for the component. The meaning of the argument depends on the device.
The following table shows the meaning of the argument:
RAM No argument
EPROM Filename of imagefile
M68681 Devicename used for Port A of DUART
M68230 No Argument
M48T02 No Argument
ATA Filename of IDE Master imagefile

Table 2 : Meaning of the arguments

2.1.2 RSTBASE Keyword

The RSTBASE keyword is used to define the base address which should be used to read the initial stackpointer and the reset vector from.
After reset, the CPU starts to read the initial stackpointer from address 0x000000 and the reset vector from address 0x000004. Using the RSTBASE keyword with the base address of the EPROM, then the base address of the EPROM will be added to the address from the CPU during the first four read cycles. So, the initial stack pointer and the reset vector are read from EPROM even if this is not located at address 0x000000.

2.1.3 COMMAND Keyword

A single command of the command line interface may be placed after each command keyword. This commands are executed before the first prompt. With the go example configurtion file) the simulation can be started imidiatly after the simulator was started.

3. Commandline User Interface

The following table shows the commands of version 1.1.0:

 he [<cmd>]               Print detailed help about command 
 ver                      Display version of simulator
 ex                       Exit MC68000 simulator
 br [<addr>]              Display or Set breakpoint
 nb [<addr>]              Clear all or one breakpoint
 md [<addr>] [<addr>]     Memory display
 mf <addr> <addr> <val>   Memory fill
 mm [<addr>]              Memory modify
 rd                       Register display
 rm <reg> <val>           Register modify
 go [<cnt>]               Execute <cnt> instructions
 tr [<cnt>]               Execute <cnt> instructions with tracing

Table 3 : Command of the command line user interface

Command like he, ver, ex oder rd are selfexplained.
br without an argument shows all breakpoints. The nb command removes all breakpoints.
The md command without an argument shows 456 byte starting at address 0x000000. The contens of an address can be changed with the mm command. Without an argument address 0x000000 is changed. With <ENTER> you step to the next address and with .<ENTER> you exit from the memory modify mode.
The rm is used to modify the contens of the CPU registers. Dataregister (d0, d1, ..., d7), addressregister (a0, a1, ..., a8), the program counter (pc) and the status register (sr) can be modified. Addressregister a7 is always the user stack pointer and a8 is always used for the supervisor stack pointer.
With the go and the tr command without an argument the simulation is started for an endless number of instructions. The tr command shows each simulated instruction. This results in a much solwer simulation.
Pressing <ENTER> stoppes the simulation and commands can be entered. Also the simulation stoppes if a breakpoint is reached.