LEGACY DOCS · 12.0Stable is 13.2. This page stays because it still owns historical or unchanged contracts.CURRENT 13.2 →
RELEASE LINE13.2 STABLE13.1 PREDECESSOR13.0 PREVIOUS12.4 NATIVE MIRARCHIVE

V12.0 BASE CONTRACT

C ABI

The i686 cdecl subset supports scalars, raw pointers, and compatible C function pointers; aggregate interoperability uses pointers to repr(C) storage.

DByte 12.0 · Language

Contract§

pub extern "C" fn dbyte_add_one(value: i32) -> i32:
    return value + (1 as i32)

Source: source-examples/v12.0.0/c_abi.dby

pub extern "C" fn dbyte_add_one(value: i32) -> i32:
    return value + (1 as i32)
DBY · 82 BSHA-256 cdc02e407b169701cdbcb03f42776d20293b5565cccbe2b8389c6ae73f9a03b8

Mechanics§

The i686 C subset follows cdecl: right-to-left arguments, caller cleanup, scalar EAX return, preserved EBX/ESI/EDI/EBP and explicit stack alignment. Interop aggregates cross through pointers to repr(C) or packed storage.

Validation and failure§

Struct-by-value, payload enums, varargs, unions, large returns, C++ and exceptions are rejected. Pointer mutability and callable convention must match.

Evidence and boundary§

Pinned clang 22 creates only the C fixture object; DByte creates its objects, archive and final ELF, then QEMU checks calls, callbacks, narrow values, cleanup and callee-saved registers.

Executable example§

pub extern "C" fn dbyte_add_one(value: i32) -> i32:
    return value + (1 as i32)

WEBSITE V12 FIXTURE