I want to compile a program under the SDCC that I used to compile under C51..
// Somewhere in a header file for C51:
sfr TCON = 0xA8; // C51 syntax
// somewhere in a .c-file
#pragma asm
mov TCON, #0
#pragma endasm
This will be translated to 75A800
(hex)
opcode direct, #immed
mov: 75 A8 00
As I compile this under SDCC this
opcode direct, #immed
mov: 75 88 00
which looks like to me that the SDCC ignores my definition of the TCON register which looks like this:
// Somewhere in a header file for SDCC
__sfr __at(0xa8) TCON; // SDCC syntax
So here is my question:
How can I tell the SDCC to use the address which I defined in another header file?
The whole thing of course looks like this:
#include "the-header-file-that-defines-my-registers.h" // defines TCON
void main(void)
{
// code ..
#pragma asm
// more code ..
mov TCON, #0
#pragma endasm
// more and more code ..
}
I've contacted the SDCC-Dev Team
On Sat, 27 Jul 2013, Stefan Falk wrote:
The answer