请教pic单片机几个问题
LIST P=16C54
#INCLUDE "P16C5X.INC"
cblock H'020'
mulcnd RES 1
mulplr RES 1
H_byte RES 1
L_byte RES 1
count RES 1
mpy clrf H_byte
clrf L_byte
movlw 8
movf mulcnd, w
bcf STATUS, C
LOOP rrf mulplr, F
btfsc STATUS, C
addwf H_byte, F
rrf H_byte, F
rrf L_byte, F
decfsz count, F
goto LOOP
retlw 0
;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
;text program
;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
start clrw
option
main movf PORTB,w
movwf mulplr
movf PORTB,w
movwf mulcnd
call_m call mpy
goto main
ORG 01ffh
goto start
end
上面是一段绝对代码8X8乘法例程
1.上面绝对代码的例程在MPLAB下不能编译通过,可重定位代码是否要通过调用才能执行
2.cblock是否一定需要endc结束
3.乘法例程中乘数与被乘数怎样产生(输入?)算法:对乘数进行右移和逐位相加,怎样理解
4.上面绝对代码的例程可分成调用文件和库文件,将它们用MPLINK链接是否能生成输出文件
5.关于宏:循环(while)结束后是否执行endw后指令
6.宏是否相当于子程序,子程序,函数和宏的关系
请回suoerlilei@163.com