在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            單片機(jī)的乘除例子

            作者: 時(shí)間:2016-11-17 來(lái)源:網(wǎng)絡(luò) 收藏
            /*

            -----------------------------------------------------------------------
            雙字節(jié)的乘法
            (R22:R23)*(R24:R25)-->(R20:R21:R22:R23)
            counter : r26
            -----------------------------------------------------------------------
            */

            本文引用地址:http://www.biyoush.com/article/201611/315479.htm

            mul_sub:
            clr r20
            clr r21
            mov a,@16
            mov r26,a
            bc psw,c
            rrc r22
            rrc r23
            mul_r1:
            jbs psw,c
            jmp mul_r2
            mov a,r25
            add r21,a
            jbc psw,c
            inc r20
            jbc psw,c
            jmp mul_r0
            mov a,r24
            add r20,a
            jmp mul_r2
            mul_r0:
            mov a,r24
            add r20,a
            bs psw,c
            mul_r2:
            rrc r20
            rrc r21
            rrc r22
            rrc r23
            djz r26
            jmp mul_r1
            ret

            /*
            ------------------------------------------------------------------------
            多字節(jié)除法子程序
            R20R21R22R23 / R24R25 =R22R23 ...R20R21
            counter : r26
            ------------------------------------------------------------------------
            */
            div_sub:
            mov a,r24
            sub a,r20
            jbs psw,c
            jmp div_begin
            jbs psw,z
            jmp div_overflow
            mov a,r25
            sub a,r21
            jbs psw,c
            jmp div_begin
            div_overflow:
            bs flag_cal,div_flow
            ret
            div_begin:
            mov a,@16
            mov r26,a
            div_loop:
            bc psw,c
            rlc r23
            rlc r22
            rlc r21
            rlc r20
            jbc psw,c
            jmp div_r3
            mov a,r24
            sub a,r20
            jbs psw,z
            jmp div_r2
            div_r1:
            mov a,r25
            sub a,r21
            jbc psw,z
            jmp div_r3
            div_r2:
            jbs psw,c
            jmp div_end
            div_r3:
            bs r23,0
            mov a,r24
            sub r20,a
            mov a,r25
            sub r21,a
            jbs psw,c
            dec r20



            關(guān)鍵詞: 單片機(jī)乘

            評(píng)論


            技術(shù)專區(qū)

            關(guān)閉