📄 pyzc4.lst
字号:
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 1
80C196 C compiler v5.0 r3 SN000000-194 (C)1996 Tasking Software BV
Object module placed in pyzc4.obj
Compiler invoked by: C:\XINGYAN\C196\BIN\C196.EXE pyzc4.c md(kb) DB SB CO MS Ot(1) SP(0) DN(1) RG(220) SI(C:\XingYan\c19
-6\Include)
Line Level Incl
cseg
1 //#pragma model(196)
2 #include <80c196kd.h>
3
4 #define SP_MODE0 0x00
5 #define SP_MODE1 0x01
6 #define SP_MODE2 0x02
7 #define SP_MODE3 0x03
8 #define REC_ENABLE 0x08
9 #define REC_DISABLE 0x00
1 #define TXD_ENABLE_BIT 0x05
11 #define EVEN_PARITY 0x08
12 #define ODD_PARITY 0x28
13 #define NO_PARITY 0x00
14 #define SET_BIT_8 0x04
15 #define SP_INTERNAL_CLK 0x8000
16 #define SP_EXTERNAL_CLK 0x0000
17 #define TXD_INTERRUPT 0x00
18 #define RXD_INTERRUPT 0x01
19 //#define SERIAL_INT 0x06
2 #define TI_BIT 0x05
21 #define RI_BIT 0x06
22 #define FE_BIT 0x04
23 #define OE_BIT 0x02
24 #define RPE_BIT 0x07
25 #define RB8_BIT 0x07
26 #define TXE_BIT 0x03
27 #define T1OVF_DETECTION 2
28 #define TOVF_INT_MSK 0
29 #define T2OVF_INT_MSK 4
3 #define T2CAPTURE_INT_MSK 3
31 #define T2OVF_DETECTION 3
32 #define T2_CLOCK_INTERNAL 0
33 #define TOVF_INT 0
34 #define AD_INT 1
35 #define HSI_DATA_AVAIL_INT 2
36 #define HSO_INT 3
37 #define HSI0_INT 4
38 #define SW_TIMER_INT 5
39 #define SERIAL_INT 6
4 #define EXT_INT 7
41 #define TRAP_INT 8
42 #define UNIMPLEMENTED_INT 9
43 #define TXD_INT 24
44 #define RXD_INT 25
45 #define HSI_FIFO4_INT 26
46 #define TIMER2_CAPT_INT 27
47 #define T2OVF_INT 28
48 #define EXT1_INT 29
49 #define HSI_FIFO_FULL_INT 30
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 2
Assembly Listing of Object Code
5 #define NONMASKABLE_INT 31
51 #define PWM0_ENABLE 0
52 #define PWM_PRESCALE 2
53
54 #define HSO4_PIN_ENABLE 4
55 #define HSO5_PIN_ENABLE 6
56 #define CAM_LOCK_BIT 6
57 #define CLEAR_CAM_BIT 7
58 #define ATOD_BUSY (ad_result & 0x08)
59 #define GO_NOW 0x08
6 #define GO_EPA 0x00
61 #define TEN_BIT_MODE 0x00
62 #define EIGHT_BIT_MODE 0x10
63 #define AD_SPEED 4
64 #define AD_INT 1
65 #define HSI0_PIN_ENABLE 0
66 #define HSI0_EXT_INT 0x10
67 #define HSI1_PIN_ENABLE 2
68 #define HSI2_PIN_ENABLE 4
69 #define HSI3_PIN_ENABLE 6
7 #define SELECT_INT_VECTOR 7
71 #define HSI_FIFO_FULL_INTMSK 0x40
72 #define HSI_FIFO_4_INT 0x4
73 #define EXTINT_SRC 1
74
75
76 /****************************************************************************/
77 /* */
78 /* Usefull bit macros. */
79 /* */
8 /****************************************************************************/
81
82 #define checkbit(var,bit) (var & (0x01 << (bit)))
83 #define setbit(var,bit) (var |= (0x01 << (bit)))
84 #define clrbit(var,bit) (var &= (~(0x01 << (bit))))
85
86 static unsigned char sp_status_image;
87 register unsigned int tmpreg;
88 #pragma interrupt(serial_isr=6)
89 #pragma interrupt (tovf_isr = TOVF_INT)
9 #pragma interrupt (ext_isr = EXT_INT)
91 #pragma interrupt (hsi0_isr = HSI0_INT)
92 const unsigned int ccr = {0x20CD};
93 #pragma locate(ccr=0x2018)
94
95 #define TRANSMIT_BUF_SIZE 20
96 #define RECEIVE_BUF_SIZE 20
97
98 static unsigned char trans_buff[TRANSMIT_BUF_SIZE];
99 static unsigned char mess[12]={'S',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'E'};
1 static char begin_trans_buff,end_trans_buff;
1
1 static unsigned char receive_buff[RECEIVE_BUF_SIZE];
1 static char end_rec_buff,begin_rec_buff;
1 static unsigned char pwm0_byte,ioport1_byte,hso_byte,pulse=0;
1 static unsigned char timer1_count=0,triggle_out=0,triggle_in=0,emergence_flag=0;
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 3
Assembly Listing of Object Code
1 extern void enable(void);
1
1 void ext_isr(void)
1 {
0000 ext_isr:
0000 F2 pushf
11 1 /* User code goes here */
111 1 emergence_flag=1;
0001 B10104 R ldb emergence_flag,#1
112 1 }
0004 F3 popf
0005 F0 ret
; Function Statistics for: ext_isr
; Code Size : 6 Parameter Count:
; Stack Size: Parameter Size :
; OReg Size : Stack Depth : 4
113
114 void hsi0_isr(void)
115 {
0006 hsi0_isr:
0006 F2 pushf
0007 69020018 sub SP,#2
000B C800 E push ?FRAME01
000D A01800 E ld ?FRAME01,SP
0010 C800 R push ?OVRBASE
116 1 /* User code goes here */
117 1 unsigned char temp_byte;
118 1 unsigned int temp_word;
119 1 pulse++;
0012 1700 R incb pulse
12 1 temp_byte=hsi_status;
0014 B00000 E ldb temp_byte,hsi_status
121 1 temp_word=hsi_time;
0017 C3000200 E st hsi_time,temp_word[?FRAME01]
122 1 }
001B CC00 R pop ?OVRBASE
001D CC00 E pop ?FRAME01
001F 65020018 add SP,#2
0023 F3 popf
0024 F0 ret
; Function Statistics for: hsi0_isr
; Code Size : 31 Parameter Count:
; Stack Size: 2 Parameter Size :
; OReg Size : 1 Stack Depth : 1
123
124 void tovf_isr(void)
125 {
0025 tovf_isr:
0025 F2 pushf
0026 C81C push Tmp0
126 1 /* User code goes here */
127 1 if(++timer1_count==12)
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 4
Assembly Listing of Object Code
0028 1701 R incb timer1_count
002A 990C01 R cmpb timer1_count,#0CH
002D D720 bne @0004
128 1 {
129 2 triggle_out=1;
002F B10102 R ldb triggle_out,#1
13 2 timer1_count=0;
0032 1101 R clrb timer1_count
131 2 mess[8]=pulse;
0034 C701080000 R stb pulse,mess+8
132 2 if(emergence_flag==1)
0039 990104 R cmpb emergence_flag,#1
003C D70F bne @0005
133 2 {
134 3 emergence_flag=0;
003E 1104 R clrb emergence_flag
135 3 mess[8]|=0x80;
0040 B30108001C R ldb Tmp0,mess+8
0045 91801C orb Tmp0,#8
0048 C70108001C R stb Tmp0,mess+8
004D @0005:
136 3 }
137 2 pulse=0;
004D 1100 R clrb pulse
004F @0004:
138 2 }
139 1 }
004F CC1C pop Tmp0
0051 F3 popf
0052 F0 ret
; Function Statistics for: tovf_isr
; Code Size : 46 Parameter Count:
; Stack Size: Parameter Size :
; OReg Size : Stack Depth : 6
14
141 void transmit(void) /* serial interrupt routine */
142 {
0053 transmit:
143 1 sp_status_image |= sp_stat; /* image sp_stat into
0053 900002 E orb sp_status_image,sp_stat
144 1 sp_status_image */
145 1
146 1 /* transmit a character if there is a character in the buffer
147 1 else leave TI_BIT set in image for putchar to enable interrupts */
148 1 if(begin_trans_buff!=end_trans_buff)
0056 980403 R cmpb begin_trans_buff,end_trans_buff
0059 DF14 be @0007
149 1 {
15 2 sbuf=trans_buff[begin_trans_buff]; /* transmit character */
005B BC031C R ldbse Tmp0,begin_trans_buff
005E B31D000000 E ldb sbuf,trans_buff[Tmp0]
151 2
152 2 /* The next statement makes the buffer circular by starting over when the
153 2 index reaches the end of the buffer. */
C196 Compiler pyzc4 15-Dec-106 17:34:24 Page 5
Assembly Listing of Object Code
154 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -