📄 example3.s
字号:
.module example3.c
.area text(rom, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
_table::
.blkb 2
.area idata
.byte 63,6
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.blkb 2
.area idata
.byte 91,'O
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.blkb 2
.area idata
.byte 'f,'m
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.blkb 2
.area idata
.byte 125,7
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.blkb 2
.area idata
.byte 127,'o
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.blkb 2
.area idata
.byte 'w,124
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.blkb 2
.area idata
.byte 57,94
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.blkb 2
.area idata
.byte 'y,'q
.area data(ram, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.dbsym e table _table A[16:16]c
.area text(rom, con, rel)
.dbfile G:\学习\avr\天祥电子AVR视频教程\chengxu\example\example3.c
.dbfunc e delay _delay fV
; i -> R20,R21
; j -> R22,R23
; ms -> R16,R17
.even
_delay::
xcall push_xgsetF000
.dbline -1
.dbline 8
; #include<iom16v.h>
; #include<macros.h>
; #define uchar unsigned char
; #define uint unsigned int
; uchar table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, 0x07,
; 0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
; void delay(uint ms)
; {
.dbline 10
; uint i,j;
; for(i=0;i<ms;i++)
clr R20
clr R21
xjmp L5
L2:
.dbline 11
; {
.dbline 12
; for(j=0;j<1141;j++);
clr R22
clr R23
xjmp L9
L6:
.dbline 12
L7:
.dbline 12
subi R22,255 ; offset = 1
sbci R23,255
L9:
.dbline 12
cpi R22,117
ldi R30,4
cpc R23,R30
brlo L6
X0:
.dbline 13
; }
L3:
.dbline 10
subi R20,255 ; offset = 1
sbci R21,255
L5:
.dbline 10
cp R20,R16
cpc R21,R17
brlo L2
X1:
.dbline -2
L1:
.dbline 0 ; func end
xjmp pop_xgsetF000
.dbsym r i 20 i
.dbsym r j 22 i
.dbsym r ms 16 i
.dbend
.dbfunc e show _show fV
; k -> R1
; j -> R0
.even
_show::
.dbline 0 ; func end
ret
.dbsym l k 2 c
.dbsym l j 0 c
.dbend
.dbfunc e main _main fV
.even
_main::
.dbline 0 ; func end
ret
.dbend
; }
; void show(uchar j,uchar k)
; {
; PORTA|=BIT(3);
; PORTB=table(j);
; PORTA&=~BIT(3);
; PORTB=0XFF;
; PORTB&=~BIT(K)
; PORTA|=BIT(4)
; PORTA&=~BIT(4)
; delay (50);
; }
; void main()
; {
; uchar i,j;
; DDRA=0xff;
; DDRB=0xff;
; while(1)
; {
; for(i=0;i<3;i++)
; show(i,i)
; }
; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -