lprsemu

Crates.iolprsemu
lib.rslprsemu
version0.4.4
sourcesrc
created_at2023-01-08 18:33:46.190271
updated_at2023-12-11 19:48:05.271942
descriptionEmulator, debugger and assembler for LPRS1 ISA & CPU
homepage
repositoryhttps://github.com/filiparag/ftn-lprsemu
max_upload_size
id753866
size82,578
Filip Parag (filiparag)

documentation

README

About

LPRSemu is an interactive emulator and debugger for LPRS1 ISA & CPU.
LPRSasm is an assembler for the reference VHDL imlpementation of the CPU.

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. Download latest stabe binaries for your platform

  2. Run the emulator with your assembly code file as the first argument

    ./lprsemu example.asm
    
  3. Type h into the prompt to list all commands
    Note: Empty command defaults to step.

  4. Test and debug your program

  5. Optional: Assemble it into VHDL using LPRSasm

    ./lprsasm example.asm
    
Commit count: 57

cargo fmt