Get started

One session from an empty folder: run an assembly server, call it, build your own assembly library, and give your coding agent the SDK. Notes on the right say what each step does.

Run a server

KvAsm, a gRPC key-value server in x86-64 assembly, released as a container image and a .NET client.

Start the server

docker run --rm -p 50051:50051 ghcr.io/asmfoundation/kvasm:0.3.0

KvAsm runs on linux/amd64 and listens on port 50051. To build it yourself instead, docker build --target runtime -t kvasm:0.3.0 . in a clone runs every server test suite first; the image exists only if all of them pass.

Add the client

dotnet add package KvAsm.Client

The .NET client, for .NET 8 or 10. Any language with gRPC tooling can use kvasm.proto and the protocol's description instead.

Put a key and read it back

Program.cs
using KvAsm.Client;

using var kv = new KvAsmClient(new Uri("http://localhost:50051"));
bool created = await kv.PutAsync("user:42", "Ada");   // true: new key
string? name = await kv.GetStringAsync("user:42");    // "Ada"
bool deleted = await kv.DeleteAsync("user:42");       // true

Large values stream with UploadAsync and DownloadAsync, up to 64 MiB by default, in chunks checked by CRC-32C at both ends.

Write assembly in .NET

AsmSdk builds .asmproj projects with dotnet build, for Windows, Linux and macOS on x64 and ARM64, and for WebAssembly. You need the .NET SDK and nothing else.

Name the SDK

global.json
{ "msbuild-sdks": { "AsmFoundation.Sdk": "0.4.0" } }

global.json names the SDK. MSBuild fetches it from nuget.org, with the assembler and linker for your machine.

Write the project

Hello/Hello.asmproj
<Project Sdk="AsmFoundation.Sdk">
  <PropertyGroup>
    <AssemblyName>hello</AssemblyName>
    <RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
  </PropertyGroup>
</Project>

The project file reads like a .csproj, and its properties are .NET's own. Every .asm file next to it is a source. Add osx-arm64 or linux-arm64 and a .s file with the ARM64 code to build those too.

Write the code

Hello/hello.asm
PROTO int32_t hello_add(int32_t a, int32_t b)
FUNCTION hello_add, 2
    lea     eax, [ARG1 + ARG2]  ; rcx + rdx on Windows, rdi + rsi on Linux
    RETURN
ENDFUNCTION

FUNCTION, ARG1 and RETURN come from the SDK's asmsdk.inc, which it puts in front of every source. They hide the difference between the Windows and Linux calling conventions, so one source builds for both. PROTO is the function's C prototype.

Build both platforms

dotnet build Hello/Hello.asmproj
Hello/bin/Debug/freestanding/win-x64/hello.dll
Hello/bin/Debug/freestanding/linux-x64/libhello.so

One build, one library per platform, and hello.h for C. A C# project that references it calls Hello.Hello.HelloAdd(40, 2), which the SDK writes from the PROTO line; the getting started guide adds ARM64, a program and the C# caller.

Teach your coding agent

The asmsdk plugin gives Claude Code the SDK's rules and recipes, a linter for .asmproj projects and a scaffolder.

Add the marketplace

/plugin marketplace add AsmFoundation/AsmClaudeMarketplace

Type it in Claude Code. The marketplace is called asmfoundation; it holds one plugin per topic.

Install the plugin

/plugin install asmsdk@asmfoundation

The plugin follows AsmSdk's releases: plugin 0.4.0 teaches SDK 0.4.0.

Ask for a project

Create an AsmSdk library that sums an int array, for Windows and Linux on x64,
with a C# test that calls it.

In our evaluation of plugin 0.1.0, agents with the plugin built 12 of 12 test projects; without it, 4 of 12.