Would ansi-basic be a more useful front-end to
start with then? I'm not as familiar with basic as
I am with c++ but that shouldn't be a big problem
since basic is an easy language to learn again. I
initially choose c++ because I know c++ better than
basic and SourceBoost (the microcontroller compiler
that I used before I started using sdcc) supports c,
c++, basic, and pascal so I know its possible to write
a usable c++ compiler for microcontrollers. Plus I
think I would need to add some features of c99 to
sdcc to make a working c++ compiler too.

-- Jonathan

On 4/24/06, Philipp Klaus Krause <pkk@spth.de> wrote:
Richard Erlacher wrote:
> Isn't that like using a '747 to commute to work?
> I've always been persuaded that, while 'C' is a general-puprose
> language, C++ is intended for big projects, with dozens of teams of
> hundreds of programmers, and hundreds of managers, with work-product in
> the tens of millions of lines.  I don't see a PIC16 or whatever being
> able to accomodate that sort o thing.  Programming "in the large"
> doesn't happen much in the microcontroller world.
> regards,
> Richard Erlacher

I had had to choose between C++ support and seeing the problems I
mentioned fixed, I'd prefer the problems fixed.

But I don't hink C++ is useless for embedded applications:

I sometimes see the scenario of a data structure and some functions
using it, which are closely tied to the struct, in projects for which I
use sdcc.
An example is the header file below. Using a class and member functions
would be the natural choice (and an inline function instead of the
macro). The resulting code would be the same, so there wouldn't be any
speed or code size problem.

#define CVU_GRAPHICS 1

#include <stdint.h>

#include "cv_graphics.h"

struct cvu_sprite
        uint8_t y;
        uint8_t x;
        uint8_t name;
        uint8_t tag;

// Write sprite to display memory. Use the location of the sprite table
as base. number should be in [0, 31].
//extern void cvu_set_sprite(const cv_vmemp base, const unsigned int
number, const struct cvu_sprite *sprite);
#define cvu_set_sprite(base, number, sprite) cv_memtovmemcpy((base) +
(number) * 0x4, (sprite), 4)

// Todo: is cvu_get_sprite needed?

// Set the x coordinate of the sprite's upper left corner. x will be
clamped to [-32, 255]
extern void cvu_set_sprite_x(struct cvu_sprite *sprite, int x);

extern int cvu_get_sprite_x(const struct cvu_sprite *sprite);

// Set the y coordinate of the sprite's upper left corner. y will be
clamped to [-32, 207]
extern void cvu_set_sprite_y(struct cvu_sprite *sprite, int y);

extern int cvu_get_sprite_y(const struct cvu_sprite *sprite);

// Set the sprite's color.
//extern void cvu_set_sprite_color(struct cvu_sprite *sprite, enum
cv_color color);
#define cvu_set_sprite_color(sprite, color) (sprite)->tag =
((sprite)->tag & 0x80) | (color);

extern enum cv_color cvu_get_sprite_color(struct cvu_sprite *sprite);


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Sdcc-user mailing list