C Bootloader Experiment

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
FlashBurn
Member
Member
Posts: 313
Joined: Fri Oct 20, 2006 10:14 am

Re: C Bootloader Experiment

Post 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.
albeva
Member
Member
Posts: 42
Joined: Thu Aug 21, 2008 8:31 pm

Re: C Bootloader Experiment

Post 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
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: C Bootloader Experiment

Post 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?
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
FlashBurn
Member
Member
Posts: 313
Joined: Fri Oct 20, 2006 10:14 am

Re: C Bootloader Experiment

Post 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.
Post Reply