For example: extern "C" { pub fn get_registers() inline_assembly = 'ByteArray Literal for the Object file to be linked directly'; } and the ByteArray Literal could be generated a procedure macro. extern "C" { pub fn get_registers() inline_assembly = get_registers_macro_assembly!(); }