所需E币: 5
时间: 2019-12-25 09:50
大小: 22.5KB
pic乘除运算子程序#define STATUS 3#define skpb skpnc ;skip if borrowed#define skpnb skpc ;skip if no borrow cblock 0x10PROD:2 ;2 bytes for productionQUOT:2 ;2 bytes for quotientPAVRA ;divider/multiplierPAVRB ;reminder / multiplierPAVRC ;additional byte spacemcount ;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 ……