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

📄 led.lis

📁 使用Atmel88芯片实现RS485通讯,Modbus通讯协议.在IVR_AVR环境中编译,文件完整.
💻 LIS
📖 第 1 页 / 共 2 页
字号:
                        .module led.c
                        .area text(rom, con, rel)
 0000                   .dbfile D:\ICCTES~1\1128\led.c
 0000                   .dbfunc e light_0 _light_0 fV
                        .even
 0000           _light_0::
 0000                   .dbline -1
 0000                   .dbline 17
 0000           ; //LED device
 0000           ; #include <iom48v.h>
 0000           ; #include <macros.h>
 0000           ; #include "main.h"
 0000           ; #include "modbus.h"
 0000           ; #include "timer2.h"   
 0000           ; 
 0000           ; static char aloneD[4];
 0000           ; 
 0000           ; //led
 0000           ; void (*pcled[10])(void);  //定义函数指针数组.
 0000           ; unsigned int LedShowLink;
 0000           ; 
 0000           ; // PB0  PB1  PB2  PB3  PB4  PB5  PD6  PD7
 0000           ; //  A    B    C    D    E    F    G   dp
 0000           ; void light_0(void)
 0000           ; {
 0000                   .dbline 19
 0000           ;      //0000'0011
 0000           ;       PORTB &= 0xc0;
 0000 85B1              in R24,0x5
 0002 807C              andi R24,192
 0004 85B9              out 0x5,R24
 0006                   .dbline 20
 0006           ;       PORTD |= 0x40; 
 0006 5E9A              sbi 0xb,6
 0008                   .dbline -2
 0008           L5:
 0008                   .dbline 0 ; func end
 0008 0895              ret
 000A                   .dbend
 000A                   .dbfunc e light_1 _light_1 fV
                        .even
 000A           _light_1::
 000A                   .dbline -1
 000A                   .dbline 24
 000A           ; }
 000A           ; 
 000A           ; void light_1(void)
 000A           ; {    //0010'0101
 000A                   .dbline 25
 000A           ;        PORTB &= 0b11111001;
 000A 85B1              in R24,0x5
 000C 897F              andi R24,249
 000E 85B9              out 0x5,R24
 0010                   .dbline 26
 0010           ;        PORTB |= 0b00111001;
 0010 85B1              in R24,0x5
 0012 8963              ori R24,57
 0014 85B9              out 0x5,R24
 0016                   .dbline 27
 0016           ;        PORTD |= 0b01000000;
 0016 5E9A              sbi 0xb,6
 0018                   .dbline -2
 0018           L6:
 0018                   .dbline 0 ; func end
 0018 0895              ret
 001A                   .dbend
 001A                   .dbfunc e light_2 _light_2 fV
                        .even
 001A           _light_2::
 001A                   .dbline -1
 001A                   .dbline 31
 001A           ; }
 001A           ; 
 001A           ; void light_2(void)
 001A           ; {    //0010'0101
 001A                   .dbline 32
 001A           ;        PORTB &= 0b11100100;
 001A 85B1              in R24,0x5
 001C 847E              andi R24,228
 001E 85B9              out 0x5,R24
 0020                   .dbline 33
 0020           ;        PORTB |= 0b00100100;
 0020 85B1              in R24,0x5
 0022 8462              ori R24,36
 0024 85B9              out 0x5,R24
 0026                   .dbline 34
 0026           ;        PORTD &= 0b10111111;
 0026 8BB1              in R24,0xb
 0028 8F7B              andi R24,191
 002A 8BB9              out 0xb,R24
 002C                   .dbline -2
 002C           L7:
 002C                   .dbline 0 ; func end
 002C 0895              ret
 002E                   .dbend
 002E                   .dbfunc e light_3 _light_3 fV
                        .even
 002E           _light_3::
 002E                   .dbline -1
 002E                   .dbline 38
 002E           ; }
 002E           ; 
 002E           ; void light_3(void)
 002E           ; {    //0000'1101
 002E                   .dbline 39
 002E           ;        PORTB &= 0b11110000;
 002E 85B1              in R24,0x5
 0030 807F              andi R24,240
 0032 85B9              out 0x5,R24
 0034                   .dbline 40
 0034           ;        PORTB |= 0b00110000;
 0034 85B1              in R24,0x5
 0036 8063              ori R24,48
 0038 85B9              out 0x5,R24
 003A                   .dbline 41
 003A           ;        PORTD &= 0b10111111;
 003A 8BB1              in R24,0xb
 003C 8F7B              andi R24,191
 003E 8BB9              out 0xb,R24
 0040                   .dbline -2
 0040           L8:
 0040                   .dbline 0 ; func end
 0040 0895              ret
 0042                   .dbend
 0042                   .dbfunc e light_4 _light_4 fV
                        .even
 0042           _light_4::
 0042                   .dbline -1
 0042                   .dbline 45
 0042           ; }
 0042           ; 
 0042           ; void light_4(void)
 0042           ; {      //1001'1001
 0042                   .dbline 46
 0042           ;        PORTB &= 0b11011001;
 0042 85B1              in R24,0x5
 0044 897D              andi R24,217
 0046 85B9              out 0x5,R24
 0048                   .dbline 47
 0048           ;        PORTB |= 0b00011001;
 0048 85B1              in R24,0x5
 004A 8961              ori R24,25
 004C 85B9              out 0x5,R24
 004E                   .dbline 48
 004E           ;        PORTD &= 0b10111111;    
 004E 8BB1              in R24,0xb
 0050 8F7B              andi R24,191
 0052 8BB9              out 0xb,R24
 0054                   .dbline -2
 0054           L9:
 0054                   .dbline 0 ; func end
 0054 0895              ret
 0056                   .dbend
 0056                   .dbfunc e light_5 _light_5 fV
                        .even
 0056           _light_5::
 0056                   .dbline -1
 0056                   .dbline 52
 0056           ; }
 0056           ; 
 0056           ; void light_5(void)
 0056           ; {      //01001001
 0056                   .dbline 53
 0056           ;        PORTB &= 0b11010010;
 0056 85B1              in R24,0x5
 0058 827D              andi R24,210
 005A 85B9              out 0x5,R24
 005C                   .dbline 54
 005C           ;        PORTB |= 0b00010010;
 005C 85B1              in R24,0x5
 005E 8261              ori R24,18
 0060 85B9              out 0x5,R24
 0062                   .dbline 55
 0062           ;        PORTD &= 0b10111111;   
 0062 8BB1              in R24,0xb
 0064 8F7B              andi R24,191
 0066 8BB9              out 0xb,R24
 0068                   .dbline -2
 0068           L10:
 0068                   .dbline 0 ; func end
 0068 0895              ret
 006A                   .dbend
 006A                   .dbfunc e light_6 _light_6 fV
                        .even
 006A           _light_6::
 006A                   .dbline -1
 006A                   .dbline 59
 006A           ; }
 006A           ; 
 006A           ; void light_6(void)
 006A           ; {   //01000001
 006A                   .dbline 60
 006A           ;        PORTB &= 0b11000010;
 006A 85B1              in R24,0x5
 006C 827C              andi R24,194
 006E 85B9              out 0x5,R24
 0070                   .dbline 61
 0070           ;        PORTB |= 0b00000010;
 0070 299A              sbi 0x5,1
 0072                   .dbline 62
 0072           ;        PORTD &= 0b10111111;
 0072 8BB1              in R24,0xb
 0074 8F7B              andi R24,191
 0076 8BB9              out 0xb,R24
 0078                   .dbline -2
 0078           L11:
 0078                   .dbline 0 ; func end
 0078 0895              ret
 007A                   .dbend
 007A                   .dbfunc e light_7 _light_7 fV
                        .even
 007A           _light_7::
 007A                   .dbline -1
 007A                   .dbline 66
 007A           ; }
 007A           ; 
 007A           ; void light_7(void)
 007A           ; {   //00011111
 007A                   .dbline 67
 007A           ;        PORTB &= 0b11111000;
 007A 85B1              in R24,0x5
 007C 887F              andi R24,248
 007E 85B9              out 0x5,R24
 0080                   .dbline 68
 0080           ;        PORTB |= 0b00111000;
 0080 85B1              in R24,0x5
 0082 8863              ori R24,56
 0084 85B9              out 0x5,R24
 0086                   .dbline 69
 0086           ;        PORTD |= 0b01000000;
 0086 5E9A              sbi 0xb,6
 0088                   .dbline -2
 0088           L12:
 0088                   .dbline 0 ; func end
 0088 0895              ret
 008A                   .dbend
 008A                   .dbfunc e light_8 _light_8 fV
                        .even
 008A           _light_8::
 008A                   .dbline -1
 008A                   .dbline 73
 008A           ; }
 008A           ; 
 008A           ; void light_8(void)
 008A           ; {   //00000001
 008A                   .dbline 74
 008A           ;       PORTB &= 0b11000000;
 008A 85B1              in R24,0x5
 008C 807C              andi R24,192
 008E 85B9              out 0x5,R24
 0090                   .dbline 76
 0090           ;       //
 0090           ;       PORTD &= 0b10111111; 
 0090 8BB1              in R24,0xb
 0092 8F7B              andi R24,191
 0094 8BB9              out 0xb,R24
 0096                   .dbline -2
 0096           L13:
 0096                   .dbline 0 ; func end
 0096 0895              ret
 0098                   .dbend
 0098                   .dbfunc e light_9 _light_9 fV
                        .even
 0098           _light_9::
 0098                   .dbline -1
 0098                   .dbline 80
 0098           ; }
 0098           ; 
 0098           ; void light_9(void)
 0098           ; {    //00001001
 0098                   .dbline 81
 0098           ;        PORTB &= 0b11010000;
 0098 85B1              in R24,0x5
 009A 807D              andi R24,208
 009C 85B9              out 0x5,R24
 009E                   .dbline 82
 009E           ;        PORTB |= 0b00010000;
 009E 2C9A              sbi 0x5,4
 00A0                   .dbline 83
 00A0           ;        PORTD &= 0b10111111;
 00A0 8BB1              in R24,0xb
 00A2 8F7B              andi R24,191
 00A4 8BB9              out 0xb,R24
 00A6                   .dbline -2
 00A6           L14:
 00A6                   .dbline 0 ; func end
 00A6 0895              ret
 00A8                   .dbend
 00A8                   .dbfunc e led_init _led_init fV
                        .even
 00A8           _led_init::
 00A8                   .dbline -1
 00A8                   .dbline 88
 00A8           ; }
 00A8           ; 
 00A8           ; 
 00A8           ; void led_init(void)
 00A8           ; {
 00A8                   .dbline 90
 00A8           ;     //段码   1: output;  0: input.
 00A8           ;        DDRD |= 0xc0;  // 0b1100'0000
 00A8 8AB1              in R24,0xa
 00AA 806C              ori R24,192
 00AC 8AB9              out 0xa,R24
 00AE                   .dbline 91
 00AE           ;        DDRB |= 0x3f;  // 0b0011'1111 
 00AE 84B1              in R24,0x4
 00B0 8F63              ori R24,63
 00B2 84B9              out 0x4,R24
 00B4                   .dbline 93
 00B4           ; //位码
 00B4           ;        DDRC |= 0x3c;  // 0b0011'1100 
 00B4 87B1              in R24,0x7
 00B6 8C63              ori R24,60
 00B8 87B9              out 0x7,R24
 00BA                   .dbline 95
 00BA           ; //
 00BA           ;      PORTC &= 0b11011111;             
 00BA 88B1              in R24,0x8
 00BC 8F7D              andi R24,223
 00BE 88B9              out 0x8,R24
 00C0                   .dbline 96
 00C0           ;        PORTC |= 0b00100000;   
 00C0 459A              sbi 0x8,5
 00C2                   .dbline 97
 00C2           ;        PORTC &= 0b11011111;
 00C2 88B1              in R24,0x8
 00C4 8F7D              andi R24,223
 00C6 88B9              out 0x8,R24
 00C8                   .dbline 98
 00C8           ;        PORTC |= 0b00010000;   
 00C8 449A              sbi 0x8,4
 00CA                   .dbline 99
 00CA           ;        PORTC &= 0b11101111;                    
 00CA 88B1              in R24,0x8
 00CC 8F7E              andi R24,239
 00CE 88B9              out 0x8,R24
 00D0                   .dbline 101
 00D0           ;       //连接
 00D0           ;       pcled[0] =  light_0;
 00D0 80E0              ldi R24,<PL_light_0
 00D2 90E0              ldi R25,>PL_light_0
 00D4 90930500          sts _pcled+1,R25
 00D8 80930400          sts _pcled,R24
 00DC                   .dbline 102
 00DC           ;       pcled[1] =  light_1; 

⌨️ 快捷键说明

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