?? unit.s
字號:
.module unit.c
.area text(rom, con, rel)
.dbfile C:\DOCUME~1\Administrator\桌面\小車尋跡\unit.c
.dbfunc e Delay100us _Delay100us fV
; i -> R20
; n -> R16
.even
_Delay100us::
xcall push_gset1
.dbline -1
.dbline 7
; #include "config.h"
; /***************************************************************************
; 延時公式
;
; */
; void Delay100us(uint8 n)
; {
.dbline 9
; uint8 i; //4clock
; for(i=147;n!=0;n--)
ldi R20,147
xjmp L5
L6:
.dbline 10
L7:
.dbline 10
mov R24,R20
subi R24,1
mov R20,R24
tst R24
brne L6
L3:
.dbline 9
dec R16
L5:
.dbline 9
tst R16
brne L7
.dbline -2
L1:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r n 16 c
.dbend
.dbfunc e Delay1ms _Delay1ms fV
; n -> R20,R21
.even
_Delay1ms::
xcall push_gset1
movw R20,R16
.dbline -1
.dbline 13
; while(--i); //5 * i clock
; }
; void Delay1ms(uint16 n)
; {
.dbline 14
xjmp L13
L10:
.dbline 14
.dbline 15
ldi R16,10
xcall _Delay100us
.dbline 16
L11:
.dbline 14
subi R20,1
sbci R21,0
L13:
.dbline 14
; for (;n!=0;n--){
cpi R20,0
cpc R20,R21
brne L10
X0:
.dbline -2
L9:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r n 20 i
.dbend
.dbfunc e Delay1s _Delay1s fV
; n -> R20,R21
.even
_Delay1s::
xcall push_gset1
movw R20,R16
.dbline -1
.dbline 19
; Delay100us(10);
; }
; }
; void Delay1s(uint16 n)
; {
.dbline 20
; n=n*40;
ldi R16,40
ldi R17,0
movw R18,R20
xcall empy16s
movw R20,R16
.dbline 21
xjmp L18
L15:
.dbline 21
.dbline 22
ldi R16,250
xcall _Delay100us
.dbline 23
L16:
.dbline 21
subi R20,1
sbci R21,0
L18:
.dbline 21
; for (;n!=0;n--){
cpi R20,0
cpc R20,R21
brne L15
X1:
.dbline -2
L14:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r n 20 i
.dbend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -