void commit(void) { if (Q_cmp != cnone) { commit_cmp(); return; } if (Q_bool != bnone) { commit_bool(); return; } if (empty == Q_type) return; spill(); switch (Q_type) { case addr_auto: cgldla(Q_val); break; case addr_static: cgldsa(Q_val); break; case addr_globl: cgldga(gsym(Q_name)); break; case addr_label: cgldlab(Q_val); break; case literal: cglit(Q_val); break; case auto_byte: cgclear(); cgldlb(Q_val); break; case auto_word: cgldlw(Q_val); break; case static_byte: cgclear(); cgldsb(Q_val); break; case static_word: cgldsw(Q_val); break; case globl_byte: cgclear(); cgldgb(gsym(Q_name)); break; case globl_word: cgldgw(gsym(Q_name)); break; default: fatal("internal: unknown Q_type"); } load(); Q_type = empty; }
void cgindb(void) { gen("movl\t%eax,%edx"); cgclear(); gen("movb\t(%edx),%al"); }
void cgindb(void) { gen("mov\tbx,ax"); cgclear(); gen("mov\tal,[bx]"); }