This project is about simulating that processor using Java and JavaFX.
This project is also intended as a programming tutorial. Here is what it demonstrates from a developer's perspective:
- Modern Java — Sealed types, records, pattern matching, and switch expressions
- JavaFX & MVVM — Property binding, FXML with factory-based dependency injection, and syntax highlighting via incubator rich text modules
- Java Module System — Single application module with selective package opening for JavaFX reflection
- Theming — Light, dark, and auto theme switching with CSS stylesheet swapping based on system preferences
- Internationalization — Resource bundles for English and German, integrated with FXML property references
- Testing — JUnit with parameterized tests, integration tests, and in-memory preference mocks
- Build & Packaging — Maven Wrapper, toolchains for JDK management, and profiles for jlink runtime images and jpackage native installers
- CI/CD — GitHub Actions workflow with branch-based triggers
- Code Quality — All compiler warnings as errors, strict Javadoc linting for accessibility, HTML, syntax, and references
- Compiler Pipeline — Four-stage assembler (lexer, linker, parser, compiler) with algebraic data types for tokens, AST nodes, and operands; the linker resolves cross-file
.includedirectives and preserves per-file diagnostic attribution - CPU Simulation — 5-stage pipeline with hazard detection, data forwarding, and snapshot-then-commit execution model
- Any JDK installed and
JAVA_HOMEpointing to it. The Maven wrapper uses this JDK to bootstrap Maven itself. - JDK 26 (OpenJDK) registered in a Maven toolchain. The build selects the correct JDK via the
maven-toolchains-plugin, so yourJAVA_HOMEJDK does not need to be version 26. Add the following to your~/.m2/toolchains.xml:
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>26</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>C:\path\to\jdk-26</jdkHome>
</configuration>
</toolchain>
</toolchains>The project uses the Maven Wrapper, so you do not need Maven installed. The wrapper automatically downloads the required Maven version on first use.
.\mvnw compile # compile sources and generate Javadoc
.\mvnw test # run unit tests
.\mvnw javafx:run # start the JavaFX application
.\mvnw package # build JAR in target/lib/
.\mvnw clean # remove build artifactsThe recommended editor is Visual Studio Code with the Java extensions.
- Open the workspace file
dlx.code-workspacein VS Code. - Install the recommended extensions when prompted.
- Use the pre-configured launch configuration to run the application.
- Open a DLX source file from
assets/examples. - Choose Compile and Load.
- Choose Run.
- Watch the magic happen! 😉
A DLX source file is a stream of lines containing labels, instructions, comments, and assembler directives:
- Segments:
.dataand.textswitch between data and code sections. - Data declarations:
.word,.half,.byte,.ascii,.asciiz,.space,.align. - Includes:
.include "relative/path.s"splices another source file in at this point.- The path is resolved relative to the directory of the including file (the master for top-level includes; the included file for nested ones).
- Absolute paths are rejected. So is including from an unsaved master, since there is no directory to resolve against — save the master first.
- Includes can be nested arbitrarily; cycles are detected and reported as a diagnostic. The same file may be included more than once; it is loaded just once but its contents are spliced in at every inclusion point.
- If an included file is open in another editor tab with unsaved changes, the linker uses the live buffer rather than the on-disk content, so errors update as you type.
- Errors in an included file are attributed to that file in the Problems view — clicking one opens the file (loading it into a new tab if needed) and jumps to the line.
See assets/examples/include_main.s and assets/examples/include_utils.s for a minimal include pair.