⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pyzc3.lst

📁 基于80196KB开发的C程序,在伟福和星研环境中编译通过,用于学习8096系列单片机的中断编程技术.并成功地用于某地机动车检测业务.
💻 LST
📖 第 1 页 / 共 4 页
字号:
C196  Compiler   pyzc3                                                                      14-Dec-106 09:06:41  Page   1


80C196 C compiler v5.0 r3              SN000000-194 (C)1996 Tasking Software BV
Object module placed in pyzc3.obj
Compiler invoked by: C:\XINGYAN\C196\BIN\C196.EXE pyzc3.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   pyzc3                                                                      14-Dec-106 09:06:41  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             
   66             
   67             /****************************************************************************/
   68             /*                                                                          */
   69             /* Usefull bit macros.                                                      */
   7              /*                                                                          */
   71             /****************************************************************************/
   72             
   73             #define   checkbit(var,bit)  (var & (0x01 << (bit)))
   74             #define   setbit(var,bit)    (var |= (0x01 << (bit)))
   75             #define   clrbit(var,bit)    (var &= (~(0x01 << (bit))))
   76             
   77             static unsigned char sp_status_image;
   78             register unsigned int tmpreg;
   79             #pragma interrupt(serial_isr=6)
   8              #pragma interrupt (tovf_isr = TOVF_INT)
   81             const unsigned int            ccr = {0x20CD};
   82             #pragma locate(ccr=0x2018)
   83             
   84             #define TRANSMIT_BUF_SIZE 20
   85             #define RECEIVE_BUF_SIZE 20
   86             
   87             static unsigned char trans_buff[TRANSMIT_BUF_SIZE];
   88             static unsigned char mess[10]={'S',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'E'};
   89             static char begin_trans_buff,end_trans_buff;
   9              
   91             static unsigned char receive_buff[RECEIVE_BUF_SIZE];
   92             static char end_rec_buff,begin_rec_buff;
   93             static unsigned char pwm0_byte,ioport1_byte,hso_byte;
   94             static unsigned char timer1_count=0,triggle_out=0,triggle_in=0;
   95             extern void enable(void);
   96             
   97             void tovf_isr(void)
   98             {
          0000                        tovf_isr: 
          0000  F2                           pushf   
   99     1          /* User code goes here */
  1       1        if(++timer1_count==12)
          0001  1700               R         incb    timer1_count
          0003  990C00             R         cmpb    timer1_count,#0CH
          0006  D705                         bne     @0002
C196  Compiler   pyzc3                                                                      14-Dec-106 09:06:41  Page   3
                 Assembly Listing of Object Code


  1       1        {
  1       2         triggle_out=1;
          0008  B10101             R         ldb     triggle_out,#1
  1       2         timer1_count=0;
          000B  1100               R         clrb    timer1_count
          000D                        @0002: 
  1       2        }   
  1       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

  1               
  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
  11      1                                               sp_status_image  */
  111     1       
  112     1       /*   transmit a character if there is a character in the buffer
  113     1            else leave TI_BIT set in image for putchar to enable interrupts   */
  114     1       if(begin_trans_buff!=end_trans_buff)
          0012  980403             R         cmpb    begin_trans_buff,end_trans_buff
          0015  DF14                         be      @0004
  115     1            {
  116     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]
  117     2       
  118     2       /*   The next statement makes the buffer circular by starting over when the
  119     2            index reaches the end of the buffer.   */
  12      2       
  121     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: 
  122     2            clrbit(sp_status_image,TI_BIT);     /*  clear TI bit in status_image.   */
          0028  71DF02             R         andb    sp_status_image,#0DFH
          002B                        @0004: 
  123     2            }
  124     1       }
          002B  F0                           ret     
                                      
                ; Function Statistics for: transmit
                ;    Code Size :   29     Parameter Count:   
                ;    Stack Size:         Parameter Size :   
                ;    OReg Size :         Stack Depth    :   

  125             
C196  Compiler   pyzc3                                                                      14-Dec-106 09:06:41  Page   4
                 Assembly Listing of Object Code


  126             int putchar(int c)
  127             {
          002C                        putchar: 
          002C  C800               E         push    ?FRAME01
          002E  A01800             E         ld      ?FRAME01,SP
          0031  2000                         br      @0008
          0033                        @0007: 
  128     1       /*   remain in loop while the buffer is full.  This is done by checking
  129     1            the end of buffer index to make sure it does not overrun the
  13      1            beginning of buffer index.   The while instruction checks the case
  131     1            when the end index is one less then the beginning index and at the
  132     1            end of the buffer when the beginning index may be equal to 0 and
  133     1            the end buffer index may be at the buffer end.   */
  134     1       
  135     1       while((end_trans_buff+1==begin_trans_buff)||
  136     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: 
  137     1       
  138     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]
  139     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
  14      1            end_trans_buff=0;                       /*  circular.           */
          005D  1104               R         clrb    end_trans_buff
          005F                        @000B: 
  141     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
  142     1            {
  143     2            setbit(int_pend, SERIAL_INT);  /*     If transmit buffer
          0068  914000             E         orb     int_pending,#4
          006B                        @000C: 
  144     2                                   was empty, then cause
  145     2                                   an interrupt to start
  146     2                                   transmitting.  */
  147     2          }
  148     1       }
          006B  CC00               E         pop     ?FRAME01
          006D  F0                           ret     
                                      
                ; Function Statistics for: putchar
C196  Compiler   pyzc3                                                                      14-Dec-106 09:06:41  Page   5
                 Assembly Listing of Object Code


                ;    Code Size :   66     Parameter Count:   1
                ;    Stack Size:         Parameter Size :   2
                ;    OReg Size :         Stack Depth    :   2

  149             
  15              unsigned char getchar()
  151             {
          006E                        getchar: 
          006E  2000                         br      @000F
          0070                        @000E: 
  152     1       while(begin_rec_buff==end_rec_buff);  /*  remain in loop while there is
          0070                        @000F: 
          0070  980506             R         cmpb    begin_rec_buff,end_rec_buff
          0073  DFFB                         be      @000E
  153     1                        not a character avaliable. */
  154     1       if(++begin_rec_buff>RECEIVE_BUF_SIZE - 1)  /*  make buffer appear    */
          0075  1706               R         incb    begin_rec_buff
          0077  991306             R         cmpb    begin_rec_buff,#13H
          007A  DA02                         ble     @0011
  155     1            begin_rec_buff=0;                     /*  circular.  */
          007C  1106               R         clrb    begin_rec_buff

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -