#include "assembler.h" #include #include #include #include #include #include #include #include #include struct block_assembler_scope { struct assembler_scope s_base; }; static enum ivy_status init_scope( struct ivy_assembler *as, struct assembler_scope *scope, const ivy_assembler_attrib_table attrib) { struct ivy_bin_block header = {0}; header.b_index = b_i32_htob((uint32_t)attrib[IVY_ASM_ATTRIB_INDEX]); assembler_write_data(as, &header, sizeof header); struct block_assembler_scope *c = (struct block_assembler_scope *)scope; return IVY_OK; } static enum ivy_status put_instr( struct ivy_assembler *as, struct assembler_scope *scope, const struct ivy_instr *instr) { uint32_t op = 0xAABBCCDD; b_i32 x = b_i32_htob(op); assembler_write_data(as, &x, sizeof x); return IVY_OK; } const struct assembler_scope_type block_scope_type = { .s_scope_size = sizeof(struct block_assembler_scope), .s_init_scope = init_scope, .s_put_instr = put_instr, };