首页|嵌入式系统|显示技术|模拟IC/电源|元件与制造|其他IC/制程|消费类电子|无线/通信|汽车电子|工业控制|医疗电子|测试测量
首页 > 分享下载 > 嵌入式系统 > pic乘除运算子程序

pic乘除运算子程序

资料介绍
pic乘除运算子程序

#define    STATUS    3

#define    skpb    skpnc    ;skip if borrowed
#define    skpnb    skpc    ;skip if no borrow

    cblock    0x10
PROD:2            ;2 bytes for production
QUOT:2            ;2 bytes for quotient
PAVRA            ;divider/multiplier
PAVRB            ;reminder / multiplier
PAVRC            ;additional byte space
mcount            ;loop counter
    endc

    org    000h

    ;movlw    0x20;
    ;movwf    PAVRA
    ;movlw    0x30
    ;movwf    PAVRB

    call    BBYTE_DIV

    goto    $-1

;====================================
;PROD:2 = PAVRA * PAVRB
;====================================
BYTE_MUL
    clrf    PROD
    clrf    PROD+1
    movlw    .8
    movwf    mcount
_mul1
    rlf    PROD,f        ;left shift 16-bit with LSB=0
    bcf    PROD,0
    rlf    PROD+1,f    
pic乘除运算子程序
本地下载

评论