示例#1
0
文件: assembler.c 项目: dkoby/stm8mu
void assembler_init()
{
    struct asm_context_t *ctx;

    app.asmcontext = malloc(sizeof(struct asm_context_t));
    if (!app.asmcontext)
    {
        debug_emsg("Can not allocate memory");
        app_close(APP_EXITCODE_ERROR);
    }

    ctx = app.asmcontext;

    ctx->pass     = 0;
    ctx->dbendian = DB_ENDIAN_BIG;

    tokens_init(&ctx->tokens);
    symbols_init(&ctx->symbols);
    sections_init(&ctx->sections);
    relocations_init(&ctx->relocations);

    ctx->section = section_select(&ctx->sections, "text");
}
示例#2
0
void asm_init (void) {
  infoHead = infoTail = currInfo = NULL; 
  tokens_init();
  lc3_sym_tab = symbol_init(0); 
}