This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

any bug with reentrant?

void func1(unsigned char *buf)reentrant
{
    *buf = 1;
}

void func2()reentrant
{
    unsigned char ch;
    func1(&ch);
}
souce code of func2:
MOV      DPTR,#0x00FFFF
ACALL    C?ADDXBP(C:000298)

MOV      R3,#0x01          ;not 0x02
MOV      DPH(0x83),0x08
MOV      DPL(0x82),0x09
MOV      DPX(0x93),#0x01
MOV      R1,DPL(0x82)
MOV      R2,DPH(0x83)
ACALL    func(C:001C63)

MOV      DPTR,#0x000001
AJMP     C?ADDXBP(C:000298)
RET

xdata is located in 0x10000-0x1ffff,so reentrant stack is located in the segment. According to C51 User Guide,address of ch(in reentrant stack)is pass to func1.register 3 contain the pointer type,and it's value should be 2,not 1.If I declare func2 as non-reentrant,the code is MOV R3,0X02.
What is the meaning fo the bold text?

0