📄 funcation.s
字号:
.module funcation.c
.area text(rom, con, rel)
.dbfile E:\company\hardware\eboda\LCD_TV\TV_power_tester\funcation.c
.dbfunc e DELAY_10uS _DELAY_10uS fV
; a -> R20,R21
; b -> R22,R23
; i -> R16,R17
.even
_DELAY_10uS::
rcall push_gset2
.dbline -1
.dbline 7
; #include <iom8v.h>
; #include <define.h>
;
;
; /********************DELAY_10uS***************************/
; void DELAY_10uS(unsigned int i)
; { unsigned int a, b;
.dbline 8
; for( a=i;a;a--)
movw R20,R16
rjmp L5
L2:
.dbline 9
ldi R22,14
ldi R23,0
rjmp L9
L6:
.dbline 9
L7:
.dbline 9
subi R22,1
sbci R23,0
L9:
.dbline 9
cpi R22,0
cpc R22,R23
brne L6
X0:
L3:
.dbline 8
subi R20,1
sbci R21,0
L5:
.dbline 8
cpi R20,0
cpc R20,R21
brne L2
X1:
.dbline -2
L1:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r a 20 i
.dbsym r b 22 i
.dbsym r i 16 i
.dbend
.dbfunc e DELAY_100uS _DELAY_100uS fV
; a -> R20,R21
; b -> R22,R23
; i -> R20,R21
.even
_DELAY_100uS::
rcall push_gset2
movw R20,R16
.dbline -1
.dbline 16
; for(b=14;b;b--);// a=1 &b=14 for 10us
; }
; /**********************DELAY_10uS****************************/
;
;
; /********************DELAY_100uS***************************/
; void DELAY_100uS(unsigned int i)
; { unsigned int a, b;
.dbline 17
; for( a=i*10;a;a--)
ldi R16,10
ldi R17,0
movw R18,R20
rcall empy16s
movw R20,R16
rjmp L14
L11:
.dbline 18
ldi R22,23
ldi R23,0
rjmp L18
L15:
.dbline 18
L16:
.dbline 18
subi R22,1
sbci R23,0
L18:
.dbline 18
cpi R22,0
cpc R22,R23
brne L15
X2:
L12:
.dbline 17
subi R20,1
sbci R21,0
L14:
.dbline 17
cpi R20,0
cpc R20,R21
brne L11
X3:
.dbline -2
L10:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r a 20 i
.dbsym r b 22 i
.dbsym r i 20 i
.dbend
.dbfunc e DELAY_1MS _DELAY_1MS fV
; a -> R20,R21
; b -> R22,R23
; i -> R20,R21
.even
_DELAY_1MS::
rcall push_gset2
movw R20,R16
.dbline -1
.dbline 24
; for(b=23;b;b--);// a=10 &b=23 for 100us
; }
; /**********************DELAY_100uS****************************/
;
; /********************DELAY_1MS***************************/
; void DELAY_1MS(unsigned int i)
; { unsigned int a, b;
.dbline 25
; for( a=i*10;a;a--)
ldi R16,10
ldi R17,0
movw R18,R20
rcall empy16s
movw R20,R16
rjmp L23
L20:
.dbline 26
ldi R22,270
ldi R23,1
rjmp L27
L24:
.dbline 26
L25:
.dbline 26
subi R22,1
sbci R23,0
L27:
.dbline 26
cpi R22,0
cpc R22,R23
brne L24
X4:
L21:
.dbline 25
subi R20,1
sbci R21,0
L23:
.dbline 25
cpi R20,0
cpc R20,R21
brne L20
X5:
.dbline -2
L19:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r a 20 i
.dbsym r b 22 i
.dbsym r i 20 i
.dbend
.dbfunc e DELAY_10MS _DELAY_10MS fV
; a -> R20,R21
; b -> R22,R23
; i -> R20,R21
.even
_DELAY_10MS::
rcall push_gset2
movw R20,R16
.dbline -1
.dbline 33
; for(b=270;b;b--);
; }
; /**********************DELAY_1MS****************************/
;
;
; /********************DELAY_10MS***************************/
; void DELAY_10MS(unsigned int i)
; { unsigned int a, b;
.dbline 34
; for( a=i*100;a;a--)
ldi R16,100
ldi R17,0
movw R18,R20
rcall empy16s
movw R20,R16
rjmp L32
L29:
.dbline 35
ldi R22,270
ldi R23,1
rjmp L36
L33:
.dbline 35
L34:
.dbline 35
subi R22,1
sbci R23,0
L36:
.dbline 35
cpi R22,0
cpc R22,R23
brne L33
X6:
L30:
.dbline 34
subi R20,1
sbci R21,0
L32:
.dbline 34
cpi R20,0
cpc R20,R21
brne L29
X7:
.dbline -2
L28:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r a 20 i
.dbsym r b 22 i
.dbsym r i 20 i
.dbend
.dbfunc e DELAY_1S _DELAY_1S fV
; a -> R20,R21
; b -> R22,R23
; i -> R20,R21
.even
_DELAY_1S::
rcall push_gset2
movw R20,R16
.dbline -1
.dbline 41
; for(b=270;b;b--);//A=100 AND B=270 FOR 10MS
; }
; /**********************DELAY_10MS****************************/
;
; /********************DELAY_1S***************************/
; void DELAY_1S(unsigned int i)
; { unsigned int a, b;
.dbline 42
; for( a=i*100;a;a--)
ldi R16,100
ldi R17,0
movw R18,R20
rcall empy16s
movw R20,R16
rjmp L41
L38:
.dbline 43
ldi R22,20000
ldi R23,78
rjmp L45
L42:
.dbline 43
L43:
.dbline 43
subi R22,1
sbci R23,0
L45:
.dbline 43
cpi R22,0
cpc R22,R23
brne L42
X8:
L39:
.dbline 42
subi R20,1
sbci R21,0
L41:
.dbline 42
cpi R20,0
cpc R20,R21
brne L38
X9:
.dbline -2
L37:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r a 20 i
.dbsym r b 22 i
.dbsym r i 20 i
.dbend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -