How imnmr/marie works
Purpose and Entry Point
MARIE is a compact, incomplete C99 implementation of the MARIE educational machine architecture and its assembly language. The executable is built directly from the single program entry point:
• main.c
• build.sh
The expected runtime artifact is a command-line marie binary; there is no indication of a web, service, or multi-process architecture.
Build and Runtime Boundary
Compilation is intentionally direct and has no package manager, generated source, or external runtime dependency:
• build.sh
• main.c
A C99 compiler is the only required toolchain component. The documented build uses optimization (-O2) and produces a native executable. The repository-level .editorconfig and .gitignore do not participate in runtime behavior.
Machine Emulator Core
The central architectural component is the MARIE machine emulator, implemented in the monolithic source file:
• main.c
This layer is expected to own machine state such as memory, registers, instruction decoding, and execution control. Because the repository contains no separate modules, the CPU model and instruction execution loop are colocated with all other program behavior.
Assembly-Language Handling
The project implements MARIE assembly language in addition to machine execution:
• main.c
Assembly parsing/translation and machine-program loading are therefore part of the same process and source unit as emulation. The key boundary is between source-level assembly input and the internal representation consumed by the MARIE execution engine.
Primary Control Flow
The likely top-level flow is a command-line driven pipeline:
1. Native process starts in main within main.c.
2. Input assembly or machine-program content is accepted and interpreted.
3. Program instructions/data are loaded into MARIE machine state.
4. The emulator repeatedly fetches, decodes, and executes MARIE instructions.
5. Execution terminates on the architecture’s halt/stop condition or an input/runtime error.
All control flow remains in-process; no IPC, persistence service, network API, database, or background worker is present in the repository.
Infrastructure and External Boundaries
The only material external boundary is the host operating environment: command-line invocation, filesystem-based source/program input, standard C runtime facilities, and native compilation.
• main.c
• build.sh
No third-party libraries, cloud infrastructure, containers, CI definitions, or external services are represented. Licensing is AGPL-3.0-only:
• LICENSE
Main entry points: main.c Program entry · build.sh Build script
Components 11
Native Build
- Build script · Compiles the program as optimized C99.
build.sh - C99 compiler
- marie binary
MARIE Runtime
- Command line · Invokes the emulator and supplies program input.
- Program entry · Starts the in-process assembly and emulation pipeline.
main.c - Program input · Read from host-provided input or filesystem.
- Assembly handling · Interprets MARIE assembly into a loadable program representation.
main.c - Program loader · Places instructions and data into MARIE state.
main.c - MARIE machine state
main.c - Fetch-decode-execute loop · Runs instructions until halt or an error.
main.c - Host runtime I/O · Provides standard runtime and filesystem interaction.
Connections 13
- Build script → C99 compiler: invokes
- C99 compiler → marie binary: produces
- Command line → marie binary: launches
- marie binary → Program entry: enters
- Command line → Program input: supplies
- Host runtime I/O → Program input: reads
- Program entry → Assembly handling: interprets input
- Program input → Assembly handling: source program
- Assembly handling → Program loader: translated program
- Program loader → MARIE machine state: initializes
- Program entry → Fetch-decode-execute loop: starts execution
- Fetch-decode-execute loop → MARIE machine state: fetches and updates
- Fetch-decode-execute loop → Host runtime I/O: reports I/O or errors