📄 pyzc2.lst
字号:
C196 Compiler pyzc2 13-Dec-106 22:07:20 Page 1
80C196 C compiler v5.0 r3 SN000000-194 (C)1996 Tasking Software BV
Object module placed in pyzc2.obj
Compiler invoked by: C:\XINGYAN\C196\BIN\C196.EXE pyzc2.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 pyzc2 13-Dec-106 22:07:20 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
59
6 /****************************************************************************/
61 /* */
62 /* Usefull bit macros. */
63 /* */
64 /****************************************************************************/
65
66 #define checkbit(var,bit) (var & (0x01 << (bit)))
67 #define setbit(var,bit) (var |= (0x01 << (bit)))
68 #define clrbit(var,bit) (var &= (~(0x01 << (bit))))
69
7 static unsigned char sp_status_image;
71 register unsigned int tmpreg;
72 #pragma interrupt(serial_isr=6)
73 #pragma interrupt (tovf_isr = TOVF_INT)
74 const unsigned int ccr = {0x20CD};
75 #pragma locate(ccr=0x2018)
76
77 #define TRANSMIT_BUF_SIZE 20
78 #define RECEIVE_BUF_SIZE 20
79
8 static unsigned char trans_buff[TRANSMIT_BUF_SIZE];
81 static unsigned char mess[10]={'S',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'E'};
82 static char begin_trans_buff,end_trans_buff;
83
84 static unsigned char receive_buff[RECEIVE_BUF_SIZE];
85 static char end_rec_buff,begin_rec_buff;
86 static unsigned char pwm0_byte,ioport1_byte,hso_byte;
87 static unsigned char timer1_count=0,triggle_out=0,triggle_in=0;
88 extern void enable(void);
89
9 void tovf_isr(void)
91 {
0000 tovf_isr:
0000 F2 pushf
92 1 /* User code goes here */
93 1 if(++timer1_count==12)
0001 1700 R incb timer1_count
0003 990C00 R cmpb timer1_count,#0CH
0006 D705 bne @0002
94 1 {
95 2 triggle_out=1;
0008 B10101 R ldb triggle_out,#1
96 2 timer1_count=0;
000B 1100 R clrb timer1_count
000D @0002:
97 2 }
C196 Compiler pyzc2 13-Dec-106 22:07:20 Page 3
Assembly Listing of Object Code
98 1 }
000D F3 popf
000E F0 ret
; Function Statistics for: tovf_isr
; Code Size : 15 Parameter Count:
; Stack Size: Parameter Size :
; OReg Size : Stack Depth : 4
99
1 void transmit(void) /* serial interrupt routine */
1 {
000F transmit:
1 1 sp_status_image |= sp_stat; /* image sp_stat into
000F 900002 E orb sp_status_image,sp_stat
1 1 sp_status_image */
1 1
1 1 /* transmit a character if there is a character in the buffer
1 1 else leave TI_BIT set in image for putchar to enable interrupts */
1 1 if(begin_trans_buff!=end_trans_buff)
0012 980403 R cmpb begin_trans_buff,end_trans_buff
0015 DF14 be @0004
1 1 {
1 2 sbuf=trans_buff[begin_trans_buff]; /* transmit character */
0017 BC031C R ldbse Tmp0,begin_trans_buff
001A B31D000000 E ldb sbuf,trans_buff[Tmp0]
11 2
111 2 /* The next statement makes the buffer circular by starting over when the
112 2 index reaches the end of the buffer. */
113 2
114 2 if(++begin_trans_buff>TRANSMIT_BUF_SIZE - 1)begin_trans_buff=0;
001F 1703 R incb begin_trans_buff
0021 991303 R cmpb begin_trans_buff,#13H
0024 DA02 ble @0005
0026 1103 R clrb begin_trans_buff
0028 @0005:
115 2 clrbit(sp_status_image,TI_BIT); /* clear TI bit in status_image. */
0028 71DF02 R andb sp_status_image,#0DFH
002B @0004:
116 2 }
117 1 }
002B F0 ret
; Function Statistics for: transmit
; Code Size : 29 Parameter Count:
; Stack Size: Parameter Size :
; OReg Size : Stack Depth :
118
119 int putchar(int c)
12 {
002C putchar:
002C C800 E push ?FRAME01
002E A01800 E ld ?FRAME01,SP
0031 2000 br @0008
0033 @0007:
C196 Compiler pyzc2 13-Dec-106 22:07:20 Page 4
Assembly Listing of Object Code
121 1 /* remain in loop while the buffer is full. This is done by checking
122 1 the end of buffer index to make sure it does not overrun the
123 1 beginning of buffer index. The while instruction checks the case
124 1 when the end index is one less then the beginning index and at the
125 1 end of the buffer when the beginning index may be equal to 0 and
126 1 the end buffer index may be at the buffer end. */
127 1
128 1 while((end_trans_buff+1==begin_trans_buff)||
129 1 (end_trans_buff==TRANSMIT_BUF_SIZE -1 && !begin_trans_buff));
0033 @0008:
0033 BC041C R ldbse Tmp0,end_trans_buff
0036 071C inc Tmp0
0038 BC031E R ldbse Tmp2,begin_trans_buff
003B 881E1C cmp Tmp0,Tmp2
003E DFF3 be @0007
0040 991304 R cmpb end_trans_buff,#13H
0043 D705 bne @000A
0045 980300 R cmpb R0,begin_trans_buff
0048 DFE9 be @0007
004A @000A:
13 1
131 1 trans_buff[end_trans_buff]=c; /* put character in buffer */
004A B300041C E ldb Tmp0,c[?FRAME01]
004E BC041E R ldbse Tmp2,end_trans_buff
0051 C71F00001C R stb Tmp0,trans_buff[Tmp2]
132 1 if(++end_trans_buff>TRANSMIT_BUF_SIZE - 1) /* make buffer appear */
0056 1704 R incb end_trans_buff
0058 991304 R cmpb end_trans_buff,#13H
005B DA02 ble @000B
133 1 end_trans_buff=0; /* circular. */
005D 1104 R clrb end_trans_buff
005F @000B:
134 1 if(checkbit(sp_status_image, TI_BIT))
005F 5120021C R andb Tmp0,sp_status_image,#2
0063 981C00 cmpb R0,Tmp0
0066 DF03 be @000C
135 1 {
136 2 setbit(int_pend, SERIAL_INT); /* If transmit buffer
0068 914000 E orb int_pending,#4
006B @000C:
137 2 was empty, then cause
138 2 an interrupt to start
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -