2 * Simulator of microcontrollers (regs51.h)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
32 /* Address of SFR registers */
34 #define ACC 0xe0 /* Accumulator */
35 #define B 0xf0 /* B register (scondary accumulator) */
36 #define PSW 0xd0 /* Program Status Word */
37 #define SP 0x81 /* Stack Pointer */
38 #define DPL 0x82 /* Data Pointer Low byte */
39 #define DPH 0x83 /* Data Pointer High byte */
40 #define P0 0x80 /* Port #0 */
41 #define P1 0x90 /* Port #1 */
42 #define P2 0xa0 /* Port #2 */
43 #define P3 0xb0 /* Port #3 */
44 #define IP 0xb8 /* Intrrupt Priority */
45 #define IE 0xa8 /* Interrupt Enable */
46 #define TMOD 0x89 /* Timer MODe */
47 #define TCON 0x88 /* Timer CONtrol */
48 #define T2CON 0xc8 /* Timer #2 CONtrol */
49 #define TH0 0x8c /* Timer #0 High byte */
50 #define TL0 0x8a /* Timer #0 Low byte */
51 #define TH1 0x8d /* Timer #1 High byte */
52 #define TL1 0x8b /* Timer #1 Low byte */
53 #define SCON 0x98 /* Serial line CONtrol */
54 #define TH2 0xcd /* Timer #2 High byte */
55 #define TL2 0xcc /* Timer #2 Low byte */
56 #define RCAP2H 0xcb /* Capture Register of Timer #2 High byte */
57 #define RCAP2L 0xca /* Capture Register of Timer #2 Low byte */
58 #define SBUF 0x99 /* Serial line BUFfer */
59 #define PCON 0x87 /* Power CONtrol */
61 #define AUXR 0x8e /* Auxiliary Register */
62 #define AUXR1 0xa2 /* Secondary Aux Register */
65 #define DPXL 0x84 /* */
66 #define DPL1 0x84 /* 2nd Data Pointer Low byte */
67 #define DPH1 0x85 /* 2nd Data Pointer High byte */
68 #define DPS 0x86 /* DPS 1H=DPTR is DPL1/DPH1,... */
69 #define EXIF 0x91 /* */
70 #define P4CNT 0x92 /* */
71 #define DPX 0x93 /* Data Pointer HHigh byte */
72 #define DPX1 0x95 /* Data Pointer HHigh byte */
73 #define ESP 0x9b /* Extended Stack Pointer */
74 #define ACON 0x9d /* */
76 #define P5CNT 0xa2 /* */
77 #define C0C 0xa3 /* */
78 #define WDTRST 0xa6 /* */
79 #define IE0 0xa8 /* */
80 #define SADDR 0xa9 /* */
81 #define IPH0 0xb7 /* */
83 #define IPL0 0xb8 /* */
84 #define SADEN 0xb9 /* */
85 #define SPH 0xbd /* */
86 #define PMR 0xc4 /* */
87 #define MCON 0xc6 /* */
89 #define T2MOD 0xc9 /* */
90 #define COR 0xce /* */
91 #define PSW1 0xd1 /* */
94 #define MA 0xd3 /* MA register from math accelerator */
95 #define MB 0xd4 /* MB register from math accelerator */
96 #define MC 0xd5 /* MC register from math accelerator */
97 #define CCON 0xd8 /* */
98 #define WDCON 0xd8 /* */
99 #define CMOD 0xd9 /* */
100 #define CCAPM0 0xda /* */
101 #define CCAPM1 0xdb /* */
102 #define CCAPM2 0xdc /* */
103 #define CCAPM3 0xdd /* */
104 #define CCAPM4 0xde /* */
105 #define C1C 0xe3 /* */
106 #define CL 0xe9 /* */
107 #define CCAP0L 0xea /* */
108 #define CCAP1L 0xeb /* */
109 #define CCAP2L 0xec /* */
110 #define CCAP3L 0xed /* */
111 #define CCAP4L 0xee /* */
112 #define CH 0xf9 /* */
113 #define CCAP0H 0xfa /* */
114 #define CCAP1H 0xfb /* */
115 #define CCAP2H 0xfc /* */
116 #define CCAP3H 0xfd /* */
117 #define CCAP4H 0xfe /* */
119 /* Bit masks of flag bits in PSW (0xd0)*/
121 #define bmCY 0x80 /* carry */
122 #define bmAC 0x40 /* acarry */
123 #define bmF0 0x20 /* flag 0 */
124 #define bmRS1 0x10 /* register select 1 */
125 #define bmRS0 0x08 /* register select 0 */
126 #define bmOV 0x04 /* arithmetic overflow */
127 #define bmP 0x01 /* parity, set by hardware */
129 /* Bit masks in PCON (0x87) */
140 /* Bit masks in IE (0xa8) */
151 /* Bit masks in IP (0xb8) */
161 /* Bit masks in IPL0 (0xb8) */
163 #define bmIPL0_6 0x40
164 #define bmIPL0_5 0x20
165 #define bmIPL0_4 0x10
166 #define bmIPL0_3 0x08
167 #define bmIPL0_2 0x04
168 #define bmIPL0_1 0x02
169 #define bmIPL0_0 0x01
171 /* Bit masks in IPH0 (0xb7) */
173 #define bmIPH0_6 0x40
174 #define bmIPH0_5 0x20
175 #define bmIPH0_4 0x10
176 #define bmIPH0_3 0x08
177 #define bmIPH0_2 0x04
178 #define bmIPH0_1 0x02
179 #define bmIPH0_0 0x01
181 /* Bit masks in P1 (0x90) */
192 /* Bit masks in P3 (0xb0) */
203 /* Bit masks in TMOD (0x89) */
214 /* Bit masks in TCON (0x88) */
225 /* Bit masks in AUXR (0x8e) */
227 #define bmEXTRAM 0x02
228 #define bmDISABLE 0x01
230 /* Bit masks in AUXR1 (0xa2) */
232 #define bmENBOOT 0x20
236 /* Bit masks in T2CON (0xc8) */
245 #define bmCP_RL2 0x01
247 /* Bit masks in SCON (0x98) */
249 #define bmFE_SM0 0x80
260 /* Bit masks in T2MOD (0xc9) */
265 /* Bit masks in CMOD (0xd9) */
273 /* Bit masks in CCON (0xd8) */
283 /* Bit masks in CCAPM0 (0xda) */
293 /* Bit masks in CCAPM1 (0xdb) */
303 /* Bit masks in CCAPM2 (0xdc) */
313 /* Bit masks in CCAPM3 (0xdd) */
323 /* Bit masks in CCAPM4 (0xde) */
344 /* End of s51.src/regs51.h */