All Projects → glouw → c8c

glouw / c8c

Licence: MIT license
The chip8 compiler, assembler, and virtual machine

Programming Languages

c
50402 projects - #5 most used programming language
assembly
5116 projects
Makefile
30231 projects

Projects that are alternatives of or similar to c8c

Customasm
💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Stars: ✭ 211 (+91.82%)
Mutual labels:  vm, virtual-machine, asm
RISVM
A low overhead, embeddable bytecode virtual machine in C++
Stars: ✭ 21 (-80.91%)
Mutual labels:  vm, virtual-machine, asm
Quickjs
The official repo is at bellard/quickjs.
Stars: ✭ 1,429 (+1199.09%)
Mutual labels:  vm, virtual-machine
E4vm
A small portable virtual machine that would run Erlang on embedded systems
Stars: ✭ 124 (+12.73%)
Mutual labels:  vm, virtual-machine
Box
[DEPRECATED] Official, pre-packaged Vagrant Box
Stars: ✭ 197 (+79.09%)
Mutual labels:  vm, virtual-machine
Dockerpi
A Virtualised Raspberry Pi inside a Docker image
Stars: ✭ 1,064 (+867.27%)
Mutual labels:  vm, virtual-machine
Footloose
Container Machines - Containers that look like Virtual Machines
Stars: ✭ 1,289 (+1071.82%)
Mutual labels:  vm, virtual-machine
Lam
🚀 a lightweight, universal actor-model vm for writing scalable and reliable applications that run natively and on WebAssembly
Stars: ✭ 176 (+60%)
Mutual labels:  vm, virtual-machine
Lc3 Vm
Write your own virtual machine for the LC-3 computer!
Stars: ✭ 631 (+473.64%)
Mutual labels:  vm, virtual-machine
Linux Unattended Installation
This project provides all you need to create an unattended installation of a minimal setup of Linux.
Stars: ✭ 215 (+95.45%)
Mutual labels:  vm, virtual-machine
clox
A virtual machine and a tree-walk interpreter for the Lox programming language in C89 🌀
Stars: ✭ 38 (-65.45%)
Mutual labels:  vm, virtual-machine
Ebcvm
EFI Byte Code Virtual Machine in userspace
Stars: ✭ 34 (-69.09%)
Mutual labels:  vm, virtual-machine
Enigma
An Erlang VM implementation in Rust
Stars: ✭ 877 (+697.27%)
Mutual labels:  vm, virtual-machine
Redtamarin
AS3 running on the command line / server side
Stars: ✭ 105 (-4.55%)
Mutual labels:  vm, virtual-machine
Ethereumjs Monorepo
Monorepo for the Ethereum VM TypeScript Implementation
Stars: ✭ 813 (+639.09%)
Mutual labels:  vm, virtual-machine
Quickjs
QuickJS是一个小型并且可嵌入的Javascript引擎,它支持ES2020规范,包括模块,异步生成器和代理器。
Stars: ✭ 2,199 (+1899.09%)
Mutual labels:  vm, virtual-machine
specter
a (tiny) VM project built with Go
Stars: ✭ 57 (-48.18%)
Mutual labels:  vm, virtual-machine
Vmcli
A set of utilities (vmcli + vmctl) for macOS Virtualization.framework
Stars: ✭ 571 (+419.09%)
Mutual labels:  vm, virtual-machine
Mac
bytecode interpreter in c (blog post)
Stars: ✭ 628 (+470.91%)
Mutual labels:  vm, virtual-machine
Macos Virtualbox Vm
Instructions and script to help you create a VirtualBox VM running macOS.
Stars: ✭ 2,385 (+2068.18%)
Mutual labels:  vm, virtual-machine

Screenshot

c8c aims to be a small typeless programming language for the CHIP-8 virtual machine:

r = { 0x80, 0x40, 0x20, 0x10 };
l = { 0x20, 0x40, 0x80, 0x10 };

main()
{
    auto x = 0, xmax = 64, dx = 4;
    auto y = 0, ymax = 32, dy = 4;
    while(y < ymax)
    {
        if(rand() & 0x1)
        {
            draw(x, y, r);
        }
        else
        {
            draw(x, y, l);
        }
        if((x += dx) == xmax)
        {
            x = 0;
            y += dy;
        }
    }
    while(1)
    {
        // Never leave main.
    }
}

Screenshot

mul(a, b)
{
    if(b == 0)
    {
        return 0;
    }
    return a + mul(a, b - 1);
}

main()
{
    putchar(24, 13, mul(9, 9));
    while(1)
    {
        // Never leave main.
    }
}

Screenshot

Just run:

make

This will build the CHIP-8 virtual machine, binner, assembler, and compiler. The compiler will then build all the unit tests (tc8c) and example code pieces (examples).

To run a compiled binary, invoke the virtual machine:

./emu examples/maze.bin

Hit the END key to exit.

To build your own c8 code, piecewise invoke the toolchain:

./c8c main.c8 main.asm

./asm main.asm main.hex

./bin main.hex main.bin

./emu main.bin
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].