SDCC makes a difference between a __bit and an __sbit. An __sbit lives in the SFR space above address 0x80.
So you would need:
__sbit __at(0x90) pa0; // PORT 1.0
But sfr's and sbit's are usually defined in a header file for your device. Is yours not already supported by SDCC?
Have a look in C:\Program Files\SDCC\include\mcs51\
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I am attempting to convert code written for the HiTech 8051 compiler (now unsupported) to work with SDCC
The line (first of several)
static __bit pa0 @ 0x90; // PORT 1.0
Gives this error, I already added the leading underscores to bit
381001.c:532: syntax error: token -> '0x90' ; column 23
Is there any way around this (or other way to assign a bit variable to specific location)
Hi,
The syntax for absolute addressing in SDCC is as below:
__bit __at (0x02) bvar;
Please go through the sdccman.pdf, the usermanual of SDCC for more details on syntax and example code.
Best Regards,
Raghunath Lolur.
SDCC makes a difference between a __bit and an __sbit. An __sbit lives in the SFR space above address 0x80.
So you would need:
__sbit __at(0x90) pa0; // PORT 1.0
But sfr's and sbit's are usually defined in a header file for your device. Is yours not already supported by SDCC?
Have a look in C:\Program Files\SDCC\include\mcs51\