Emulator and debugger for LPRS1 ISA & CPU

Overview

About

LPRSemu is a simple emulator and debugger for LPRS1 ISA & CPU. It supports loading programs from assembly text files, binary string representation or by directly writing assembly code in Rust using a macro.

Emulation example

Registers
| R0:    30 | R1:     5 | R2:     0 | R3:     0 |
| R4:     0 | R5:     0 | R6:     0 | R7:     0 |
Flags [ zero: true  ] [ sign: false ] [ carry: false ]
Program counter: 7
Runtime counter: 22
Data memory
|   0 |     0
|   1 |     5
|   2 |     6
| ··· |     0
Program memory
|     | main:
|   0 |     inc   R0, R0
|   1 |     ld    R1, R0
|   2 |     inc   R0, R0
|   3 |     ld    R2, R0
|   4 |     sub   R0, R0, R0
|     | loop:
|   5 |     add   R0, R0, R1
|   6 |     dec   R2, R2
|   7 |     jmpnz 5 (loop) <=
|   8 |     st    R0, R2
|     | shift:
|   9 |     shr   R0, R0 (*)
|  10 |     jmpnz 9 (shift)
|     | divide:
|  11 |     shl   R1, R1
|  12 |     jmpnz 11 (divide)
| ··· | nop

lprsemu >>

Usage

  1. Clone repository from GitHub

    git clone https://github.com/filiparag/ftn-lprsemu && cd ftn-lprsemu
  2. Choose one option from the following:

    • Write assembly code in an arbitrary text file.
      After launching the emulator, type lf <file> to load the program stored in path of <file>.
    • Write assembly code into ROM_ASM macro located in src/asm.rs, and set DATA_MEMORY accordingly.
    • Load binary string into ROM_BIN from oQ in instr_rom.vhd, and sMEM values from data_ram.vhd into DATA_MEMORY.
      After launching the emulator, type lb to load the program stored in binary string form. By default, code is loaded from the macro.
  3. Compile and run the emulator

     cargo run --release

    Note: Release mode provides significantly better performance.

  4. Type h into the prompt to list all commands
    Note: Empty command defaults to step.

  5. Enjoy debugging!

You might also like...
Unicorn Emulator Debug Server - Written in Rust, with bindings of C, Go, Java and Python

udbserver - Unicorn Emulator Debug Server When you do emulation with Unicorn Engine, do you want to inspect the inner state during every step? udbserv

Learning Rust and ECS by implementing an emulator for Silkroad Online.

Skrillax Learning Rust and ECS by implementing an emulator for an MMORPG. Skrillax is my learning project for playing around with Rust, learning about

🥔 MOS-6502 and NES emulator in Rust (SDL/WebAssembly)
🥔 MOS-6502 and NES emulator in Rust (SDL/WebAssembly)

🥔 Potatis /mos6502 - Generic CPU emulator. Passes all tests, including illegal ops. (No BCD mode). /nes - A very incomplete NES emulator. /nes-sdl -

A hardware-accelerated GPU terminal emulator powered by WebGPU, focusing to run in desktops, browsers, tvs and everywhere.
A hardware-accelerated GPU terminal emulator powered by WebGPU, focusing to run in desktops, browsers, tvs and everywhere.

Rio term tl;dr: Rio is a terminal built to run everywhere, as a native desktop applications by Rust/WebGPU or even in the browser powered by WebAssemb

Commodore 64 emulator written in Rust
Commodore 64 emulator written in Rust

Rust64 - a C64 emulator written in Rust This is my attempt to study the Rust programming language and have fun at the same time. The goal is to presen

A Flash Player emulator written in Rust
A Flash Player emulator written in Rust

website | demo | nightly builds | wiki Ruffle Ruffle is an Adobe Flash Player emulator written in the Rust programming language. Ruffle targets both t

A Gameboy Emulator in Rust

RBoy A Gameboy Color Emulator written in Rust Implemented CPU All instructions correct All timings correct Double speed mode GPU Normal mode Color mod

RGB (Rust Game Boy) is a simple emulator for the original game boy
RGB (Rust Game Boy) is a simple emulator for the original game boy

RGB RGB (Rust Game Boy) is a simple emulator for the original game boy and the color game boy. Warning: This no longer compiles in the latest versions

Full featured Cross-platform GameBoy emulator by Rust. Forever boys!.
Full featured Cross-platform GameBoy emulator by Rust. Forever boys!.

Gameboy Full featured Cross-platform GameBoy emulator. Forever boys!. You can start a game with the following command, here with a built-in game "Boxe

Owner
Filip Parag
Student at Faculty of Technical Sciences in Novi Sad. Teaching assistant at @pfe-rs. Team member at @memristor. Open source developer.
Filip Parag
SCEMU The crates.io lib, x86 cpu and systems emulator focused mainly for anti-malware

SCEMU Usage Download the maps32.zip or maps64.zip from: https://github.com/sha0coder/scemu/releases/download/maps/maps32.zip https://github.com/sha0co

sha0coder 11 Dec 25, 2022
Intel 8080 cpu emulator by Rust

i8080 i8080 is a emulator for Intel 8080 cpu. 8080 Programmers Manual 8080 opcodes [dependencies] i8080 = { git = "https://github.com/mohanson/i8080"

Mohanson 83 Dec 27, 2022
Non cycle-accurate emulator of the 6502 cpu, written in pure rust

CPU 6502 A non cycle-accurate emulator implementing all legal 6502 opcodes. What does non cycle-accurate mean? Every instruction on the 6502 takes a n

Pietro 10 Jul 15, 2022
A CPU emulator for running unit tests on Game Boy code.

evunit This is a unit testing application for Game Boy roms. It includes a CPU emulator, and loads test configurations from TOML files. Configuring a

Evie M. 8 Jan 1, 2023
Nes-emulator - A NES emulator made to learn the Rust programming language

nes-emulator Building $ rustc --version rustc 1.32.0 (9fda7c223 2019-01-16) $ cargo --version cargo 1.32.0 (8610973aa 2019-01-02) $ cargo build --rel

Michael Burge 225 Dec 23, 2022
Intel 8085 CPU emulation in Rust

PP8085 PP808 is a program that emulates the Intel 8085 Microprocessor architecure. The library is written in Rust and aims to mirror the operation of

Parth Pant 6 Jul 7, 2022
A Game Boy research project and emulator written in Rust

Mooneye GB Mooneye GB is a Game Boy research project and emulator written in Rust. The main goals of this project are accuracy and documentation. Some

Joonas Javanainen 802 Dec 28, 2022
TestSuite4 is a framework designed to simplify development and testing of TON Contracts. It includes light-weight emulator of blockchain making it easy to develop contracts.

TestSuite4 0.1.2 TestSuite4 is a framework designed to simplify development and testing of TON Contracts. It contains lightweight blockchain emulator

TON Labs 26 Feb 3, 2022
Learn emulator and programming languages, target chip8, nes, gbc, gba ...

[WIP]learn emulator go-chip8 go run main.go source https://en.wikipedia.org/wiki/CHIP-8 http://devernay.free.fr/hacks/chip8/C8TECH10.HTM https://githu

早晨海风 4 Apr 30, 2021
A NES emulator written in Rust, with a focus on expandability and accuracy

A NES emulator written in Rust, with a focus on expandability and accuracy

Benjamin Mordaunt 4 Sep 19, 2022