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

C51 Inline assemble error

I'm using C51 V6.12
C source file is like this:
void I2CWrite(unsigned char D,bit ConvToBCD)
{
#pragma asm
.....
#pragma endasm
}
unsigned char I2CRead(bit ACK,bit ConvToBin)
{
#pragma asm
.....
#pragma endasm
}

complied with C51:
?PR?I2CRead?IO_INT SEGMENT CODE
?BI?I2CRead?IO_INT SEGMENT BIT OVERLAYABLE
?PR?_I2CWrite?IO_INT SEGMENT CODE
?DT?_I2CWrite?IO_INT SEGMENT DATA OVERLAYABLE
?BI?_I2CWrite?IO_INT SEGMENT BIT OVERLAYABLE
PUBLIC ?_I2CWrite?BIT
PUBLIC _I2CWrite
PUBLIC ?I2CRead?BIT
PUBLIC I2CRead

RSEG ?DT?_I2CWrite?IO_INT
?_I2CWrite?BYTE:
D?142: DS 1 ;*******

RSEG ?BI?_I2CWrite?IO_INT
?_I2CWrite?BIT:
D?142: DS 1 ;******
ConvToBCD?143: DBIT 1

RSEG ?BI?I2CRead?IO_INT
?I2CRead?BIT:
ACK?040: DBIT 1
ConvToBin?041: DBIT 1

there is Two "D?142"
one is in ?_I2CWrite?BIT:
and A51 can't compile it.

which is compiled OK with C51 V6.02

0