                        .module key1.c
                        .area text(rom, con, rel)
 0000                   .dbfile ..\..\..\..\ATTINYÏµÁÐ¿ª·¢°å\ATtiny13¿ª·¢°å×ÊÁÏ\ATtiny13ÊµÀý³ÌÐò\KEY°´~1\key1.c
                        .area data(ram, con, rel)
 0000                   .dbfile ..\..\..\..\ATTINYÏµÁÐ¿ª·¢°å\ATtiny13¿ª·¢°å×ÊÁÏ\ATtiny13ÊµÀý³ÌÐò\KEY°´~1\key1.c
 0000           _i::
 0000                   .blkb 1
                        .area idata
 0000 00                .byte 0
                        .area data(ram, con, rel)
 0001                   .dbfile ..\..\..\..\ATTINYÏµÁÐ¿ª·¢°å\ATtiny13¿ª·¢°å×ÊÁÏ\ATtiny13ÊµÀý³ÌÐò\KEY°´~1\key1.c
 0001                   .dbfile F:\²©¿Æµç×ÓÌÔ±¦µêËùÓÐ×ÊÁÏ\²©¿Æ²úÆ·ÅäÌ×ÎÄ¼þ\AVRÏà¹Ø²úÆ·\ATTINYÏµÁÐ¿ª·¢°å\ATtiny13¿ª·¢°å×ÊÁÏ\ATtiny13ÊµÀý³ÌÐò\KEY°´~1\key1.c
 0001                   .dbsym e i _i c
                        .area text(rom, con, rel)
 0000                   .dbfile F:\²©¿Æµç×ÓÌÔ±¦µêËùÓÐ×ÊÁÏ\²©¿Æ²úÆ·ÅäÌ×ÎÄ¼þ\AVRÏà¹Ø²úÆ·\ATTINYÏµÁÐ¿ª·¢°å\ATtiny13¿ª·¢°å×ÊÁÏ\ATtiny13ÊµÀý³ÌÐò\KEY°´~1\key1.c
 0000                   .dbfunc e delay_us _delay_us fV
 0000           ;           time -> R16,R17
                        .even
 0000           _delay_us::
 0000                   .dbline -1
 0000                   .dbline 19
 0000           ; /****************************************************************************
 0000           ; PB0:LED
 0000           ; PB1:KEY1
 0000           ; PB2:KEY2
 0000           ; PB3:ADC
 0000           ; PB4:LED2
 0000           ; PB5:RESET KEY
 0000           ; */////////////////////////////////////////////////////////////////////////////
 0000           ; #include <iot13v.h>
 0000           ; #include <macros.h>
 0000           ; #define key1  PB2
 0000           ; #define key2  PB4
 0000           ; #define uchar  unsigned char 
 0000           ; #define uint  unsigned int 
 0000           ; uchar i=0;
 0000           ; 
 0000           ; /*Î¢Ãë¼¶ÑÓÊ±³ÌÐò*/
 0000           ; void delay_us(int time)
 0000           ; {     
 0000           L2:
 0000                   .dbline 21
 0000           ;        do
 0000           ;        {
 0000                   .dbline 22
 0000           ;               time--;
 0000 0150              subi R16,1
 0002 1040              sbci R17,0
 0004                   .dbline 23
 0004           ;        }      
 0004           L3:
 0004                   .dbline 24
 0004           ;        while (time>1);
 0004 81E0              ldi R24,1
 0006 90E0              ldi R25,0
 0008 8017              cp R24,R16
 000A 9107              cpc R25,R17
 000C CCF3              brlt L2
 000E           X0:
 000E                   .dbline -2
 000E           L1:
 000E                   .dbline 0 ; func end
 000E 0895              ret
 0010                   .dbsym r time 16 I
 0010                   .dbend
 0010                   .dbfunc e delay_ms _delay_ms fV
 0010           ;           time -> R20,R21
                        .even
 0010           _delay_ms::
 0010 4A93              st -y,R20
 0012 5A93              st -y,R21
 0014 A801              movw R20,R16
 0016                   .dbline -1
 0016                   .dbline 29
 0016           ; }       
 0016           ; 
 0016           ; /*ºÁÃë¼¶ÑÓÊ±³ÌÐò*/     
 0016           ; void delay_ms(unsigned int time)
 0016           ; {
 0016 05C0              xjmp L7
 0018           L6:
 0018                   .dbline 31
 0018           ;        while(time!=0)
 0018           ;        {              
 0018                   .dbline 32
 0018           ;                 delay_us(1000);
 0018 08EE              ldi R16,1000
 001A 13E0              ldi R17,3
 001C F1DF              xcall _delay_us
 001E                   .dbline 33
 001E           ;                 time--;
 001E 4150              subi R20,1
 0020 5040              sbci R21,0
 0022                   .dbline 34
 0022           ;        }
 0022           L7:
 0022                   .dbline 30
 0022 4030              cpi R20,0
 0024 4507              cpc R20,R21
 0026 C1F7              brne L6
 0028           X1:
 0028                   .dbline -2
 0028           L5:
 0028                   .dbline 0 ; func end
 0028 5991              ld R21,y+
 002A 4991              ld R20,y+
 002C 0895              ret
 002E                   .dbsym r time 20 i
 002E                   .dbend
 002E                   .dbfunc e key_scan _key_scan fV
 002E           ;              j -> R16
                        .even
 002E           _key_scan::
 002E                   .dbline -1
 002E                   .dbline 38
 002E           ; }
 002E           ; 
 002E           ; void key_scan(void)
 002E           ; {
 002E                   .dbline 40
 002E           ;     uchar j;
 002E           ;     DDRB|=0X06;  //PB1 PB2ÉèÖÃÎªÊä³ö 
 002E 87B3              in R24,0x17
 0030 8660              ori R24,6
 0032 87BB              out 0x17,R24
 0034                   .dbline 41
 0034           ;       PORTB|=0X06; //PB1 PB2ÉèÖÃÎª1
 0034 88B3              in R24,0x18
 0036 8660              ori R24,6
 0038 88BB              out 0x18,R24
 003A                   .dbline 42
 003A           ;       DDRB&=0Xf9;  //PB1 PB2ÉèÖÃÎªÊäÈë
 003A 87B3              in R24,0x17
 003C 897F              andi R24,249
 003E 87BB              out 0x17,R24
 0040                   .dbline 43
 0040           ;       j=PINB;      //¶ÁÈ¡PB¿ÚµçÆ½
 0040 06B3              in R16,0x16
 0042                   .dbline 44
 0042           ;       i=j&0X06;
 0042 802F              mov R24,R16
 0044 8670              andi R24,6
 0046 80930000          sts _i,R24
 004A                   .dbline -2
 004A           L9:
 004A                   .dbline 0 ; func end
 004A 0895              ret
 004C                   .dbsym r j 16 c
 004C                   .dbend
 004C                   .dbfunc e main _main fV
                        .even
 004C           _main::
 004C                   .dbline -1
 004C                   .dbline 48
 004C           ; }
 004C           ;       
 004C           ; void main(void)
 004C           ; {
 004C                   .dbline 49
 004C           ;       PORTB = 0xff;
 004C 8FEF              ldi R24,255
 004E 88BB              out 0x18,R24
 0050                   .dbline 50
 0050           ;       DDRB = 0xff;    //½«ËùÓÐI/O¿Ú¾ù³õÊ¼»¯ÎªÊä³ö×´Ì¬
 0050 87BB              out 0x17,R24
 0052 12C0              xjmp L12
 0054           L11:
 0054                   .dbline 52
 0054           ;     while(1)
 0054           ;     {
 0054                   .dbline 53
 0054           ;         key_scan();
 0054 ECDF              xcall _key_scan
 0056                   .dbline 54
 0056           ;         switch(i)
 0056 40910000          lds R20,_i
 005A 5527              clr R21
 005C 4230              cpi R20,2
 005E E0E0              ldi R30,0
 0060 5E07              cpc R21,R30
 0062 41F0              breq L18
 0064           X2:
 0064 4430              cpi R20,4
 0066 E0E0              ldi R30,0
 0068 5E07              cpc R21,R30
 006A 09F0              breq L17
 006C           X3:
 006C 05C0              xjmp L14
 006E           L17:
 006E                   .dbline 57
 006E           ;           {
 006E           ;              case 0x04:   
 006E           ;              PORTB=(0<<PB0)|(1<<PB4);
 006E 80E1              ldi R24,16
 0070 88BB              out 0x18,R24
 0072                   .dbline 58
 0072           ;                  break;
 0072 02C0              xjmp L15
 0074           L18:
 0074                   .dbline 60
 0074           ;              case 0x02: 
 0074           ;              PORTB=(1<<PB0)|(0<<PB4);
 0074 81E0              ldi R24,1
 0076 88BB              out 0x18,R24
 0078                   .dbline 61
 0078           ;                  break;
 0078           L14:
 0078           L15:
 0078                   .dbline 63
 0078           ;           }
 0078           ;    }
 0078           L12:
 0078                   .dbline 51
 0078 EDCF              xjmp L11
 007A           X4:
 007A                   .dbline -2
 007A           L10:
 007A                   .dbline 0 ; func end
 007A 0895              ret
 007C                   .dbend
 007C           ;  }
