https://github.com/brentseidel/sim-cpu
CPU Simulations written in Ada
https://github.com/brentseidel/sim-cpu
6502-emulation 68000 8080a 8085 ada assembly-language simulation z80-emulator
Last synced: about 1 month ago
JSON representation
CPU Simulations written in Ada
- Host: GitHub
- URL: https://github.com/brentseidel/sim-cpu
- Owner: BrentSeidel
- License: gpl-3.0
- Created: 2022-01-21T17:08:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-13T19:23:10.000Z (2 months ago)
- Last Synced: 2025-04-13T19:39:41.464Z (2 months ago)
- Topics: 6502-emulation, 68000, 8080a, 8085, ada, assembly-language, simulation, z80-emulator
- Language: Ada
- Homepage:
- Size: 2.46 MB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sim-CPU
CPU Simulations written in AdaThis is spun off of the Pi-Mainframe repository. Moving simulation into
a separate repository will allow simulators to be developed more independently
as well as used in other applications.[]
(https://alire.ada.dev/crates/bbs_simcpu.html)[]
(https://alire.ada.dev/crates/simcpucli.html)[]
(https://alire.ada.dev/crates/loadcpm.html)## Implementation
The root of the simulators is the abstract object "simulator" defined in the
BBS.Sim_CPU package. It defined the external interface that all simulators
must implement. It is expected to evolve as some actual CPU simulators get
implemented.## Simulators
The following simulators are implemented.### Simple Example
This is not really a CPU simulator. Its main purpose is to blink the lights
in the Pi-Mainframe in interesting patterns.### Intel 8080
[More information](https://github.com/BrentSeidel/Sim-CPU/tree/main/src/i8080/README.md)All 8080 and 8085 instructions have been implemented. Z80 instructions are
being implemented, but are not ready for use yet.### Motorola 68000
[More information](https://github.com/BrentSeidel/Sim-CPU/tree/main/src/m68000/README.md)All the 68000 CPU instructions have been implemented.
## CLI
A command line interface is provided for development of both the simulators
and software that runs on the simulator.The following commands are currently provided:
- BREAK
- Set a breakpoint (currently only one can be active at a time)
- CONTINUE
- Continue execution
- DEP
- Deposit value to a memory location
- DUMP
- Display a region of memory
- EXIT or QUIT
- EXIT the program
- GO
- Start execution at a specified address
- LISP
- Enter Lisp interpreter
- LOAD
- Load data from a file into memory
- REG
- Display register values
- RUN
- Execute instructions until halt or breakpoint
- STEP
- Execute one instruction
- TRACE
- Print information for each instruction executed
- UNBREAK
- Remove a breakpoint### Lisp
For more information on the embedded [tiny-Lisp](https://github.com/BrentSeidel/Ada-Lisp)
interpreter.The following additional Lisp words are implemented for controlling the
simulation. With use, more words may be added.
- Execute one instruction
- (sim-step)
- Get/set memory (byte/word/long)
- (memb addr value)
- (memb addr)
- (memw addr value)
- (memw addr)
- (meml addr value)
- (meml addr)
- Set execution address
- (go address)
- Read register value (index is simulator dependent)
- (reg-val index)
- Return number of registers
- (num-reg)
- Return or set simulator halted state
- (halted state)
- (halted)