This is a custom cpu emulator, made open source to allow contribution and the progress of the project.
Updates:
- RAM and CPU registers are moved to arrays instead of folders, now RAM isn’t failing anymore and fillers won’t be necessary in the ASM code.
- ASM code and C code can now be written in a single string and no longer needs arrays to iterate through lines.
- Added org directive for ASM code, making it so it can have an execution offset, leaving other parts of the RAM free.
Current specs
- Single threaded CPU
- 32KB VRAM
- 20 instructions
- Most of the 32 bit registers found in architectures like x86.
Demos:
-
Assembly written Hello World!
-
Bootloader
Github repo:
juaninsanote7773/ro-cpuemu: An open source custom-made CPU Emulator written in Luau
Current place stable:
asm.rbxl (94.4 KB)
2 Likes
Calling this Emulation is incorrect. it lacks the core features of true emulation and feels more like a superficial simulation.
You’re using NumberValue instances for no apparent reason, instead of a simple mutable global state (if one is even needed).
The core CPU instruction set is minimal (~20 ops) and doesn’t reflect real ISA features like pipelining, privilege levels, or standardized instruction encoding. There’s also a lack of hardware-like behavior.
Additionally, your “C compiler” functions more like a token expander. There’s no actual parser, grammar, or AST, just sequence substitution, misrepresenting what a compiler typically does.
Lastly, adopting tools like Rojo to structure the project and simplify the build system would be greatly appreciated by contributors interested in improving this PC simulator.
2 Likes
The core CPU instruction set is minimal (~20 ops) and doesn’t reflect real ISA features like pipelining, privilege levels, or standardized instruction encoding. There’s also a lack of hardware-like behavior.
Its custom made, and if you didn’t see my past post it was made in 3 days.
Additionally, your “C compiler” functions more like a token expander. There’s no actual parser, grammar, or AST, just sequence substitution, misrepresenting what a compiler typically does.
its translation, and that mess of a translator is one of the reasons i made it open source
Lastly, adopting tools like Rojo to structure the project and simplify the build system would be greatly appreciated by contributors interested in improving this PC simulator.
will do this later
i will try to make it more complete by adding the whole x86 register set, and i will see if i can move the important numbervalues to their respective modulescripts.
And people like this is the other reason that i made it open source,
they know more about this stuff than me, and its great.
Thanks for your feedback.
I was thinking of upgrading the RAM functionality by making it so all addresses are packed to 1 byte, but the problem is that i haven’t found a way to do so.
I will update the title to make it more fitting.
I would greatly appreciate your further contribution in the project.