mc8051fun/long_add.c

28 lines
415 B
C
Raw Normal View History

2024-07-01 20:48:39 +02:00
#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
2024-07-03 07:06:33 +02:00
mov r0,a
mov a,@r0 ; *v2
mov r1,a
mov a,@r0 ; len
mov r7,a
mov r0,dpl
lcall long_invert
2024-07-01 20:48:39 +02:00
mov dpl,#0x00
jnc $002
inc dpl
$002:
__endasm;
}