Zasm is an x86_64 machine code generator lib in Zig.
Zasm lets you describe instructions and generate the corresponding x86_64 machine code.
You can then load these bytes into executable memory to be called like a normal function.
Zasm is still in its early development stage, so breaking changes should be expected.
As for documentation, right now you'll have to read the source code. zigs auto doc might help