You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CubeSatSim/libs/libmf/source/pn9bit.c

31 lines
402 B

#include "libmfcrc.h"
#if defined(SDCC)
__reentrantb uint16_t pn9_advance_bit(uint16_t pn9) __reentrant __naked
{
pn9;
__asm
mov a,dph
rrc a
mov a,dpl
rrc a
jnb acc.4,00000$
cpl c
00000$: mov dpl,a
clr a
rlc a
mov dph,a
ret
__endasm;
}
#else
__reentrantb uint16_t pn9_advance_bit(uint16_t pn9) __reentrant
{
return (uint8_t)(pn9 >> 1) | (((pn9 << 3) ^ (pn9 << 8)) & 0x100);
}
#endif

Powered by TurnKey Linux.