86:
and complexity of the program code, it will optimize access to that variable and hence improve the execution time of a program. In C (but not C++ where the keyword is essentially ignored) the location of a variable declared with
105:
may still be significant; for example the
Microchip MPLAB XC32 compiler allows the programmer to specify a particular register with the keyword; however, this is discouraged in favor of the compiler's optimizations. When used,
101:
is essentially meaningless in modern compilers due to optimization which will place variables in a register if appropriate regardless of whether the hint is given. For programming of embedded systems
234:
229:
68:
28:
164:
79:
159:
124:/* store integer variable "i" in RAM, register, or other location as compiler sees fit */
75:
17:
206:
136:/* suggests storing integer variable "i" in a CPU register or other fast location */
189:
169:
223:
42:
38:
111:
64:
56:
93:
114:, or possibly for other very frequently used variables in the code.
52:
83:
72:
97:
operator can be applied. Aside from this limitation,
78:(or some other faster location) instead of in
8:
207:"MPLAB® XC32 C/C++ Compiler User's Guide"
190:"INTERNATIONAL STANDARD ISO/IEC 9899:TC2"
55:, until it became reserved and unused in
181:
82:. If possible depending on the type of
7:
25:
18:Register (C programming language)
1:
41:(or keyword), type modifier,
91:cannot be accessed, but the
235:Variable (computer science)
251:
51:keyword was deprecated in
230:C (programming language)
121:
29:C programming language
165:Program optimization
80:random-access memory
160:Optimizing compiler
110:is typically for
69:declared variable
16:(Redirected from
242:
214:
213:
211:
203:
197:
196:
194:
186:
170:Static (keyword)
149:
146:
143:
140:
137:
134:
131:
128:
125:
109:
104:
100:
96:
90:
50:
45:, and hint. The
36:
21:
250:
249:
245:
244:
243:
241:
240:
239:
220:
219:
218:
217:
209:
205:
204:
200:
192:
188:
187:
183:
178:
156:
151:
150:
147:
144:
141:
138:
135:
132:
129:
126:
123:
120:
107:
102:
98:
92:
88:
46:
32:
23:
22:
15:
12:
11:
5:
248:
246:
238:
237:
232:
222:
221:
216:
215:
212:. p. 170.
198:
180:
179:
177:
174:
173:
172:
167:
162:
155:
152:
122:
119:
116:
24:
14:
13:
10:
9:
6:
4:
3:
2:
247:
236:
233:
231:
228:
227:
225:
208:
202:
199:
191:
185:
182:
175:
171:
168:
166:
163:
161:
158:
157:
153:
117:
115:
113:
112:loop counters
95:
85:
81:
77:
74:
70:
66:
62:
58:
54:
49:
44:
43:storage class
40:
39:reserved word
35:
30:
19:
201:
184:
60:
47:
33:
26:
224:Categories
176:References
67:stores a
63:that the
154:See also
139:register
118:Examples
108:register
103:register
99:register
89:register
76:register
65:compiler
61:suggests
48:register
34:register
27:In the
94:sizeof
210:(PDF)
193:(PDF)
71:in a
59:. It
57:C++17
37:is a
142:int
127:int
84:CPU
73:CPU
53:C++
226::
31:,
195:.
148:;
145:i
133:;
130:i
20:)
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.