📄 ex2_main.lst
字号:
ANSI-C/cC++ Compiler for HC12 V-5.0.24 Build 4047, Feb 17 2004
1: /******************************************************************************
2: *
3: * (c) copyright Freescale Semiconductor Hong Kong Ltd. 2004
4: * ALL RIGHTS RESERVED
5: *
6: *******************************************************************************
7: ** THIS CODE IS ONLY INTENDED AS AN EXAMPLE FOR DEMONSTRATING THE FREESCALE **
8: ** MICROCONTROLLERS. IT HAS ONLY BEEN GIVEN A MIMIMUM LEVEL OF TEST. IT IS **
9: ** PROVIDED 'AS SEEN' WITH NO GUARANTEES AND NO PROMISE OF SUPPORT. **
10: *******************************************************************************
11: *
12: * FILE: main.c REVISION 0.2
13: *
14: * DESCRIPTION: Application code is placed here.
15: * This module handles all tasks for initialization.
16: * It is invoked by _Startup right after start12.c was being
17: * finished.
18: *
19: * TARGET DEVICE: Hardware EVB912DP256 or equivalent
20: *
21: * COMPILER: Metrowerks VERSION: ADS v1.2 (initial version)
22: * VERSION: ADS v2.0 (Demo beta version)
23: * VERSION: ADS v3.1 (Demo version)
24: *
25: * NOTES
26: * -----
27: * All modules remain at their reset addresses.
28: *
29: *
30: * UPDATED HISTORY:
31: *
32: * REV YYYY.MM.DD AUTHOR DESCRIPTION OF CHANGE
33: * --- ---------- ------ ---------------------
34: * 0.0 2002.04.27 Kenny Lam Initial version
35: * 0.1 2002.07.12 Kenny Lam Demo beta version
36: * 0.2 2004.04.12 Kenny Lam Demo version
37: *
38: ******************************************************************************/
39: /* Freescale is not obligated to provide any support, upgrades or new */
40: /* releases of the Software. Freescale may make changes to the Software at */
41: /* any time, without any obligation to notify or provide updated versions of */
42: /* the Software to you. Freescale expressly disclaims any warranty for the */
43: /* Software. The Software is provided as is, without warranty of any kind, */
44: /* either express or implied, including, without limitation, the implied */
45: /* warranties of merchantability, fitness for a particular purpose, or */
46: /* non-infringement. You assume the entire risk arising out of the use or */
47: /* performance of the Software, or any systems you design using the software */
48: /* (if any). Nothing may be construed as a warranty or representation by */
49: /* Freescale that the Software or any derivative work developed with or */
50: /* incorporating the Software will be free from infringement of the */
51: /* intellectual property rights of third parties. In no event will Freescale */
52: /* be liable, whether in contract, tort, or otherwise, for any incidental, */
53: /* special, indirect, consequential or punitive damages, including, but not */
54: /* limited to, damages for any loss of use, loss of time, inconvenience, */
55: /* commercial loss, or lost profits, savings, or revenues to the full extent */
56: /* such may be disclaimed by law. The Software is not fault tolerant and is */
57: /* not designed, manufactured or intended by Freescale for incorporation */
58: /* into products intended for use or resale in on-line control equipment in */
59: /* hazardous, dangerous to life or potentially life-threatening environments */
60: /* requiring fail-safe performance, such as in the operation of nuclear */
61: /* facilities, aircraft navigation or communication systems, air traffic */
62: /* control, direct life support machines or weapons systems, in which the */
63: /* failure of products could lead directly to death, personal injury or */
64: /* severe physical or environmental damage (High Risk Activities). You */
65: /* specifically represent and warrant that you will not use the Software or */
66: /* any derivative work of the Software for High Risk Activities. */
67: /* Freescale and the Freescale logos are registered trademarks of Freescale */
68: /* Semiconductor Inc. */
69: /*****************************************************************************/
70:
71: #include <hidef.h>
72: #include "const.h"
73: #include "ex2_extern.h"
74: #define _GLOBAL_DECL_
75: #include "GlobalVar.h"
76: #include "DP256Port.h"
77:
78: #ifdef BANKED
79: #pragma CODE_SEG CodeForcedToPPage33
80: #else
81: #pragma CODE_SEG DEFAULT
82: #endif
83:
84: /**********************************************
85: * Main subroutine
86: ***********************************************/
87: void main(void)
88: {
Function: main
Source : D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\sources\ex2_main.c
Options : -DRAM -Env"GENPATH=D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31;D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\bin;D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\cmd;D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\prm;D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\sources;C:\Program Files\Metrowerks\CodeWarrior CW12_V3.1\lib\HC12c\LIB;C:\Program Files\Metrowerks\CodeWarrior CW12_V3.1\lib\HC12c\SRC;C:\Program Files\Metrowerks\CodeWarrior CW12_V3.1\lib\HC12c\INCLUDE" -Env"LIBPATH=C:\Program Files\Metrowerks\CodeWarrior CW12_V3.1\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\bin" -Env"TEXTPATH=D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\bin" -Lasm=%n.lst -ObjN="D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\S12_Ex2_Timer7_ICD_CW31_Data\Ram_Application\ObjectCode\ex2_main.c.o" -Ol0
89: //Write a program to get the periodic interrupt as time base
90:
91: init_system();
0000 160000 JSR init_system
92: DDRB=0x2;
0003 c602 LDAB #2
0005 5b03 STAB 3
93: DDRS=0xFF;
0007 86ff LDAA #255
0009 7a024a STAA 586
94: PORTS = 0x55;
000c c655 LDAB #85
000e 7b0248 STAB 584
95: #ifdef BANK
96: printf0("\n\n\n\tHello Banked Flash World!!!\n\n\r");
97: #endif
98: #ifdef NON_BANK
99: printf0("\n\n\n\tHello Non-Banked Flash World!!!\n\n\r");
100: #endif
101: #ifdef RAM
102: printf0("\n\n\n\tHello RAM World!!!\n\n\r");
0011 cc0000 LDD #"\012\012\012\011Hello RAM World!!!\012\012\015"
0014 160000 JSR printf0
103: #endif
104: printf0("\nHour Min Sec\n\r");
0017 cc0000 LDD #"\012Hour Min Sec\012\015"
001a 160000 JSR printf0
105: EnableInterrupts;
001d 10ef CLI
106:
107: for(;;)
108: {
109: hex_clk_dec(HourData);
001f f60000 LDAB HourData
0022 160000 JSR hex_clk_dec
110: printf0(" \r");
0025 cc0000 LDD #" \015"
0028 160000 JSR printf0
111: hex_clk_dec(MinData);
002b f60000 LDAB MinData
002e 160000 JSR hex_clk_dec
112: printf0(" \r");
0031 cc0000 LDD #" \015"
0034 160000 JSR printf0
113: hex_clk_dec(SecData);
0037 f60000 LDAB SecData
003a 160000 JSR hex_clk_dec
114: tx_char0(CR);
003d c60d LDAB #13
003f 160000 JSR tx_char0
115: delay1();
0042 160000 JSR delay1
0045 20d8 BRA *-38 ;abs = 001f
116: }
117: }
118:
119: /**********************************************
120: * System initialisation subroutine
121: ***********************************************/
122: void init_system()
123: {
Function: init_system
Source : D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\sources\ex2_main.c
Options : -DRAM -Env"GENPATH=D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31;D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\bin;D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\cmd;D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\prm;D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\sources;C:\Program Files\Metrowerks\CodeWarrior CW12_V3.1\lib\HC12c\LIB;C:\Program Files\Metrowerks\CodeWarrior CW12_V3.1\lib\HC12c\SRC;C:\Program Files\Metrowerks\CodeWarrior CW12_V3.1\lib\HC12c\INCLUDE" -Env"LIBPATH=C:\Program Files\Metrowerks\CodeWarrior CW12_V3.1\lib\HC12c\INCLUDE" -Env"OBJPATH=D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\bin" -Env"TEXTPATH=D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\bin" -Lasm=%n.lst -ObjN="D:\Profiles\r63492.FSL\My Documents\Training document\培训教材\HCS12\S12 Ex2 Timer7 ICD CW31\S12_Ex2_Timer7_ICD_CW31_Data\Ram_Application\ObjectCode\ex2_main.c.o" -Ol0
124: init_SCI0();
0000 160000 JSR init_SCI0
125: init_timer();
0003 060000 JMP init_timer
126: }
127:
128:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -