1 1.1 christos #ifndef S12Z_H 2 1.1 christos #define S12Z_H 3 1.1 christos 4 1.1 christos /* This byte is used to prefix instructions in "page 2" of the opcode 5 1.1.1.2 christos space. */ 6 1.1 christos #define PAGE2_PREBYTE (0x1b) 7 1.1 christos 8 1.1 christos struct reg 9 1.1 christos { 10 1.1.1.2 christos char *name; /* The canonical name of the register. */ 11 1.1.1.2 christos int bytes; /* its size, in bytes. */ 12 1.1 christos }; 13 1.1 christos 14 1.1 christos 15 1.1 christos /* How many registers do we have. Actually there are only 13, 16 1.1 christos because CCL and CCH are the low and high bytes of CCW. But 17 1.1 christos for assemnbly / disassembly purposes they are considered 18 1.1.1.2 christos distinct registers. */ 19 1.1 christos #define S12Z_N_REGISTERS 15 20 1.1 christos 21 1.1 christos extern const struct reg registers[S12Z_N_REGISTERS]; 22 1.1 christos 23 1.1.1.2 christos /* Solaris defines REG_Y in sys/regset.h; undef it here to avoid 24 1.1.1.2 christos breaking compilation when this target is enabled. */ 25 1.1.1.2 christos #undef REG_Y 26 1.1.1.2 christos 27 1.1.1.2 christos enum 28 1.1.1.2 christos { 29 1.1 christos REG_D2 = 0, 30 1.1 christos REG_D3, 31 1.1 christos REG_D4, 32 1.1 christos REG_D5, 33 1.1 christos REG_D0, 34 1.1 christos REG_D1, 35 1.1 christos REG_D6, 36 1.1 christos REG_D7, 37 1.1 christos REG_X, 38 1.1 christos REG_Y, 39 1.1 christos REG_S, 40 1.1 christos REG_P, 41 1.1 christos REG_CCH, 42 1.1 christos REG_CCL, 43 1.1 christos REG_CCW 44 1.1 christos }; 45 1.1 christos 46 1.1.1.2 christos /* Any of the registers d0, d1, ... d7. */ 47 1.1 christos #define REG_BIT_Dn \ 48 1.1 christos ((0x1U << REG_D2) | \ 49 1.1 christos (0x1U << REG_D3) | \ 50 1.1 christos (0x1U << REG_D4) | \ 51 1.1 christos (0x1U << REG_D5) | \ 52 1.1 christos (0x1U << REG_D6) | \ 53 1.1 christos (0x1U << REG_D7) | \ 54 1.1 christos (0x1U << REG_D0) | \ 55 1.1 christos (0x1U << REG_D1)) 56 1.1 christos 57 1.1.1.2 christos /* Any of the registers x, y or z. */ 58 1.1 christos #define REG_BIT_XYS \ 59 1.1 christos ((0x1U << REG_X) | \ 60 1.1 christos (0x1U << REG_Y) | \ 61 1.1 christos (0x1U << REG_S)) 62 1.1 christos 63 1.1.1.2 christos /* Any of the registers x, y, z or p. */ 64 1.1 christos #define REG_BIT_XYSP \ 65 1.1 christos ((0x1U << REG_X) | \ 66 1.1 christos (0x1U << REG_Y) | \ 67 1.1 christos (0x1U << REG_S) | \ 68 1.1 christos (0x1U << REG_P)) 69 1.1 christos 70 1.1.1.2 christos /* The x register or the y register. */ 71 1.1 christos #define REG_BIT_XY \ 72 1.1 christos ((0x1U << REG_X) | \ 73 1.1 christos (0x1U << REG_Y)) 74 1.1 christos 75 1.1 christos #endif 76