Skip to content

Zarem Project Configs

Avishai Dernis edited this page Apr 21, 2026 · 1 revision

DISCLAIMER:

This is pre-release documentation and is subject to change.

Last updated for version 0.4.x.

Project Config Tree

The root of a Zarem project config is the Project node.

The Project node requires 3 children. Name, ArchitectureConfig, and FormatConfig.

Project Name

The project name determines the final output file name. The executable in obj/ will be simply <projectname>. That's currently its only purpose.

Architecture Config

The architecture config is where most of the magic happens. The architecture config has a Type attribute, which determines what architecture to use for the project ("MIPS", "RISC-V", etc). Depending on the architecture, different properties will be available such as Version (for MIPS) or VersionInfo (for RISC-V).

The architecture config will always contain an AssemblerConfig, EmulatorConfig, and LinkerConfig to handle configuration details for these respective components. Currently each of them requires their type to be specified redundantly specified.

Assembler Config

The assembler config is normally left empty, but it can also contain properties like AlignMessageThreshold, AlignWarningThreshold, and SpaceMessageThreshold to specify a size where the assembler should give a warning/message when a directive is being used in an unexpected way.

It can also contain architecture specific assembler configuration options, though none currently exist.

Emulator Config

The emulator config specifies details for handling emulation. Usually, it contains a TrapHost which is used to handle traps (such as syscalls). The default is the Zarem trap handler, which is documented here.

The emulator can also contain the property ExecutionMode with options interpret and jit, to specify how to handle execution. jit is much, much faster but is currently experimental, only supported for MIPS, and doesn't allow debugging.

Again, there are architecture specific options, such as DisableDelaySlots for MIPS which will change the behavior of jumps and branches to apply instantly instead of delayed like on actual hardware.

Linker Config

The linker config specifies how the linker should link the project, mainly including the EntryPoint which contains the name of the entry point symbol.

Format Config

The format config specifies what module format to use.

Example project file

<?xml version="1.0" encoding="utf-8"?>
<Project>
  <Name>Demo</Name>
  <ArchitectureConfig Type="MIPS">
    <Version>mips3</Version>
    <AssemblerConfig Type="MIPS" />
    <EmulatorConfig Type="MIPS">
      <DisableDelaySlots>false</DisableDelaySlots>
      <TrapHost>Zarem</TrapHost>
    </EmulatorConfig>
    <LinkerConfig Type="MIPS">
      <EntryPoint>entry</EntryPoint>
      <LinkMode>Executable</LinkMode>
      <BaseAddress>0</BaseAddress>
    </LinkerConfig>
  </ArchitectureConfig>
  <FormatConfig Type="ELF" />
</Project>

Clone this wiki locally