+void ia32_build_16bit_reg_map(pmap *reg_map) {
+ pmap_insert(reg_map, &ia32_gp_regs[REG_EAX], "ax");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_EBX], "bx");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_ECX], "cx");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_EDX], "dx");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_ESI], "si");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_EDI], "di");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_EBP], "bp");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_ESP], "sp");
+}
+
+void ia32_build_8bit_reg_map(pmap *reg_map) {
+ pmap_insert(reg_map, &ia32_gp_regs[REG_EAX], "al");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_EBX], "bl");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_ECX], "cl");
+ pmap_insert(reg_map, &ia32_gp_regs[REG_EDX], "dl");
+}
+
+const char *ia32_get_mapped_reg_name(pmap *reg_map, const arch_register_t *reg) {
+ pmap_entry *e = pmap_find(reg_map, (void *)reg);
+
+ //assert(e && "missing map init?");
+ if (! e) {
+ printf("FIXME: ia32map_regs.c:122: returning fake register name for ia32 with 32 register\n");
+ return reg->name;
+ }