⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aad.asm

📁 温度控制仪表及数码管显示
💻 ASM
📖 第 1 页 / 共 2 页
字号:
            movwf    temp2
            rrf      temp2,1
            rrf      temp2,1
            rrf      temp2,1
            rrf      temp2,1
            rrf      temp2,1
            rrf      temp2,1
            movlw    03h
            andwf    temp2,1
            movf     temp2,0
            addwf    temp1,0
            movwf    adr_int
            addwf    adr_int,0
            movwf    adr
            return
;============================上限修改子程序========================================= 
change_max  movlw    01h
            movwf    disp_dig
            movf     max,0
            movwf    disp_seg
            call     display
            movlw    02h
            movwf    disp_dig
            movf     max,0
            movwf    disp_seg
            swapf    disp_seg,1
            call     display
            movlw    03h
            movwf    disp_dig
            movlw    00h
            movwf    disp_seg
            call     display
            movlw    04h
            movwf    disp_dig
            movlw    0ch
            movwf    disp_seg
            call     display
            movf     max,0
            movwf    max_temp
lop1        btfss    portb,0
            goto     lop1
            call     delay10
            btfss    portb,0
            goto     lop1
            bsf      t1con,0
            movlw    1eh
            movwf    tmr1_count
lop2        btfsc    portb,2
            goto     lop2_k4
            call     delay10
            btfsc    portb,2
            goto     lop2_k4
            goto     lop3
lop2_k4     btfsc    portb,3
            goto     lop2_k1
            call     delay10
            btfsc    portb,3
            goto     lop2_k1
            goto     lop4
lop2_k1     btfsc    portb,0
            goto     lop2
            call     delay10
            btfsc    portb,0
            goto     lop2
            bcf      t1con,0
            movf     max_temp,0
            movwf    max
            call     delay30
            call     delay30
            call     delay30
            goto     next1
lop3        bsf      t1con,0
            movlw    1eh
            movwf    tmr1_count
            call     delay30
            call     delay30
            call     delay30
            call     delay30
            movlw    10h
            addwf    max_temp,1
            movf     max_temp,0
            sublw    99h
            btfsc    status,0
            goto     lop5
lop4        bsf      t1con,0
            movlw    1eh
            movwf    tmr1_count
            call     delay30
            call     delay30
            call     delay30
            call     delay30
            movlw    01h
            addwf    max_temp,1
            movf     max_temp,0
            andlw    0fh
            sublw    09h
            btfsc    status,0
            goto     lop5
            movlw    0f0h
            andwf    max_temp,1
            movf     min,0
            subwf    max_temp,0
            btfsc    status,0
            goto     lop5
            movf     min,0
            movwf    max_temp
            goto     lop5
lop5        movlw    01h
            movwf    disp_dig
            movf     max_temp,0
            movwf    disp_seg
            call     display
            movlw    02h
            movwf    disp_dig
            movf     max_temp,0
            movwf    disp_seg
            swapf    disp_seg,1
            call     display
            goto     lop2
            return
;============================下限修改子程序=========================================
change_min  movlw    01h
            movwf    disp_dig
            movf     min,0
            movwf    disp_seg
            call     display
            movlw    02h
            movwf    disp_dig
            movf     min,0
            movwf    disp_seg
            swapf    disp_seg,1
            call     display
            movlw    03h
            movwf    disp_dig
            movlw    00h
            movwf    disp_seg
            call     display
            movlw    04h
            movwf    disp_dig
            movlw    0dh
            movwf    disp_seg
            call     display
            movf     min,0
            movwf    min_temp
lop6        btfss    portb,1
            goto     lop6
            call     delay10
            btfss    portb,1
            goto     lop6
            bsf      t1con,0
            movlw    1eh
            movwf    tmr1_count
lop7        btfsc    portb,2
            goto     lop7_k4
            call     delay10
            btfsc    portb,2
            goto     lop7_k4
            goto     lop8
lop7_k4     btfsc    portb,3
            goto     lop7_k2
            call     delay10
            btfsc    portb,3
            goto     lop7_k2
            goto     lop9
lop7_k2     btfsc    portb,1
            goto     lop7
            call     delay10
            btfsc    portb,1
            goto     lop7
            bcf      t1con,0
            movf     min_temp,0
            movwf    min
            call     delay30
            call     delay30
            call     delay30
            goto     next2
lop8        bsf      t1con,0
            movlw    1eh
            movwf    tmr1_count
            call     delay30
            call     delay30
            call     delay30
            call     delay30
            movlw    10h
            addwf    min_temp,1
            movf     max,0
            subwf    min_temp,0
            btfss    status,0
            goto     lop10
            movf     max,0
            movwf    min_temp
            goto     lop10
lop9        bsf      t1con,0
            movlw    1eh
            movwf    tmr1_count
            call     delay30
            call     delay30
            call     delay30
            call     delay30
            movlw    01h
            addwf    min_temp,1
            movf     max,0
            subwf    min_temp,0
            btfss    status,0
            goto     lop11
            movf     max,0
            movwf    min_temp
            goto     lop10
lop11       movf     min_temp,0
            andlw    0fh
            sublw    09h
            btfsc    status,0
            goto     lop10
            movlw    0f0h
            andwf    min_temp,1
lop10       movlw    01h
            movwf    disp_dig
            movf     min_temp,0
            movwf    disp_seg
            call     display
            movlw    02h
            movwf    disp_dig
            movf     min_temp,0
            movwf    disp_seg
            swapf    disp_seg,1
            call     display
            return
;============================显示子程序=========================================
display     bcf      portc,4
            movlw    08h
            movwf    disp_count
lp1         bcf      portc,3
            btfss    disp_dig,7
            goto     pc5_clr1
            bsf      portc,5
            goto     clk_up1
pc5_clr1    bcf      portc,5
            nop
clk_up1     bsf      portc,3
            rlf      disp_dig,1
            decfsz   disp_count,1
            goto     lp1
            movlw    08h
            movwf    disp_count
lp2         bcf      portc,3
            btfss    disp_seg,7
            goto     pc5_clr2
            bsf      portc,5
            goto     clk_up2
pc5_clr2    bcf      portc,5
            nop
clk_up2     bsf      portc,3
            rlf      disp_seg,1
            decfsz   disp_count,1
            goto     lp2
            bsf      portc,4
            return   
            end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -