Page 2 of 2

Re: C Bootloader Experiment

Posted: Sun Aug 24, 2008 8:47 am
by FlashBurn
Yeah I meant that it is 16bit code using 32bit registers and I´m looking for a way to get gcc to use 16bit registers.

Re: C Bootloader Experiment

Posted: Sun Aug 24, 2008 8:53 am
by albeva
Couldn't you just inline them, like: (From the GCC manual.)

Code: Select all

inline void foo (const char) __attribute__((always_inline));
I find a small macro like this very useful:

Code: Select all

#define INLINE_FUNCTION(_decl) \
    static inline _decl __attribute__((always_inline)); \
    _decl

Re: C Bootloader Experiment

Posted: Sun Aug 24, 2008 9:22 am
by Brynet-Inc
FlashBurn wrote:Yeah I meant that it is 16bit code using 32bit registers and I´m looking for a way to get gcc to use 16bit registers.
Are you going to be running the code on a <= 286 processor?

Re: C Bootloader Experiment

Posted: Sun Aug 24, 2008 9:26 am
by FlashBurn
No, but I read that the "ret" instruction will also be 32bit, so that it tries to return to a 32bit address. I haven´t checked this. At the moment I try to get my old borland c++ 2.0 running and to compile for loader.