28 lines
415 B
C
28 lines
415 B
C
#include "mc8051fun.h"
|
|
#include "bcd.h"
|
|
|
|
#pragma disable_warning 59 // Disable "must return a value" warning
|
|
|
|
uint8_t long_add(__idata uint8_t *v1, __idata uint8_t *v2,uint8_t len) __reentrant
|
|
{
|
|
(void)v1; (void)v2; (void)len;
|
|
__asm
|
|
mov a,_bp
|
|
add a,#0xfd
|
|
mov r0,a
|
|
mov a,@r0 ; *v2
|
|
mov r1,a
|
|
mov a,@r0 ; len
|
|
mov r7,a
|
|
mov r0,dpl
|
|
lcall long_invert
|
|
mov dpl,#0x00
|
|
jnc $002
|
|
inc dpl
|
|
$002:
|
|
__endasm;
|
|
}
|
|
|
|
|
|
|