asm/asm.c
static void emit_addr(struct Context *ctx, enum Arg arg, struct Token *token) {
    if (token->kind == TK_SYMBOL) {
        add_patch(ctx, token);
    } else {
        asmchk(token->kind == TK_NUMBER, ctx, token, "Expected number");
        asmchk(
            arg & A_IMM, ctx, token,
            "Expected immediate address"
        );
        BUFADD(ctx->out, token->value & 0xFF);
        BUFADD(ctx->out, (token->value >> 8) & 0xFF);
    }
}
// emits the specified token/argument as an address
emits the specified token/argument as an address
emits the specified token / argument as an address
static void emit_addr(struct Context *ctx, enum Arg arg, struct Token *token) {
    if (token->kind == TK_SYMBOL) {
        add_patch(ctx, token);
    } else {
        asmchk(token->kind == TK_NUMBER, ctx, token, "Expected number");
        asmchk(
            arg & A_IMM, ctx, token,
            "Expected immediate address"
        );
        BUFADD(ctx->out, token->value & 0xFF);
        BUFADD(ctx->out, (token->value >> 8) & 0xFF);
    }
}
static void emit_addr ( struct Context * ctx , enum Arg arg , struct Token * token ) { if ( token -> kind == TK_SYMBOL ) { add_patch ( ctx , token ) ; } else { asmchk ( token -> kind == TK_NUMBER , ctx , token , " " ) ; asmchk ( arg & A_IMM , ctx , token , " " ) ; BUFADD ( ctx -> out , token -> value & 0xFF ) ; BUFADD ( ctx -> out , ( token -> value >> 8 ) & 0xFF ) ; } }
emits the specified token/argument as an address
emits the specified token / argument as an address