34 lines
447 B
C
34 lines
447 B
C
|
#include "mc8051fun.h"
|
||
|
|
||
|
/*
|
||
|
* C-Wrapper for bcd_tolong
|
||
|
*/
|
||
|
|
||
|
void bcd_tolong(__idata uint8_t *bcdval, __idata uint8_t *binval, uint8_t bcdlen, uint8_t binlen) __reentrant
|
||
|
{
|
||
|
(void)binval;
|
||
|
(void)bcdval;
|
||
|
(void)binlen;
|
||
|
(void)bcdlen;
|
||
|
|
||
|
__asm
|
||
|
mov a,_bp
|
||
|
add a,#0xfd
|
||
|
mov r0,a
|
||
|
mov a,@r0 ; binval
|
||
|
mov r1,a
|
||
|
dec r0
|
||
|
mov a,@r0 ; bcdlen
|
||
|
mov r7,a
|
||
|
dec r0
|
||
|
mov a,@r0 ; binlen
|
||
|
mov r6,a
|
||
|
mov r0,dpl ; bcdval
|
||
|
lcall bcd_tolong
|
||
|
|
||
|
__endasm;
|
||
|
}
|
||
|
|
||
|
|
||
|
|