📄 fil10.asm
字号:
mov _P2,#0xFF
;c:/hj51avr/code/c/fil10.c:60: P3_7 = 0; //关闭蜂鸣器
; genAssign
clr _P3_7
;c:/hj51avr/code/c/fil10.c:62: Counts = 0;
; genAssign
clr a
mov (_Counts + 3),a
mov (_Counts + 2),a
mov (_Counts + 1),a
mov _Counts,a
;c:/hj51avr/code/c/fil10.c:63: times = 0;
; genAssign
mov _times,#0x00
;c:/hj51avr/code/c/fil10.c:65: ET0 = 1; // 外部计数触发方式下降沿方式
; genAssign
setb _ET0
;c:/hj51avr/code/c/fil10.c:66: TMOD = 0x01; // 计数器工作在方式 0
; genAssign
mov _TMOD,#0x01
;c:/hj51avr/code/c/fil10.c:67: EX0 = 1;
; genAssign
setb _EX0
;c:/hj51avr/code/c/fil10.c:68: TR0 =1; //打开定时器T0
; genAssign
setb _TR0
;c:/hj51avr/code/c/fil10.c:71: EA =1; // 中断总允许
; genAssign
setb _EA
;c:/hj51avr/code/c/fil10.c:75: while(1) //设置一个无限制循环
00102$:
;c:/hj51avr/code/c/fil10.c:77: P1_0 =~P1_0; //翻转 P1.0 作为外部中断源
; genCpl
; Peephole 167 removed redundant bit moves (c not set to _P1_0)
cpl _P1_0
;c:/hj51avr/code/c/fil10.c:79: DIS_NUM(scount);
; genCast
mov dpl,_scount
mov dph,(_scount + 1)
; genCall
lcall _DIS_NUM
; Peephole 112.b changed ljmp to sjmp
sjmp 00102$
00104$:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'delay'
;------------------------------------------------------------
;times Allocated to registers r2
;t Allocated to registers r3 r4
;i Allocated to registers
;------------------------------------------------------------
;c:/hj51avr/code/c/fil10.c:86: void delay(unsigned char times)
; -----------------------------------------
; function delay
; -----------------------------------------
_delay:
; genReceive
mov r2,dpl
;c:/hj51avr/code/c/fil10.c:88: int t=15000; //延时倍数
; genAssign
mov r3,#0x98
mov r4,#0x3A
;c:/hj51avr/code/c/fil10.c:89: unsigned char i=times;
; genAssign
00105$:
;c:/hj51avr/code/c/fil10.c:90: for(;i!=0;i--)
; genCmpEq
cjne r2,#0x00,00114$
; Peephole 112.b changed ljmp to sjmp
sjmp 00109$
00114$:
; genAssign
mov ar5,r3
mov ar6,r4
00101$:
;c:/hj51avr/code/c/fil10.c:91: {for(;t!=0;t--){}}
; genCmpEq
; Peephole 241.b optimized compare
clr a
cjne r5,#0x00,00115$
cjne r6,#0x00,00115$
inc a
00115$:
00116$:
mov r7,a
; genAssign
mov ar3,r5
mov ar4,r6
; genIfx
mov a,r7
; genIfxJump
; Peephole 109 removed ljmp by inverse jump logic
jnz 00107$
00117$:
; genMinus
; genMinusDec
; tail decrement optimized
dec r5
cjne r5,#0xff,00101$
dec r6
; Peephole 112.b changed ljmp to sjmp
sjmp 00101$
00107$:
;c:/hj51avr/code/c/fil10.c:90: for(;i!=0;i--)
; genMinus
; genMinusDec
dec r2
; Peephole 112.b changed ljmp to sjmp
sjmp 00105$
00109$:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'display'
;------------------------------------------------------------
;disdata Allocated with name '_display_PARM_2'
;disseg Allocated to registers r2
;dataf Allocated to registers r3
;------------------------------------------------------------
;c:/hj51avr/code/c/fil10.c:101: void display(unsigned char disseg,unsigned char disdata)
; -----------------------------------------
; function display
; -----------------------------------------
_display:
; genReceive
mov r2,dpl
;c:/hj51avr/code/c/fil10.c:104: if(disseg < 8) //只有当要显示的位数有效,才显示.否则,不显示
; genCmpLt
; genCmp
cjne r2,#0x08,00112$
00112$:
; genIfxJump
; Peephole 108 removed ljmp by inverse jump logic
jnc 00105$
00113$:
;c:/hj51avr/code/c/fil10.c:106: dataf = 1;
; genAssign
mov r3,#0x01
;c:/hj51avr/code/c/fil10.c:107: while(disseg)
; genAssign
00101$:
; genIfx
mov a,r2
; genIfxJump
; Peephole 110 removed ljmp by inverse jump logic
jz 00103$
00114$:
;c:/hj51avr/code/c/fil10.c:109: dataf <<= 1;
; genLeftShift
; genLeftShiftLiteral
; genlshOne
mov a,r3
add a,acc
mov r3,a
;c:/hj51avr/code/c/fil10.c:110: disseg--;
; genMinus
; genMinusDec
dec r2
; Peephole 112.b changed ljmp to sjmp
sjmp 00101$
00103$:
;c:/hj51avr/code/c/fil10.c:112: sege = 0;
; genAssign
clr _P2_7
;c:/hj51avr/code/c/fil10.c:113: segdata = dataf; //这里首先把要显示的数据放到数据总线
; genAssign
mov _P0,r3
;c:/hj51avr/code/c/fil10.c:114: segb = 1; //这里给出一个脉冲,数据送往位选端
; genAssign
setb _P2_6
;c:/hj51avr/code/c/fil10.c:115: segb = 0;
; genAssign
clr _P2_6
;c:/hj51avr/code/c/fil10.c:117: segdata = disbuf_u[disdata];
; genPlus
mov a,_display_PARM_2
; Peephole 181 changed mov to clr
; genPointerGet
; genCodePointerGet
; Peephole 181 changed mov to clr
; Peephole 186.d optimized movc sequence
mov dptr,#_disbuf_u
movc a,@a+dptr
mov _P0,a
;c:/hj51avr/code/c/fil10.c:118: segd = 1; //这里给出一个脉冲,数据送往段选端
; genAssign
setb _P2_5
;c:/hj51avr/code/c/fil10.c:119: segd = 0;
; genAssign
clr _P2_5
; Peephole 112.b changed ljmp to sjmp
sjmp 00107$
00105$:
;c:/hj51avr/code/c/fil10.c:122: segdata = 255;
; genAssign
mov _P0,#0xFF
;c:/hj51avr/code/c/fil10.c:123: segd = 1; //这里给出一个脉冲,数据送往段选端
; genAssign
setb _P2_5
;c:/hj51avr/code/c/fil10.c:124: segd = 0; //往段寄存器全部送255,那么就关闭了显示(显示灭)
; genAssign
clr _P2_5
00107$:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'delay5ms'
;------------------------------------------------------------
;------------------------------------------------------------
;c:/hj51avr/code/c/fil10.c:130: void delay5ms()
; -----------------------------------------
; function delay5ms
; -----------------------------------------
_delay5ms:
;c:/hj51avr/code/c/fil10.c:137: _endasm;
; genInline
mov R0,#100
lp:
mov R1,#5
lk:
djnz R1,lk
djnz R0,lp
00101$:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'DIS_NUM'
;------------------------------------------------------------
;number Allocated to registers
;nu Allocated to registers r5 r6
;tmp Allocated to registers r2 r3
;i Allocated to registers
;------------------------------------------------------------
;c:/hj51avr/code/c/fil10.c:141: void DIS_NUM(int number)
; -----------------------------------------
; function DIS_NUM
; -----------------------------------------
_DIS_NUM:
; genReceive
mov r2,dpl
mov r3,dph
;c:/hj51avr/code/c/fil10.c:146: for(i =0;i<6;i++)
; genAssign
mov r4,#0x00
00101$:
; genCmpLt
; genCmp
cjne r4,#0x06,00109$
00109$:
; genIfxJump
; Peephole 108 removed ljmp by inverse jump logic
jnc 00104$
00110$:
;c:/hj51avr/code/c/fil10.c:148: nu = tmp%10;
; genAssign
clr a
mov (__modsint_PARM_2 + 1),a
mov __modsint_PARM_2,#0x0A
; genCall
mov dpl,r2
mov dph,r3
push ar2
push ar3
push ar4
lcall __modsint
mov r5,dpl
mov r6,dph
pop ar4
pop ar3
pop ar2
;c:/hj51avr/code/c/fil10.c:149: display(i,nu);
; genCast
mov _display_PARM_2,r5
; genCall
mov dpl,r4
push ar2
push ar3
push ar4
push ar5
push ar6
lcall _display
pop ar6
pop ar5
pop ar4
pop ar3
pop ar2
;c:/hj51avr/code/c/fil10.c:150: delay5ms();
; genCall
push ar2
push ar3
push ar4
push ar5
push ar6
lcall _delay5ms
pop ar6
pop ar5
pop ar4
pop ar3
pop ar2
;c:/hj51avr/code/c/fil10.c:151: tmp = tmp/10;
; genAssign
clr a
mov (__divsint_PARM_2 + 1),a
mov __divsint_PARM_2,#0x0A
; genCall
mov dpl,r2
mov dph,r3
push ar4
push ar5
push ar6
lcall __divsint
mov r2,dpl
mov r3,dph
pop ar6
pop ar5
pop ar4
;c:/hj51avr/code/c/fil10.c:146: for(i =0;i<6;i++)
; genPlus
; genPlusIncr
inc r4
; Peephole 112.b changed ljmp to sjmp
sjmp 00101$
00104$:
;c:/hj51avr/code/c/fil10.c:154: display(255,nu);
; genCast
mov _display_PARM_2,r5
; genCall
mov dpl,#0xFF
lcall _display
00105$:
ret
.area CSEG (CODE)
_disbuf_u:
.db #0xC0
.db #0xF9
.db #0xA4
.db #0xB0
.db #0x99
.db #0x92
.db #0x82
.db #0xF8
.db #0x80
.db #0x90
.db #0x88
.db #0x83
.db #0xC6
.db #0xA1
.db #0x86
.db #0x8E
.db #0x40
.db #0x79
.db #0x24
.db #0x30
.db #0x19
.db #0x12
.db #0x02
.db #0x78
.db #0x00
.db #0x10
.db #0x08
.db #0x03
.db #0x46
.db #0x21
.db #0x06
.db #0x0E
.area XINIT (CODE)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -