单片机开发资料光盘-双龙-686M.zip
源代码在线查看: triangularwave.s
.module TriangularWave.c
.area text
.dbfile E:\grc\licc\例子10.4.2\TriangularWave.c
.dbfunc s delay _delay fI
.even
_delay::
.dbline 6{
; #include
; #include
; #define uchar unsigned char
; #define uint unsigned int
; void delay(void)
; {
.dbline 7}
; }
L1:
ret
.dbfunc s main _main fI
; c -> R20
.even
_main::
.dbline 9{
; void main(void)
; {
.dbline 11
; uchar c;
; DDRA=0xff;
ldi R24,255
out 0x1a,R24
.dbline 12
; for (;;)
L3:
.dbline 13
; {
.dbline 14
; for (c=0x00;c clr R20
rjmp L10
L7:
.dbline 15
.dbline 16
out 0x1b,R20
.dbline 17
rcall _delay
.dbline 18
L8:
.dbline 14
inc R20
L10:
.dbline 14
cpi R20,255
brlo L7
.dbline 19
; {
; PORTA=c;
; delay();
; }
; for (c=0xff;c>0x00;c--)
ldi R20,255
rjmp L14
L11:
.dbline 20
.dbline 21
out 0x1b,R20
.dbline 22
rcall _delay
.dbline 23
L12:
.dbline 19
dec R20
L14:
.dbline 19
clr R2
cp R2,R20
brlo L11
.dbline 24
; {
; PORTA=c;
; delay();
; }
; }
.dbline 12
.dbline 12
rjmp L3
X0:
L2:
ret
.dbline 13}
.dbsym r c 20 c