Dear All,
Consider the following code:
-
struct S1
{
char a, b, c;
};
typedef void (*foo_t)(void *arg);
struct S2
{
__xdata void *p;
foo_t f1, f2, f3;
};
void foo1 (void *arg) {arg;}
void foo2 (void *arg) {arg;}
void foo3 (void *arg) {ar
Thanks Maarten. I have posted it as a bug in the tracker system.
Krish
On Mon, Feb 21, 2011 at 10:50 PM, Maarten Brock
wrote:
> Hi Krish,
>
> Instead of posting this to the other users, it is better to file this as a
> bug report in the SDCC tracker system. Otherwise it runs a great risk of
> be
Hi Donald,
The keyword 'sbit' is used to define special function bits, much like
the keyword 'sfr' for the special function registers. The good news is
that most of the SFRs in 8051 are already defined in <8051.h> Thus to
set the 4th bit of PORT-2 to 0, use the following code:
#include <8051.h>
Hi Donald,
I am trying to re-clarify the concept of __sfr and __sbit.
The statement '__sfr __at 0x9A MY_SFR' means that a new SFR is
declared at 0x9A which is identified by the name MY_SFR in this
program.
However, this does not mean that MY_SFR.0 or MY_SFR_0 can be used to
access the 'bit 0' of
Thus next time I'll check the <.h> file to find out the
> specific register name of machine in SDCC.
> Now I really want to know what SDCC compile flow is.How a c code become to
> be a assembly code,even the machine code?
> What is the differences between SDCC and GCC?
&
Hi Doland,
The program is perfectly fine. The simulation is producing the
expecting result as well. How are you simulating the program?
You should not call the assembler or linker explicitly. Let it be
called by sdcc itself.
Krish
On Wed, Mar 23, 2011 at 10:26 PM, duck donal wrote:
> Hi roelof
Strange :( Same here with sdcc-3.0.0. Should be reported as a bug.
However, it is not severe. You can always remove the type-casting and
successfully compile your code.
Krish
On Tue, Apr 5, 2011 at 9:40 AM, Bob Frankel wrote:
> consider the following program, which initializes a static structur
Hi,
My solution would be:
#include
union U8x4_n_U32
{
uint8_t u8[4];
uint32_t u32;
};
union U8x4_n_U32 u8x4_n_u32;
// uint32_t to array of uint8_t conversion
u8x4_n_u32.u32 = 0xA0459201;
/**
** Now you can access the individual bytes as
** u
011 09:10, schrieb Krishnendu Chatterjee:
> > Hi,
> >
> > My solution would be:
> >
> > #include
> >
> > union […]
>
> This seems to be the best so far, but none of the presented "solutions"
> from this thread is portable or good C. He
ds in a union or a struct or the position of bytes in
> a long int.
>
> Maarten
>
> > Am 05.05.2011 09:10, schrieb Krishnendu Chatterjee:
> >> Hi,
> >>
> >> My solution would be:
> >>
> >> #include
> >>
> >> union [
I agree with Maarten. The XRAM initialization code is always included, but
is not executed at runtime. I suggest to use s51 or any other 8051 simulator
to verify this.
Regards,
Krish
On Sat, Jul 9, 2011 at 10:31 AM, Maarten Brock wrote:
> Hi Charles,
>
> As Frieder pointed out this code you see
s_lcd (char *s)
> >{
> >REG_SEL=1;
> >
> >while (*s)
> >{
> >lcd_command(*s++);
> >}
> >
> >REG_SEL=0;
> >}
>
> --
> Jason White
>
>
> --
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Regi
Hi folks,
I am facing some problem using inline functions on mcs51 port. Consider the
following code:
#include
int n[10];
inline int *address (void) { return &n[0]; }
inline int size (void) { return sizeof (n); }
void main (void)
{
memset (address(), 0, size());
}
When it is compiled wi
13 matches
Mail list logo