+2002-08-13 Stephane Carrez <stcarrez@nerim.fr>
+
+ * m68hc11-tdep.c (HARD_PAGE_REGNUM): Define for 68HC12 page register.
+ (M68HC11_LAST_HARD_REG, m68hc11_register_names): Update.
+ (m68hc11_register_virtual_type): Return a 8-bit type for 8-bit
+ registers.
+ (m68hc11_register_raw_size): Likewise.
+
2002-08-13 Andrew Cagney <cagney@redhat.com>
* i386-tdep.c (i386_register_name): Handle mmx registers.
#define HARD_A_REGNUM 5
#define HARD_B_REGNUM 6
#define HARD_CCR_REGNUM 7
-#define M68HC11_LAST_HARD_REG (HARD_CCR_REGNUM)
+
+/* 68HC12 page number register.
+ Note: to keep a compatibility with gcc register naming, we must
+ not have to rename FP and other soft registers. The page register
+ is a real hard register and must therefore be counted by NUM_REGS.
+ For this it has the same number as Z register (which is not used). */
+#define HARD_PAGE_REGNUM 8
+#define M68HC11_LAST_HARD_REG (HARD_PAGE_REGNUM)
/* Z is replaced by X or Y by gcc during machine reorg.
??? There is no way to get it and even know whether
m68hc11_register_names[] =
{
"x", "d", "y", "sp", "pc", "a", "b",
- "ccr", "z", "frame","tmp", "zs", "xy", 0,
+ "ccr", "page", "frame","tmp", "zs", "xy", 0,
"d1", "d2", "d3", "d4", "d5", "d6", "d7",
"d8", "d9", "d10", "d11", "d12", "d13", "d14",
"d15", "d16", "d17", "d18", "d19", "d20", "d21",
static struct type *
m68hc11_register_virtual_type (int reg_nr)
{
- return builtin_type_uint16;
+ switch (reg_nr)
+ {
+ case HARD_PAGE_REGNUM:
+ case HARD_A_REGNUM:
+ case HARD_B_REGNUM:
+ case HARD_CCR_REGNUM:
+ return builtin_type_uint8;
+
+ default:
+ return builtin_type_uint16;
+ }
}
static void
static int
m68hc11_register_raw_size (int reg_nr)
{
- return M68HC11_REG_SIZE;
+ switch (reg_nr)
+ {
+ case HARD_PAGE_REGNUM:
+ case HARD_A_REGNUM:
+ case HARD_B_REGNUM:
+ case HARD_CCR_REGNUM:
+ return 1;
+
+ default:
+ return M68HC11_REG_SIZE;
+ }
}
static int