29 lines
408 B
C
29 lines
408 B
C
#include "mc8051fun.h"
|
|
|
|
uint8_t long_mul(__idata uint8_t *v1, __idata uint8_t *v2,uint8_t len, __idata uint8_t *result) __reentrant
|
|
{
|
|
(void)v1; (void)v2; (void)len,(void)result;
|
|
__asm
|
|
mov a,_bp
|
|
add a,#0xfd
|
|
mov r0,a
|
|
mov a,@r0 ; *v2
|
|
dec r0
|
|
mov r1,a
|
|
mov a,@r0 ; len
|
|
mov r7,a
|
|
dec r0
|
|
mov a,@r0 ; result
|
|
mov r2,a
|
|
mov r0,dpl
|
|
lcall long_mul
|
|
mov dpl,#0x00
|
|
jnc $002
|
|
inc dpl
|
|
$002:
|
|
__endasm;
|
|
}
|
|
|
|
|
|
|