This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.
pubfnsyscall0(
number: SYS,
) u32 {
// r0 is both an input register and a clobber. musl and glibc achieve this with
// a "+" constraint, which isn't supported in Zig, so instead we separately list
// r0 as both an input and an output. (Listing it as an input and a clobber would
// cause the C backend to emit invalid code; see #25209.)
varr0_out: u32 = undefined;
returnasmvolatile (
\\ sc\\ bns+ 1f\\ neg 3, 3\\ 1:
: [ret] "={r3}" (-> u32),
[r0_out] "={r0}" (r0_out),
: [number] "{r0}" (@backingInt(number)),
: .{ .memory = true, .cr0 = true, .r4 = true, .r5 = true, .r6 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true, .ctr = true, .xer = true });
}