by Richard Lesh
CPUSim64 is a Java-based emulator of a simple 64-bit CPU, created to make learning assembly language and computer architecture approachable and fun. It abstracts away the quirks of complex modern ISAs like Intel/AMD64 and ARM, allowing you to focus on core programming concepts in a safe, sandboxed environment.
Written in Java, CPUSim64 runs on any system with Java 17 or later installed. It includes command-line scripts to make common tasks—such as assembling source code, disassembling object files, tracing program execution, and running binaries—straightforward and efficient. A good text or code editor is recommended for writing your CPUSim64 programs.
With CPUSim64 you can:
Write and run assembly programs
Step through execution to observe register and memory state
Use provided tools to assemble, disassemble, and trace code
To get started, the CPUSim64 distribution (CPUSim64V2.zip) includes comprehensive documentation and sample code that guide you through the architecture, instruction set, and programming model:
Architecture Reference — Defines the CPU model, registers, memory layout, and execution semantics.
Programmer Guide — Teaches you how to write, assemble, and run assembly code on CPUSim64.
Directives Reference — Reference for the preprocessor and assembler directives.
Instruction Set Reference — Lists all supported instructions and their encoding/semantics.
Software Interrupt Reference — Covers system interface conventions and interrupt handling.
Library Reference — Reference to the library of CPUSim64 code that implements useful OS routines and abstract data structures.
Compilers — Describes the compiler plug-in architecture and the C11, C++14, VB.NET, MMIX and Rust compilers.
Cycle Timing Model — Reference to the cycle times of the CPUSim64 instructions.
Pure Programmer — Blog with more examples of CPUSim64 code.
You can download the latest CPUSim64 source or submit bug reports on GitHub.