Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/psmths/riscal-cpu
RISCAL is a 32-bit reduced instruction-set computer (RISC) designed for learning and research purposes. It is named after my dog, Rascal.
https://github.com/psmths/riscal-cpu
assembler assembly instruction-set-architecture machine-code obfuscation risc virtual-machine virtualization
Last synced: 17 days ago
JSON representation
RISCAL is a 32-bit reduced instruction-set computer (RISC) designed for learning and research purposes. It is named after my dog, Rascal.
- Host: GitHub
- URL: https://github.com/psmths/riscal-cpu
- Owner: Psmths
- License: gpl-3.0
- Created: 2021-11-15T18:12:41.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-23T14:58:15.000Z (about 3 years ago)
- Last Synced: 2024-11-16T10:18:27.729Z (3 months ago)
- Topics: assembler, assembly, instruction-set-architecture, machine-code, obfuscation, risc, virtual-machine, virtualization
- Language: C++
- Homepage:
- Size: 261 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
RISCAL CPU
RISCAL is a 32-bit custom instruction set architecture virtual machine. It is intended to be used for learning/research purposes. In a nutshell, RISCAL provides:
* 32-bit, fixed-length instruction set
* 16 General-purpose registers
* FLAGS, stack pointer, return pointer registers
* 65536 words of program memory, can be extended to 2^32 bytes
* Ability to set up and leverage a return stack to send and retrieve data from RISCAL after exit## Getting Started
This repo comes preloaded with several examples. To build the examples:
```
git clone https://github.com/Psmths/riscal-cpu
cd riscal-cpu
make examples
```The built examples will be available in the `bin/` directory.
To leverage RISCAL from a program, use the following methods:
```
unsigned char *run();
void load_rom(unsigned char *rom, int rom_size);
void load_stack(unsigned char *data, int data_size);
```The easiest way to get starting programming RISCAL is to grab a copy of [customasm](https://github.com/hlorenzi/customasm). This repo contains the custom instruction set definition in the examples directory, in the file riscal.asm to get you started, as well as plenty of supporting examples to use as guides and references.
## Debugging RISCAL
As it stands RISCAL does not have a formal debugger. You can set a debugging flag, however, in the debugger.hpp file:
```
#ifndef DBG_HPP
#define DBG_HPP#define DEBUG
#endif
```This will print to stdout all registers for each operation that the VM performs, as well as a stack dump.