Mercurial > repos > simple16
comparison src/cpu.h @ 46:51672bd41cdd
Rework data segment setup to allow a stack segment and to add space for push and pop instructions
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 30 Aug 2016 20:50:54 -0700 |
parents | 6e7bfe83d2b0 |
children |
comparison
equal
deleted
inserted
replaced
45:5338b9affd09 | 46:51672bd41cdd |
---|---|
32 uint32_t current_target; | 32 uint32_t current_target; |
33 uint32_t num_mem_regions; | 33 uint32_t num_mem_regions; |
34 uint16_t regs[16]; | 34 uint16_t regs[16]; |
35 uint16_t exception; | 35 uint16_t exception; |
36 uint16_t exception_pc; | 36 uint16_t exception_pc; |
37 uint16_t exception_pch; | |
38 uint16_t exception_sr; | 37 uint16_t exception_sr; |
39 uint16_t exception_ur; | 38 uint16_t exception_ur; |
40 uint16_t vector_base; | 39 uint16_t vector_base; |
41 uint32_t pc_msb; | 40 uint32_t pc_msb; |
42 uint32_t data_low_msb; | 41 uint32_t exception_pc_msb; |
43 uint32_t data_high_msb; | |
44 | 42 |
45 uint16_t prefetch; | 43 uint16_t prefetch; |
46 | 44 |
47 uint8_t state; | 45 uint8_t state; |
48 uint8_t pending_interrupts; | 46 uint8_t pending_interrupts; |
101 }; | 99 }; |
102 | 100 |
103 enum { | 101 enum { |
104 RETI, | 102 RETI, |
105 TRAPI, | 103 TRAPI, |
104 PUSH, | |
105 POP, | |
106 GETPCH, | |
107 SETPCH, | |
106 GETEPC, | 108 GETEPC, |
107 SETEPC, | 109 SETEPC, |
108 GETEPCH, | |
109 SETEPCH, | |
110 GETESR, | 110 GETESR, |
111 SETESR, | 111 SETESR, |
112 GETEUR, | 112 GETEUR, |
113 SETEUR, | 113 SETEUR, |
114 GETENUM, | 114 GETENUM, |
115 SETENUM, | 115 SETENUM, |
116 GETVBR, | 116 GETVBR, |
117 SETVBR, | 117 SETVBR, |
118 GETDATABANKS, | |
119 SETDATABANKS, | |
120 }; | 118 }; |
121 | 119 |
122 enum { | 120 enum { |
123 COND_ALWAYS, | 121 COND_ALWAYS, |
124 COND_NEVER, | 122 COND_NEVER, |
130 COND_NCARRY, | 128 COND_NCARRY, |
131 COND_GREATER, | 129 COND_GREATER, |
132 COND_LEQ | 130 COND_LEQ |
133 }; | 131 }; |
134 | 132 |
133 #define REG_DB 12 | |
134 #define REG_SP 13 | |
135 #define REG_PC 14 | 135 #define REG_PC 14 |
136 #define REG_SR 15 | 136 #define REG_SR 15 |
137 | 137 |
138 #endif //CPU_H_ | 138 #endif //CPU_H_ |