Re: Embedded systems - C translator.

new topic     » goto parent     » topic index » view thread      » older message » newer message
smudger said...

Seeing as I don't write C programs and I can't be arsed to write in assembler...

Would it be possible - in principle - to write Euphoria code for an embedded system then use the C-translator with the -keep option to generate C source code then use a cross compiler to make executable code for the target system?

Assume the embedded system did not have a hardware abstraction layer, so you would need to initialise and read/write to ports directly (somehow).

Cheers, Smudger

Would it work out of the box? No, absolutely not - unless it was a system that ran Linux/GNU (glibc) on an x86 cpu or something.

The translated C code is pretty generic and ran on a variety of C compilers, without requiring tweaking for any of them. So the translated C code would work with a new C compiler for the embedded system - but you'd still need to port the C runtime library over.

If the embedded system supports gcc (this is getting more common) then it's probably easier. You'd still need to make changes to the runtime library to get it up and running in a usable state on the new system though.

The initialising of and doing the read/write to ports directly can be done as part of the porting to the runtime library - adding these codes to the init method.

However, you could also use embedded machine code to read/write these ports and do whatever other initialisation was needed, if you wanted to. Euphoria itself has no support for reading/writing hardware ports.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu