This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can I get m68k gcc to generate 16-bit variable references?


Hi Steve,

C++ has a way to do it (via references), but you want to do it in C.

Hmm.

The usual way of doing it in C is with pointers.

struct lowmem { int foo; /* ... */ };
struct lowmem* gLowmem = (struct lowmem*)0x0400;
int count_foo(void) { return ++gLowmem->foo; }

HTH,
--Eljay



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]