CLOSED-WORLD CIL AOT COMPILER

C# to
Motorola 68k.

CopperSharp compiles a constrained subset of CIL into native Motorola 68k code. It emits Amiga HUNK executables, Kickstart ROM images, or assembler source.

CPUs
68000 · 68020 · 68040 · 68060
Targets
Amiga · MorphOS
License
MIT
hello-amiga.csREADY
01using CopperSharp.Sdk.Amiga;
02
03public static class Hello
04{
05 public static int Main()
06 {
07 DOS.PutStr(Hello, Amiga!);
08 return 0;
09 }
10}
copper68kc Hello.dll --cpu 68000 --format hunk
compiled in 184 msHELLO.HUNK
01 No virtual machine
02 Optional mark-and-sweep GC
03 Native 68k output
04 Typed Amiga bindings

THE PIPELINE

Compilation pipeline

The compiler resolves reachable managed code, lowers supported CIL to Motorola 68k instructions, and writes the selected output format.

01

Build a managed assembly

Compile the C# project normally. The input is a managed PE assembly with CIL method bodies.

02

Resolve the closed world

Starting at the selected entry point, resolve reachable methods, framework members, and platform calls.

03

Lower and optimize

Lower supported CIL into machine IR, allocate registers, and generate code for the selected 68k CPU.

04

Link the output

Resolve imports, relocations, and symbols, then emit HUNK, ROM, or assembler output.

OUTPUT FORMATS

HUNK, ROM,
or assembler.

The backend can write a loadable Amiga executable, a fixed-layout Kickstart ROM image, or readable assembler source.

01

AMIGA HUNK

Executable

02

KICKSTART ROM

Boot image

03

68K ASM

Readable output

AMIGA SDK

Library calls as
C# declarations.

The SDK declares Amiga libraries, pointer types, hooks, tag lists, and register conventions. Platform calls are resolved during closed-world analysis and lowered using the Amiga ABI.

Browse the SDK
SDK SURFACE42 LIBRARIES +
01exec.libraryBOUND
02dos.libraryBOUND
03intuition.libraryBOUND
04graphics.libraryBOUND
05muimaster.libraryBOUND
06iffparse.libraryBOUND
IFF / DOSEXAMPLE 02

IFF parsing with typed exceptions and nested cleanup.

View example ↗
CopperSharp emblem

PROJECT SCOPE

A bounded compiler.
An explicit surface.

The supported CIL and .NET framework surface is intentionally constrained and tracked in the repository alongside execution tests and compatibility reports.

GETTING STARTED

Publish a HUNK
from a C# project.

The project template uses the packaged CopperSharp MSBuild SDK. Publishing restores the compiler and writes the Amiga executable, map, and compatibility report.

Complete example and instructions
POWERSHELL / SHELLPREVIEW.1
dotnet new install CopperSharp.Templates::0.1.0-preview.1
dotnet new amiga -n HelloAmiga
cd HelloAmiga && dotnet publish -r amiga-m68k