33 lines
349 B
C
33 lines
349 B
C
|
|
/**
|
|
* Add two longs in xmem zero page
|
|
*
|
|
* r0 = ptr to firts arg
|
|
* r1 = ptr to second arg
|
|
* r7 = length
|
|
*
|
|
* result is in r0*
|
|
*/
|
|
|
|
void long_xadd() __naked
|
|
{
|
|
__asm
|
|
.globl long_xadd
|
|
.globl long_xaddc
|
|
long_xadd:
|
|
clr c
|
|
long_xaddc:
|
|
movx a,@r1
|
|
mov b,a
|
|
movx a,@r0
|
|
addc a,b
|
|
movx @r0,a
|
|
inc r0
|
|
inc r1
|
|
djnz r7,long_xaddc
|
|
ret
|
|
__endasm;
|
|
}
|
|
|
|
|