KeLe-open-code commited on
Commit
bd8bc50
·
verified ·
1 Parent(s): 6b770f4

Publish sanitized 8051 lab examples

Browse files
Files changed (43) hide show
  1. .gitattributes +1 -0
  2. .gitignore +36 -0
  3. 1/1.c +34 -0
  4. 1/1.pdsprj +0 -0
  5. 1/1.uvproj +395 -0
  6. 1/STARTUP.A51 +198 -0
  7. 2/2.DSN +3 -0
  8. 2/2.c +30 -0
  9. 2/2.pdsprj +0 -0
  10. 2/2.uvproj +395 -0
  11. 2/STARTUP.A51 +198 -0
  12. 3/3.DSN +0 -0
  13. 3/3.c +38 -0
  14. 3/3.pdsprj +0 -0
  15. 3/3.uvproj +395 -0
  16. 3/STARTUP.A51 +198 -0
  17. 4/4.DSN +0 -0
  18. 4/4.c +25 -0
  19. 4/4.pdsprj +0 -0
  20. 4/4.uvproj +395 -0
  21. 4/STARTUP.A51 +198 -0
  22. 5/5.DSN +0 -0
  23. 5/5.c +60 -0
  24. 5/5.pdsprj +0 -0
  25. 5/5.uvproj +395 -0
  26. 5/STARTUP.A51 +198 -0
  27. 6/6.DSN +0 -0
  28. 6/6.c +68 -0
  29. 6/6.pdsprj +0 -0
  30. 6/6.uvproj +395 -0
  31. 6/STARTUP.A51 +198 -0
  32. 7/7.DSN +0 -0
  33. 7/7.c +18 -0
  34. 7/7.pdsprj +0 -0
  35. 7/7.uvproj +395 -0
  36. 7/STARTUP.A51 +198 -0
  37. 8/8.DSN +0 -0
  38. 8/8.c +32 -0
  39. 8/8.pdsprj +0 -0
  40. 8/8.uvproj +395 -0
  41. 8/STARTUP.A51 +198 -0
  42. LICENSE +21 -0
  43. README.md +35 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ 2/2.DSN filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Personal or student information
2
+ /1/2*.c
3
+
4
+ # Keil user settings and build outputs
5
+ *.uvgui.*
6
+ *.uvopt
7
+ *.build_log.htm
8
+ *.lst
9
+ *.LST
10
+ *.obj
11
+ *.OBJ
12
+ *.m51
13
+ *.M51
14
+ *.lnp
15
+ *.hex
16
+ *.HEX
17
+ *.__i
18
+ **/Listings/
19
+ **/Objects/
20
+ **/verify/
21
+ **/代码/
22
+ **/代码1/
23
+ /2/动态显示*
24
+ /3/2*
25
+ /5/矩阵式键盘*
26
+ build-check.txt
27
+
28
+ # Proteus backups and user settings
29
+ *.workspace
30
+ *.pdsbak
31
+ *.agent-backup
32
+ *_candidate.DSN
33
+
34
+ # OS files
35
+ .DS_Store
36
+ Thumbs.db
1/1.c ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <REG51.H>
2
+
3
+ void delayMs(unsigned int i)
4
+ {
5
+ unsigned char t;
6
+ while (i--)
7
+ {
8
+ for (t = 0; t < 120; t++);
9
+ }
10
+ }
11
+
12
+ void main(void)
13
+ {
14
+ unsigned char i;
15
+
16
+ while (1)
17
+ {
18
+ for (i = 0; i < 7; i++)
19
+ {
20
+ P2 = ~(1 << i);
21
+ delayMs(500);
22
+ }
23
+ for (i = 5; i > 0; i--)
24
+ {
25
+ P2 = ~(1 << i);
26
+ delayMs(500);
27
+ }
28
+ for (i = 0; i < 7; i++)
29
+ {
30
+ P2 = ~(1 << i);
31
+ delayMs(500);
32
+ }
33
+ }
34
+ }
1/1.pdsprj ADDED
Binary file (14.5 kB). View file
 
1/1.uvproj ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
3
+
4
+ <SchemaVersion>1.1</SchemaVersion>
5
+
6
+ <Header>### uVision Project, (C) Keil Software</Header>
7
+
8
+ <Targets>
9
+ <Target>
10
+ <TargetName>Target 1</TargetName>
11
+ <ToolsetNumber>0x0</ToolsetNumber>
12
+ <ToolsetName>MCS-51</ToolsetName>
13
+ <uAC6>0</uAC6>
14
+ <TargetOption>
15
+ <TargetCommonOption>
16
+ <Device>AT89C51</Device>
17
+ <Vendor>Microchip</Vendor>
18
+ <Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
19
+ <FlashUtilSpec></FlashUtilSpec>
20
+ <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
21
+ <FlashDriverDll></FlashDriverDll>
22
+ <DeviceId>2976</DeviceId>
23
+ <RegisterFile>REGX51.H</RegisterFile>
24
+ <MemoryEnv></MemoryEnv>
25
+ <Cmp></Cmp>
26
+ <Asm></Asm>
27
+ <Linker></Linker>
28
+ <OHString></OHString>
29
+ <InfinionOptionDll></InfinionOptionDll>
30
+ <SLE66CMisc></SLE66CMisc>
31
+ <SLE66AMisc></SLE66AMisc>
32
+ <SLE66LinkerMisc></SLE66LinkerMisc>
33
+ <SFDFile></SFDFile>
34
+ <bCustSvd>0</bCustSvd>
35
+ <UseEnv>0</UseEnv>
36
+ <BinPath></BinPath>
37
+ <IncludePath></IncludePath>
38
+ <LibPath></LibPath>
39
+ <RegisterFilePath>Atmel\</RegisterFilePath>
40
+ <DBRegisterFilePath>Atmel\</DBRegisterFilePath>
41
+ <TargetStatus>
42
+ <Error>0</Error>
43
+ <ExitCodeStop>0</ExitCodeStop>
44
+ <ButtonStop>0</ButtonStop>
45
+ <NotGenerated>0</NotGenerated>
46
+ <InvalidFlash>1</InvalidFlash>
47
+ </TargetStatus>
48
+ <OutputDirectory>.\Objects\</OutputDirectory>
49
+ <OutputName>1</OutputName>
50
+ <CreateExecutable>1</CreateExecutable>
51
+ <CreateLib>0</CreateLib>
52
+ <CreateHexFile>1</CreateHexFile>
53
+ <DebugInformation>1</DebugInformation>
54
+ <BrowseInformation>1</BrowseInformation>
55
+ <ListingPath>.\Listings\</ListingPath>
56
+ <HexFormatSelection>0</HexFormatSelection>
57
+ <Merge32K>0</Merge32K>
58
+ <CreateBatchFile>0</CreateBatchFile>
59
+ <BeforeCompile>
60
+ <RunUserProg1>0</RunUserProg1>
61
+ <RunUserProg2>0</RunUserProg2>
62
+ <UserProg1Name></UserProg1Name>
63
+ <UserProg2Name></UserProg2Name>
64
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
65
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
66
+ <nStopU1X>0</nStopU1X>
67
+ <nStopU2X>0</nStopU2X>
68
+ </BeforeCompile>
69
+ <BeforeMake>
70
+ <RunUserProg1>0</RunUserProg1>
71
+ <RunUserProg2>0</RunUserProg2>
72
+ <UserProg1Name></UserProg1Name>
73
+ <UserProg2Name></UserProg2Name>
74
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
75
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76
+ <nStopB1X>0</nStopB1X>
77
+ <nStopB2X>0</nStopB2X>
78
+ </BeforeMake>
79
+ <AfterMake>
80
+ <RunUserProg1>0</RunUserProg1>
81
+ <RunUserProg2>0</RunUserProg2>
82
+ <UserProg1Name></UserProg1Name>
83
+ <UserProg2Name></UserProg2Name>
84
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
85
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
86
+ <nStopA1X>0</nStopA1X>
87
+ <nStopA2X>0</nStopA2X>
88
+ </AfterMake>
89
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
90
+ <SVCSIdString></SVCSIdString>
91
+ </TargetCommonOption>
92
+ <CommonProperty>
93
+ <UseCPPCompiler>0</UseCPPCompiler>
94
+ <RVCTCodeConst>0</RVCTCodeConst>
95
+ <RVCTZI>0</RVCTZI>
96
+ <RVCTOtherData>0</RVCTOtherData>
97
+ <ModuleSelection>0</ModuleSelection>
98
+ <IncludeInBuild>1</IncludeInBuild>
99
+ <AlwaysBuild>0</AlwaysBuild>
100
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
101
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
102
+ <PublicsOnly>0</PublicsOnly>
103
+ <StopOnExitCode>3</StopOnExitCode>
104
+ <CustomArgument></CustomArgument>
105
+ <IncludeLibraryModules></IncludeLibraryModules>
106
+ <ComprImg>1</ComprImg>
107
+ <BankNo>65535</BankNo>
108
+ </CommonProperty>
109
+ <DllOption>
110
+ <SimDllName>S8051.DLL</SimDllName>
111
+ <SimDllArguments></SimDllArguments>
112
+ <SimDlgDll>DP51.DLL</SimDlgDll>
113
+ <SimDlgDllArguments>-p51</SimDlgDllArguments>
114
+ <TargetDllName>S8051.DLL</TargetDllName>
115
+ <TargetDllArguments></TargetDllArguments>
116
+ <TargetDlgDll>TP51.DLL</TargetDlgDll>
117
+ <TargetDlgDllArguments>-p51</TargetDlgDllArguments>
118
+ </DllOption>
119
+ <DebugOption>
120
+ <OPTHX>
121
+ <HexSelection>0</HexSelection>
122
+ <HexRangeLowAddress>0</HexRangeLowAddress>
123
+ <HexRangeHighAddress>0</HexRangeHighAddress>
124
+ <HexOffset>0</HexOffset>
125
+ <Oh166RecLen>16</Oh166RecLen>
126
+ </OPTHX>
127
+ <Simulator>
128
+ <UseSimulator>1</UseSimulator>
129
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
130
+ <RunToMain>1</RunToMain>
131
+ <RestoreBreakpoints>1</RestoreBreakpoints>
132
+ <RestoreWatchpoints>1</RestoreWatchpoints>
133
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
134
+ <RestoreFunctions>1</RestoreFunctions>
135
+ <RestoreToolbox>1</RestoreToolbox>
136
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
137
+ <RestoreSysVw>1</RestoreSysVw>
138
+ </Simulator>
139
+ <Target>
140
+ <UseTarget>0</UseTarget>
141
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
142
+ <RunToMain>0</RunToMain>
143
+ <RestoreBreakpoints>1</RestoreBreakpoints>
144
+ <RestoreWatchpoints>1</RestoreWatchpoints>
145
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
146
+ <RestoreFunctions>0</RestoreFunctions>
147
+ <RestoreToolbox>1</RestoreToolbox>
148
+ <RestoreTracepoints>1</RestoreTracepoints>
149
+ <RestoreSysVw>1</RestoreSysVw>
150
+ </Target>
151
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
152
+ <TargetSelection>-1</TargetSelection>
153
+ <SimDlls>
154
+ <CpuDll></CpuDll>
155
+ <CpuDllArguments></CpuDllArguments>
156
+ <PeripheralDll></PeripheralDll>
157
+ <PeripheralDllArguments></PeripheralDllArguments>
158
+ <InitializationFile></InitializationFile>
159
+ </SimDlls>
160
+ <TargetDlls>
161
+ <CpuDll></CpuDll>
162
+ <CpuDllArguments></CpuDllArguments>
163
+ <PeripheralDll></PeripheralDll>
164
+ <PeripheralDllArguments></PeripheralDllArguments>
165
+ <InitializationFile></InitializationFile>
166
+ <Driver></Driver>
167
+ </TargetDlls>
168
+ </DebugOption>
169
+ <Utilities>
170
+ <Flash1>
171
+ <UseTargetDll>0</UseTargetDll>
172
+ <UseExternalTool>0</UseExternalTool>
173
+ <RunIndependent>0</RunIndependent>
174
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
175
+ <Capability>0</Capability>
176
+ <DriverSelection>-1</DriverSelection>
177
+ </Flash1>
178
+ <bUseTDR>0</bUseTDR>
179
+ <Flash2></Flash2>
180
+ <Flash3></Flash3>
181
+ <Flash4></Flash4>
182
+ <pFcarmOut></pFcarmOut>
183
+ <pFcarmGrp></pFcarmGrp>
184
+ <pFcArmRoot></pFcArmRoot>
185
+ <FcArmLst>0</FcArmLst>
186
+ </Utilities>
187
+ <Target51>
188
+ <Target51Misc>
189
+ <MemoryModel>0</MemoryModel>
190
+ <RTOS>0</RTOS>
191
+ <RomSize>2</RomSize>
192
+ <DataHold>0</DataHold>
193
+ <XDataHold>0</XDataHold>
194
+ <UseOnchipRom>0</UseOnchipRom>
195
+ <UseOnchipArithmetic>0</UseOnchipArithmetic>
196
+ <UseMultipleDPTR>0</UseMultipleDPTR>
197
+ <UseOnchipXram>0</UseOnchipXram>
198
+ <HadIRAM>1</HadIRAM>
199
+ <HadXRAM>0</HadXRAM>
200
+ <HadIROM>1</HadIROM>
201
+ <Moda2>0</Moda2>
202
+ <Moddp2>0</Moddp2>
203
+ <Modp2>0</Modp2>
204
+ <Mod517dp>0</Mod517dp>
205
+ <Mod517au>0</Mod517au>
206
+ <Mode2>0</Mode2>
207
+ <useCB>0</useCB>
208
+ <useXB>0</useXB>
209
+ <useL251>0</useL251>
210
+ <useA251>0</useA251>
211
+ <Mx51>0</Mx51>
212
+ <ModC812>0</ModC812>
213
+ <ModCont>0</ModCont>
214
+ <Lp51>0</Lp51>
215
+ <useXBS>0</useXBS>
216
+ <ModDA>0</ModDA>
217
+ <ModAB2>0</ModAB2>
218
+ <Mx51P>0</Mx51P>
219
+ <hadXRAM2>0</hadXRAM2>
220
+ <uocXram2>0</uocXram2>
221
+ <hadXRAM3>0</hadXRAM3>
222
+ <ModC2>0</ModC2>
223
+ <ModH2>0</ModH2>
224
+ <Mdu_R515>0</Mdu_R515>
225
+ <Mdu_F120>0</Mdu_F120>
226
+ <Psoc>0</Psoc>
227
+ <hadIROM2>0</hadIROM2>
228
+ <hadIROM3>0</hadIROM3>
229
+ <ModSmx2>0</ModSmx2>
230
+ <cBanks>0</cBanks>
231
+ <xBanks>0</xBanks>
232
+ <OnChipMemories>
233
+ <RCB>
234
+ <Type>0</Type>
235
+ <StartAddress>0x0</StartAddress>
236
+ <Size>0x10000</Size>
237
+ </RCB>
238
+ <RXB>
239
+ <Type>0</Type>
240
+ <StartAddress>0x0</StartAddress>
241
+ <Size>0x0</Size>
242
+ </RXB>
243
+ <Ocm1>
244
+ <Type>0</Type>
245
+ <StartAddress>0x0</StartAddress>
246
+ <Size>0x0</Size>
247
+ </Ocm1>
248
+ <Ocm2>
249
+ <Type>0</Type>
250
+ <StartAddress>0x0</StartAddress>
251
+ <Size>0x0</Size>
252
+ </Ocm2>
253
+ <Ocm3>
254
+ <Type>0</Type>
255
+ <StartAddress>0x0</StartAddress>
256
+ <Size>0x0</Size>
257
+ </Ocm3>
258
+ <Ocr1>
259
+ <Type>0</Type>
260
+ <StartAddress>0x0</StartAddress>
261
+ <Size>0x0</Size>
262
+ </Ocr1>
263
+ <Ocr2>
264
+ <Type>0</Type>
265
+ <StartAddress>0x0</StartAddress>
266
+ <Size>0x0</Size>
267
+ </Ocr2>
268
+ <Ocr3>
269
+ <Type>0</Type>
270
+ <StartAddress>0x0</StartAddress>
271
+ <Size>0x0</Size>
272
+ </Ocr3>
273
+ <IRO>
274
+ <Type>1</Type>
275
+ <StartAddress>0x0</StartAddress>
276
+ <Size>0x1000</Size>
277
+ </IRO>
278
+ <IRA>
279
+ <Type>0</Type>
280
+ <StartAddress>0x0</StartAddress>
281
+ <Size>0x80</Size>
282
+ </IRA>
283
+ <XRA>
284
+ <Type>0</Type>
285
+ <StartAddress>0x0</StartAddress>
286
+ <Size>0x0</Size>
287
+ </XRA>
288
+ <XRA512>
289
+ <Type>0</Type>
290
+ <StartAddress>0x0</StartAddress>
291
+ <Size>0x0</Size>
292
+ </XRA512>
293
+ <IROM512>
294
+ <Type>0</Type>
295
+ <StartAddress>0x0</StartAddress>
296
+ <Size>0x0</Size>
297
+ </IROM512>
298
+ <XRA513>
299
+ <Type>0</Type>
300
+ <StartAddress>0x0</StartAddress>
301
+ <Size>0x0</Size>
302
+ </XRA513>
303
+ <IROM513>
304
+ <Type>0</Type>
305
+ <StartAddress>0x0</StartAddress>
306
+ <Size>0x0</Size>
307
+ </IROM513>
308
+ </OnChipMemories>
309
+ </Target51Misc>
310
+ <C51>
311
+ <RegisterColoring>0</RegisterColoring>
312
+ <VariablesInOrder>0</VariablesInOrder>
313
+ <IntegerPromotion>1</IntegerPromotion>
314
+ <uAregs>0</uAregs>
315
+ <UseInterruptVector>1</UseInterruptVector>
316
+ <Fuzzy>3</Fuzzy>
317
+ <Optimize>8</Optimize>
318
+ <WarningLevel>2</WarningLevel>
319
+ <SizeSpeed>1</SizeSpeed>
320
+ <ObjectExtend>1</ObjectExtend>
321
+ <ACallAJmp>0</ACallAJmp>
322
+ <InterruptVectorAddress>0</InterruptVectorAddress>
323
+ <VariousControls>
324
+ <MiscControls></MiscControls>
325
+ <Define></Define>
326
+ <Undefine></Undefine>
327
+ <IncludePath></IncludePath>
328
+ </VariousControls>
329
+ </C51>
330
+ <Ax51>
331
+ <UseMpl>0</UseMpl>
332
+ <UseStandard>1</UseStandard>
333
+ <UseCase>0</UseCase>
334
+ <UseMod51>0</UseMod51>
335
+ <VariousControls>
336
+ <MiscControls></MiscControls>
337
+ <Define></Define>
338
+ <Undefine></Undefine>
339
+ <IncludePath></IncludePath>
340
+ </VariousControls>
341
+ </Ax51>
342
+ <Lx51>
343
+ <useFile>0</useFile>
344
+ <linkonly>0</linkonly>
345
+ <UseMemoryFromTarget>1</UseMemoryFromTarget>
346
+ <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
347
+ <WarningLevel>2</WarningLevel>
348
+ <DataOverlaying>1</DataOverlaying>
349
+ <OverlayString></OverlayString>
350
+ <MiscControls></MiscControls>
351
+ <DisableWarningNumbers></DisableWarningNumbers>
352
+ <LinkerCmdFile></LinkerCmdFile>
353
+ <Assign></Assign>
354
+ <ReserveString></ReserveString>
355
+ <CClasses></CClasses>
356
+ <UserClasses></UserClasses>
357
+ <CSection></CSection>
358
+ <UserSection></UserSection>
359
+ <CodeBaseAddress></CodeBaseAddress>
360
+ <XDataBaseAddress></XDataBaseAddress>
361
+ <PDataBaseAddress></PDataBaseAddress>
362
+ <BitBaseAddress></BitBaseAddress>
363
+ <DataBaseAddress></DataBaseAddress>
364
+ <IDataBaseAddress></IDataBaseAddress>
365
+ <Precede></Precede>
366
+ <Stack></Stack>
367
+ <CodeSegmentName></CodeSegmentName>
368
+ <XDataSegmentName></XDataSegmentName>
369
+ <BitSegmentName></BitSegmentName>
370
+ <DataSegmentName></DataSegmentName>
371
+ <IDataSegmentName></IDataSegmentName>
372
+ </Lx51>
373
+ </Target51>
374
+ </TargetOption>
375
+ <Groups>
376
+ <Group>
377
+ <GroupName>Source Group 1</GroupName>
378
+ <Files>
379
+ <File>
380
+ <FileName>1.c</FileName>
381
+ <FileType>1</FileType>
382
+ <FilePath>.\1.c</FilePath>
383
+ </File>
384
+ <File>
385
+ <FileName>STARTUP.A51</FileName>
386
+ <FileType>2</FileType>
387
+ <FilePath>.\STARTUP.A51</FilePath>
388
+ </File>
389
+ </Files>
390
+ </Group>
391
+ </Groups>
392
+ </Target>
393
+ </Targets>
394
+
395
+ </Project>
1/STARTUP.A51 ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $NOMOD51
2
+ ;------------------------------------------------------------------------------
3
+ ; This file is part of the C51 Compiler package
4
+ ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
5
+ ; Version 8.01
6
+ ;
7
+ ; *** <<< Use Configuration Wizard in Context Menu >>> ***
8
+ ;------------------------------------------------------------------------------
9
+ ; STARTUP.A51: This code is executed after processor reset.
10
+ ;
11
+ ; To translate this file use A51 with the following invocation:
12
+ ;
13
+ ; A51 STARTUP.A51
14
+ ;
15
+ ; To link the modified STARTUP.OBJ file to your application use the following
16
+ ; Lx51 invocation:
17
+ ;
18
+ ; Lx51 your object file list, STARTUP.OBJ controls
19
+ ;
20
+ ;------------------------------------------------------------------------------
21
+ ;
22
+ ; User-defined <h> Power-On Initialization of Memory
23
+ ;
24
+ ; With the following EQU statements the initialization of memory
25
+ ; at processor reset can be defined:
26
+ ;
27
+ ; <o> IDATALEN: IDATA memory size <0x0-0x100>
28
+ ; <i> Note: The absolute start-address of IDATA memory is always 0
29
+ ; <i> The IDATA space overlaps physically the DATA and BIT areas.
30
+ IDATALEN EQU 80H
31
+ ;
32
+ ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
33
+ ; <i> The absolute start address of XDATA memory
34
+ XDATASTART EQU 0
35
+ ;
36
+ ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
37
+ ; <i> The length of XDATA memory in bytes.
38
+ XDATALEN EQU 0
39
+ ;
40
+ ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
41
+ ; <i> The absolute start address of PDATA memory
42
+ PDATASTART EQU 0H
43
+ ;
44
+ ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
45
+ ; <i> The length of PDATA memory in bytes.
46
+ PDATALEN EQU 0H
47
+ ;
48
+ ;</h>
49
+ ;------------------------------------------------------------------------------
50
+ ;
51
+ ;<h> Reentrant Stack Initialization
52
+ ;
53
+ ; The following EQU statements define the stack pointer for reentrant
54
+ ; functions and initialized it:
55
+ ;
56
+ ; <h> Stack Space for reentrant functions in the SMALL model.
57
+ ; <q> IBPSTACK: Enable SMALL model reentrant stack
58
+ ; <i> Stack space for reentrant functions in the SMALL model.
59
+ IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
60
+ ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
61
+ ; <i> Set the top of the stack to the highest location.
62
+ IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
63
+ ; </h>
64
+ ;
65
+ ; <h> Stack Space for reentrant functions in the LARGE model.
66
+ ; <q> XBPSTACK: Enable LARGE model reentrant stack
67
+ ; <i> Stack space for reentrant functions in the LARGE model.
68
+ XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
69
+ ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
70
+ ; <i> Set the top of the stack to the highest location.
71
+ XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
72
+ ; </h>
73
+ ;
74
+ ; <h> Stack Space for reentrant functions in the COMPACT model.
75
+ ; <q> PBPSTACK: Enable COMPACT model reentrant stack
76
+ ; <i> Stack space for reentrant functions in the COMPACT model.
77
+ PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
78
+ ;
79
+ ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
80
+ ; <i> Set the top of the stack to the highest location.
81
+ PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
82
+ ; </h>
83
+ ;</h>
84
+ ;------------------------------------------------------------------------------
85
+ ;
86
+ ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
87
+ ; <e>Compact Model Page Definition
88
+ ;
89
+ ; <i>Define the XDATA page used for PDATA variables.
90
+ ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
91
+ ;
92
+ ; Enable pdata memory page initalization
93
+ PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
94
+ ;
95
+ ; <o> PPAGE number <0x0-0xFF>
96
+ ; <i> uppermost 256-byte address of the page used for PDATA variables.
97
+ PPAGE EQU 0
98
+ ;
99
+ ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
100
+ ; <i> most 8051 variants use P2 as uppermost address byte
101
+ PPAGE_SFR DATA 0A0H
102
+ ;
103
+ ; </e>
104
+ ;------------------------------------------------------------------------------
105
+
106
+ ; Standard SFR Symbols
107
+ ACC DATA 0E0H
108
+ B DATA 0F0H
109
+ SP DATA 81H
110
+ DPL DATA 82H
111
+ DPH DATA 83H
112
+
113
+ NAME ?C_STARTUP
114
+
115
+
116
+ ?C_C51STARTUP SEGMENT CODE
117
+ ?STACK SEGMENT IDATA
118
+
119
+ RSEG ?STACK
120
+ DS 1
121
+
122
+ EXTRN CODE (?C_START)
123
+ PUBLIC ?C_STARTUP
124
+
125
+ CSEG AT 0
126
+ ?C_STARTUP: LJMP STARTUP1
127
+
128
+ RSEG ?C_C51STARTUP
129
+
130
+ STARTUP1:
131
+
132
+ IF IDATALEN <> 0
133
+ MOV R0,#IDATALEN - 1
134
+ CLR A
135
+ IDATALOOP: MOV @R0,A
136
+ DJNZ R0,IDATALOOP
137
+ ENDIF
138
+
139
+ IF XDATALEN <> 0
140
+ MOV DPTR,#XDATASTART
141
+ MOV R7,#LOW (XDATALEN)
142
+ IF (LOW (XDATALEN)) <> 0
143
+ MOV R6,#(HIGH (XDATALEN)) +1
144
+ ELSE
145
+ MOV R6,#HIGH (XDATALEN)
146
+ ENDIF
147
+ CLR A
148
+ XDATALOOP: MOVX @DPTR,A
149
+ INC DPTR
150
+ DJNZ R7,XDATALOOP
151
+ DJNZ R6,XDATALOOP
152
+ ENDIF
153
+
154
+ IF PPAGEENABLE <> 0
155
+ MOV PPAGE_SFR,#PPAGE
156
+ ENDIF
157
+
158
+ IF PDATALEN <> 0
159
+ MOV R0,#LOW (PDATASTART)
160
+ MOV R7,#LOW (PDATALEN)
161
+ CLR A
162
+ PDATALOOP: MOVX @R0,A
163
+ INC R0
164
+ DJNZ R7,PDATALOOP
165
+ ENDIF
166
+
167
+ IF IBPSTACK <> 0
168
+ EXTRN DATA (?C_IBP)
169
+
170
+ MOV ?C_IBP,#LOW IBPSTACKTOP
171
+ ENDIF
172
+
173
+ IF XBPSTACK <> 0
174
+ EXTRN DATA (?C_XBP)
175
+
176
+ MOV ?C_XBP,#HIGH XBPSTACKTOP
177
+ MOV ?C_XBP+1,#LOW XBPSTACKTOP
178
+ ENDIF
179
+
180
+ IF PBPSTACK <> 0
181
+ EXTRN DATA (?C_PBP)
182
+ MOV ?C_PBP,#LOW PBPSTACKTOP
183
+ ENDIF
184
+
185
+ MOV SP,#?STACK-1
186
+
187
+ ; This code is required if you use L51_BANK.A51 with Banking Mode 4
188
+ ;<h> Code Banking
189
+ ; <q> Select Bank 0 for L51_BANK.A51 Mode 4
190
+ #if 0
191
+ ; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
192
+ EXTRN CODE (?B_SWITCH0)
193
+ CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
194
+ #endif
195
+ ;</h>
196
+ LJMP ?C_START
197
+
198
+ END
2/2.DSN ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba0231d524833e21b3736f5b955ca66337a0e64da9cd3592efa5af0a4fbd780b
3
+ size 100491
2/2.c ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <REG51.H>
2
+
3
+ unsigned char code seg[10] = {
4
+ 0x3F, 0x06, 0x5B, 0x4F, 0x66,
5
+ 0x6D, 0x7D, 0x07, 0x7F, 0x6F
6
+ };
7
+ unsigned char code num[4] = {1, 2, 3, 4};
8
+
9
+ void delayMs(unsigned int i)
10
+ {
11
+ unsigned char t;
12
+ while (i--)
13
+ {
14
+ for (t = 0; t < 120; t++);
15
+ }
16
+ }
17
+
18
+ void main(void)
19
+ {
20
+ unsigned char i;
21
+
22
+ while (1)
23
+ {
24
+ for (i = 0; i < 4; i++)
25
+ {
26
+ P0 = seg[num[i]];
27
+ delayMs(500);
28
+ }
29
+ }
30
+ }
2/2.pdsprj ADDED
Binary file (17.6 kB). View file
 
2/2.uvproj ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
3
+
4
+ <SchemaVersion>1.1</SchemaVersion>
5
+
6
+ <Header>### uVision Project, (C) Keil Software</Header>
7
+
8
+ <Targets>
9
+ <Target>
10
+ <TargetName>Target 1</TargetName>
11
+ <ToolsetNumber>0x0</ToolsetNumber>
12
+ <ToolsetName>MCS-51</ToolsetName>
13
+ <uAC6>0</uAC6>
14
+ <TargetOption>
15
+ <TargetCommonOption>
16
+ <Device>AT89C51</Device>
17
+ <Vendor>Microchip</Vendor>
18
+ <Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
19
+ <FlashUtilSpec></FlashUtilSpec>
20
+ <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
21
+ <FlashDriverDll></FlashDriverDll>
22
+ <DeviceId>2976</DeviceId>
23
+ <RegisterFile>REGX51.H</RegisterFile>
24
+ <MemoryEnv></MemoryEnv>
25
+ <Cmp></Cmp>
26
+ <Asm></Asm>
27
+ <Linker></Linker>
28
+ <OHString></OHString>
29
+ <InfinionOptionDll></InfinionOptionDll>
30
+ <SLE66CMisc></SLE66CMisc>
31
+ <SLE66AMisc></SLE66AMisc>
32
+ <SLE66LinkerMisc></SLE66LinkerMisc>
33
+ <SFDFile></SFDFile>
34
+ <bCustSvd>0</bCustSvd>
35
+ <UseEnv>0</UseEnv>
36
+ <BinPath></BinPath>
37
+ <IncludePath></IncludePath>
38
+ <LibPath></LibPath>
39
+ <RegisterFilePath>Atmel\</RegisterFilePath>
40
+ <DBRegisterFilePath>Atmel\</DBRegisterFilePath>
41
+ <TargetStatus>
42
+ <Error>0</Error>
43
+ <ExitCodeStop>0</ExitCodeStop>
44
+ <ButtonStop>0</ButtonStop>
45
+ <NotGenerated>0</NotGenerated>
46
+ <InvalidFlash>1</InvalidFlash>
47
+ </TargetStatus>
48
+ <OutputDirectory>.\</OutputDirectory>
49
+ <OutputName>动态显示</OutputName>
50
+ <CreateExecutable>1</CreateExecutable>
51
+ <CreateLib>0</CreateLib>
52
+ <CreateHexFile>1</CreateHexFile>
53
+ <DebugInformation>1</DebugInformation>
54
+ <BrowseInformation>1</BrowseInformation>
55
+ <ListingPath>.\Listings\</ListingPath>
56
+ <HexFormatSelection>0</HexFormatSelection>
57
+ <Merge32K>0</Merge32K>
58
+ <CreateBatchFile>0</CreateBatchFile>
59
+ <BeforeCompile>
60
+ <RunUserProg1>0</RunUserProg1>
61
+ <RunUserProg2>0</RunUserProg2>
62
+ <UserProg1Name></UserProg1Name>
63
+ <UserProg2Name></UserProg2Name>
64
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
65
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
66
+ <nStopU1X>0</nStopU1X>
67
+ <nStopU2X>0</nStopU2X>
68
+ </BeforeCompile>
69
+ <BeforeMake>
70
+ <RunUserProg1>0</RunUserProg1>
71
+ <RunUserProg2>0</RunUserProg2>
72
+ <UserProg1Name></UserProg1Name>
73
+ <UserProg2Name></UserProg2Name>
74
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
75
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76
+ <nStopB1X>0</nStopB1X>
77
+ <nStopB2X>0</nStopB2X>
78
+ </BeforeMake>
79
+ <AfterMake>
80
+ <RunUserProg1>0</RunUserProg1>
81
+ <RunUserProg2>0</RunUserProg2>
82
+ <UserProg1Name></UserProg1Name>
83
+ <UserProg2Name></UserProg2Name>
84
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
85
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
86
+ <nStopA1X>0</nStopA1X>
87
+ <nStopA2X>0</nStopA2X>
88
+ </AfterMake>
89
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
90
+ <SVCSIdString></SVCSIdString>
91
+ </TargetCommonOption>
92
+ <CommonProperty>
93
+ <UseCPPCompiler>0</UseCPPCompiler>
94
+ <RVCTCodeConst>0</RVCTCodeConst>
95
+ <RVCTZI>0</RVCTZI>
96
+ <RVCTOtherData>0</RVCTOtherData>
97
+ <ModuleSelection>0</ModuleSelection>
98
+ <IncludeInBuild>1</IncludeInBuild>
99
+ <AlwaysBuild>0</AlwaysBuild>
100
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
101
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
102
+ <PublicsOnly>0</PublicsOnly>
103
+ <StopOnExitCode>3</StopOnExitCode>
104
+ <CustomArgument></CustomArgument>
105
+ <IncludeLibraryModules></IncludeLibraryModules>
106
+ <ComprImg>1</ComprImg>
107
+ <BankNo>65535</BankNo>
108
+ </CommonProperty>
109
+ <DllOption>
110
+ <SimDllName>S8051.DLL</SimDllName>
111
+ <SimDllArguments></SimDllArguments>
112
+ <SimDlgDll>DP51.DLL</SimDlgDll>
113
+ <SimDlgDllArguments>-p51</SimDlgDllArguments>
114
+ <TargetDllName>S8051.DLL</TargetDllName>
115
+ <TargetDllArguments></TargetDllArguments>
116
+ <TargetDlgDll>TP51.DLL</TargetDlgDll>
117
+ <TargetDlgDllArguments>-p51</TargetDlgDllArguments>
118
+ </DllOption>
119
+ <DebugOption>
120
+ <OPTHX>
121
+ <HexSelection>0</HexSelection>
122
+ <HexRangeLowAddress>0</HexRangeLowAddress>
123
+ <HexRangeHighAddress>0</HexRangeHighAddress>
124
+ <HexOffset>0</HexOffset>
125
+ <Oh166RecLen>16</Oh166RecLen>
126
+ </OPTHX>
127
+ <Simulator>
128
+ <UseSimulator>1</UseSimulator>
129
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
130
+ <RunToMain>1</RunToMain>
131
+ <RestoreBreakpoints>1</RestoreBreakpoints>
132
+ <RestoreWatchpoints>1</RestoreWatchpoints>
133
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
134
+ <RestoreFunctions>1</RestoreFunctions>
135
+ <RestoreToolbox>1</RestoreToolbox>
136
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
137
+ <RestoreSysVw>1</RestoreSysVw>
138
+ </Simulator>
139
+ <Target>
140
+ <UseTarget>0</UseTarget>
141
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
142
+ <RunToMain>0</RunToMain>
143
+ <RestoreBreakpoints>1</RestoreBreakpoints>
144
+ <RestoreWatchpoints>1</RestoreWatchpoints>
145
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
146
+ <RestoreFunctions>0</RestoreFunctions>
147
+ <RestoreToolbox>1</RestoreToolbox>
148
+ <RestoreTracepoints>1</RestoreTracepoints>
149
+ <RestoreSysVw>1</RestoreSysVw>
150
+ </Target>
151
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
152
+ <TargetSelection>-1</TargetSelection>
153
+ <SimDlls>
154
+ <CpuDll></CpuDll>
155
+ <CpuDllArguments></CpuDllArguments>
156
+ <PeripheralDll></PeripheralDll>
157
+ <PeripheralDllArguments></PeripheralDllArguments>
158
+ <InitializationFile></InitializationFile>
159
+ </SimDlls>
160
+ <TargetDlls>
161
+ <CpuDll></CpuDll>
162
+ <CpuDllArguments></CpuDllArguments>
163
+ <PeripheralDll></PeripheralDll>
164
+ <PeripheralDllArguments></PeripheralDllArguments>
165
+ <InitializationFile></InitializationFile>
166
+ <Driver></Driver>
167
+ </TargetDlls>
168
+ </DebugOption>
169
+ <Utilities>
170
+ <Flash1>
171
+ <UseTargetDll>0</UseTargetDll>
172
+ <UseExternalTool>0</UseExternalTool>
173
+ <RunIndependent>0</RunIndependent>
174
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
175
+ <Capability>0</Capability>
176
+ <DriverSelection>-1</DriverSelection>
177
+ </Flash1>
178
+ <bUseTDR>0</bUseTDR>
179
+ <Flash2></Flash2>
180
+ <Flash3></Flash3>
181
+ <Flash4></Flash4>
182
+ <pFcarmOut></pFcarmOut>
183
+ <pFcarmGrp></pFcarmGrp>
184
+ <pFcArmRoot></pFcArmRoot>
185
+ <FcArmLst>0</FcArmLst>
186
+ </Utilities>
187
+ <Target51>
188
+ <Target51Misc>
189
+ <MemoryModel>0</MemoryModel>
190
+ <RTOS>0</RTOS>
191
+ <RomSize>2</RomSize>
192
+ <DataHold>0</DataHold>
193
+ <XDataHold>0</XDataHold>
194
+ <UseOnchipRom>0</UseOnchipRom>
195
+ <UseOnchipArithmetic>0</UseOnchipArithmetic>
196
+ <UseMultipleDPTR>0</UseMultipleDPTR>
197
+ <UseOnchipXram>0</UseOnchipXram>
198
+ <HadIRAM>1</HadIRAM>
199
+ <HadXRAM>0</HadXRAM>
200
+ <HadIROM>1</HadIROM>
201
+ <Moda2>0</Moda2>
202
+ <Moddp2>0</Moddp2>
203
+ <Modp2>0</Modp2>
204
+ <Mod517dp>0</Mod517dp>
205
+ <Mod517au>0</Mod517au>
206
+ <Mode2>0</Mode2>
207
+ <useCB>0</useCB>
208
+ <useXB>0</useXB>
209
+ <useL251>0</useL251>
210
+ <useA251>0</useA251>
211
+ <Mx51>0</Mx51>
212
+ <ModC812>0</ModC812>
213
+ <ModCont>0</ModCont>
214
+ <Lp51>0</Lp51>
215
+ <useXBS>0</useXBS>
216
+ <ModDA>0</ModDA>
217
+ <ModAB2>0</ModAB2>
218
+ <Mx51P>0</Mx51P>
219
+ <hadXRAM2>0</hadXRAM2>
220
+ <uocXram2>0</uocXram2>
221
+ <hadXRAM3>0</hadXRAM3>
222
+ <ModC2>0</ModC2>
223
+ <ModH2>0</ModH2>
224
+ <Mdu_R515>0</Mdu_R515>
225
+ <Mdu_F120>0</Mdu_F120>
226
+ <Psoc>0</Psoc>
227
+ <hadIROM2>0</hadIROM2>
228
+ <hadIROM3>0</hadIROM3>
229
+ <ModSmx2>0</ModSmx2>
230
+ <cBanks>0</cBanks>
231
+ <xBanks>0</xBanks>
232
+ <OnChipMemories>
233
+ <RCB>
234
+ <Type>0</Type>
235
+ <StartAddress>0x0</StartAddress>
236
+ <Size>0xffff</Size>
237
+ </RCB>
238
+ <RXB>
239
+ <Type>0</Type>
240
+ <StartAddress>0x0</StartAddress>
241
+ <Size>0x0</Size>
242
+ </RXB>
243
+ <Ocm1>
244
+ <Type>0</Type>
245
+ <StartAddress>0x0</StartAddress>
246
+ <Size>0x0</Size>
247
+ </Ocm1>
248
+ <Ocm2>
249
+ <Type>0</Type>
250
+ <StartAddress>0x0</StartAddress>
251
+ <Size>0x0</Size>
252
+ </Ocm2>
253
+ <Ocm3>
254
+ <Type>0</Type>
255
+ <StartAddress>0x0</StartAddress>
256
+ <Size>0x0</Size>
257
+ </Ocm3>
258
+ <Ocr1>
259
+ <Type>0</Type>
260
+ <StartAddress>0x0</StartAddress>
261
+ <Size>0x0</Size>
262
+ </Ocr1>
263
+ <Ocr2>
264
+ <Type>0</Type>
265
+ <StartAddress>0x0</StartAddress>
266
+ <Size>0x0</Size>
267
+ </Ocr2>
268
+ <Ocr3>
269
+ <Type>0</Type>
270
+ <StartAddress>0x0</StartAddress>
271
+ <Size>0x0</Size>
272
+ </Ocr3>
273
+ <IRO>
274
+ <Type>1</Type>
275
+ <StartAddress>0x0</StartAddress>
276
+ <Size>0x1000</Size>
277
+ </IRO>
278
+ <IRA>
279
+ <Type>0</Type>
280
+ <StartAddress>0x0</StartAddress>
281
+ <Size>0x80</Size>
282
+ </IRA>
283
+ <XRA>
284
+ <Type>0</Type>
285
+ <StartAddress>0x0</StartAddress>
286
+ <Size>0x0</Size>
287
+ </XRA>
288
+ <XRA512>
289
+ <Type>0</Type>
290
+ <StartAddress>0x0</StartAddress>
291
+ <Size>0x0</Size>
292
+ </XRA512>
293
+ <IROM512>
294
+ <Type>0</Type>
295
+ <StartAddress>0x0</StartAddress>
296
+ <Size>0x0</Size>
297
+ </IROM512>
298
+ <XRA513>
299
+ <Type>0</Type>
300
+ <StartAddress>0x0</StartAddress>
301
+ <Size>0x0</Size>
302
+ </XRA513>
303
+ <IROM513>
304
+ <Type>0</Type>
305
+ <StartAddress>0x0</StartAddress>
306
+ <Size>0x0</Size>
307
+ </IROM513>
308
+ </OnChipMemories>
309
+ </Target51Misc>
310
+ <C51>
311
+ <RegisterColoring>0</RegisterColoring>
312
+ <VariablesInOrder>0</VariablesInOrder>
313
+ <IntegerPromotion>1</IntegerPromotion>
314
+ <uAregs>0</uAregs>
315
+ <UseInterruptVector>1</UseInterruptVector>
316
+ <Fuzzy>3</Fuzzy>
317
+ <Optimize>8</Optimize>
318
+ <WarningLevel>2</WarningLevel>
319
+ <SizeSpeed>1</SizeSpeed>
320
+ <ObjectExtend>1</ObjectExtend>
321
+ <ACallAJmp>0</ACallAJmp>
322
+ <InterruptVectorAddress>0</InterruptVectorAddress>
323
+ <VariousControls>
324
+ <MiscControls></MiscControls>
325
+ <Define></Define>
326
+ <Undefine></Undefine>
327
+ <IncludePath></IncludePath>
328
+ </VariousControls>
329
+ </C51>
330
+ <Ax51>
331
+ <UseMpl>0</UseMpl>
332
+ <UseStandard>1</UseStandard>
333
+ <UseCase>0</UseCase>
334
+ <UseMod51>0</UseMod51>
335
+ <VariousControls>
336
+ <MiscControls></MiscControls>
337
+ <Define></Define>
338
+ <Undefine></Undefine>
339
+ <IncludePath></IncludePath>
340
+ </VariousControls>
341
+ </Ax51>
342
+ <Lx51>
343
+ <useFile>0</useFile>
344
+ <linkonly>0</linkonly>
345
+ <UseMemoryFromTarget>1</UseMemoryFromTarget>
346
+ <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
347
+ <WarningLevel>2</WarningLevel>
348
+ <DataOverlaying>1</DataOverlaying>
349
+ <OverlayString></OverlayString>
350
+ <MiscControls></MiscControls>
351
+ <DisableWarningNumbers></DisableWarningNumbers>
352
+ <LinkerCmdFile></LinkerCmdFile>
353
+ <Assign></Assign>
354
+ <ReserveString></ReserveString>
355
+ <CClasses></CClasses>
356
+ <UserClasses></UserClasses>
357
+ <CSection></CSection>
358
+ <UserSection></UserSection>
359
+ <CodeBaseAddress></CodeBaseAddress>
360
+ <XDataBaseAddress></XDataBaseAddress>
361
+ <PDataBaseAddress></PDataBaseAddress>
362
+ <BitBaseAddress></BitBaseAddress>
363
+ <DataBaseAddress></DataBaseAddress>
364
+ <IDataBaseAddress></IDataBaseAddress>
365
+ <Precede></Precede>
366
+ <Stack></Stack>
367
+ <CodeSegmentName></CodeSegmentName>
368
+ <XDataSegmentName></XDataSegmentName>
369
+ <BitSegmentName></BitSegmentName>
370
+ <DataSegmentName></DataSegmentName>
371
+ <IDataSegmentName></IDataSegmentName>
372
+ </Lx51>
373
+ </Target51>
374
+ </TargetOption>
375
+ <Groups>
376
+ <Group>
377
+ <GroupName>Source Group 1</GroupName>
378
+ <Files>
379
+ <File>
380
+ <FileName>STARTUP.A51</FileName>
381
+ <FileType>2</FileType>
382
+ <FilePath>.\STARTUP.A51</FilePath>
383
+ </File>
384
+ <File>
385
+ <FileName>2.c</FileName>
386
+ <FileType>1</FileType>
387
+ <FilePath>.\2.c</FilePath>
388
+ </File>
389
+ </Files>
390
+ </Group>
391
+ </Groups>
392
+ </Target>
393
+ </Targets>
394
+
395
+ </Project>
2/STARTUP.A51 ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $NOMOD51
2
+ ;------------------------------------------------------------------------------
3
+ ; This file is part of the C51 Compiler package
4
+ ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
5
+ ; Version 8.01
6
+ ;
7
+ ; *** <<< Use Configuration Wizard in Context Menu >>> ***
8
+ ;------------------------------------------------------------------------------
9
+ ; STARTUP.A51: This code is executed after processor reset.
10
+ ;
11
+ ; To translate this file use A51 with the following invocation:
12
+ ;
13
+ ; A51 STARTUP.A51
14
+ ;
15
+ ; To link the modified STARTUP.OBJ file to your application use the following
16
+ ; Lx51 invocation:
17
+ ;
18
+ ; Lx51 your object file list, STARTUP.OBJ controls
19
+ ;
20
+ ;------------------------------------------------------------------------------
21
+ ;
22
+ ; User-defined <h> Power-On Initialization of Memory
23
+ ;
24
+ ; With the following EQU statements the initialization of memory
25
+ ; at processor reset can be defined:
26
+ ;
27
+ ; <o> IDATALEN: IDATA memory size <0x0-0x100>
28
+ ; <i> Note: The absolute start-address of IDATA memory is always 0
29
+ ; <i> The IDATA space overlaps physically the DATA and BIT areas.
30
+ IDATALEN EQU 80H
31
+ ;
32
+ ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
33
+ ; <i> The absolute start address of XDATA memory
34
+ XDATASTART EQU 0
35
+ ;
36
+ ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
37
+ ; <i> The length of XDATA memory in bytes.
38
+ XDATALEN EQU 0
39
+ ;
40
+ ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
41
+ ; <i> The absolute start address of PDATA memory
42
+ PDATASTART EQU 0H
43
+ ;
44
+ ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
45
+ ; <i> The length of PDATA memory in bytes.
46
+ PDATALEN EQU 0H
47
+ ;
48
+ ;</h>
49
+ ;------------------------------------------------------------------------------
50
+ ;
51
+ ;<h> Reentrant Stack Initialization
52
+ ;
53
+ ; The following EQU statements define the stack pointer for reentrant
54
+ ; functions and initialized it:
55
+ ;
56
+ ; <h> Stack Space for reentrant functions in the SMALL model.
57
+ ; <q> IBPSTACK: Enable SMALL model reentrant stack
58
+ ; <i> Stack space for reentrant functions in the SMALL model.
59
+ IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
60
+ ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
61
+ ; <i> Set the top of the stack to the highest location.
62
+ IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
63
+ ; </h>
64
+ ;
65
+ ; <h> Stack Space for reentrant functions in the LARGE model.
66
+ ; <q> XBPSTACK: Enable LARGE model reentrant stack
67
+ ; <i> Stack space for reentrant functions in the LARGE model.
68
+ XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
69
+ ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
70
+ ; <i> Set the top of the stack to the highest location.
71
+ XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
72
+ ; </h>
73
+ ;
74
+ ; <h> Stack Space for reentrant functions in the COMPACT model.
75
+ ; <q> PBPSTACK: Enable COMPACT model reentrant stack
76
+ ; <i> Stack space for reentrant functions in the COMPACT model.
77
+ PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
78
+ ;
79
+ ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
80
+ ; <i> Set the top of the stack to the highest location.
81
+ PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
82
+ ; </h>
83
+ ;</h>
84
+ ;------------------------------------------------------------------------------
85
+ ;
86
+ ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
87
+ ; <e>Compact Model Page Definition
88
+ ;
89
+ ; <i>Define the XDATA page used for PDATA variables.
90
+ ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
91
+ ;
92
+ ; Enable pdata memory page initalization
93
+ PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
94
+ ;
95
+ ; <o> PPAGE number <0x0-0xFF>
96
+ ; <i> uppermost 256-byte address of the page used for PDATA variables.
97
+ PPAGE EQU 0
98
+ ;
99
+ ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
100
+ ; <i> most 8051 variants use P2 as uppermost address byte
101
+ PPAGE_SFR DATA 0A0H
102
+ ;
103
+ ; </e>
104
+ ;------------------------------------------------------------------------------
105
+
106
+ ; Standard SFR Symbols
107
+ ACC DATA 0E0H
108
+ B DATA 0F0H
109
+ SP DATA 81H
110
+ DPL DATA 82H
111
+ DPH DATA 83H
112
+
113
+ NAME ?C_STARTUP
114
+
115
+
116
+ ?C_C51STARTUP SEGMENT CODE
117
+ ?STACK SEGMENT IDATA
118
+
119
+ RSEG ?STACK
120
+ DS 1
121
+
122
+ EXTRN CODE (?C_START)
123
+ PUBLIC ?C_STARTUP
124
+
125
+ CSEG AT 0
126
+ ?C_STARTUP: LJMP STARTUP1
127
+
128
+ RSEG ?C_C51STARTUP
129
+
130
+ STARTUP1:
131
+
132
+ IF IDATALEN <> 0
133
+ MOV R0,#IDATALEN - 1
134
+ CLR A
135
+ IDATALOOP: MOV @R0,A
136
+ DJNZ R0,IDATALOOP
137
+ ENDIF
138
+
139
+ IF XDATALEN <> 0
140
+ MOV DPTR,#XDATASTART
141
+ MOV R7,#LOW (XDATALEN)
142
+ IF (LOW (XDATALEN)) <> 0
143
+ MOV R6,#(HIGH (XDATALEN)) +1
144
+ ELSE
145
+ MOV R6,#HIGH (XDATALEN)
146
+ ENDIF
147
+ CLR A
148
+ XDATALOOP: MOVX @DPTR,A
149
+ INC DPTR
150
+ DJNZ R7,XDATALOOP
151
+ DJNZ R6,XDATALOOP
152
+ ENDIF
153
+
154
+ IF PPAGEENABLE <> 0
155
+ MOV PPAGE_SFR,#PPAGE
156
+ ENDIF
157
+
158
+ IF PDATALEN <> 0
159
+ MOV R0,#LOW (PDATASTART)
160
+ MOV R7,#LOW (PDATALEN)
161
+ CLR A
162
+ PDATALOOP: MOVX @R0,A
163
+ INC R0
164
+ DJNZ R7,PDATALOOP
165
+ ENDIF
166
+
167
+ IF IBPSTACK <> 0
168
+ EXTRN DATA (?C_IBP)
169
+
170
+ MOV ?C_IBP,#LOW IBPSTACKTOP
171
+ ENDIF
172
+
173
+ IF XBPSTACK <> 0
174
+ EXTRN DATA (?C_XBP)
175
+
176
+ MOV ?C_XBP,#HIGH XBPSTACKTOP
177
+ MOV ?C_XBP+1,#LOW XBPSTACKTOP
178
+ ENDIF
179
+
180
+ IF PBPSTACK <> 0
181
+ EXTRN DATA (?C_PBP)
182
+ MOV ?C_PBP,#LOW PBPSTACKTOP
183
+ ENDIF
184
+
185
+ MOV SP,#?STACK-1
186
+
187
+ ; This code is required if you use L51_BANK.A51 with Banking Mode 4
188
+ ;<h> Code Banking
189
+ ; <q> Select Bank 0 for L51_BANK.A51 Mode 4
190
+ #if 0
191
+ ; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
192
+ EXTRN CODE (?B_SWITCH0)
193
+ CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
194
+ #endif
195
+ ;</h>
196
+ LJMP ?C_START
197
+
198
+ END
3/3.DSN ADDED
Binary file (89.8 kB). View file
 
3/3.c ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <REG51.H>
2
+
3
+ sbit a = P3^0;
4
+ sbit b = P3^1;
5
+ sbit c = P3^2;
6
+
7
+ unsigned char code seg[10] = {
8
+ 0x3F, 0x06, 0x5B, 0x4F, 0x66,
9
+ 0x6D, 0x7D, 0x07, 0x7F, 0x6F
10
+ };
11
+ unsigned char code num[4] = {1, 2, 3, 4};
12
+
13
+ void delayMs(unsigned int i)
14
+ {
15
+ unsigned char t;
16
+ while (i--)
17
+ {
18
+ for (t = 0; t < 120; t++);
19
+ }
20
+ }
21
+
22
+ void main(void)
23
+ {
24
+ unsigned char i;
25
+
26
+ while (1)
27
+ {
28
+ for (i = 0; i < 4; i++)
29
+ {
30
+ P0 = 0x00;
31
+ a = i & 0x01;
32
+ b = (i >> 1) & 0x01;
33
+ c = (i >> 2) & 0x01;
34
+ P0 = seg[num[i]];
35
+ delayMs(2);
36
+ }
37
+ }
38
+ }
3/3.pdsprj ADDED
Binary file (16.6 kB). View file
 
3/3.uvproj ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
3
+
4
+ <SchemaVersion>1.1</SchemaVersion>
5
+
6
+ <Header>### uVision Project, (C) Keil Software</Header>
7
+
8
+ <Targets>
9
+ <Target>
10
+ <TargetName>Target 1</TargetName>
11
+ <ToolsetNumber>0x0</ToolsetNumber>
12
+ <ToolsetName>MCS-51</ToolsetName>
13
+ <uAC6>0</uAC6>
14
+ <TargetOption>
15
+ <TargetCommonOption>
16
+ <Device>AT89C51</Device>
17
+ <Vendor>Microchip</Vendor>
18
+ <Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
19
+ <FlashUtilSpec></FlashUtilSpec>
20
+ <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
21
+ <FlashDriverDll></FlashDriverDll>
22
+ <DeviceId>2976</DeviceId>
23
+ <RegisterFile>REGX51.H</RegisterFile>
24
+ <MemoryEnv></MemoryEnv>
25
+ <Cmp></Cmp>
26
+ <Asm></Asm>
27
+ <Linker></Linker>
28
+ <OHString></OHString>
29
+ <InfinionOptionDll></InfinionOptionDll>
30
+ <SLE66CMisc></SLE66CMisc>
31
+ <SLE66AMisc></SLE66AMisc>
32
+ <SLE66LinkerMisc></SLE66LinkerMisc>
33
+ <SFDFile></SFDFile>
34
+ <bCustSvd>0</bCustSvd>
35
+ <UseEnv>0</UseEnv>
36
+ <BinPath></BinPath>
37
+ <IncludePath></IncludePath>
38
+ <LibPath></LibPath>
39
+ <RegisterFilePath>Atmel\</RegisterFilePath>
40
+ <DBRegisterFilePath>Atmel\</DBRegisterFilePath>
41
+ <TargetStatus>
42
+ <Error>0</Error>
43
+ <ExitCodeStop>0</ExitCodeStop>
44
+ <ButtonStop>0</ButtonStop>
45
+ <NotGenerated>0</NotGenerated>
46
+ <InvalidFlash>1</InvalidFlash>
47
+ </TargetStatus>
48
+ <OutputDirectory>.\</OutputDirectory>
49
+ <OutputName>3</OutputName>
50
+ <CreateExecutable>1</CreateExecutable>
51
+ <CreateLib>0</CreateLib>
52
+ <CreateHexFile>1</CreateHexFile>
53
+ <DebugInformation>1</DebugInformation>
54
+ <BrowseInformation>1</BrowseInformation>
55
+ <ListingPath>.\Listings\</ListingPath>
56
+ <HexFormatSelection>0</HexFormatSelection>
57
+ <Merge32K>0</Merge32K>
58
+ <CreateBatchFile>0</CreateBatchFile>
59
+ <BeforeCompile>
60
+ <RunUserProg1>0</RunUserProg1>
61
+ <RunUserProg2>0</RunUserProg2>
62
+ <UserProg1Name></UserProg1Name>
63
+ <UserProg2Name></UserProg2Name>
64
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
65
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
66
+ <nStopU1X>0</nStopU1X>
67
+ <nStopU2X>0</nStopU2X>
68
+ </BeforeCompile>
69
+ <BeforeMake>
70
+ <RunUserProg1>0</RunUserProg1>
71
+ <RunUserProg2>0</RunUserProg2>
72
+ <UserProg1Name></UserProg1Name>
73
+ <UserProg2Name></UserProg2Name>
74
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
75
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76
+ <nStopB1X>0</nStopB1X>
77
+ <nStopB2X>0</nStopB2X>
78
+ </BeforeMake>
79
+ <AfterMake>
80
+ <RunUserProg1>0</RunUserProg1>
81
+ <RunUserProg2>0</RunUserProg2>
82
+ <UserProg1Name></UserProg1Name>
83
+ <UserProg2Name></UserProg2Name>
84
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
85
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
86
+ <nStopA1X>0</nStopA1X>
87
+ <nStopA2X>0</nStopA2X>
88
+ </AfterMake>
89
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
90
+ <SVCSIdString></SVCSIdString>
91
+ </TargetCommonOption>
92
+ <CommonProperty>
93
+ <UseCPPCompiler>0</UseCPPCompiler>
94
+ <RVCTCodeConst>0</RVCTCodeConst>
95
+ <RVCTZI>0</RVCTZI>
96
+ <RVCTOtherData>0</RVCTOtherData>
97
+ <ModuleSelection>0</ModuleSelection>
98
+ <IncludeInBuild>1</IncludeInBuild>
99
+ <AlwaysBuild>0</AlwaysBuild>
100
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
101
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
102
+ <PublicsOnly>0</PublicsOnly>
103
+ <StopOnExitCode>3</StopOnExitCode>
104
+ <CustomArgument></CustomArgument>
105
+ <IncludeLibraryModules></IncludeLibraryModules>
106
+ <ComprImg>1</ComprImg>
107
+ <BankNo>65535</BankNo>
108
+ </CommonProperty>
109
+ <DllOption>
110
+ <SimDllName>S8051.DLL</SimDllName>
111
+ <SimDllArguments></SimDllArguments>
112
+ <SimDlgDll>DP51.DLL</SimDlgDll>
113
+ <SimDlgDllArguments>-p51</SimDlgDllArguments>
114
+ <TargetDllName>S8051.DLL</TargetDllName>
115
+ <TargetDllArguments></TargetDllArguments>
116
+ <TargetDlgDll>TP51.DLL</TargetDlgDll>
117
+ <TargetDlgDllArguments>-p51</TargetDlgDllArguments>
118
+ </DllOption>
119
+ <DebugOption>
120
+ <OPTHX>
121
+ <HexSelection>0</HexSelection>
122
+ <HexRangeLowAddress>0</HexRangeLowAddress>
123
+ <HexRangeHighAddress>0</HexRangeHighAddress>
124
+ <HexOffset>0</HexOffset>
125
+ <Oh166RecLen>16</Oh166RecLen>
126
+ </OPTHX>
127
+ <Simulator>
128
+ <UseSimulator>1</UseSimulator>
129
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
130
+ <RunToMain>1</RunToMain>
131
+ <RestoreBreakpoints>1</RestoreBreakpoints>
132
+ <RestoreWatchpoints>1</RestoreWatchpoints>
133
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
134
+ <RestoreFunctions>1</RestoreFunctions>
135
+ <RestoreToolbox>1</RestoreToolbox>
136
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
137
+ <RestoreSysVw>1</RestoreSysVw>
138
+ </Simulator>
139
+ <Target>
140
+ <UseTarget>0</UseTarget>
141
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
142
+ <RunToMain>0</RunToMain>
143
+ <RestoreBreakpoints>1</RestoreBreakpoints>
144
+ <RestoreWatchpoints>1</RestoreWatchpoints>
145
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
146
+ <RestoreFunctions>0</RestoreFunctions>
147
+ <RestoreToolbox>1</RestoreToolbox>
148
+ <RestoreTracepoints>1</RestoreTracepoints>
149
+ <RestoreSysVw>1</RestoreSysVw>
150
+ </Target>
151
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
152
+ <TargetSelection>-1</TargetSelection>
153
+ <SimDlls>
154
+ <CpuDll></CpuDll>
155
+ <CpuDllArguments></CpuDllArguments>
156
+ <PeripheralDll></PeripheralDll>
157
+ <PeripheralDllArguments></PeripheralDllArguments>
158
+ <InitializationFile></InitializationFile>
159
+ </SimDlls>
160
+ <TargetDlls>
161
+ <CpuDll></CpuDll>
162
+ <CpuDllArguments></CpuDllArguments>
163
+ <PeripheralDll></PeripheralDll>
164
+ <PeripheralDllArguments></PeripheralDllArguments>
165
+ <InitializationFile></InitializationFile>
166
+ <Driver></Driver>
167
+ </TargetDlls>
168
+ </DebugOption>
169
+ <Utilities>
170
+ <Flash1>
171
+ <UseTargetDll>0</UseTargetDll>
172
+ <UseExternalTool>0</UseExternalTool>
173
+ <RunIndependent>0</RunIndependent>
174
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
175
+ <Capability>0</Capability>
176
+ <DriverSelection>-1</DriverSelection>
177
+ </Flash1>
178
+ <bUseTDR>0</bUseTDR>
179
+ <Flash2></Flash2>
180
+ <Flash3></Flash3>
181
+ <Flash4></Flash4>
182
+ <pFcarmOut></pFcarmOut>
183
+ <pFcarmGrp></pFcarmGrp>
184
+ <pFcArmRoot></pFcArmRoot>
185
+ <FcArmLst>0</FcArmLst>
186
+ </Utilities>
187
+ <Target51>
188
+ <Target51Misc>
189
+ <MemoryModel>0</MemoryModel>
190
+ <RTOS>0</RTOS>
191
+ <RomSize>2</RomSize>
192
+ <DataHold>0</DataHold>
193
+ <XDataHold>0</XDataHold>
194
+ <UseOnchipRom>0</UseOnchipRom>
195
+ <UseOnchipArithmetic>0</UseOnchipArithmetic>
196
+ <UseMultipleDPTR>0</UseMultipleDPTR>
197
+ <UseOnchipXram>0</UseOnchipXram>
198
+ <HadIRAM>1</HadIRAM>
199
+ <HadXRAM>0</HadXRAM>
200
+ <HadIROM>1</HadIROM>
201
+ <Moda2>0</Moda2>
202
+ <Moddp2>0</Moddp2>
203
+ <Modp2>0</Modp2>
204
+ <Mod517dp>0</Mod517dp>
205
+ <Mod517au>0</Mod517au>
206
+ <Mode2>0</Mode2>
207
+ <useCB>0</useCB>
208
+ <useXB>0</useXB>
209
+ <useL251>0</useL251>
210
+ <useA251>0</useA251>
211
+ <Mx51>0</Mx51>
212
+ <ModC812>0</ModC812>
213
+ <ModCont>0</ModCont>
214
+ <Lp51>0</Lp51>
215
+ <useXBS>0</useXBS>
216
+ <ModDA>0</ModDA>
217
+ <ModAB2>0</ModAB2>
218
+ <Mx51P>0</Mx51P>
219
+ <hadXRAM2>0</hadXRAM2>
220
+ <uocXram2>0</uocXram2>
221
+ <hadXRAM3>0</hadXRAM3>
222
+ <ModC2>0</ModC2>
223
+ <ModH2>0</ModH2>
224
+ <Mdu_R515>0</Mdu_R515>
225
+ <Mdu_F120>0</Mdu_F120>
226
+ <Psoc>0</Psoc>
227
+ <hadIROM2>0</hadIROM2>
228
+ <hadIROM3>0</hadIROM3>
229
+ <ModSmx2>0</ModSmx2>
230
+ <cBanks>0</cBanks>
231
+ <xBanks>0</xBanks>
232
+ <OnChipMemories>
233
+ <RCB>
234
+ <Type>0</Type>
235
+ <StartAddress>0x0</StartAddress>
236
+ <Size>0xffff</Size>
237
+ </RCB>
238
+ <RXB>
239
+ <Type>0</Type>
240
+ <StartAddress>0x0</StartAddress>
241
+ <Size>0x0</Size>
242
+ </RXB>
243
+ <Ocm1>
244
+ <Type>0</Type>
245
+ <StartAddress>0x0</StartAddress>
246
+ <Size>0x0</Size>
247
+ </Ocm1>
248
+ <Ocm2>
249
+ <Type>0</Type>
250
+ <StartAddress>0x0</StartAddress>
251
+ <Size>0x0</Size>
252
+ </Ocm2>
253
+ <Ocm3>
254
+ <Type>0</Type>
255
+ <StartAddress>0x0</StartAddress>
256
+ <Size>0x0</Size>
257
+ </Ocm3>
258
+ <Ocr1>
259
+ <Type>0</Type>
260
+ <StartAddress>0x0</StartAddress>
261
+ <Size>0x0</Size>
262
+ </Ocr1>
263
+ <Ocr2>
264
+ <Type>0</Type>
265
+ <StartAddress>0x0</StartAddress>
266
+ <Size>0x0</Size>
267
+ </Ocr2>
268
+ <Ocr3>
269
+ <Type>0</Type>
270
+ <StartAddress>0x0</StartAddress>
271
+ <Size>0x0</Size>
272
+ </Ocr3>
273
+ <IRO>
274
+ <Type>1</Type>
275
+ <StartAddress>0x0</StartAddress>
276
+ <Size>0x1000</Size>
277
+ </IRO>
278
+ <IRA>
279
+ <Type>0</Type>
280
+ <StartAddress>0x0</StartAddress>
281
+ <Size>0x80</Size>
282
+ </IRA>
283
+ <XRA>
284
+ <Type>0</Type>
285
+ <StartAddress>0x0</StartAddress>
286
+ <Size>0x0</Size>
287
+ </XRA>
288
+ <XRA512>
289
+ <Type>0</Type>
290
+ <StartAddress>0x0</StartAddress>
291
+ <Size>0x0</Size>
292
+ </XRA512>
293
+ <IROM512>
294
+ <Type>0</Type>
295
+ <StartAddress>0x0</StartAddress>
296
+ <Size>0x0</Size>
297
+ </IROM512>
298
+ <XRA513>
299
+ <Type>0</Type>
300
+ <StartAddress>0x0</StartAddress>
301
+ <Size>0x0</Size>
302
+ </XRA513>
303
+ <IROM513>
304
+ <Type>0</Type>
305
+ <StartAddress>0x0</StartAddress>
306
+ <Size>0x0</Size>
307
+ </IROM513>
308
+ </OnChipMemories>
309
+ </Target51Misc>
310
+ <C51>
311
+ <RegisterColoring>0</RegisterColoring>
312
+ <VariablesInOrder>0</VariablesInOrder>
313
+ <IntegerPromotion>1</IntegerPromotion>
314
+ <uAregs>0</uAregs>
315
+ <UseInterruptVector>1</UseInterruptVector>
316
+ <Fuzzy>3</Fuzzy>
317
+ <Optimize>8</Optimize>
318
+ <WarningLevel>2</WarningLevel>
319
+ <SizeSpeed>1</SizeSpeed>
320
+ <ObjectExtend>1</ObjectExtend>
321
+ <ACallAJmp>0</ACallAJmp>
322
+ <InterruptVectorAddress>0</InterruptVectorAddress>
323
+ <VariousControls>
324
+ <MiscControls></MiscControls>
325
+ <Define></Define>
326
+ <Undefine></Undefine>
327
+ <IncludePath></IncludePath>
328
+ </VariousControls>
329
+ </C51>
330
+ <Ax51>
331
+ <UseMpl>0</UseMpl>
332
+ <UseStandard>1</UseStandard>
333
+ <UseCase>0</UseCase>
334
+ <UseMod51>0</UseMod51>
335
+ <VariousControls>
336
+ <MiscControls></MiscControls>
337
+ <Define></Define>
338
+ <Undefine></Undefine>
339
+ <IncludePath></IncludePath>
340
+ </VariousControls>
341
+ </Ax51>
342
+ <Lx51>
343
+ <useFile>0</useFile>
344
+ <linkonly>0</linkonly>
345
+ <UseMemoryFromTarget>1</UseMemoryFromTarget>
346
+ <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
347
+ <WarningLevel>2</WarningLevel>
348
+ <DataOverlaying>1</DataOverlaying>
349
+ <OverlayString></OverlayString>
350
+ <MiscControls></MiscControls>
351
+ <DisableWarningNumbers></DisableWarningNumbers>
352
+ <LinkerCmdFile></LinkerCmdFile>
353
+ <Assign></Assign>
354
+ <ReserveString></ReserveString>
355
+ <CClasses></CClasses>
356
+ <UserClasses></UserClasses>
357
+ <CSection></CSection>
358
+ <UserSection></UserSection>
359
+ <CodeBaseAddress></CodeBaseAddress>
360
+ <XDataBaseAddress></XDataBaseAddress>
361
+ <PDataBaseAddress></PDataBaseAddress>
362
+ <BitBaseAddress></BitBaseAddress>
363
+ <DataBaseAddress></DataBaseAddress>
364
+ <IDataBaseAddress></IDataBaseAddress>
365
+ <Precede></Precede>
366
+ <Stack></Stack>
367
+ <CodeSegmentName></CodeSegmentName>
368
+ <XDataSegmentName></XDataSegmentName>
369
+ <BitSegmentName></BitSegmentName>
370
+ <DataSegmentName></DataSegmentName>
371
+ <IDataSegmentName></IDataSegmentName>
372
+ </Lx51>
373
+ </Target51>
374
+ </TargetOption>
375
+ <Groups>
376
+ <Group>
377
+ <GroupName>Source Group 1</GroupName>
378
+ <Files>
379
+ <File>
380
+ <FileName>STARTUP.A51</FileName>
381
+ <FileType>2</FileType>
382
+ <FilePath>.\STARTUP.A51</FilePath>
383
+ </File>
384
+ <File>
385
+ <FileName>3.c</FileName>
386
+ <FileType>1</FileType>
387
+ <FilePath>.\3.c</FilePath>
388
+ </File>
389
+ </Files>
390
+ </Group>
391
+ </Groups>
392
+ </Target>
393
+ </Targets>
394
+
395
+ </Project>
3/STARTUP.A51 ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $NOMOD51
2
+ ;------------------------------------------------------------------------------
3
+ ; This file is part of the C51 Compiler package
4
+ ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
5
+ ; Version 8.01
6
+ ;
7
+ ; *** <<< Use Configuration Wizard in Context Menu >>> ***
8
+ ;------------------------------------------------------------------------------
9
+ ; STARTUP.A51: This code is executed after processor reset.
10
+ ;
11
+ ; To translate this file use A51 with the following invocation:
12
+ ;
13
+ ; A51 STARTUP.A51
14
+ ;
15
+ ; To link the modified STARTUP.OBJ file to your application use the following
16
+ ; Lx51 invocation:
17
+ ;
18
+ ; Lx51 your object file list, STARTUP.OBJ controls
19
+ ;
20
+ ;------------------------------------------------------------------------------
21
+ ;
22
+ ; User-defined <h> Power-On Initialization of Memory
23
+ ;
24
+ ; With the following EQU statements the initialization of memory
25
+ ; at processor reset can be defined:
26
+ ;
27
+ ; <o> IDATALEN: IDATA memory size <0x0-0x100>
28
+ ; <i> Note: The absolute start-address of IDATA memory is always 0
29
+ ; <i> The IDATA space overlaps physically the DATA and BIT areas.
30
+ IDATALEN EQU 80H
31
+ ;
32
+ ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
33
+ ; <i> The absolute start address of XDATA memory
34
+ XDATASTART EQU 0
35
+ ;
36
+ ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
37
+ ; <i> The length of XDATA memory in bytes.
38
+ XDATALEN EQU 0
39
+ ;
40
+ ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
41
+ ; <i> The absolute start address of PDATA memory
42
+ PDATASTART EQU 0H
43
+ ;
44
+ ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
45
+ ; <i> The length of PDATA memory in bytes.
46
+ PDATALEN EQU 0H
47
+ ;
48
+ ;</h>
49
+ ;------------------------------------------------------------------------------
50
+ ;
51
+ ;<h> Reentrant Stack Initialization
52
+ ;
53
+ ; The following EQU statements define the stack pointer for reentrant
54
+ ; functions and initialized it:
55
+ ;
56
+ ; <h> Stack Space for reentrant functions in the SMALL model.
57
+ ; <q> IBPSTACK: Enable SMALL model reentrant stack
58
+ ; <i> Stack space for reentrant functions in the SMALL model.
59
+ IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
60
+ ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
61
+ ; <i> Set the top of the stack to the highest location.
62
+ IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
63
+ ; </h>
64
+ ;
65
+ ; <h> Stack Space for reentrant functions in the LARGE model.
66
+ ; <q> XBPSTACK: Enable LARGE model reentrant stack
67
+ ; <i> Stack space for reentrant functions in the LARGE model.
68
+ XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
69
+ ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
70
+ ; <i> Set the top of the stack to the highest location.
71
+ XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
72
+ ; </h>
73
+ ;
74
+ ; <h> Stack Space for reentrant functions in the COMPACT model.
75
+ ; <q> PBPSTACK: Enable COMPACT model reentrant stack
76
+ ; <i> Stack space for reentrant functions in the COMPACT model.
77
+ PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
78
+ ;
79
+ ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
80
+ ; <i> Set the top of the stack to the highest location.
81
+ PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
82
+ ; </h>
83
+ ;</h>
84
+ ;------------------------------------------------------------------------------
85
+ ;
86
+ ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
87
+ ; <e>Compact Model Page Definition
88
+ ;
89
+ ; <i>Define the XDATA page used for PDATA variables.
90
+ ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
91
+ ;
92
+ ; Enable pdata memory page initalization
93
+ PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
94
+ ;
95
+ ; <o> PPAGE number <0x0-0xFF>
96
+ ; <i> uppermost 256-byte address of the page used for PDATA variables.
97
+ PPAGE EQU 0
98
+ ;
99
+ ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
100
+ ; <i> most 8051 variants use P2 as uppermost address byte
101
+ PPAGE_SFR DATA 0A0H
102
+ ;
103
+ ; </e>
104
+ ;------------------------------------------------------------------------------
105
+
106
+ ; Standard SFR Symbols
107
+ ACC DATA 0E0H
108
+ B DATA 0F0H
109
+ SP DATA 81H
110
+ DPL DATA 82H
111
+ DPH DATA 83H
112
+
113
+ NAME ?C_STARTUP
114
+
115
+
116
+ ?C_C51STARTUP SEGMENT CODE
117
+ ?STACK SEGMENT IDATA
118
+
119
+ RSEG ?STACK
120
+ DS 1
121
+
122
+ EXTRN CODE (?C_START)
123
+ PUBLIC ?C_STARTUP
124
+
125
+ CSEG AT 0
126
+ ?C_STARTUP: LJMP STARTUP1
127
+
128
+ RSEG ?C_C51STARTUP
129
+
130
+ STARTUP1:
131
+
132
+ IF IDATALEN <> 0
133
+ MOV R0,#IDATALEN - 1
134
+ CLR A
135
+ IDATALOOP: MOV @R0,A
136
+ DJNZ R0,IDATALOOP
137
+ ENDIF
138
+
139
+ IF XDATALEN <> 0
140
+ MOV DPTR,#XDATASTART
141
+ MOV R7,#LOW (XDATALEN)
142
+ IF (LOW (XDATALEN)) <> 0
143
+ MOV R6,#(HIGH (XDATALEN)) +1
144
+ ELSE
145
+ MOV R6,#HIGH (XDATALEN)
146
+ ENDIF
147
+ CLR A
148
+ XDATALOOP: MOVX @DPTR,A
149
+ INC DPTR
150
+ DJNZ R7,XDATALOOP
151
+ DJNZ R6,XDATALOOP
152
+ ENDIF
153
+
154
+ IF PPAGEENABLE <> 0
155
+ MOV PPAGE_SFR,#PPAGE
156
+ ENDIF
157
+
158
+ IF PDATALEN <> 0
159
+ MOV R0,#LOW (PDATASTART)
160
+ MOV R7,#LOW (PDATALEN)
161
+ CLR A
162
+ PDATALOOP: MOVX @R0,A
163
+ INC R0
164
+ DJNZ R7,PDATALOOP
165
+ ENDIF
166
+
167
+ IF IBPSTACK <> 0
168
+ EXTRN DATA (?C_IBP)
169
+
170
+ MOV ?C_IBP,#LOW IBPSTACKTOP
171
+ ENDIF
172
+
173
+ IF XBPSTACK <> 0
174
+ EXTRN DATA (?C_XBP)
175
+
176
+ MOV ?C_XBP,#HIGH XBPSTACKTOP
177
+ MOV ?C_XBP+1,#LOW XBPSTACKTOP
178
+ ENDIF
179
+
180
+ IF PBPSTACK <> 0
181
+ EXTRN DATA (?C_PBP)
182
+ MOV ?C_PBP,#LOW PBPSTACKTOP
183
+ ENDIF
184
+
185
+ MOV SP,#?STACK-1
186
+
187
+ ; This code is required if you use L51_BANK.A51 with Banking Mode 4
188
+ ;<h> Code Banking
189
+ ; <q> Select Bank 0 for L51_BANK.A51 Mode 4
190
+ #if 0
191
+ ; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
192
+ EXTRN CODE (?B_SWITCH0)
193
+ CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
194
+ #endif
195
+ ;</h>
196
+ LJMP ?C_START
197
+
198
+ END
4/4.DSN ADDED
Binary file (83.7 kB). View file
 
4/4.c ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <REG51.H>
2
+
3
+ sbit K1 = P3^0;
4
+ sbit K2 = P3^1;
5
+ sbit K3 = P3^2;
6
+ sbit K4 = P3^3;
7
+
8
+ void main(void)
9
+ {
10
+ P2 = 0xFF;
11
+
12
+ while (1)
13
+ {
14
+ if (K1 == 0)
15
+ P2 = 0xFE;
16
+ else if (K2 == 0)
17
+ P2 = 0xFC;
18
+ else if (K3 == 0)
19
+ P2 = 0xF8;
20
+ else if (K4 == 0)
21
+ P2 = 0xF0;
22
+ else
23
+ P2 = 0xFF;
24
+ }
25
+ }
4/4.pdsprj ADDED
Binary file (14.8 kB). View file
 
4/4.uvproj ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
3
+
4
+ <SchemaVersion>1.1</SchemaVersion>
5
+
6
+ <Header>### uVision Project, (C) Keil Software</Header>
7
+
8
+ <Targets>
9
+ <Target>
10
+ <TargetName>Target 1</TargetName>
11
+ <ToolsetNumber>0x0</ToolsetNumber>
12
+ <ToolsetName>MCS-51</ToolsetName>
13
+ <uAC6>0</uAC6>
14
+ <TargetOption>
15
+ <TargetCommonOption>
16
+ <Device>AT89C51</Device>
17
+ <Vendor>Microchip</Vendor>
18
+ <Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
19
+ <FlashUtilSpec></FlashUtilSpec>
20
+ <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
21
+ <FlashDriverDll></FlashDriverDll>
22
+ <DeviceId>2976</DeviceId>
23
+ <RegisterFile>REGX51.H</RegisterFile>
24
+ <MemoryEnv></MemoryEnv>
25
+ <Cmp></Cmp>
26
+ <Asm></Asm>
27
+ <Linker></Linker>
28
+ <OHString></OHString>
29
+ <InfinionOptionDll></InfinionOptionDll>
30
+ <SLE66CMisc></SLE66CMisc>
31
+ <SLE66AMisc></SLE66AMisc>
32
+ <SLE66LinkerMisc></SLE66LinkerMisc>
33
+ <SFDFile></SFDFile>
34
+ <bCustSvd>0</bCustSvd>
35
+ <UseEnv>0</UseEnv>
36
+ <BinPath></BinPath>
37
+ <IncludePath></IncludePath>
38
+ <LibPath></LibPath>
39
+ <RegisterFilePath>Atmel\</RegisterFilePath>
40
+ <DBRegisterFilePath>Atmel\</DBRegisterFilePath>
41
+ <TargetStatus>
42
+ <Error>0</Error>
43
+ <ExitCodeStop>0</ExitCodeStop>
44
+ <ButtonStop>0</ButtonStop>
45
+ <NotGenerated>0</NotGenerated>
46
+ <InvalidFlash>1</InvalidFlash>
47
+ </TargetStatus>
48
+ <OutputDirectory>.\代码1\</OutputDirectory>
49
+ <OutputName>优化</OutputName>
50
+ <CreateExecutable>1</CreateExecutable>
51
+ <CreateLib>0</CreateLib>
52
+ <CreateHexFile>1</CreateHexFile>
53
+ <DebugInformation>1</DebugInformation>
54
+ <BrowseInformation>1</BrowseInformation>
55
+ <ListingPath>.\Listings\</ListingPath>
56
+ <HexFormatSelection>0</HexFormatSelection>
57
+ <Merge32K>0</Merge32K>
58
+ <CreateBatchFile>0</CreateBatchFile>
59
+ <BeforeCompile>
60
+ <RunUserProg1>0</RunUserProg1>
61
+ <RunUserProg2>0</RunUserProg2>
62
+ <UserProg1Name></UserProg1Name>
63
+ <UserProg2Name></UserProg2Name>
64
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
65
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
66
+ <nStopU1X>0</nStopU1X>
67
+ <nStopU2X>0</nStopU2X>
68
+ </BeforeCompile>
69
+ <BeforeMake>
70
+ <RunUserProg1>0</RunUserProg1>
71
+ <RunUserProg2>0</RunUserProg2>
72
+ <UserProg1Name></UserProg1Name>
73
+ <UserProg2Name></UserProg2Name>
74
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
75
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76
+ <nStopB1X>0</nStopB1X>
77
+ <nStopB2X>0</nStopB2X>
78
+ </BeforeMake>
79
+ <AfterMake>
80
+ <RunUserProg1>0</RunUserProg1>
81
+ <RunUserProg2>0</RunUserProg2>
82
+ <UserProg1Name></UserProg1Name>
83
+ <UserProg2Name></UserProg2Name>
84
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
85
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
86
+ <nStopA1X>0</nStopA1X>
87
+ <nStopA2X>0</nStopA2X>
88
+ </AfterMake>
89
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
90
+ <SVCSIdString></SVCSIdString>
91
+ </TargetCommonOption>
92
+ <CommonProperty>
93
+ <UseCPPCompiler>0</UseCPPCompiler>
94
+ <RVCTCodeConst>0</RVCTCodeConst>
95
+ <RVCTZI>0</RVCTZI>
96
+ <RVCTOtherData>0</RVCTOtherData>
97
+ <ModuleSelection>0</ModuleSelection>
98
+ <IncludeInBuild>1</IncludeInBuild>
99
+ <AlwaysBuild>0</AlwaysBuild>
100
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
101
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
102
+ <PublicsOnly>0</PublicsOnly>
103
+ <StopOnExitCode>3</StopOnExitCode>
104
+ <CustomArgument></CustomArgument>
105
+ <IncludeLibraryModules></IncludeLibraryModules>
106
+ <ComprImg>1</ComprImg>
107
+ <BankNo>65535</BankNo>
108
+ </CommonProperty>
109
+ <DllOption>
110
+ <SimDllName>S8051.DLL</SimDllName>
111
+ <SimDllArguments></SimDllArguments>
112
+ <SimDlgDll>DP51.DLL</SimDlgDll>
113
+ <SimDlgDllArguments>-p51</SimDlgDllArguments>
114
+ <TargetDllName>S8051.DLL</TargetDllName>
115
+ <TargetDllArguments></TargetDllArguments>
116
+ <TargetDlgDll>TP51.DLL</TargetDlgDll>
117
+ <TargetDlgDllArguments>-p51</TargetDlgDllArguments>
118
+ </DllOption>
119
+ <DebugOption>
120
+ <OPTHX>
121
+ <HexSelection>0</HexSelection>
122
+ <HexRangeLowAddress>0</HexRangeLowAddress>
123
+ <HexRangeHighAddress>0</HexRangeHighAddress>
124
+ <HexOffset>0</HexOffset>
125
+ <Oh166RecLen>16</Oh166RecLen>
126
+ </OPTHX>
127
+ <Simulator>
128
+ <UseSimulator>1</UseSimulator>
129
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
130
+ <RunToMain>1</RunToMain>
131
+ <RestoreBreakpoints>1</RestoreBreakpoints>
132
+ <RestoreWatchpoints>1</RestoreWatchpoints>
133
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
134
+ <RestoreFunctions>1</RestoreFunctions>
135
+ <RestoreToolbox>1</RestoreToolbox>
136
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
137
+ <RestoreSysVw>1</RestoreSysVw>
138
+ </Simulator>
139
+ <Target>
140
+ <UseTarget>0</UseTarget>
141
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
142
+ <RunToMain>0</RunToMain>
143
+ <RestoreBreakpoints>1</RestoreBreakpoints>
144
+ <RestoreWatchpoints>1</RestoreWatchpoints>
145
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
146
+ <RestoreFunctions>0</RestoreFunctions>
147
+ <RestoreToolbox>1</RestoreToolbox>
148
+ <RestoreTracepoints>1</RestoreTracepoints>
149
+ <RestoreSysVw>1</RestoreSysVw>
150
+ </Target>
151
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
152
+ <TargetSelection>-1</TargetSelection>
153
+ <SimDlls>
154
+ <CpuDll></CpuDll>
155
+ <CpuDllArguments></CpuDllArguments>
156
+ <PeripheralDll></PeripheralDll>
157
+ <PeripheralDllArguments></PeripheralDllArguments>
158
+ <InitializationFile></InitializationFile>
159
+ </SimDlls>
160
+ <TargetDlls>
161
+ <CpuDll></CpuDll>
162
+ <CpuDllArguments></CpuDllArguments>
163
+ <PeripheralDll></PeripheralDll>
164
+ <PeripheralDllArguments></PeripheralDllArguments>
165
+ <InitializationFile></InitializationFile>
166
+ <Driver></Driver>
167
+ </TargetDlls>
168
+ </DebugOption>
169
+ <Utilities>
170
+ <Flash1>
171
+ <UseTargetDll>0</UseTargetDll>
172
+ <UseExternalTool>0</UseExternalTool>
173
+ <RunIndependent>0</RunIndependent>
174
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
175
+ <Capability>0</Capability>
176
+ <DriverSelection>-1</DriverSelection>
177
+ </Flash1>
178
+ <bUseTDR>0</bUseTDR>
179
+ <Flash2></Flash2>
180
+ <Flash3></Flash3>
181
+ <Flash4></Flash4>
182
+ <pFcarmOut></pFcarmOut>
183
+ <pFcarmGrp></pFcarmGrp>
184
+ <pFcArmRoot></pFcArmRoot>
185
+ <FcArmLst>0</FcArmLst>
186
+ </Utilities>
187
+ <Target51>
188
+ <Target51Misc>
189
+ <MemoryModel>0</MemoryModel>
190
+ <RTOS>0</RTOS>
191
+ <RomSize>2</RomSize>
192
+ <DataHold>0</DataHold>
193
+ <XDataHold>0</XDataHold>
194
+ <UseOnchipRom>0</UseOnchipRom>
195
+ <UseOnchipArithmetic>0</UseOnchipArithmetic>
196
+ <UseMultipleDPTR>0</UseMultipleDPTR>
197
+ <UseOnchipXram>0</UseOnchipXram>
198
+ <HadIRAM>1</HadIRAM>
199
+ <HadXRAM>0</HadXRAM>
200
+ <HadIROM>1</HadIROM>
201
+ <Moda2>0</Moda2>
202
+ <Moddp2>0</Moddp2>
203
+ <Modp2>0</Modp2>
204
+ <Mod517dp>0</Mod517dp>
205
+ <Mod517au>0</Mod517au>
206
+ <Mode2>0</Mode2>
207
+ <useCB>0</useCB>
208
+ <useXB>0</useXB>
209
+ <useL251>0</useL251>
210
+ <useA251>0</useA251>
211
+ <Mx51>0</Mx51>
212
+ <ModC812>0</ModC812>
213
+ <ModCont>0</ModCont>
214
+ <Lp51>0</Lp51>
215
+ <useXBS>0</useXBS>
216
+ <ModDA>0</ModDA>
217
+ <ModAB2>0</ModAB2>
218
+ <Mx51P>0</Mx51P>
219
+ <hadXRAM2>0</hadXRAM2>
220
+ <uocXram2>0</uocXram2>
221
+ <hadXRAM3>0</hadXRAM3>
222
+ <ModC2>0</ModC2>
223
+ <ModH2>0</ModH2>
224
+ <Mdu_R515>0</Mdu_R515>
225
+ <Mdu_F120>0</Mdu_F120>
226
+ <Psoc>0</Psoc>
227
+ <hadIROM2>0</hadIROM2>
228
+ <hadIROM3>0</hadIROM3>
229
+ <ModSmx2>0</ModSmx2>
230
+ <cBanks>0</cBanks>
231
+ <xBanks>0</xBanks>
232
+ <OnChipMemories>
233
+ <RCB>
234
+ <Type>0</Type>
235
+ <StartAddress>0x0</StartAddress>
236
+ <Size>0xffff</Size>
237
+ </RCB>
238
+ <RXB>
239
+ <Type>0</Type>
240
+ <StartAddress>0x0</StartAddress>
241
+ <Size>0x0</Size>
242
+ </RXB>
243
+ <Ocm1>
244
+ <Type>0</Type>
245
+ <StartAddress>0x0</StartAddress>
246
+ <Size>0x0</Size>
247
+ </Ocm1>
248
+ <Ocm2>
249
+ <Type>0</Type>
250
+ <StartAddress>0x0</StartAddress>
251
+ <Size>0x0</Size>
252
+ </Ocm2>
253
+ <Ocm3>
254
+ <Type>0</Type>
255
+ <StartAddress>0x0</StartAddress>
256
+ <Size>0x0</Size>
257
+ </Ocm3>
258
+ <Ocr1>
259
+ <Type>0</Type>
260
+ <StartAddress>0x0</StartAddress>
261
+ <Size>0x0</Size>
262
+ </Ocr1>
263
+ <Ocr2>
264
+ <Type>0</Type>
265
+ <StartAddress>0x0</StartAddress>
266
+ <Size>0x0</Size>
267
+ </Ocr2>
268
+ <Ocr3>
269
+ <Type>0</Type>
270
+ <StartAddress>0x0</StartAddress>
271
+ <Size>0x0</Size>
272
+ </Ocr3>
273
+ <IRO>
274
+ <Type>1</Type>
275
+ <StartAddress>0x0</StartAddress>
276
+ <Size>0x1000</Size>
277
+ </IRO>
278
+ <IRA>
279
+ <Type>0</Type>
280
+ <StartAddress>0x0</StartAddress>
281
+ <Size>0x80</Size>
282
+ </IRA>
283
+ <XRA>
284
+ <Type>0</Type>
285
+ <StartAddress>0x0</StartAddress>
286
+ <Size>0x0</Size>
287
+ </XRA>
288
+ <XRA512>
289
+ <Type>0</Type>
290
+ <StartAddress>0x0</StartAddress>
291
+ <Size>0x0</Size>
292
+ </XRA512>
293
+ <IROM512>
294
+ <Type>0</Type>
295
+ <StartAddress>0x0</StartAddress>
296
+ <Size>0x0</Size>
297
+ </IROM512>
298
+ <XRA513>
299
+ <Type>0</Type>
300
+ <StartAddress>0x0</StartAddress>
301
+ <Size>0x0</Size>
302
+ </XRA513>
303
+ <IROM513>
304
+ <Type>0</Type>
305
+ <StartAddress>0x0</StartAddress>
306
+ <Size>0x0</Size>
307
+ </IROM513>
308
+ </OnChipMemories>
309
+ </Target51Misc>
310
+ <C51>
311
+ <RegisterColoring>0</RegisterColoring>
312
+ <VariablesInOrder>0</VariablesInOrder>
313
+ <IntegerPromotion>1</IntegerPromotion>
314
+ <uAregs>0</uAregs>
315
+ <UseInterruptVector>1</UseInterruptVector>
316
+ <Fuzzy>3</Fuzzy>
317
+ <Optimize>8</Optimize>
318
+ <WarningLevel>2</WarningLevel>
319
+ <SizeSpeed>1</SizeSpeed>
320
+ <ObjectExtend>1</ObjectExtend>
321
+ <ACallAJmp>0</ACallAJmp>
322
+ <InterruptVectorAddress>0</InterruptVectorAddress>
323
+ <VariousControls>
324
+ <MiscControls></MiscControls>
325
+ <Define></Define>
326
+ <Undefine></Undefine>
327
+ <IncludePath></IncludePath>
328
+ </VariousControls>
329
+ </C51>
330
+ <Ax51>
331
+ <UseMpl>0</UseMpl>
332
+ <UseStandard>1</UseStandard>
333
+ <UseCase>0</UseCase>
334
+ <UseMod51>0</UseMod51>
335
+ <VariousControls>
336
+ <MiscControls></MiscControls>
337
+ <Define></Define>
338
+ <Undefine></Undefine>
339
+ <IncludePath></IncludePath>
340
+ </VariousControls>
341
+ </Ax51>
342
+ <Lx51>
343
+ <useFile>0</useFile>
344
+ <linkonly>0</linkonly>
345
+ <UseMemoryFromTarget>1</UseMemoryFromTarget>
346
+ <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
347
+ <WarningLevel>2</WarningLevel>
348
+ <DataOverlaying>1</DataOverlaying>
349
+ <OverlayString></OverlayString>
350
+ <MiscControls></MiscControls>
351
+ <DisableWarningNumbers></DisableWarningNumbers>
352
+ <LinkerCmdFile></LinkerCmdFile>
353
+ <Assign></Assign>
354
+ <ReserveString></ReserveString>
355
+ <CClasses></CClasses>
356
+ <UserClasses></UserClasses>
357
+ <CSection></CSection>
358
+ <UserSection></UserSection>
359
+ <CodeBaseAddress></CodeBaseAddress>
360
+ <XDataBaseAddress></XDataBaseAddress>
361
+ <PDataBaseAddress></PDataBaseAddress>
362
+ <BitBaseAddress></BitBaseAddress>
363
+ <DataBaseAddress></DataBaseAddress>
364
+ <IDataBaseAddress></IDataBaseAddress>
365
+ <Precede></Precede>
366
+ <Stack></Stack>
367
+ <CodeSegmentName></CodeSegmentName>
368
+ <XDataSegmentName></XDataSegmentName>
369
+ <BitSegmentName></BitSegmentName>
370
+ <DataSegmentName></DataSegmentName>
371
+ <IDataSegmentName></IDataSegmentName>
372
+ </Lx51>
373
+ </Target51>
374
+ </TargetOption>
375
+ <Groups>
376
+ <Group>
377
+ <GroupName>Source Group 1</GroupName>
378
+ <Files>
379
+ <File>
380
+ <FileName>STARTUP.A51</FileName>
381
+ <FileType>2</FileType>
382
+ <FilePath>.\STARTUP.A51</FilePath>
383
+ </File>
384
+ <File>
385
+ <FileName>4.c</FileName>
386
+ <FileType>1</FileType>
387
+ <FilePath>.\4.c</FilePath>
388
+ </File>
389
+ </Files>
390
+ </Group>
391
+ </Groups>
392
+ </Target>
393
+ </Targets>
394
+
395
+ </Project>
4/STARTUP.A51 ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $NOMOD51
2
+ ;------------------------------------------------------------------------------
3
+ ; This file is part of the C51 Compiler package
4
+ ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
5
+ ; Version 8.01
6
+ ;
7
+ ; *** <<< Use Configuration Wizard in Context Menu >>> ***
8
+ ;------------------------------------------------------------------------------
9
+ ; STARTUP.A51: This code is executed after processor reset.
10
+ ;
11
+ ; To translate this file use A51 with the following invocation:
12
+ ;
13
+ ; A51 STARTUP.A51
14
+ ;
15
+ ; To link the modified STARTUP.OBJ file to your application use the following
16
+ ; Lx51 invocation:
17
+ ;
18
+ ; Lx51 your object file list, STARTUP.OBJ controls
19
+ ;
20
+ ;------------------------------------------------------------------------------
21
+ ;
22
+ ; User-defined <h> Power-On Initialization of Memory
23
+ ;
24
+ ; With the following EQU statements the initialization of memory
25
+ ; at processor reset can be defined:
26
+ ;
27
+ ; <o> IDATALEN: IDATA memory size <0x0-0x100>
28
+ ; <i> Note: The absolute start-address of IDATA memory is always 0
29
+ ; <i> The IDATA space overlaps physically the DATA and BIT areas.
30
+ IDATALEN EQU 80H
31
+ ;
32
+ ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
33
+ ; <i> The absolute start address of XDATA memory
34
+ XDATASTART EQU 0
35
+ ;
36
+ ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
37
+ ; <i> The length of XDATA memory in bytes.
38
+ XDATALEN EQU 0
39
+ ;
40
+ ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
41
+ ; <i> The absolute start address of PDATA memory
42
+ PDATASTART EQU 0H
43
+ ;
44
+ ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
45
+ ; <i> The length of PDATA memory in bytes.
46
+ PDATALEN EQU 0H
47
+ ;
48
+ ;</h>
49
+ ;------------------------------------------------------------------------------
50
+ ;
51
+ ;<h> Reentrant Stack Initialization
52
+ ;
53
+ ; The following EQU statements define the stack pointer for reentrant
54
+ ; functions and initialized it:
55
+ ;
56
+ ; <h> Stack Space for reentrant functions in the SMALL model.
57
+ ; <q> IBPSTACK: Enable SMALL model reentrant stack
58
+ ; <i> Stack space for reentrant functions in the SMALL model.
59
+ IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
60
+ ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
61
+ ; <i> Set the top of the stack to the highest location.
62
+ IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
63
+ ; </h>
64
+ ;
65
+ ; <h> Stack Space for reentrant functions in the LARGE model.
66
+ ; <q> XBPSTACK: Enable LARGE model reentrant stack
67
+ ; <i> Stack space for reentrant functions in the LARGE model.
68
+ XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
69
+ ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
70
+ ; <i> Set the top of the stack to the highest location.
71
+ XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
72
+ ; </h>
73
+ ;
74
+ ; <h> Stack Space for reentrant functions in the COMPACT model.
75
+ ; <q> PBPSTACK: Enable COMPACT model reentrant stack
76
+ ; <i> Stack space for reentrant functions in the COMPACT model.
77
+ PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
78
+ ;
79
+ ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
80
+ ; <i> Set the top of the stack to the highest location.
81
+ PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
82
+ ; </h>
83
+ ;</h>
84
+ ;------------------------------------------------------------------------------
85
+ ;
86
+ ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
87
+ ; <e>Compact Model Page Definition
88
+ ;
89
+ ; <i>Define the XDATA page used for PDATA variables.
90
+ ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
91
+ ;
92
+ ; Enable pdata memory page initalization
93
+ PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
94
+ ;
95
+ ; <o> PPAGE number <0x0-0xFF>
96
+ ; <i> uppermost 256-byte address of the page used for PDATA variables.
97
+ PPAGE EQU 0
98
+ ;
99
+ ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
100
+ ; <i> most 8051 variants use P2 as uppermost address byte
101
+ PPAGE_SFR DATA 0A0H
102
+ ;
103
+ ; </e>
104
+ ;------------------------------------------------------------------------------
105
+
106
+ ; Standard SFR Symbols
107
+ ACC DATA 0E0H
108
+ B DATA 0F0H
109
+ SP DATA 81H
110
+ DPL DATA 82H
111
+ DPH DATA 83H
112
+
113
+ NAME ?C_STARTUP
114
+
115
+
116
+ ?C_C51STARTUP SEGMENT CODE
117
+ ?STACK SEGMENT IDATA
118
+
119
+ RSEG ?STACK
120
+ DS 1
121
+
122
+ EXTRN CODE (?C_START)
123
+ PUBLIC ?C_STARTUP
124
+
125
+ CSEG AT 0
126
+ ?C_STARTUP: LJMP STARTUP1
127
+
128
+ RSEG ?C_C51STARTUP
129
+
130
+ STARTUP1:
131
+
132
+ IF IDATALEN <> 0
133
+ MOV R0,#IDATALEN - 1
134
+ CLR A
135
+ IDATALOOP: MOV @R0,A
136
+ DJNZ R0,IDATALOOP
137
+ ENDIF
138
+
139
+ IF XDATALEN <> 0
140
+ MOV DPTR,#XDATASTART
141
+ MOV R7,#LOW (XDATALEN)
142
+ IF (LOW (XDATALEN)) <> 0
143
+ MOV R6,#(HIGH (XDATALEN)) +1
144
+ ELSE
145
+ MOV R6,#HIGH (XDATALEN)
146
+ ENDIF
147
+ CLR A
148
+ XDATALOOP: MOVX @DPTR,A
149
+ INC DPTR
150
+ DJNZ R7,XDATALOOP
151
+ DJNZ R6,XDATALOOP
152
+ ENDIF
153
+
154
+ IF PPAGEENABLE <> 0
155
+ MOV PPAGE_SFR,#PPAGE
156
+ ENDIF
157
+
158
+ IF PDATALEN <> 0
159
+ MOV R0,#LOW (PDATASTART)
160
+ MOV R7,#LOW (PDATALEN)
161
+ CLR A
162
+ PDATALOOP: MOVX @R0,A
163
+ INC R0
164
+ DJNZ R7,PDATALOOP
165
+ ENDIF
166
+
167
+ IF IBPSTACK <> 0
168
+ EXTRN DATA (?C_IBP)
169
+
170
+ MOV ?C_IBP,#LOW IBPSTACKTOP
171
+ ENDIF
172
+
173
+ IF XBPSTACK <> 0
174
+ EXTRN DATA (?C_XBP)
175
+
176
+ MOV ?C_XBP,#HIGH XBPSTACKTOP
177
+ MOV ?C_XBP+1,#LOW XBPSTACKTOP
178
+ ENDIF
179
+
180
+ IF PBPSTACK <> 0
181
+ EXTRN DATA (?C_PBP)
182
+ MOV ?C_PBP,#LOW PBPSTACKTOP
183
+ ENDIF
184
+
185
+ MOV SP,#?STACK-1
186
+
187
+ ; This code is required if you use L51_BANK.A51 with Banking Mode 4
188
+ ;<h> Code Banking
189
+ ; <q> Select Bank 0 for L51_BANK.A51 Mode 4
190
+ #if 0
191
+ ; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
192
+ EXTRN CODE (?B_SWITCH0)
193
+ CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
194
+ #endif
195
+ ;</h>
196
+ LJMP ?C_START
197
+
198
+ END
5/5.DSN ADDED
Binary file (91.9 kB). View file
 
5/5.c ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <REG51.H>
2
+
3
+ sbit C1 = P3^3;
4
+ sbit C2 = P3^2;
5
+ sbit C3 = P3^1;
6
+ sbit C4 = P3^0;
7
+
8
+ unsigned char code led[8] = {
9
+ 0xFE, 0xFC, 0xF8, 0xF0,
10
+ 0xE0, 0xC0, 0x80, 0x00
11
+ };
12
+
13
+ void delayMs(unsigned int i)
14
+ {
15
+ unsigned char t;
16
+ while (i--)
17
+ {
18
+ for (t = 0; t < 120; t++);
19
+ }
20
+ }
21
+
22
+ unsigned char scan(void)
23
+ {
24
+ unsigned char k = 0;
25
+
26
+ P3 = 0x7F;
27
+ if (C1 == 0) k = 1;
28
+ else if (C2 == 0) k = 2;
29
+ else if (C3 == 0) k = 3;
30
+ else if (C4 == 0) k = 4;
31
+
32
+ if (k == 0)
33
+ {
34
+ P3 = 0xBF;
35
+ if (C1 == 0) k = 5;
36
+ else if (C2 == 0) k = 6;
37
+ else if (C3 == 0) k = 7;
38
+ else if (C4 == 0) k = 8;
39
+ }
40
+
41
+ P3 = 0xFF;
42
+ return k;
43
+ }
44
+
45
+ void main(void)
46
+ {
47
+ unsigned char k;
48
+ P2 = 0xFF;
49
+
50
+ while (1)
51
+ {
52
+ k = scan();
53
+ if (k != 0)
54
+ {
55
+ delayMs(10);
56
+ if (scan() == k)
57
+ P2 = led[k - 1];
58
+ }
59
+ }
60
+ }
5/5.pdsprj ADDED
Binary file (16.5 kB). View file
 
5/5.uvproj ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
3
+
4
+ <SchemaVersion>1.1</SchemaVersion>
5
+
6
+ <Header>### uVision Project, (C) Keil Software</Header>
7
+
8
+ <Targets>
9
+ <Target>
10
+ <TargetName>Target 1</TargetName>
11
+ <ToolsetNumber>0x0</ToolsetNumber>
12
+ <ToolsetName>MCS-51</ToolsetName>
13
+ <uAC6>0</uAC6>
14
+ <TargetOption>
15
+ <TargetCommonOption>
16
+ <Device>AT89C51</Device>
17
+ <Vendor>Microchip</Vendor>
18
+ <Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
19
+ <FlashUtilSpec></FlashUtilSpec>
20
+ <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
21
+ <FlashDriverDll></FlashDriverDll>
22
+ <DeviceId>2976</DeviceId>
23
+ <RegisterFile>REGX51.H</RegisterFile>
24
+ <MemoryEnv></MemoryEnv>
25
+ <Cmp></Cmp>
26
+ <Asm></Asm>
27
+ <Linker></Linker>
28
+ <OHString></OHString>
29
+ <InfinionOptionDll></InfinionOptionDll>
30
+ <SLE66CMisc></SLE66CMisc>
31
+ <SLE66AMisc></SLE66AMisc>
32
+ <SLE66LinkerMisc></SLE66LinkerMisc>
33
+ <SFDFile></SFDFile>
34
+ <bCustSvd>0</bCustSvd>
35
+ <UseEnv>0</UseEnv>
36
+ <BinPath></BinPath>
37
+ <IncludePath></IncludePath>
38
+ <LibPath></LibPath>
39
+ <RegisterFilePath>Atmel\</RegisterFilePath>
40
+ <DBRegisterFilePath>Atmel\</DBRegisterFilePath>
41
+ <TargetStatus>
42
+ <Error>0</Error>
43
+ <ExitCodeStop>0</ExitCodeStop>
44
+ <ButtonStop>0</ButtonStop>
45
+ <NotGenerated>0</NotGenerated>
46
+ <InvalidFlash>1</InvalidFlash>
47
+ </TargetStatus>
48
+ <OutputDirectory>.\</OutputDirectory>
49
+ <OutputName>矩阵式键盘</OutputName>
50
+ <CreateExecutable>1</CreateExecutable>
51
+ <CreateLib>0</CreateLib>
52
+ <CreateHexFile>1</CreateHexFile>
53
+ <DebugInformation>1</DebugInformation>
54
+ <BrowseInformation>1</BrowseInformation>
55
+ <ListingPath>.\Listings\</ListingPath>
56
+ <HexFormatSelection>0</HexFormatSelection>
57
+ <Merge32K>0</Merge32K>
58
+ <CreateBatchFile>0</CreateBatchFile>
59
+ <BeforeCompile>
60
+ <RunUserProg1>0</RunUserProg1>
61
+ <RunUserProg2>0</RunUserProg2>
62
+ <UserProg1Name></UserProg1Name>
63
+ <UserProg2Name></UserProg2Name>
64
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
65
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
66
+ <nStopU1X>0</nStopU1X>
67
+ <nStopU2X>0</nStopU2X>
68
+ </BeforeCompile>
69
+ <BeforeMake>
70
+ <RunUserProg1>0</RunUserProg1>
71
+ <RunUserProg2>0</RunUserProg2>
72
+ <UserProg1Name></UserProg1Name>
73
+ <UserProg2Name></UserProg2Name>
74
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
75
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76
+ <nStopB1X>0</nStopB1X>
77
+ <nStopB2X>0</nStopB2X>
78
+ </BeforeMake>
79
+ <AfterMake>
80
+ <RunUserProg1>0</RunUserProg1>
81
+ <RunUserProg2>0</RunUserProg2>
82
+ <UserProg1Name></UserProg1Name>
83
+ <UserProg2Name></UserProg2Name>
84
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
85
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
86
+ <nStopA1X>0</nStopA1X>
87
+ <nStopA2X>0</nStopA2X>
88
+ </AfterMake>
89
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
90
+ <SVCSIdString></SVCSIdString>
91
+ </TargetCommonOption>
92
+ <CommonProperty>
93
+ <UseCPPCompiler>0</UseCPPCompiler>
94
+ <RVCTCodeConst>0</RVCTCodeConst>
95
+ <RVCTZI>0</RVCTZI>
96
+ <RVCTOtherData>0</RVCTOtherData>
97
+ <ModuleSelection>0</ModuleSelection>
98
+ <IncludeInBuild>1</IncludeInBuild>
99
+ <AlwaysBuild>0</AlwaysBuild>
100
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
101
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
102
+ <PublicsOnly>0</PublicsOnly>
103
+ <StopOnExitCode>3</StopOnExitCode>
104
+ <CustomArgument></CustomArgument>
105
+ <IncludeLibraryModules></IncludeLibraryModules>
106
+ <ComprImg>1</ComprImg>
107
+ <BankNo>65535</BankNo>
108
+ </CommonProperty>
109
+ <DllOption>
110
+ <SimDllName>S8051.DLL</SimDllName>
111
+ <SimDllArguments></SimDllArguments>
112
+ <SimDlgDll>DP51.DLL</SimDlgDll>
113
+ <SimDlgDllArguments>-p51</SimDlgDllArguments>
114
+ <TargetDllName>S8051.DLL</TargetDllName>
115
+ <TargetDllArguments></TargetDllArguments>
116
+ <TargetDlgDll>TP51.DLL</TargetDlgDll>
117
+ <TargetDlgDllArguments>-p51</TargetDlgDllArguments>
118
+ </DllOption>
119
+ <DebugOption>
120
+ <OPTHX>
121
+ <HexSelection>0</HexSelection>
122
+ <HexRangeLowAddress>0</HexRangeLowAddress>
123
+ <HexRangeHighAddress>0</HexRangeHighAddress>
124
+ <HexOffset>0</HexOffset>
125
+ <Oh166RecLen>16</Oh166RecLen>
126
+ </OPTHX>
127
+ <Simulator>
128
+ <UseSimulator>1</UseSimulator>
129
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
130
+ <RunToMain>1</RunToMain>
131
+ <RestoreBreakpoints>1</RestoreBreakpoints>
132
+ <RestoreWatchpoints>1</RestoreWatchpoints>
133
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
134
+ <RestoreFunctions>1</RestoreFunctions>
135
+ <RestoreToolbox>1</RestoreToolbox>
136
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
137
+ <RestoreSysVw>1</RestoreSysVw>
138
+ </Simulator>
139
+ <Target>
140
+ <UseTarget>0</UseTarget>
141
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
142
+ <RunToMain>0</RunToMain>
143
+ <RestoreBreakpoints>1</RestoreBreakpoints>
144
+ <RestoreWatchpoints>1</RestoreWatchpoints>
145
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
146
+ <RestoreFunctions>0</RestoreFunctions>
147
+ <RestoreToolbox>1</RestoreToolbox>
148
+ <RestoreTracepoints>1</RestoreTracepoints>
149
+ <RestoreSysVw>1</RestoreSysVw>
150
+ </Target>
151
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
152
+ <TargetSelection>-1</TargetSelection>
153
+ <SimDlls>
154
+ <CpuDll></CpuDll>
155
+ <CpuDllArguments></CpuDllArguments>
156
+ <PeripheralDll></PeripheralDll>
157
+ <PeripheralDllArguments></PeripheralDllArguments>
158
+ <InitializationFile></InitializationFile>
159
+ </SimDlls>
160
+ <TargetDlls>
161
+ <CpuDll></CpuDll>
162
+ <CpuDllArguments></CpuDllArguments>
163
+ <PeripheralDll></PeripheralDll>
164
+ <PeripheralDllArguments></PeripheralDllArguments>
165
+ <InitializationFile></InitializationFile>
166
+ <Driver></Driver>
167
+ </TargetDlls>
168
+ </DebugOption>
169
+ <Utilities>
170
+ <Flash1>
171
+ <UseTargetDll>0</UseTargetDll>
172
+ <UseExternalTool>0</UseExternalTool>
173
+ <RunIndependent>0</RunIndependent>
174
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
175
+ <Capability>0</Capability>
176
+ <DriverSelection>-1</DriverSelection>
177
+ </Flash1>
178
+ <bUseTDR>0</bUseTDR>
179
+ <Flash2></Flash2>
180
+ <Flash3></Flash3>
181
+ <Flash4></Flash4>
182
+ <pFcarmOut></pFcarmOut>
183
+ <pFcarmGrp></pFcarmGrp>
184
+ <pFcArmRoot></pFcArmRoot>
185
+ <FcArmLst>0</FcArmLst>
186
+ </Utilities>
187
+ <Target51>
188
+ <Target51Misc>
189
+ <MemoryModel>0</MemoryModel>
190
+ <RTOS>0</RTOS>
191
+ <RomSize>2</RomSize>
192
+ <DataHold>0</DataHold>
193
+ <XDataHold>0</XDataHold>
194
+ <UseOnchipRom>0</UseOnchipRom>
195
+ <UseOnchipArithmetic>0</UseOnchipArithmetic>
196
+ <UseMultipleDPTR>0</UseMultipleDPTR>
197
+ <UseOnchipXram>0</UseOnchipXram>
198
+ <HadIRAM>1</HadIRAM>
199
+ <HadXRAM>0</HadXRAM>
200
+ <HadIROM>1</HadIROM>
201
+ <Moda2>0</Moda2>
202
+ <Moddp2>0</Moddp2>
203
+ <Modp2>0</Modp2>
204
+ <Mod517dp>0</Mod517dp>
205
+ <Mod517au>0</Mod517au>
206
+ <Mode2>0</Mode2>
207
+ <useCB>0</useCB>
208
+ <useXB>0</useXB>
209
+ <useL251>0</useL251>
210
+ <useA251>0</useA251>
211
+ <Mx51>0</Mx51>
212
+ <ModC812>0</ModC812>
213
+ <ModCont>0</ModCont>
214
+ <Lp51>0</Lp51>
215
+ <useXBS>0</useXBS>
216
+ <ModDA>0</ModDA>
217
+ <ModAB2>0</ModAB2>
218
+ <Mx51P>0</Mx51P>
219
+ <hadXRAM2>0</hadXRAM2>
220
+ <uocXram2>0</uocXram2>
221
+ <hadXRAM3>0</hadXRAM3>
222
+ <ModC2>0</ModC2>
223
+ <ModH2>0</ModH2>
224
+ <Mdu_R515>0</Mdu_R515>
225
+ <Mdu_F120>0</Mdu_F120>
226
+ <Psoc>0</Psoc>
227
+ <hadIROM2>0</hadIROM2>
228
+ <hadIROM3>0</hadIROM3>
229
+ <ModSmx2>0</ModSmx2>
230
+ <cBanks>0</cBanks>
231
+ <xBanks>0</xBanks>
232
+ <OnChipMemories>
233
+ <RCB>
234
+ <Type>0</Type>
235
+ <StartAddress>0x0</StartAddress>
236
+ <Size>0xffff</Size>
237
+ </RCB>
238
+ <RXB>
239
+ <Type>0</Type>
240
+ <StartAddress>0x0</StartAddress>
241
+ <Size>0x0</Size>
242
+ </RXB>
243
+ <Ocm1>
244
+ <Type>0</Type>
245
+ <StartAddress>0x0</StartAddress>
246
+ <Size>0x0</Size>
247
+ </Ocm1>
248
+ <Ocm2>
249
+ <Type>0</Type>
250
+ <StartAddress>0x0</StartAddress>
251
+ <Size>0x0</Size>
252
+ </Ocm2>
253
+ <Ocm3>
254
+ <Type>0</Type>
255
+ <StartAddress>0x0</StartAddress>
256
+ <Size>0x0</Size>
257
+ </Ocm3>
258
+ <Ocr1>
259
+ <Type>0</Type>
260
+ <StartAddress>0x0</StartAddress>
261
+ <Size>0x0</Size>
262
+ </Ocr1>
263
+ <Ocr2>
264
+ <Type>0</Type>
265
+ <StartAddress>0x0</StartAddress>
266
+ <Size>0x0</Size>
267
+ </Ocr2>
268
+ <Ocr3>
269
+ <Type>0</Type>
270
+ <StartAddress>0x0</StartAddress>
271
+ <Size>0x0</Size>
272
+ </Ocr3>
273
+ <IRO>
274
+ <Type>1</Type>
275
+ <StartAddress>0x0</StartAddress>
276
+ <Size>0x1000</Size>
277
+ </IRO>
278
+ <IRA>
279
+ <Type>0</Type>
280
+ <StartAddress>0x0</StartAddress>
281
+ <Size>0x80</Size>
282
+ </IRA>
283
+ <XRA>
284
+ <Type>0</Type>
285
+ <StartAddress>0x0</StartAddress>
286
+ <Size>0x0</Size>
287
+ </XRA>
288
+ <XRA512>
289
+ <Type>0</Type>
290
+ <StartAddress>0x0</StartAddress>
291
+ <Size>0x0</Size>
292
+ </XRA512>
293
+ <IROM512>
294
+ <Type>0</Type>
295
+ <StartAddress>0x0</StartAddress>
296
+ <Size>0x0</Size>
297
+ </IROM512>
298
+ <XRA513>
299
+ <Type>0</Type>
300
+ <StartAddress>0x0</StartAddress>
301
+ <Size>0x0</Size>
302
+ </XRA513>
303
+ <IROM513>
304
+ <Type>0</Type>
305
+ <StartAddress>0x0</StartAddress>
306
+ <Size>0x0</Size>
307
+ </IROM513>
308
+ </OnChipMemories>
309
+ </Target51Misc>
310
+ <C51>
311
+ <RegisterColoring>0</RegisterColoring>
312
+ <VariablesInOrder>0</VariablesInOrder>
313
+ <IntegerPromotion>1</IntegerPromotion>
314
+ <uAregs>0</uAregs>
315
+ <UseInterruptVector>1</UseInterruptVector>
316
+ <Fuzzy>3</Fuzzy>
317
+ <Optimize>8</Optimize>
318
+ <WarningLevel>2</WarningLevel>
319
+ <SizeSpeed>1</SizeSpeed>
320
+ <ObjectExtend>1</ObjectExtend>
321
+ <ACallAJmp>0</ACallAJmp>
322
+ <InterruptVectorAddress>0</InterruptVectorAddress>
323
+ <VariousControls>
324
+ <MiscControls></MiscControls>
325
+ <Define></Define>
326
+ <Undefine></Undefine>
327
+ <IncludePath></IncludePath>
328
+ </VariousControls>
329
+ </C51>
330
+ <Ax51>
331
+ <UseMpl>0</UseMpl>
332
+ <UseStandard>1</UseStandard>
333
+ <UseCase>0</UseCase>
334
+ <UseMod51>0</UseMod51>
335
+ <VariousControls>
336
+ <MiscControls></MiscControls>
337
+ <Define></Define>
338
+ <Undefine></Undefine>
339
+ <IncludePath></IncludePath>
340
+ </VariousControls>
341
+ </Ax51>
342
+ <Lx51>
343
+ <useFile>0</useFile>
344
+ <linkonly>0</linkonly>
345
+ <UseMemoryFromTarget>1</UseMemoryFromTarget>
346
+ <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
347
+ <WarningLevel>2</WarningLevel>
348
+ <DataOverlaying>1</DataOverlaying>
349
+ <OverlayString></OverlayString>
350
+ <MiscControls></MiscControls>
351
+ <DisableWarningNumbers></DisableWarningNumbers>
352
+ <LinkerCmdFile></LinkerCmdFile>
353
+ <Assign></Assign>
354
+ <ReserveString></ReserveString>
355
+ <CClasses></CClasses>
356
+ <UserClasses></UserClasses>
357
+ <CSection></CSection>
358
+ <UserSection></UserSection>
359
+ <CodeBaseAddress></CodeBaseAddress>
360
+ <XDataBaseAddress></XDataBaseAddress>
361
+ <PDataBaseAddress></PDataBaseAddress>
362
+ <BitBaseAddress></BitBaseAddress>
363
+ <DataBaseAddress></DataBaseAddress>
364
+ <IDataBaseAddress></IDataBaseAddress>
365
+ <Precede></Precede>
366
+ <Stack></Stack>
367
+ <CodeSegmentName></CodeSegmentName>
368
+ <XDataSegmentName></XDataSegmentName>
369
+ <BitSegmentName></BitSegmentName>
370
+ <DataSegmentName></DataSegmentName>
371
+ <IDataSegmentName></IDataSegmentName>
372
+ </Lx51>
373
+ </Target51>
374
+ </TargetOption>
375
+ <Groups>
376
+ <Group>
377
+ <GroupName>Source Group 1</GroupName>
378
+ <Files>
379
+ <File>
380
+ <FileName>STARTUP.A51</FileName>
381
+ <FileType>2</FileType>
382
+ <FilePath>.\STARTUP.A51</FilePath>
383
+ </File>
384
+ <File>
385
+ <FileName>5.c</FileName>
386
+ <FileType>1</FileType>
387
+ <FilePath>.\5.c</FilePath>
388
+ </File>
389
+ </Files>
390
+ </Group>
391
+ </Groups>
392
+ </Target>
393
+ </Targets>
394
+
395
+ </Project>
5/STARTUP.A51 ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $NOMOD51
2
+ ;------------------------------------------------------------------------------
3
+ ; This file is part of the C51 Compiler package
4
+ ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
5
+ ; Version 8.01
6
+ ;
7
+ ; *** <<< Use Configuration Wizard in Context Menu >>> ***
8
+ ;------------------------------------------------------------------------------
9
+ ; STARTUP.A51: This code is executed after processor reset.
10
+ ;
11
+ ; To translate this file use A51 with the following invocation:
12
+ ;
13
+ ; A51 STARTUP.A51
14
+ ;
15
+ ; To link the modified STARTUP.OBJ file to your application use the following
16
+ ; Lx51 invocation:
17
+ ;
18
+ ; Lx51 your object file list, STARTUP.OBJ controls
19
+ ;
20
+ ;------------------------------------------------------------------------------
21
+ ;
22
+ ; User-defined <h> Power-On Initialization of Memory
23
+ ;
24
+ ; With the following EQU statements the initialization of memory
25
+ ; at processor reset can be defined:
26
+ ;
27
+ ; <o> IDATALEN: IDATA memory size <0x0-0x100>
28
+ ; <i> Note: The absolute start-address of IDATA memory is always 0
29
+ ; <i> The IDATA space overlaps physically the DATA and BIT areas.
30
+ IDATALEN EQU 80H
31
+ ;
32
+ ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
33
+ ; <i> The absolute start address of XDATA memory
34
+ XDATASTART EQU 0
35
+ ;
36
+ ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
37
+ ; <i> The length of XDATA memory in bytes.
38
+ XDATALEN EQU 0
39
+ ;
40
+ ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
41
+ ; <i> The absolute start address of PDATA memory
42
+ PDATASTART EQU 0H
43
+ ;
44
+ ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
45
+ ; <i> The length of PDATA memory in bytes.
46
+ PDATALEN EQU 0H
47
+ ;
48
+ ;</h>
49
+ ;------------------------------------------------------------------------------
50
+ ;
51
+ ;<h> Reentrant Stack Initialization
52
+ ;
53
+ ; The following EQU statements define the stack pointer for reentrant
54
+ ; functions and initialized it:
55
+ ;
56
+ ; <h> Stack Space for reentrant functions in the SMALL model.
57
+ ; <q> IBPSTACK: Enable SMALL model reentrant stack
58
+ ; <i> Stack space for reentrant functions in the SMALL model.
59
+ IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
60
+ ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
61
+ ; <i> Set the top of the stack to the highest location.
62
+ IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
63
+ ; </h>
64
+ ;
65
+ ; <h> Stack Space for reentrant functions in the LARGE model.
66
+ ; <q> XBPSTACK: Enable LARGE model reentrant stack
67
+ ; <i> Stack space for reentrant functions in the LARGE model.
68
+ XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
69
+ ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
70
+ ; <i> Set the top of the stack to the highest location.
71
+ XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
72
+ ; </h>
73
+ ;
74
+ ; <h> Stack Space for reentrant functions in the COMPACT model.
75
+ ; <q> PBPSTACK: Enable COMPACT model reentrant stack
76
+ ; <i> Stack space for reentrant functions in the COMPACT model.
77
+ PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
78
+ ;
79
+ ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
80
+ ; <i> Set the top of the stack to the highest location.
81
+ PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
82
+ ; </h>
83
+ ;</h>
84
+ ;------------------------------------------------------------------------------
85
+ ;
86
+ ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
87
+ ; <e>Compact Model Page Definition
88
+ ;
89
+ ; <i>Define the XDATA page used for PDATA variables.
90
+ ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
91
+ ;
92
+ ; Enable pdata memory page initalization
93
+ PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
94
+ ;
95
+ ; <o> PPAGE number <0x0-0xFF>
96
+ ; <i> uppermost 256-byte address of the page used for PDATA variables.
97
+ PPAGE EQU 0
98
+ ;
99
+ ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
100
+ ; <i> most 8051 variants use P2 as uppermost address byte
101
+ PPAGE_SFR DATA 0A0H
102
+ ;
103
+ ; </e>
104
+ ;------------------------------------------------------------------------------
105
+
106
+ ; Standard SFR Symbols
107
+ ACC DATA 0E0H
108
+ B DATA 0F0H
109
+ SP DATA 81H
110
+ DPL DATA 82H
111
+ DPH DATA 83H
112
+
113
+ NAME ?C_STARTUP
114
+
115
+
116
+ ?C_C51STARTUP SEGMENT CODE
117
+ ?STACK SEGMENT IDATA
118
+
119
+ RSEG ?STACK
120
+ DS 1
121
+
122
+ EXTRN CODE (?C_START)
123
+ PUBLIC ?C_STARTUP
124
+
125
+ CSEG AT 0
126
+ ?C_STARTUP: LJMP STARTUP1
127
+
128
+ RSEG ?C_C51STARTUP
129
+
130
+ STARTUP1:
131
+
132
+ IF IDATALEN <> 0
133
+ MOV R0,#IDATALEN - 1
134
+ CLR A
135
+ IDATALOOP: MOV @R0,A
136
+ DJNZ R0,IDATALOOP
137
+ ENDIF
138
+
139
+ IF XDATALEN <> 0
140
+ MOV DPTR,#XDATASTART
141
+ MOV R7,#LOW (XDATALEN)
142
+ IF (LOW (XDATALEN)) <> 0
143
+ MOV R6,#(HIGH (XDATALEN)) +1
144
+ ELSE
145
+ MOV R6,#HIGH (XDATALEN)
146
+ ENDIF
147
+ CLR A
148
+ XDATALOOP: MOVX @DPTR,A
149
+ INC DPTR
150
+ DJNZ R7,XDATALOOP
151
+ DJNZ R6,XDATALOOP
152
+ ENDIF
153
+
154
+ IF PPAGEENABLE <> 0
155
+ MOV PPAGE_SFR,#PPAGE
156
+ ENDIF
157
+
158
+ IF PDATALEN <> 0
159
+ MOV R0,#LOW (PDATASTART)
160
+ MOV R7,#LOW (PDATALEN)
161
+ CLR A
162
+ PDATALOOP: MOVX @R0,A
163
+ INC R0
164
+ DJNZ R7,PDATALOOP
165
+ ENDIF
166
+
167
+ IF IBPSTACK <> 0
168
+ EXTRN DATA (?C_IBP)
169
+
170
+ MOV ?C_IBP,#LOW IBPSTACKTOP
171
+ ENDIF
172
+
173
+ IF XBPSTACK <> 0
174
+ EXTRN DATA (?C_XBP)
175
+
176
+ MOV ?C_XBP,#HIGH XBPSTACKTOP
177
+ MOV ?C_XBP+1,#LOW XBPSTACKTOP
178
+ ENDIF
179
+
180
+ IF PBPSTACK <> 0
181
+ EXTRN DATA (?C_PBP)
182
+ MOV ?C_PBP,#LOW PBPSTACKTOP
183
+ ENDIF
184
+
185
+ MOV SP,#?STACK-1
186
+
187
+ ; This code is required if you use L51_BANK.A51 with Banking Mode 4
188
+ ;<h> Code Banking
189
+ ; <q> Select Bank 0 for L51_BANK.A51 Mode 4
190
+ #if 0
191
+ ; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
192
+ EXTRN CODE (?B_SWITCH0)
193
+ CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
194
+ #endif
195
+ ;</h>
196
+ LJMP ?C_START
197
+
198
+ END
6/6.DSN ADDED
Binary file (68.3 kB). View file
 
6/6.c ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <REG51.H>
2
+
3
+ sbit RS = P2^6;
4
+ sbit RW = P2^5;
5
+ sbit E = P2^7;
6
+
7
+ void delayMs(unsigned int i)
8
+ {
9
+ unsigned char t;
10
+ while (i--)
11
+ {
12
+ for (t = 0; t < 120; t++);
13
+ }
14
+ }
15
+
16
+ void cmd(unsigned char x)
17
+ {
18
+ RS = 0;
19
+ RW = 0;
20
+ P0 = x;
21
+ E = 1;
22
+ delayMs(1);
23
+ E = 0;
24
+ delayMs(1);
25
+ }
26
+
27
+ void dat(unsigned char x)
28
+ {
29
+ RS = 1;
30
+ RW = 0;
31
+ P0 = x;
32
+ E = 1;
33
+ delayMs(1);
34
+ E = 0;
35
+ delayMs(1);
36
+ }
37
+
38
+ void main(void)
39
+ {
40
+ delayMs(15);
41
+ cmd(0x38);
42
+ cmd(0x0C);
43
+ cmd(0x06);
44
+ cmd(0x01);
45
+ delayMs(2);
46
+
47
+ cmd(0x80);
48
+ dat('M');
49
+ dat('C');
50
+ dat('U');
51
+ dat(':');
52
+ dat('8');
53
+ dat('0');
54
+ dat('5');
55
+ dat('1');
56
+
57
+ cmd(0xC0);
58
+ dat('M');
59
+ dat('C');
60
+ dat('U');
61
+ dat(' ');
62
+ dat('T');
63
+ dat('E');
64
+ dat('S');
65
+ dat('T');
66
+
67
+ while (1);
68
+ }
6/6.pdsprj ADDED
Binary file (13.8 kB). View file
 
6/6.uvproj ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
3
+
4
+ <SchemaVersion>1.1</SchemaVersion>
5
+
6
+ <Header>### uVision Project, (C) Keil Software</Header>
7
+
8
+ <Targets>
9
+ <Target>
10
+ <TargetName>Target 1</TargetName>
11
+ <ToolsetNumber>0x0</ToolsetNumber>
12
+ <ToolsetName>MCS-51</ToolsetName>
13
+ <uAC6>0</uAC6>
14
+ <TargetOption>
15
+ <TargetCommonOption>
16
+ <Device>AT89C51</Device>
17
+ <Vendor>Microchip</Vendor>
18
+ <Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
19
+ <FlashUtilSpec></FlashUtilSpec>
20
+ <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
21
+ <FlashDriverDll></FlashDriverDll>
22
+ <DeviceId>2976</DeviceId>
23
+ <RegisterFile>REGX51.H</RegisterFile>
24
+ <MemoryEnv></MemoryEnv>
25
+ <Cmp></Cmp>
26
+ <Asm></Asm>
27
+ <Linker></Linker>
28
+ <OHString></OHString>
29
+ <InfinionOptionDll></InfinionOptionDll>
30
+ <SLE66CMisc></SLE66CMisc>
31
+ <SLE66AMisc></SLE66AMisc>
32
+ <SLE66LinkerMisc></SLE66LinkerMisc>
33
+ <SFDFile></SFDFile>
34
+ <bCustSvd>0</bCustSvd>
35
+ <UseEnv>0</UseEnv>
36
+ <BinPath></BinPath>
37
+ <IncludePath></IncludePath>
38
+ <LibPath></LibPath>
39
+ <RegisterFilePath>Atmel\</RegisterFilePath>
40
+ <DBRegisterFilePath>Atmel\</DBRegisterFilePath>
41
+ <TargetStatus>
42
+ <Error>0</Error>
43
+ <ExitCodeStop>0</ExitCodeStop>
44
+ <ButtonStop>0</ButtonStop>
45
+ <NotGenerated>0</NotGenerated>
46
+ <InvalidFlash>1</InvalidFlash>
47
+ </TargetStatus>
48
+ <OutputDirectory>.\代码1\</OutputDirectory>
49
+ <OutputName>液晶显示</OutputName>
50
+ <CreateExecutable>1</CreateExecutable>
51
+ <CreateLib>0</CreateLib>
52
+ <CreateHexFile>1</CreateHexFile>
53
+ <DebugInformation>1</DebugInformation>
54
+ <BrowseInformation>1</BrowseInformation>
55
+ <ListingPath>.\Listings\</ListingPath>
56
+ <HexFormatSelection>0</HexFormatSelection>
57
+ <Merge32K>0</Merge32K>
58
+ <CreateBatchFile>0</CreateBatchFile>
59
+ <BeforeCompile>
60
+ <RunUserProg1>0</RunUserProg1>
61
+ <RunUserProg2>0</RunUserProg2>
62
+ <UserProg1Name></UserProg1Name>
63
+ <UserProg2Name></UserProg2Name>
64
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
65
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
66
+ <nStopU1X>0</nStopU1X>
67
+ <nStopU2X>0</nStopU2X>
68
+ </BeforeCompile>
69
+ <BeforeMake>
70
+ <RunUserProg1>0</RunUserProg1>
71
+ <RunUserProg2>0</RunUserProg2>
72
+ <UserProg1Name></UserProg1Name>
73
+ <UserProg2Name></UserProg2Name>
74
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
75
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76
+ <nStopB1X>0</nStopB1X>
77
+ <nStopB2X>0</nStopB2X>
78
+ </BeforeMake>
79
+ <AfterMake>
80
+ <RunUserProg1>0</RunUserProg1>
81
+ <RunUserProg2>0</RunUserProg2>
82
+ <UserProg1Name></UserProg1Name>
83
+ <UserProg2Name></UserProg2Name>
84
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
85
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
86
+ <nStopA1X>0</nStopA1X>
87
+ <nStopA2X>0</nStopA2X>
88
+ </AfterMake>
89
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
90
+ <SVCSIdString></SVCSIdString>
91
+ </TargetCommonOption>
92
+ <CommonProperty>
93
+ <UseCPPCompiler>0</UseCPPCompiler>
94
+ <RVCTCodeConst>0</RVCTCodeConst>
95
+ <RVCTZI>0</RVCTZI>
96
+ <RVCTOtherData>0</RVCTOtherData>
97
+ <ModuleSelection>0</ModuleSelection>
98
+ <IncludeInBuild>1</IncludeInBuild>
99
+ <AlwaysBuild>0</AlwaysBuild>
100
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
101
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
102
+ <PublicsOnly>0</PublicsOnly>
103
+ <StopOnExitCode>3</StopOnExitCode>
104
+ <CustomArgument></CustomArgument>
105
+ <IncludeLibraryModules></IncludeLibraryModules>
106
+ <ComprImg>1</ComprImg>
107
+ <BankNo>65535</BankNo>
108
+ </CommonProperty>
109
+ <DllOption>
110
+ <SimDllName>S8051.DLL</SimDllName>
111
+ <SimDllArguments></SimDllArguments>
112
+ <SimDlgDll>DP51.DLL</SimDlgDll>
113
+ <SimDlgDllArguments>-p51</SimDlgDllArguments>
114
+ <TargetDllName>S8051.DLL</TargetDllName>
115
+ <TargetDllArguments></TargetDllArguments>
116
+ <TargetDlgDll>TP51.DLL</TargetDlgDll>
117
+ <TargetDlgDllArguments>-p51</TargetDlgDllArguments>
118
+ </DllOption>
119
+ <DebugOption>
120
+ <OPTHX>
121
+ <HexSelection>0</HexSelection>
122
+ <HexRangeLowAddress>0</HexRangeLowAddress>
123
+ <HexRangeHighAddress>0</HexRangeHighAddress>
124
+ <HexOffset>0</HexOffset>
125
+ <Oh166RecLen>16</Oh166RecLen>
126
+ </OPTHX>
127
+ <Simulator>
128
+ <UseSimulator>1</UseSimulator>
129
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
130
+ <RunToMain>1</RunToMain>
131
+ <RestoreBreakpoints>1</RestoreBreakpoints>
132
+ <RestoreWatchpoints>1</RestoreWatchpoints>
133
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
134
+ <RestoreFunctions>1</RestoreFunctions>
135
+ <RestoreToolbox>1</RestoreToolbox>
136
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
137
+ <RestoreSysVw>1</RestoreSysVw>
138
+ </Simulator>
139
+ <Target>
140
+ <UseTarget>0</UseTarget>
141
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
142
+ <RunToMain>0</RunToMain>
143
+ <RestoreBreakpoints>1</RestoreBreakpoints>
144
+ <RestoreWatchpoints>1</RestoreWatchpoints>
145
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
146
+ <RestoreFunctions>0</RestoreFunctions>
147
+ <RestoreToolbox>1</RestoreToolbox>
148
+ <RestoreTracepoints>1</RestoreTracepoints>
149
+ <RestoreSysVw>1</RestoreSysVw>
150
+ </Target>
151
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
152
+ <TargetSelection>-1</TargetSelection>
153
+ <SimDlls>
154
+ <CpuDll></CpuDll>
155
+ <CpuDllArguments></CpuDllArguments>
156
+ <PeripheralDll></PeripheralDll>
157
+ <PeripheralDllArguments></PeripheralDllArguments>
158
+ <InitializationFile></InitializationFile>
159
+ </SimDlls>
160
+ <TargetDlls>
161
+ <CpuDll></CpuDll>
162
+ <CpuDllArguments></CpuDllArguments>
163
+ <PeripheralDll></PeripheralDll>
164
+ <PeripheralDllArguments></PeripheralDllArguments>
165
+ <InitializationFile></InitializationFile>
166
+ <Driver></Driver>
167
+ </TargetDlls>
168
+ </DebugOption>
169
+ <Utilities>
170
+ <Flash1>
171
+ <UseTargetDll>0</UseTargetDll>
172
+ <UseExternalTool>0</UseExternalTool>
173
+ <RunIndependent>0</RunIndependent>
174
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
175
+ <Capability>0</Capability>
176
+ <DriverSelection>-1</DriverSelection>
177
+ </Flash1>
178
+ <bUseTDR>0</bUseTDR>
179
+ <Flash2></Flash2>
180
+ <Flash3></Flash3>
181
+ <Flash4></Flash4>
182
+ <pFcarmOut></pFcarmOut>
183
+ <pFcarmGrp></pFcarmGrp>
184
+ <pFcArmRoot></pFcArmRoot>
185
+ <FcArmLst>0</FcArmLst>
186
+ </Utilities>
187
+ <Target51>
188
+ <Target51Misc>
189
+ <MemoryModel>0</MemoryModel>
190
+ <RTOS>0</RTOS>
191
+ <RomSize>2</RomSize>
192
+ <DataHold>0</DataHold>
193
+ <XDataHold>0</XDataHold>
194
+ <UseOnchipRom>0</UseOnchipRom>
195
+ <UseOnchipArithmetic>0</UseOnchipArithmetic>
196
+ <UseMultipleDPTR>0</UseMultipleDPTR>
197
+ <UseOnchipXram>0</UseOnchipXram>
198
+ <HadIRAM>1</HadIRAM>
199
+ <HadXRAM>0</HadXRAM>
200
+ <HadIROM>1</HadIROM>
201
+ <Moda2>0</Moda2>
202
+ <Moddp2>0</Moddp2>
203
+ <Modp2>0</Modp2>
204
+ <Mod517dp>0</Mod517dp>
205
+ <Mod517au>0</Mod517au>
206
+ <Mode2>0</Mode2>
207
+ <useCB>0</useCB>
208
+ <useXB>0</useXB>
209
+ <useL251>0</useL251>
210
+ <useA251>0</useA251>
211
+ <Mx51>0</Mx51>
212
+ <ModC812>0</ModC812>
213
+ <ModCont>0</ModCont>
214
+ <Lp51>0</Lp51>
215
+ <useXBS>0</useXBS>
216
+ <ModDA>0</ModDA>
217
+ <ModAB2>0</ModAB2>
218
+ <Mx51P>0</Mx51P>
219
+ <hadXRAM2>0</hadXRAM2>
220
+ <uocXram2>0</uocXram2>
221
+ <hadXRAM3>0</hadXRAM3>
222
+ <ModC2>0</ModC2>
223
+ <ModH2>0</ModH2>
224
+ <Mdu_R515>0</Mdu_R515>
225
+ <Mdu_F120>0</Mdu_F120>
226
+ <Psoc>0</Psoc>
227
+ <hadIROM2>0</hadIROM2>
228
+ <hadIROM3>0</hadIROM3>
229
+ <ModSmx2>0</ModSmx2>
230
+ <cBanks>0</cBanks>
231
+ <xBanks>0</xBanks>
232
+ <OnChipMemories>
233
+ <RCB>
234
+ <Type>0</Type>
235
+ <StartAddress>0x0</StartAddress>
236
+ <Size>0xffff</Size>
237
+ </RCB>
238
+ <RXB>
239
+ <Type>0</Type>
240
+ <StartAddress>0x0</StartAddress>
241
+ <Size>0x0</Size>
242
+ </RXB>
243
+ <Ocm1>
244
+ <Type>0</Type>
245
+ <StartAddress>0x0</StartAddress>
246
+ <Size>0x0</Size>
247
+ </Ocm1>
248
+ <Ocm2>
249
+ <Type>0</Type>
250
+ <StartAddress>0x0</StartAddress>
251
+ <Size>0x0</Size>
252
+ </Ocm2>
253
+ <Ocm3>
254
+ <Type>0</Type>
255
+ <StartAddress>0x0</StartAddress>
256
+ <Size>0x0</Size>
257
+ </Ocm3>
258
+ <Ocr1>
259
+ <Type>0</Type>
260
+ <StartAddress>0x0</StartAddress>
261
+ <Size>0x0</Size>
262
+ </Ocr1>
263
+ <Ocr2>
264
+ <Type>0</Type>
265
+ <StartAddress>0x0</StartAddress>
266
+ <Size>0x0</Size>
267
+ </Ocr2>
268
+ <Ocr3>
269
+ <Type>0</Type>
270
+ <StartAddress>0x0</StartAddress>
271
+ <Size>0x0</Size>
272
+ </Ocr3>
273
+ <IRO>
274
+ <Type>1</Type>
275
+ <StartAddress>0x0</StartAddress>
276
+ <Size>0x1000</Size>
277
+ </IRO>
278
+ <IRA>
279
+ <Type>0</Type>
280
+ <StartAddress>0x0</StartAddress>
281
+ <Size>0x80</Size>
282
+ </IRA>
283
+ <XRA>
284
+ <Type>0</Type>
285
+ <StartAddress>0x0</StartAddress>
286
+ <Size>0x0</Size>
287
+ </XRA>
288
+ <XRA512>
289
+ <Type>0</Type>
290
+ <StartAddress>0x0</StartAddress>
291
+ <Size>0x0</Size>
292
+ </XRA512>
293
+ <IROM512>
294
+ <Type>0</Type>
295
+ <StartAddress>0x0</StartAddress>
296
+ <Size>0x0</Size>
297
+ </IROM512>
298
+ <XRA513>
299
+ <Type>0</Type>
300
+ <StartAddress>0x0</StartAddress>
301
+ <Size>0x0</Size>
302
+ </XRA513>
303
+ <IROM513>
304
+ <Type>0</Type>
305
+ <StartAddress>0x0</StartAddress>
306
+ <Size>0x0</Size>
307
+ </IROM513>
308
+ </OnChipMemories>
309
+ </Target51Misc>
310
+ <C51>
311
+ <RegisterColoring>0</RegisterColoring>
312
+ <VariablesInOrder>0</VariablesInOrder>
313
+ <IntegerPromotion>1</IntegerPromotion>
314
+ <uAregs>0</uAregs>
315
+ <UseInterruptVector>1</UseInterruptVector>
316
+ <Fuzzy>3</Fuzzy>
317
+ <Optimize>8</Optimize>
318
+ <WarningLevel>2</WarningLevel>
319
+ <SizeSpeed>1</SizeSpeed>
320
+ <ObjectExtend>1</ObjectExtend>
321
+ <ACallAJmp>0</ACallAJmp>
322
+ <InterruptVectorAddress>0</InterruptVectorAddress>
323
+ <VariousControls>
324
+ <MiscControls></MiscControls>
325
+ <Define></Define>
326
+ <Undefine></Undefine>
327
+ <IncludePath></IncludePath>
328
+ </VariousControls>
329
+ </C51>
330
+ <Ax51>
331
+ <UseMpl>0</UseMpl>
332
+ <UseStandard>1</UseStandard>
333
+ <UseCase>0</UseCase>
334
+ <UseMod51>0</UseMod51>
335
+ <VariousControls>
336
+ <MiscControls></MiscControls>
337
+ <Define></Define>
338
+ <Undefine></Undefine>
339
+ <IncludePath></IncludePath>
340
+ </VariousControls>
341
+ </Ax51>
342
+ <Lx51>
343
+ <useFile>0</useFile>
344
+ <linkonly>0</linkonly>
345
+ <UseMemoryFromTarget>1</UseMemoryFromTarget>
346
+ <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
347
+ <WarningLevel>2</WarningLevel>
348
+ <DataOverlaying>1</DataOverlaying>
349
+ <OverlayString></OverlayString>
350
+ <MiscControls></MiscControls>
351
+ <DisableWarningNumbers></DisableWarningNumbers>
352
+ <LinkerCmdFile></LinkerCmdFile>
353
+ <Assign></Assign>
354
+ <ReserveString></ReserveString>
355
+ <CClasses></CClasses>
356
+ <UserClasses></UserClasses>
357
+ <CSection></CSection>
358
+ <UserSection></UserSection>
359
+ <CodeBaseAddress></CodeBaseAddress>
360
+ <XDataBaseAddress></XDataBaseAddress>
361
+ <PDataBaseAddress></PDataBaseAddress>
362
+ <BitBaseAddress></BitBaseAddress>
363
+ <DataBaseAddress></DataBaseAddress>
364
+ <IDataBaseAddress></IDataBaseAddress>
365
+ <Precede></Precede>
366
+ <Stack></Stack>
367
+ <CodeSegmentName></CodeSegmentName>
368
+ <XDataSegmentName></XDataSegmentName>
369
+ <BitSegmentName></BitSegmentName>
370
+ <DataSegmentName></DataSegmentName>
371
+ <IDataSegmentName></IDataSegmentName>
372
+ </Lx51>
373
+ </Target51>
374
+ </TargetOption>
375
+ <Groups>
376
+ <Group>
377
+ <GroupName>Source Group 1</GroupName>
378
+ <Files>
379
+ <File>
380
+ <FileName>STARTUP.A51</FileName>
381
+ <FileType>2</FileType>
382
+ <FilePath>.\STARTUP.A51</FilePath>
383
+ </File>
384
+ <File>
385
+ <FileName>6.c</FileName>
386
+ <FileType>1</FileType>
387
+ <FilePath>.\6.c</FilePath>
388
+ </File>
389
+ </Files>
390
+ </Group>
391
+ </Groups>
392
+ </Target>
393
+ </Targets>
394
+
395
+ </Project>
6/STARTUP.A51 ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $NOMOD51
2
+ ;------------------------------------------------------------------------------
3
+ ; This file is part of the C51 Compiler package
4
+ ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
5
+ ; Version 8.01
6
+ ;
7
+ ; *** <<< Use Configuration Wizard in Context Menu >>> ***
8
+ ;------------------------------------------------------------------------------
9
+ ; STARTUP.A51: This code is executed after processor reset.
10
+ ;
11
+ ; To translate this file use A51 with the following invocation:
12
+ ;
13
+ ; A51 STARTUP.A51
14
+ ;
15
+ ; To link the modified STARTUP.OBJ file to your application use the following
16
+ ; Lx51 invocation:
17
+ ;
18
+ ; Lx51 your object file list, STARTUP.OBJ controls
19
+ ;
20
+ ;------------------------------------------------------------------------------
21
+ ;
22
+ ; User-defined <h> Power-On Initialization of Memory
23
+ ;
24
+ ; With the following EQU statements the initialization of memory
25
+ ; at processor reset can be defined:
26
+ ;
27
+ ; <o> IDATALEN: IDATA memory size <0x0-0x100>
28
+ ; <i> Note: The absolute start-address of IDATA memory is always 0
29
+ ; <i> The IDATA space overlaps physically the DATA and BIT areas.
30
+ IDATALEN EQU 80H
31
+ ;
32
+ ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
33
+ ; <i> The absolute start address of XDATA memory
34
+ XDATASTART EQU 0
35
+ ;
36
+ ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
37
+ ; <i> The length of XDATA memory in bytes.
38
+ XDATALEN EQU 0
39
+ ;
40
+ ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
41
+ ; <i> The absolute start address of PDATA memory
42
+ PDATASTART EQU 0H
43
+ ;
44
+ ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
45
+ ; <i> The length of PDATA memory in bytes.
46
+ PDATALEN EQU 0H
47
+ ;
48
+ ;</h>
49
+ ;------------------------------------------------------------------------------
50
+ ;
51
+ ;<h> Reentrant Stack Initialization
52
+ ;
53
+ ; The following EQU statements define the stack pointer for reentrant
54
+ ; functions and initialized it:
55
+ ;
56
+ ; <h> Stack Space for reentrant functions in the SMALL model.
57
+ ; <q> IBPSTACK: Enable SMALL model reentrant stack
58
+ ; <i> Stack space for reentrant functions in the SMALL model.
59
+ IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
60
+ ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
61
+ ; <i> Set the top of the stack to the highest location.
62
+ IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
63
+ ; </h>
64
+ ;
65
+ ; <h> Stack Space for reentrant functions in the LARGE model.
66
+ ; <q> XBPSTACK: Enable LARGE model reentrant stack
67
+ ; <i> Stack space for reentrant functions in the LARGE model.
68
+ XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
69
+ ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
70
+ ; <i> Set the top of the stack to the highest location.
71
+ XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
72
+ ; </h>
73
+ ;
74
+ ; <h> Stack Space for reentrant functions in the COMPACT model.
75
+ ; <q> PBPSTACK: Enable COMPACT model reentrant stack
76
+ ; <i> Stack space for reentrant functions in the COMPACT model.
77
+ PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
78
+ ;
79
+ ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
80
+ ; <i> Set the top of the stack to the highest location.
81
+ PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
82
+ ; </h>
83
+ ;</h>
84
+ ;------------------------------------------------------------------------------
85
+ ;
86
+ ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
87
+ ; <e>Compact Model Page Definition
88
+ ;
89
+ ; <i>Define the XDATA page used for PDATA variables.
90
+ ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
91
+ ;
92
+ ; Enable pdata memory page initalization
93
+ PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
94
+ ;
95
+ ; <o> PPAGE number <0x0-0xFF>
96
+ ; <i> uppermost 256-byte address of the page used for PDATA variables.
97
+ PPAGE EQU 0
98
+ ;
99
+ ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
100
+ ; <i> most 8051 variants use P2 as uppermost address byte
101
+ PPAGE_SFR DATA 0A0H
102
+ ;
103
+ ; </e>
104
+ ;------------------------------------------------------------------------------
105
+
106
+ ; Standard SFR Symbols
107
+ ACC DATA 0E0H
108
+ B DATA 0F0H
109
+ SP DATA 81H
110
+ DPL DATA 82H
111
+ DPH DATA 83H
112
+
113
+ NAME ?C_STARTUP
114
+
115
+
116
+ ?C_C51STARTUP SEGMENT CODE
117
+ ?STACK SEGMENT IDATA
118
+
119
+ RSEG ?STACK
120
+ DS 1
121
+
122
+ EXTRN CODE (?C_START)
123
+ PUBLIC ?C_STARTUP
124
+
125
+ CSEG AT 0
126
+ ?C_STARTUP: LJMP STARTUP1
127
+
128
+ RSEG ?C_C51STARTUP
129
+
130
+ STARTUP1:
131
+
132
+ IF IDATALEN <> 0
133
+ MOV R0,#IDATALEN - 1
134
+ CLR A
135
+ IDATALOOP: MOV @R0,A
136
+ DJNZ R0,IDATALOOP
137
+ ENDIF
138
+
139
+ IF XDATALEN <> 0
140
+ MOV DPTR,#XDATASTART
141
+ MOV R7,#LOW (XDATALEN)
142
+ IF (LOW (XDATALEN)) <> 0
143
+ MOV R6,#(HIGH (XDATALEN)) +1
144
+ ELSE
145
+ MOV R6,#HIGH (XDATALEN)
146
+ ENDIF
147
+ CLR A
148
+ XDATALOOP: MOVX @DPTR,A
149
+ INC DPTR
150
+ DJNZ R7,XDATALOOP
151
+ DJNZ R6,XDATALOOP
152
+ ENDIF
153
+
154
+ IF PPAGEENABLE <> 0
155
+ MOV PPAGE_SFR,#PPAGE
156
+ ENDIF
157
+
158
+ IF PDATALEN <> 0
159
+ MOV R0,#LOW (PDATASTART)
160
+ MOV R7,#LOW (PDATALEN)
161
+ CLR A
162
+ PDATALOOP: MOVX @R0,A
163
+ INC R0
164
+ DJNZ R7,PDATALOOP
165
+ ENDIF
166
+
167
+ IF IBPSTACK <> 0
168
+ EXTRN DATA (?C_IBP)
169
+
170
+ MOV ?C_IBP,#LOW IBPSTACKTOP
171
+ ENDIF
172
+
173
+ IF XBPSTACK <> 0
174
+ EXTRN DATA (?C_XBP)
175
+
176
+ MOV ?C_XBP,#HIGH XBPSTACKTOP
177
+ MOV ?C_XBP+1,#LOW XBPSTACKTOP
178
+ ENDIF
179
+
180
+ IF PBPSTACK <> 0
181
+ EXTRN DATA (?C_PBP)
182
+ MOV ?C_PBP,#LOW PBPSTACKTOP
183
+ ENDIF
184
+
185
+ MOV SP,#?STACK-1
186
+
187
+ ; This code is required if you use L51_BANK.A51 with Banking Mode 4
188
+ ;<h> Code Banking
189
+ ; <q> Select Bank 0 for L51_BANK.A51 Mode 4
190
+ #if 0
191
+ ; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
192
+ EXTRN CODE (?B_SWITCH0)
193
+ CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
194
+ #endif
195
+ ;</h>
196
+ LJMP ?C_START
197
+
198
+ END
7/7.DSN ADDED
Binary file (83.7 kB). View file
 
7/7.c ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <REG51.H>
2
+
3
+ sbit LED = P2^0;
4
+
5
+ void int0(void) interrupt 0
6
+ {
7
+ LED = !LED;
8
+ }
9
+
10
+ void main(void)
11
+ {
12
+ LED = 1;
13
+ IT0 = 1;
14
+ EX0 = 1;
15
+ EA = 1;
16
+
17
+ while (1);
18
+ }
7/7.pdsprj ADDED
Binary file (14.8 kB). View file
 
7/7.uvproj ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
3
+
4
+ <SchemaVersion>1.1</SchemaVersion>
5
+
6
+ <Header>### uVision Project, (C) Keil Software</Header>
7
+
8
+ <Targets>
9
+ <Target>
10
+ <TargetName>Target 1</TargetName>
11
+ <ToolsetNumber>0x0</ToolsetNumber>
12
+ <ToolsetName>MCS-51</ToolsetName>
13
+ <uAC6>0</uAC6>
14
+ <TargetOption>
15
+ <TargetCommonOption>
16
+ <Device>AT89C51</Device>
17
+ <Vendor>Microchip</Vendor>
18
+ <Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
19
+ <FlashUtilSpec></FlashUtilSpec>
20
+ <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
21
+ <FlashDriverDll></FlashDriverDll>
22
+ <DeviceId>2976</DeviceId>
23
+ <RegisterFile>REGX51.H</RegisterFile>
24
+ <MemoryEnv></MemoryEnv>
25
+ <Cmp></Cmp>
26
+ <Asm></Asm>
27
+ <Linker></Linker>
28
+ <OHString></OHString>
29
+ <InfinionOptionDll></InfinionOptionDll>
30
+ <SLE66CMisc></SLE66CMisc>
31
+ <SLE66AMisc></SLE66AMisc>
32
+ <SLE66LinkerMisc></SLE66LinkerMisc>
33
+ <SFDFile></SFDFile>
34
+ <bCustSvd>0</bCustSvd>
35
+ <UseEnv>0</UseEnv>
36
+ <BinPath></BinPath>
37
+ <IncludePath></IncludePath>
38
+ <LibPath></LibPath>
39
+ <RegisterFilePath>Atmel\</RegisterFilePath>
40
+ <DBRegisterFilePath>Atmel\</DBRegisterFilePath>
41
+ <TargetStatus>
42
+ <Error>0</Error>
43
+ <ExitCodeStop>0</ExitCodeStop>
44
+ <ButtonStop>0</ButtonStop>
45
+ <NotGenerated>0</NotGenerated>
46
+ <InvalidFlash>1</InvalidFlash>
47
+ </TargetStatus>
48
+ <OutputDirectory>.\代码\</OutputDirectory>
49
+ <OutputName>外部中断</OutputName>
50
+ <CreateExecutable>1</CreateExecutable>
51
+ <CreateLib>0</CreateLib>
52
+ <CreateHexFile>1</CreateHexFile>
53
+ <DebugInformation>1</DebugInformation>
54
+ <BrowseInformation>1</BrowseInformation>
55
+ <ListingPath>.\Listings\</ListingPath>
56
+ <HexFormatSelection>0</HexFormatSelection>
57
+ <Merge32K>0</Merge32K>
58
+ <CreateBatchFile>0</CreateBatchFile>
59
+ <BeforeCompile>
60
+ <RunUserProg1>0</RunUserProg1>
61
+ <RunUserProg2>0</RunUserProg2>
62
+ <UserProg1Name></UserProg1Name>
63
+ <UserProg2Name></UserProg2Name>
64
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
65
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
66
+ <nStopU1X>0</nStopU1X>
67
+ <nStopU2X>0</nStopU2X>
68
+ </BeforeCompile>
69
+ <BeforeMake>
70
+ <RunUserProg1>0</RunUserProg1>
71
+ <RunUserProg2>0</RunUserProg2>
72
+ <UserProg1Name></UserProg1Name>
73
+ <UserProg2Name></UserProg2Name>
74
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
75
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76
+ <nStopB1X>0</nStopB1X>
77
+ <nStopB2X>0</nStopB2X>
78
+ </BeforeMake>
79
+ <AfterMake>
80
+ <RunUserProg1>0</RunUserProg1>
81
+ <RunUserProg2>0</RunUserProg2>
82
+ <UserProg1Name></UserProg1Name>
83
+ <UserProg2Name></UserProg2Name>
84
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
85
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
86
+ <nStopA1X>0</nStopA1X>
87
+ <nStopA2X>0</nStopA2X>
88
+ </AfterMake>
89
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
90
+ <SVCSIdString></SVCSIdString>
91
+ </TargetCommonOption>
92
+ <CommonProperty>
93
+ <UseCPPCompiler>0</UseCPPCompiler>
94
+ <RVCTCodeConst>0</RVCTCodeConst>
95
+ <RVCTZI>0</RVCTZI>
96
+ <RVCTOtherData>0</RVCTOtherData>
97
+ <ModuleSelection>0</ModuleSelection>
98
+ <IncludeInBuild>1</IncludeInBuild>
99
+ <AlwaysBuild>0</AlwaysBuild>
100
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
101
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
102
+ <PublicsOnly>0</PublicsOnly>
103
+ <StopOnExitCode>3</StopOnExitCode>
104
+ <CustomArgument></CustomArgument>
105
+ <IncludeLibraryModules></IncludeLibraryModules>
106
+ <ComprImg>1</ComprImg>
107
+ <BankNo>65535</BankNo>
108
+ </CommonProperty>
109
+ <DllOption>
110
+ <SimDllName>S8051.DLL</SimDllName>
111
+ <SimDllArguments></SimDllArguments>
112
+ <SimDlgDll>DP51.DLL</SimDlgDll>
113
+ <SimDlgDllArguments>-p51</SimDlgDllArguments>
114
+ <TargetDllName>S8051.DLL</TargetDllName>
115
+ <TargetDllArguments></TargetDllArguments>
116
+ <TargetDlgDll>TP51.DLL</TargetDlgDll>
117
+ <TargetDlgDllArguments>-p51</TargetDlgDllArguments>
118
+ </DllOption>
119
+ <DebugOption>
120
+ <OPTHX>
121
+ <HexSelection>0</HexSelection>
122
+ <HexRangeLowAddress>0</HexRangeLowAddress>
123
+ <HexRangeHighAddress>0</HexRangeHighAddress>
124
+ <HexOffset>0</HexOffset>
125
+ <Oh166RecLen>16</Oh166RecLen>
126
+ </OPTHX>
127
+ <Simulator>
128
+ <UseSimulator>1</UseSimulator>
129
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
130
+ <RunToMain>1</RunToMain>
131
+ <RestoreBreakpoints>1</RestoreBreakpoints>
132
+ <RestoreWatchpoints>1</RestoreWatchpoints>
133
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
134
+ <RestoreFunctions>1</RestoreFunctions>
135
+ <RestoreToolbox>1</RestoreToolbox>
136
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
137
+ <RestoreSysVw>1</RestoreSysVw>
138
+ </Simulator>
139
+ <Target>
140
+ <UseTarget>0</UseTarget>
141
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
142
+ <RunToMain>0</RunToMain>
143
+ <RestoreBreakpoints>1</RestoreBreakpoints>
144
+ <RestoreWatchpoints>1</RestoreWatchpoints>
145
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
146
+ <RestoreFunctions>0</RestoreFunctions>
147
+ <RestoreToolbox>1</RestoreToolbox>
148
+ <RestoreTracepoints>1</RestoreTracepoints>
149
+ <RestoreSysVw>1</RestoreSysVw>
150
+ </Target>
151
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
152
+ <TargetSelection>-1</TargetSelection>
153
+ <SimDlls>
154
+ <CpuDll></CpuDll>
155
+ <CpuDllArguments></CpuDllArguments>
156
+ <PeripheralDll></PeripheralDll>
157
+ <PeripheralDllArguments></PeripheralDllArguments>
158
+ <InitializationFile></InitializationFile>
159
+ </SimDlls>
160
+ <TargetDlls>
161
+ <CpuDll></CpuDll>
162
+ <CpuDllArguments></CpuDllArguments>
163
+ <PeripheralDll></PeripheralDll>
164
+ <PeripheralDllArguments></PeripheralDllArguments>
165
+ <InitializationFile></InitializationFile>
166
+ <Driver></Driver>
167
+ </TargetDlls>
168
+ </DebugOption>
169
+ <Utilities>
170
+ <Flash1>
171
+ <UseTargetDll>0</UseTargetDll>
172
+ <UseExternalTool>0</UseExternalTool>
173
+ <RunIndependent>0</RunIndependent>
174
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
175
+ <Capability>0</Capability>
176
+ <DriverSelection>-1</DriverSelection>
177
+ </Flash1>
178
+ <bUseTDR>0</bUseTDR>
179
+ <Flash2></Flash2>
180
+ <Flash3></Flash3>
181
+ <Flash4></Flash4>
182
+ <pFcarmOut></pFcarmOut>
183
+ <pFcarmGrp></pFcarmGrp>
184
+ <pFcArmRoot></pFcArmRoot>
185
+ <FcArmLst>0</FcArmLst>
186
+ </Utilities>
187
+ <Target51>
188
+ <Target51Misc>
189
+ <MemoryModel>0</MemoryModel>
190
+ <RTOS>0</RTOS>
191
+ <RomSize>2</RomSize>
192
+ <DataHold>0</DataHold>
193
+ <XDataHold>0</XDataHold>
194
+ <UseOnchipRom>0</UseOnchipRom>
195
+ <UseOnchipArithmetic>0</UseOnchipArithmetic>
196
+ <UseMultipleDPTR>0</UseMultipleDPTR>
197
+ <UseOnchipXram>0</UseOnchipXram>
198
+ <HadIRAM>1</HadIRAM>
199
+ <HadXRAM>0</HadXRAM>
200
+ <HadIROM>1</HadIROM>
201
+ <Moda2>0</Moda2>
202
+ <Moddp2>0</Moddp2>
203
+ <Modp2>0</Modp2>
204
+ <Mod517dp>0</Mod517dp>
205
+ <Mod517au>0</Mod517au>
206
+ <Mode2>0</Mode2>
207
+ <useCB>0</useCB>
208
+ <useXB>0</useXB>
209
+ <useL251>0</useL251>
210
+ <useA251>0</useA251>
211
+ <Mx51>0</Mx51>
212
+ <ModC812>0</ModC812>
213
+ <ModCont>0</ModCont>
214
+ <Lp51>0</Lp51>
215
+ <useXBS>0</useXBS>
216
+ <ModDA>0</ModDA>
217
+ <ModAB2>0</ModAB2>
218
+ <Mx51P>0</Mx51P>
219
+ <hadXRAM2>0</hadXRAM2>
220
+ <uocXram2>0</uocXram2>
221
+ <hadXRAM3>0</hadXRAM3>
222
+ <ModC2>0</ModC2>
223
+ <ModH2>0</ModH2>
224
+ <Mdu_R515>0</Mdu_R515>
225
+ <Mdu_F120>0</Mdu_F120>
226
+ <Psoc>0</Psoc>
227
+ <hadIROM2>0</hadIROM2>
228
+ <hadIROM3>0</hadIROM3>
229
+ <ModSmx2>0</ModSmx2>
230
+ <cBanks>0</cBanks>
231
+ <xBanks>0</xBanks>
232
+ <OnChipMemories>
233
+ <RCB>
234
+ <Type>0</Type>
235
+ <StartAddress>0x0</StartAddress>
236
+ <Size>0xffff</Size>
237
+ </RCB>
238
+ <RXB>
239
+ <Type>0</Type>
240
+ <StartAddress>0x0</StartAddress>
241
+ <Size>0x0</Size>
242
+ </RXB>
243
+ <Ocm1>
244
+ <Type>0</Type>
245
+ <StartAddress>0x0</StartAddress>
246
+ <Size>0x0</Size>
247
+ </Ocm1>
248
+ <Ocm2>
249
+ <Type>0</Type>
250
+ <StartAddress>0x0</StartAddress>
251
+ <Size>0x0</Size>
252
+ </Ocm2>
253
+ <Ocm3>
254
+ <Type>0</Type>
255
+ <StartAddress>0x0</StartAddress>
256
+ <Size>0x0</Size>
257
+ </Ocm3>
258
+ <Ocr1>
259
+ <Type>0</Type>
260
+ <StartAddress>0x0</StartAddress>
261
+ <Size>0x0</Size>
262
+ </Ocr1>
263
+ <Ocr2>
264
+ <Type>0</Type>
265
+ <StartAddress>0x0</StartAddress>
266
+ <Size>0x0</Size>
267
+ </Ocr2>
268
+ <Ocr3>
269
+ <Type>0</Type>
270
+ <StartAddress>0x0</StartAddress>
271
+ <Size>0x0</Size>
272
+ </Ocr3>
273
+ <IRO>
274
+ <Type>1</Type>
275
+ <StartAddress>0x0</StartAddress>
276
+ <Size>0x1000</Size>
277
+ </IRO>
278
+ <IRA>
279
+ <Type>0</Type>
280
+ <StartAddress>0x0</StartAddress>
281
+ <Size>0x80</Size>
282
+ </IRA>
283
+ <XRA>
284
+ <Type>0</Type>
285
+ <StartAddress>0x0</StartAddress>
286
+ <Size>0x0</Size>
287
+ </XRA>
288
+ <XRA512>
289
+ <Type>0</Type>
290
+ <StartAddress>0x0</StartAddress>
291
+ <Size>0x0</Size>
292
+ </XRA512>
293
+ <IROM512>
294
+ <Type>0</Type>
295
+ <StartAddress>0x0</StartAddress>
296
+ <Size>0x0</Size>
297
+ </IROM512>
298
+ <XRA513>
299
+ <Type>0</Type>
300
+ <StartAddress>0x0</StartAddress>
301
+ <Size>0x0</Size>
302
+ </XRA513>
303
+ <IROM513>
304
+ <Type>0</Type>
305
+ <StartAddress>0x0</StartAddress>
306
+ <Size>0x0</Size>
307
+ </IROM513>
308
+ </OnChipMemories>
309
+ </Target51Misc>
310
+ <C51>
311
+ <RegisterColoring>0</RegisterColoring>
312
+ <VariablesInOrder>0</VariablesInOrder>
313
+ <IntegerPromotion>1</IntegerPromotion>
314
+ <uAregs>0</uAregs>
315
+ <UseInterruptVector>1</UseInterruptVector>
316
+ <Fuzzy>3</Fuzzy>
317
+ <Optimize>8</Optimize>
318
+ <WarningLevel>2</WarningLevel>
319
+ <SizeSpeed>1</SizeSpeed>
320
+ <ObjectExtend>1</ObjectExtend>
321
+ <ACallAJmp>0</ACallAJmp>
322
+ <InterruptVectorAddress>0</InterruptVectorAddress>
323
+ <VariousControls>
324
+ <MiscControls></MiscControls>
325
+ <Define></Define>
326
+ <Undefine></Undefine>
327
+ <IncludePath></IncludePath>
328
+ </VariousControls>
329
+ </C51>
330
+ <Ax51>
331
+ <UseMpl>0</UseMpl>
332
+ <UseStandard>1</UseStandard>
333
+ <UseCase>0</UseCase>
334
+ <UseMod51>0</UseMod51>
335
+ <VariousControls>
336
+ <MiscControls></MiscControls>
337
+ <Define></Define>
338
+ <Undefine></Undefine>
339
+ <IncludePath></IncludePath>
340
+ </VariousControls>
341
+ </Ax51>
342
+ <Lx51>
343
+ <useFile>0</useFile>
344
+ <linkonly>0</linkonly>
345
+ <UseMemoryFromTarget>1</UseMemoryFromTarget>
346
+ <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
347
+ <WarningLevel>2</WarningLevel>
348
+ <DataOverlaying>1</DataOverlaying>
349
+ <OverlayString></OverlayString>
350
+ <MiscControls></MiscControls>
351
+ <DisableWarningNumbers></DisableWarningNumbers>
352
+ <LinkerCmdFile></LinkerCmdFile>
353
+ <Assign></Assign>
354
+ <ReserveString></ReserveString>
355
+ <CClasses></CClasses>
356
+ <UserClasses></UserClasses>
357
+ <CSection></CSection>
358
+ <UserSection></UserSection>
359
+ <CodeBaseAddress></CodeBaseAddress>
360
+ <XDataBaseAddress></XDataBaseAddress>
361
+ <PDataBaseAddress></PDataBaseAddress>
362
+ <BitBaseAddress></BitBaseAddress>
363
+ <DataBaseAddress></DataBaseAddress>
364
+ <IDataBaseAddress></IDataBaseAddress>
365
+ <Precede></Precede>
366
+ <Stack></Stack>
367
+ <CodeSegmentName></CodeSegmentName>
368
+ <XDataSegmentName></XDataSegmentName>
369
+ <BitSegmentName></BitSegmentName>
370
+ <DataSegmentName></DataSegmentName>
371
+ <IDataSegmentName></IDataSegmentName>
372
+ </Lx51>
373
+ </Target51>
374
+ </TargetOption>
375
+ <Groups>
376
+ <Group>
377
+ <GroupName>Source Group 1</GroupName>
378
+ <Files>
379
+ <File>
380
+ <FileName>STARTUP.A51</FileName>
381
+ <FileType>2</FileType>
382
+ <FilePath>.\STARTUP.A51</FilePath>
383
+ </File>
384
+ <File>
385
+ <FileName>7.c</FileName>
386
+ <FileType>1</FileType>
387
+ <FilePath>.\7.c</FilePath>
388
+ </File>
389
+ </Files>
390
+ </Group>
391
+ </Groups>
392
+ </Target>
393
+ </Targets>
394
+
395
+ </Project>
7/STARTUP.A51 ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $NOMOD51
2
+ ;------------------------------------------------------------------------------
3
+ ; This file is part of the C51 Compiler package
4
+ ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
5
+ ; Version 8.01
6
+ ;
7
+ ; *** <<< Use Configuration Wizard in Context Menu >>> ***
8
+ ;------------------------------------------------------------------------------
9
+ ; STARTUP.A51: This code is executed after processor reset.
10
+ ;
11
+ ; To translate this file use A51 with the following invocation:
12
+ ;
13
+ ; A51 STARTUP.A51
14
+ ;
15
+ ; To link the modified STARTUP.OBJ file to your application use the following
16
+ ; Lx51 invocation:
17
+ ;
18
+ ; Lx51 your object file list, STARTUP.OBJ controls
19
+ ;
20
+ ;------------------------------------------------------------------------------
21
+ ;
22
+ ; User-defined <h> Power-On Initialization of Memory
23
+ ;
24
+ ; With the following EQU statements the initialization of memory
25
+ ; at processor reset can be defined:
26
+ ;
27
+ ; <o> IDATALEN: IDATA memory size <0x0-0x100>
28
+ ; <i> Note: The absolute start-address of IDATA memory is always 0
29
+ ; <i> The IDATA space overlaps physically the DATA and BIT areas.
30
+ IDATALEN EQU 80H
31
+ ;
32
+ ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
33
+ ; <i> The absolute start address of XDATA memory
34
+ XDATASTART EQU 0
35
+ ;
36
+ ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
37
+ ; <i> The length of XDATA memory in bytes.
38
+ XDATALEN EQU 0
39
+ ;
40
+ ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
41
+ ; <i> The absolute start address of PDATA memory
42
+ PDATASTART EQU 0H
43
+ ;
44
+ ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
45
+ ; <i> The length of PDATA memory in bytes.
46
+ PDATALEN EQU 0H
47
+ ;
48
+ ;</h>
49
+ ;------------------------------------------------------------------------------
50
+ ;
51
+ ;<h> Reentrant Stack Initialization
52
+ ;
53
+ ; The following EQU statements define the stack pointer for reentrant
54
+ ; functions and initialized it:
55
+ ;
56
+ ; <h> Stack Space for reentrant functions in the SMALL model.
57
+ ; <q> IBPSTACK: Enable SMALL model reentrant stack
58
+ ; <i> Stack space for reentrant functions in the SMALL model.
59
+ IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
60
+ ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
61
+ ; <i> Set the top of the stack to the highest location.
62
+ IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
63
+ ; </h>
64
+ ;
65
+ ; <h> Stack Space for reentrant functions in the LARGE model.
66
+ ; <q> XBPSTACK: Enable LARGE model reentrant stack
67
+ ; <i> Stack space for reentrant functions in the LARGE model.
68
+ XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
69
+ ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
70
+ ; <i> Set the top of the stack to the highest location.
71
+ XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
72
+ ; </h>
73
+ ;
74
+ ; <h> Stack Space for reentrant functions in the COMPACT model.
75
+ ; <q> PBPSTACK: Enable COMPACT model reentrant stack
76
+ ; <i> Stack space for reentrant functions in the COMPACT model.
77
+ PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
78
+ ;
79
+ ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
80
+ ; <i> Set the top of the stack to the highest location.
81
+ PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
82
+ ; </h>
83
+ ;</h>
84
+ ;------------------------------------------------------------------------------
85
+ ;
86
+ ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
87
+ ; <e>Compact Model Page Definition
88
+ ;
89
+ ; <i>Define the XDATA page used for PDATA variables.
90
+ ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
91
+ ;
92
+ ; Enable pdata memory page initalization
93
+ PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
94
+ ;
95
+ ; <o> PPAGE number <0x0-0xFF>
96
+ ; <i> uppermost 256-byte address of the page used for PDATA variables.
97
+ PPAGE EQU 0
98
+ ;
99
+ ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
100
+ ; <i> most 8051 variants use P2 as uppermost address byte
101
+ PPAGE_SFR DATA 0A0H
102
+ ;
103
+ ; </e>
104
+ ;------------------------------------------------------------------------------
105
+
106
+ ; Standard SFR Symbols
107
+ ACC DATA 0E0H
108
+ B DATA 0F0H
109
+ SP DATA 81H
110
+ DPL DATA 82H
111
+ DPH DATA 83H
112
+
113
+ NAME ?C_STARTUP
114
+
115
+
116
+ ?C_C51STARTUP SEGMENT CODE
117
+ ?STACK SEGMENT IDATA
118
+
119
+ RSEG ?STACK
120
+ DS 1
121
+
122
+ EXTRN CODE (?C_START)
123
+ PUBLIC ?C_STARTUP
124
+
125
+ CSEG AT 0
126
+ ?C_STARTUP: LJMP STARTUP1
127
+
128
+ RSEG ?C_C51STARTUP
129
+
130
+ STARTUP1:
131
+
132
+ IF IDATALEN <> 0
133
+ MOV R0,#IDATALEN - 1
134
+ CLR A
135
+ IDATALOOP: MOV @R0,A
136
+ DJNZ R0,IDATALOOP
137
+ ENDIF
138
+
139
+ IF XDATALEN <> 0
140
+ MOV DPTR,#XDATASTART
141
+ MOV R7,#LOW (XDATALEN)
142
+ IF (LOW (XDATALEN)) <> 0
143
+ MOV R6,#(HIGH (XDATALEN)) +1
144
+ ELSE
145
+ MOV R6,#HIGH (XDATALEN)
146
+ ENDIF
147
+ CLR A
148
+ XDATALOOP: MOVX @DPTR,A
149
+ INC DPTR
150
+ DJNZ R7,XDATALOOP
151
+ DJNZ R6,XDATALOOP
152
+ ENDIF
153
+
154
+ IF PPAGEENABLE <> 0
155
+ MOV PPAGE_SFR,#PPAGE
156
+ ENDIF
157
+
158
+ IF PDATALEN <> 0
159
+ MOV R0,#LOW (PDATASTART)
160
+ MOV R7,#LOW (PDATALEN)
161
+ CLR A
162
+ PDATALOOP: MOVX @R0,A
163
+ INC R0
164
+ DJNZ R7,PDATALOOP
165
+ ENDIF
166
+
167
+ IF IBPSTACK <> 0
168
+ EXTRN DATA (?C_IBP)
169
+
170
+ MOV ?C_IBP,#LOW IBPSTACKTOP
171
+ ENDIF
172
+
173
+ IF XBPSTACK <> 0
174
+ EXTRN DATA (?C_XBP)
175
+
176
+ MOV ?C_XBP,#HIGH XBPSTACKTOP
177
+ MOV ?C_XBP+1,#LOW XBPSTACKTOP
178
+ ENDIF
179
+
180
+ IF PBPSTACK <> 0
181
+ EXTRN DATA (?C_PBP)
182
+ MOV ?C_PBP,#LOW PBPSTACKTOP
183
+ ENDIF
184
+
185
+ MOV SP,#?STACK-1
186
+
187
+ ; This code is required if you use L51_BANK.A51 with Banking Mode 4
188
+ ;<h> Code Banking
189
+ ; <q> Select Bank 0 for L51_BANK.A51 Mode 4
190
+ #if 0
191
+ ; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
192
+ EXTRN CODE (?B_SWITCH0)
193
+ CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
194
+ #endif
195
+ ;</h>
196
+ LJMP ?C_START
197
+
198
+ END
8/8.DSN ADDED
Binary file (33.8 kB). View file
 
8/8.c ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <REG51.H>
2
+
3
+ unsigned char i = 0;
4
+
5
+ void timer(void) interrupt 1
6
+ {
7
+ TH0 = 0x3C;
8
+ TL0 = 0xB0;
9
+ i++;
10
+
11
+ if (i == 20)
12
+ {
13
+ i = 0;
14
+ if (P2 == 0xF0)
15
+ P2 = 0x0F;
16
+ else
17
+ P2 = 0xF0;
18
+ }
19
+ }
20
+
21
+ void main(void)
22
+ {
23
+ P2 = 0xF0;
24
+ TMOD = 0x01;
25
+ TH0 = 0x3C;
26
+ TL0 = 0xB0;
27
+ ET0 = 1;
28
+ EA = 1;
29
+ TR0 = 1;
30
+
31
+ while (1);
32
+ }
8/8.pdsprj ADDED
Binary file (7.62 kB). View file
 
8/8.uvproj ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
3
+
4
+ <SchemaVersion>1.1</SchemaVersion>
5
+
6
+ <Header>### uVision Project, (C) Keil Software</Header>
7
+
8
+ <Targets>
9
+ <Target>
10
+ <TargetName>Target 1</TargetName>
11
+ <ToolsetNumber>0x0</ToolsetNumber>
12
+ <ToolsetName>MCS-51</ToolsetName>
13
+ <uAC6>0</uAC6>
14
+ <TargetOption>
15
+ <TargetCommonOption>
16
+ <Device>AT89C51</Device>
17
+ <Vendor>Microchip</Vendor>
18
+ <Cpu>IRAM(0-0x7F) IROM(0-0xFFF) CLOCK(24000000)</Cpu>
19
+ <FlashUtilSpec></FlashUtilSpec>
20
+ <StartupFile>"LIB\STARTUP.A51" ("Standard 8051 Startup Code")</StartupFile>
21
+ <FlashDriverDll></FlashDriverDll>
22
+ <DeviceId>2976</DeviceId>
23
+ <RegisterFile>REGX51.H</RegisterFile>
24
+ <MemoryEnv></MemoryEnv>
25
+ <Cmp></Cmp>
26
+ <Asm></Asm>
27
+ <Linker></Linker>
28
+ <OHString></OHString>
29
+ <InfinionOptionDll></InfinionOptionDll>
30
+ <SLE66CMisc></SLE66CMisc>
31
+ <SLE66AMisc></SLE66AMisc>
32
+ <SLE66LinkerMisc></SLE66LinkerMisc>
33
+ <SFDFile></SFDFile>
34
+ <bCustSvd>0</bCustSvd>
35
+ <UseEnv>0</UseEnv>
36
+ <BinPath></BinPath>
37
+ <IncludePath></IncludePath>
38
+ <LibPath></LibPath>
39
+ <RegisterFilePath>Atmel\</RegisterFilePath>
40
+ <DBRegisterFilePath>Atmel\</DBRegisterFilePath>
41
+ <TargetStatus>
42
+ <Error>0</Error>
43
+ <ExitCodeStop>0</ExitCodeStop>
44
+ <ButtonStop>0</ButtonStop>
45
+ <NotGenerated>0</NotGenerated>
46
+ <InvalidFlash>1</InvalidFlash>
47
+ </TargetStatus>
48
+ <OutputDirectory>.\代码\</OutputDirectory>
49
+ <OutputName>project</OutputName>
50
+ <CreateExecutable>1</CreateExecutable>
51
+ <CreateLib>0</CreateLib>
52
+ <CreateHexFile>1</CreateHexFile>
53
+ <DebugInformation>1</DebugInformation>
54
+ <BrowseInformation>1</BrowseInformation>
55
+ <ListingPath>.\Listings\</ListingPath>
56
+ <HexFormatSelection>0</HexFormatSelection>
57
+ <Merge32K>0</Merge32K>
58
+ <CreateBatchFile>0</CreateBatchFile>
59
+ <BeforeCompile>
60
+ <RunUserProg1>0</RunUserProg1>
61
+ <RunUserProg2>0</RunUserProg2>
62
+ <UserProg1Name></UserProg1Name>
63
+ <UserProg2Name></UserProg2Name>
64
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
65
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
66
+ <nStopU1X>0</nStopU1X>
67
+ <nStopU2X>0</nStopU2X>
68
+ </BeforeCompile>
69
+ <BeforeMake>
70
+ <RunUserProg1>0</RunUserProg1>
71
+ <RunUserProg2>0</RunUserProg2>
72
+ <UserProg1Name></UserProg1Name>
73
+ <UserProg2Name></UserProg2Name>
74
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
75
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
76
+ <nStopB1X>0</nStopB1X>
77
+ <nStopB2X>0</nStopB2X>
78
+ </BeforeMake>
79
+ <AfterMake>
80
+ <RunUserProg1>0</RunUserProg1>
81
+ <RunUserProg2>0</RunUserProg2>
82
+ <UserProg1Name></UserProg1Name>
83
+ <UserProg2Name></UserProg2Name>
84
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
85
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
86
+ <nStopA1X>0</nStopA1X>
87
+ <nStopA2X>0</nStopA2X>
88
+ </AfterMake>
89
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
90
+ <SVCSIdString></SVCSIdString>
91
+ </TargetCommonOption>
92
+ <CommonProperty>
93
+ <UseCPPCompiler>0</UseCPPCompiler>
94
+ <RVCTCodeConst>0</RVCTCodeConst>
95
+ <RVCTZI>0</RVCTZI>
96
+ <RVCTOtherData>0</RVCTOtherData>
97
+ <ModuleSelection>0</ModuleSelection>
98
+ <IncludeInBuild>1</IncludeInBuild>
99
+ <AlwaysBuild>0</AlwaysBuild>
100
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
101
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
102
+ <PublicsOnly>0</PublicsOnly>
103
+ <StopOnExitCode>3</StopOnExitCode>
104
+ <CustomArgument></CustomArgument>
105
+ <IncludeLibraryModules></IncludeLibraryModules>
106
+ <ComprImg>1</ComprImg>
107
+ <BankNo>65535</BankNo>
108
+ </CommonProperty>
109
+ <DllOption>
110
+ <SimDllName>S8051.DLL</SimDllName>
111
+ <SimDllArguments></SimDllArguments>
112
+ <SimDlgDll>DP51.DLL</SimDlgDll>
113
+ <SimDlgDllArguments>-p51</SimDlgDllArguments>
114
+ <TargetDllName>S8051.DLL</TargetDllName>
115
+ <TargetDllArguments></TargetDllArguments>
116
+ <TargetDlgDll>TP51.DLL</TargetDlgDll>
117
+ <TargetDlgDllArguments>-p51</TargetDlgDllArguments>
118
+ </DllOption>
119
+ <DebugOption>
120
+ <OPTHX>
121
+ <HexSelection>0</HexSelection>
122
+ <HexRangeLowAddress>0</HexRangeLowAddress>
123
+ <HexRangeHighAddress>0</HexRangeHighAddress>
124
+ <HexOffset>0</HexOffset>
125
+ <Oh166RecLen>16</Oh166RecLen>
126
+ </OPTHX>
127
+ <Simulator>
128
+ <UseSimulator>1</UseSimulator>
129
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
130
+ <RunToMain>1</RunToMain>
131
+ <RestoreBreakpoints>1</RestoreBreakpoints>
132
+ <RestoreWatchpoints>1</RestoreWatchpoints>
133
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
134
+ <RestoreFunctions>1</RestoreFunctions>
135
+ <RestoreToolbox>1</RestoreToolbox>
136
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
137
+ <RestoreSysVw>1</RestoreSysVw>
138
+ </Simulator>
139
+ <Target>
140
+ <UseTarget>0</UseTarget>
141
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
142
+ <RunToMain>0</RunToMain>
143
+ <RestoreBreakpoints>1</RestoreBreakpoints>
144
+ <RestoreWatchpoints>1</RestoreWatchpoints>
145
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
146
+ <RestoreFunctions>0</RestoreFunctions>
147
+ <RestoreToolbox>1</RestoreToolbox>
148
+ <RestoreTracepoints>1</RestoreTracepoints>
149
+ <RestoreSysVw>1</RestoreSysVw>
150
+ </Target>
151
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
152
+ <TargetSelection>-1</TargetSelection>
153
+ <SimDlls>
154
+ <CpuDll></CpuDll>
155
+ <CpuDllArguments></CpuDllArguments>
156
+ <PeripheralDll></PeripheralDll>
157
+ <PeripheralDllArguments></PeripheralDllArguments>
158
+ <InitializationFile></InitializationFile>
159
+ </SimDlls>
160
+ <TargetDlls>
161
+ <CpuDll></CpuDll>
162
+ <CpuDllArguments></CpuDllArguments>
163
+ <PeripheralDll></PeripheralDll>
164
+ <PeripheralDllArguments></PeripheralDllArguments>
165
+ <InitializationFile></InitializationFile>
166
+ <Driver></Driver>
167
+ </TargetDlls>
168
+ </DebugOption>
169
+ <Utilities>
170
+ <Flash1>
171
+ <UseTargetDll>0</UseTargetDll>
172
+ <UseExternalTool>0</UseExternalTool>
173
+ <RunIndependent>0</RunIndependent>
174
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
175
+ <Capability>0</Capability>
176
+ <DriverSelection>-1</DriverSelection>
177
+ </Flash1>
178
+ <bUseTDR>0</bUseTDR>
179
+ <Flash2></Flash2>
180
+ <Flash3></Flash3>
181
+ <Flash4></Flash4>
182
+ <pFcarmOut></pFcarmOut>
183
+ <pFcarmGrp></pFcarmGrp>
184
+ <pFcArmRoot></pFcArmRoot>
185
+ <FcArmLst>0</FcArmLst>
186
+ </Utilities>
187
+ <Target51>
188
+ <Target51Misc>
189
+ <MemoryModel>0</MemoryModel>
190
+ <RTOS>0</RTOS>
191
+ <RomSize>2</RomSize>
192
+ <DataHold>0</DataHold>
193
+ <XDataHold>0</XDataHold>
194
+ <UseOnchipRom>0</UseOnchipRom>
195
+ <UseOnchipArithmetic>0</UseOnchipArithmetic>
196
+ <UseMultipleDPTR>0</UseMultipleDPTR>
197
+ <UseOnchipXram>0</UseOnchipXram>
198
+ <HadIRAM>1</HadIRAM>
199
+ <HadXRAM>0</HadXRAM>
200
+ <HadIROM>1</HadIROM>
201
+ <Moda2>0</Moda2>
202
+ <Moddp2>0</Moddp2>
203
+ <Modp2>0</Modp2>
204
+ <Mod517dp>0</Mod517dp>
205
+ <Mod517au>0</Mod517au>
206
+ <Mode2>0</Mode2>
207
+ <useCB>0</useCB>
208
+ <useXB>0</useXB>
209
+ <useL251>0</useL251>
210
+ <useA251>0</useA251>
211
+ <Mx51>0</Mx51>
212
+ <ModC812>0</ModC812>
213
+ <ModCont>0</ModCont>
214
+ <Lp51>0</Lp51>
215
+ <useXBS>0</useXBS>
216
+ <ModDA>0</ModDA>
217
+ <ModAB2>0</ModAB2>
218
+ <Mx51P>0</Mx51P>
219
+ <hadXRAM2>0</hadXRAM2>
220
+ <uocXram2>0</uocXram2>
221
+ <hadXRAM3>0</hadXRAM3>
222
+ <ModC2>0</ModC2>
223
+ <ModH2>0</ModH2>
224
+ <Mdu_R515>0</Mdu_R515>
225
+ <Mdu_F120>0</Mdu_F120>
226
+ <Psoc>0</Psoc>
227
+ <hadIROM2>0</hadIROM2>
228
+ <hadIROM3>0</hadIROM3>
229
+ <ModSmx2>0</ModSmx2>
230
+ <cBanks>0</cBanks>
231
+ <xBanks>0</xBanks>
232
+ <OnChipMemories>
233
+ <RCB>
234
+ <Type>0</Type>
235
+ <StartAddress>0x0</StartAddress>
236
+ <Size>0xffff</Size>
237
+ </RCB>
238
+ <RXB>
239
+ <Type>0</Type>
240
+ <StartAddress>0x0</StartAddress>
241
+ <Size>0x0</Size>
242
+ </RXB>
243
+ <Ocm1>
244
+ <Type>0</Type>
245
+ <StartAddress>0x0</StartAddress>
246
+ <Size>0x0</Size>
247
+ </Ocm1>
248
+ <Ocm2>
249
+ <Type>0</Type>
250
+ <StartAddress>0x0</StartAddress>
251
+ <Size>0x0</Size>
252
+ </Ocm2>
253
+ <Ocm3>
254
+ <Type>0</Type>
255
+ <StartAddress>0x0</StartAddress>
256
+ <Size>0x0</Size>
257
+ </Ocm3>
258
+ <Ocr1>
259
+ <Type>0</Type>
260
+ <StartAddress>0x0</StartAddress>
261
+ <Size>0x0</Size>
262
+ </Ocr1>
263
+ <Ocr2>
264
+ <Type>0</Type>
265
+ <StartAddress>0x0</StartAddress>
266
+ <Size>0x0</Size>
267
+ </Ocr2>
268
+ <Ocr3>
269
+ <Type>0</Type>
270
+ <StartAddress>0x0</StartAddress>
271
+ <Size>0x0</Size>
272
+ </Ocr3>
273
+ <IRO>
274
+ <Type>1</Type>
275
+ <StartAddress>0x0</StartAddress>
276
+ <Size>0x1000</Size>
277
+ </IRO>
278
+ <IRA>
279
+ <Type>0</Type>
280
+ <StartAddress>0x0</StartAddress>
281
+ <Size>0x80</Size>
282
+ </IRA>
283
+ <XRA>
284
+ <Type>0</Type>
285
+ <StartAddress>0x0</StartAddress>
286
+ <Size>0x0</Size>
287
+ </XRA>
288
+ <XRA512>
289
+ <Type>0</Type>
290
+ <StartAddress>0x0</StartAddress>
291
+ <Size>0x0</Size>
292
+ </XRA512>
293
+ <IROM512>
294
+ <Type>0</Type>
295
+ <StartAddress>0x0</StartAddress>
296
+ <Size>0x0</Size>
297
+ </IROM512>
298
+ <XRA513>
299
+ <Type>0</Type>
300
+ <StartAddress>0x0</StartAddress>
301
+ <Size>0x0</Size>
302
+ </XRA513>
303
+ <IROM513>
304
+ <Type>0</Type>
305
+ <StartAddress>0x0</StartAddress>
306
+ <Size>0x0</Size>
307
+ </IROM513>
308
+ </OnChipMemories>
309
+ </Target51Misc>
310
+ <C51>
311
+ <RegisterColoring>0</RegisterColoring>
312
+ <VariablesInOrder>0</VariablesInOrder>
313
+ <IntegerPromotion>1</IntegerPromotion>
314
+ <uAregs>0</uAregs>
315
+ <UseInterruptVector>1</UseInterruptVector>
316
+ <Fuzzy>3</Fuzzy>
317
+ <Optimize>8</Optimize>
318
+ <WarningLevel>2</WarningLevel>
319
+ <SizeSpeed>1</SizeSpeed>
320
+ <ObjectExtend>1</ObjectExtend>
321
+ <ACallAJmp>0</ACallAJmp>
322
+ <InterruptVectorAddress>0</InterruptVectorAddress>
323
+ <VariousControls>
324
+ <MiscControls></MiscControls>
325
+ <Define></Define>
326
+ <Undefine></Undefine>
327
+ <IncludePath></IncludePath>
328
+ </VariousControls>
329
+ </C51>
330
+ <Ax51>
331
+ <UseMpl>0</UseMpl>
332
+ <UseStandard>1</UseStandard>
333
+ <UseCase>0</UseCase>
334
+ <UseMod51>0</UseMod51>
335
+ <VariousControls>
336
+ <MiscControls></MiscControls>
337
+ <Define></Define>
338
+ <Undefine></Undefine>
339
+ <IncludePath></IncludePath>
340
+ </VariousControls>
341
+ </Ax51>
342
+ <Lx51>
343
+ <useFile>0</useFile>
344
+ <linkonly>0</linkonly>
345
+ <UseMemoryFromTarget>1</UseMemoryFromTarget>
346
+ <CaseSensitiveSymbols>0</CaseSensitiveSymbols>
347
+ <WarningLevel>2</WarningLevel>
348
+ <DataOverlaying>1</DataOverlaying>
349
+ <OverlayString></OverlayString>
350
+ <MiscControls></MiscControls>
351
+ <DisableWarningNumbers></DisableWarningNumbers>
352
+ <LinkerCmdFile></LinkerCmdFile>
353
+ <Assign></Assign>
354
+ <ReserveString></ReserveString>
355
+ <CClasses></CClasses>
356
+ <UserClasses></UserClasses>
357
+ <CSection></CSection>
358
+ <UserSection></UserSection>
359
+ <CodeBaseAddress></CodeBaseAddress>
360
+ <XDataBaseAddress></XDataBaseAddress>
361
+ <PDataBaseAddress></PDataBaseAddress>
362
+ <BitBaseAddress></BitBaseAddress>
363
+ <DataBaseAddress></DataBaseAddress>
364
+ <IDataBaseAddress></IDataBaseAddress>
365
+ <Precede></Precede>
366
+ <Stack></Stack>
367
+ <CodeSegmentName></CodeSegmentName>
368
+ <XDataSegmentName></XDataSegmentName>
369
+ <BitSegmentName></BitSegmentName>
370
+ <DataSegmentName></DataSegmentName>
371
+ <IDataSegmentName></IDataSegmentName>
372
+ </Lx51>
373
+ </Target51>
374
+ </TargetOption>
375
+ <Groups>
376
+ <Group>
377
+ <GroupName>Source Group 1</GroupName>
378
+ <Files>
379
+ <File>
380
+ <FileName>STARTUP.A51</FileName>
381
+ <FileType>2</FileType>
382
+ <FilePath>.\STARTUP.A51</FilePath>
383
+ </File>
384
+ <File>
385
+ <FileName>8.c</FileName>
386
+ <FileType>1</FileType>
387
+ <FilePath>.\8.c</FilePath>
388
+ </File>
389
+ </Files>
390
+ </Group>
391
+ </Groups>
392
+ </Target>
393
+ </Targets>
394
+
395
+ </Project>
8/STARTUP.A51 ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $NOMOD51
2
+ ;------------------------------------------------------------------------------
3
+ ; This file is part of the C51 Compiler package
4
+ ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
5
+ ; Version 8.01
6
+ ;
7
+ ; *** <<< Use Configuration Wizard in Context Menu >>> ***
8
+ ;------------------------------------------------------------------------------
9
+ ; STARTUP.A51: This code is executed after processor reset.
10
+ ;
11
+ ; To translate this file use A51 with the following invocation:
12
+ ;
13
+ ; A51 STARTUP.A51
14
+ ;
15
+ ; To link the modified STARTUP.OBJ file to your application use the following
16
+ ; Lx51 invocation:
17
+ ;
18
+ ; Lx51 your object file list, STARTUP.OBJ controls
19
+ ;
20
+ ;------------------------------------------------------------------------------
21
+ ;
22
+ ; User-defined <h> Power-On Initialization of Memory
23
+ ;
24
+ ; With the following EQU statements the initialization of memory
25
+ ; at processor reset can be defined:
26
+ ;
27
+ ; <o> IDATALEN: IDATA memory size <0x0-0x100>
28
+ ; <i> Note: The absolute start-address of IDATA memory is always 0
29
+ ; <i> The IDATA space overlaps physically the DATA and BIT areas.
30
+ IDATALEN EQU 80H
31
+ ;
32
+ ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
33
+ ; <i> The absolute start address of XDATA memory
34
+ XDATASTART EQU 0
35
+ ;
36
+ ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
37
+ ; <i> The length of XDATA memory in bytes.
38
+ XDATALEN EQU 0
39
+ ;
40
+ ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
41
+ ; <i> The absolute start address of PDATA memory
42
+ PDATASTART EQU 0H
43
+ ;
44
+ ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
45
+ ; <i> The length of PDATA memory in bytes.
46
+ PDATALEN EQU 0H
47
+ ;
48
+ ;</h>
49
+ ;------------------------------------------------------------------------------
50
+ ;
51
+ ;<h> Reentrant Stack Initialization
52
+ ;
53
+ ; The following EQU statements define the stack pointer for reentrant
54
+ ; functions and initialized it:
55
+ ;
56
+ ; <h> Stack Space for reentrant functions in the SMALL model.
57
+ ; <q> IBPSTACK: Enable SMALL model reentrant stack
58
+ ; <i> Stack space for reentrant functions in the SMALL model.
59
+ IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
60
+ ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
61
+ ; <i> Set the top of the stack to the highest location.
62
+ IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
63
+ ; </h>
64
+ ;
65
+ ; <h> Stack Space for reentrant functions in the LARGE model.
66
+ ; <q> XBPSTACK: Enable LARGE model reentrant stack
67
+ ; <i> Stack space for reentrant functions in the LARGE model.
68
+ XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
69
+ ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
70
+ ; <i> Set the top of the stack to the highest location.
71
+ XBPSTACKTOP EQU 0xFFFF +1 ; default 0FFFFH+1
72
+ ; </h>
73
+ ;
74
+ ; <h> Stack Space for reentrant functions in the COMPACT model.
75
+ ; <q> PBPSTACK: Enable COMPACT model reentrant stack
76
+ ; <i> Stack space for reentrant functions in the COMPACT model.
77
+ PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
78
+ ;
79
+ ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
80
+ ; <i> Set the top of the stack to the highest location.
81
+ PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
82
+ ; </h>
83
+ ;</h>
84
+ ;------------------------------------------------------------------------------
85
+ ;
86
+ ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
87
+ ; <e>Compact Model Page Definition
88
+ ;
89
+ ; <i>Define the XDATA page used for PDATA variables.
90
+ ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
91
+ ;
92
+ ; Enable pdata memory page initalization
93
+ PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
94
+ ;
95
+ ; <o> PPAGE number <0x0-0xFF>
96
+ ; <i> uppermost 256-byte address of the page used for PDATA variables.
97
+ PPAGE EQU 0
98
+ ;
99
+ ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
100
+ ; <i> most 8051 variants use P2 as uppermost address byte
101
+ PPAGE_SFR DATA 0A0H
102
+ ;
103
+ ; </e>
104
+ ;------------------------------------------------------------------------------
105
+
106
+ ; Standard SFR Symbols
107
+ ACC DATA 0E0H
108
+ B DATA 0F0H
109
+ SP DATA 81H
110
+ DPL DATA 82H
111
+ DPH DATA 83H
112
+
113
+ NAME ?C_STARTUP
114
+
115
+
116
+ ?C_C51STARTUP SEGMENT CODE
117
+ ?STACK SEGMENT IDATA
118
+
119
+ RSEG ?STACK
120
+ DS 1
121
+
122
+ EXTRN CODE (?C_START)
123
+ PUBLIC ?C_STARTUP
124
+
125
+ CSEG AT 0
126
+ ?C_STARTUP: LJMP STARTUP1
127
+
128
+ RSEG ?C_C51STARTUP
129
+
130
+ STARTUP1:
131
+
132
+ IF IDATALEN <> 0
133
+ MOV R0,#IDATALEN - 1
134
+ CLR A
135
+ IDATALOOP: MOV @R0,A
136
+ DJNZ R0,IDATALOOP
137
+ ENDIF
138
+
139
+ IF XDATALEN <> 0
140
+ MOV DPTR,#XDATASTART
141
+ MOV R7,#LOW (XDATALEN)
142
+ IF (LOW (XDATALEN)) <> 0
143
+ MOV R6,#(HIGH (XDATALEN)) +1
144
+ ELSE
145
+ MOV R6,#HIGH (XDATALEN)
146
+ ENDIF
147
+ CLR A
148
+ XDATALOOP: MOVX @DPTR,A
149
+ INC DPTR
150
+ DJNZ R7,XDATALOOP
151
+ DJNZ R6,XDATALOOP
152
+ ENDIF
153
+
154
+ IF PPAGEENABLE <> 0
155
+ MOV PPAGE_SFR,#PPAGE
156
+ ENDIF
157
+
158
+ IF PDATALEN <> 0
159
+ MOV R0,#LOW (PDATASTART)
160
+ MOV R7,#LOW (PDATALEN)
161
+ CLR A
162
+ PDATALOOP: MOVX @R0,A
163
+ INC R0
164
+ DJNZ R7,PDATALOOP
165
+ ENDIF
166
+
167
+ IF IBPSTACK <> 0
168
+ EXTRN DATA (?C_IBP)
169
+
170
+ MOV ?C_IBP,#LOW IBPSTACKTOP
171
+ ENDIF
172
+
173
+ IF XBPSTACK <> 0
174
+ EXTRN DATA (?C_XBP)
175
+
176
+ MOV ?C_XBP,#HIGH XBPSTACKTOP
177
+ MOV ?C_XBP+1,#LOW XBPSTACKTOP
178
+ ENDIF
179
+
180
+ IF PBPSTACK <> 0
181
+ EXTRN DATA (?C_PBP)
182
+ MOV ?C_PBP,#LOW PBPSTACKTOP
183
+ ENDIF
184
+
185
+ MOV SP,#?STACK-1
186
+
187
+ ; This code is required if you use L51_BANK.A51 with Banking Mode 4
188
+ ;<h> Code Banking
189
+ ; <q> Select Bank 0 for L51_BANK.A51 Mode 4
190
+ #if 0
191
+ ; <i> Initialize bank mechanism to code bank 0 when using L51_BANK.A51 with Banking Mode 4.
192
+ EXTRN CODE (?B_SWITCH0)
193
+ CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
194
+ #endif
195
+ ;</h>
196
+ LJMP ?C_START
197
+
198
+ END
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2025 MCU contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - "8051"
5
+ - microcontroller
6
+ - keil
7
+ - proteus
8
+ ---
9
+
10
+ # MCU:单片机原理实验答案
11
+
12
+ 基于 AT89C51 的 8 个单片机实验示例,包含简单直白的 C51 源码、Keil uVision 工程和 Proteus 仿真文件。
13
+
14
+ ## 实验内容
15
+
16
+ 1. LED 流水灯
17
+ 2. 数码管轮流显示数字
18
+ 3. 四位数码管动态显示
19
+ 4. 独立按键控制 LED
20
+ 5. 矩阵键盘控制 LED
21
+ 6. LCD1602 字符显示
22
+ 7. 外部中断控制 LED
23
+ 8. 定时器中断控制 LED
24
+
25
+ ## 使用方法
26
+
27
+ - 使用 Keil uVision 打开各实验目录中的 `.uvproj` 工程并编译。
28
+ - 使用 Proteus 打开 `.pdsprj` 工程;如提示缺少程序文件,请先在 Keil 中编译,再在单片机属性中选择生成的 HEX 文件。
29
+ - 编译产物和个人本机配置未纳入仓库,需要在本机重新生成。
30
+
31
+ 代码仅用于学习交流,建议理解实验原理后自行完成实验。
32
+
33
+ ## 许可证
34
+
35
+ MIT License,详见 `LICENSE`。