Next: , Previous: Run-time assemblers, Up: Porting GNU lightning


3.4 Creating the platform-independent layer

The platform-independent layer is the one that is ultimately used by gnu lightning clients. Creating this layer is a matter of creating a hundred or so macros that comprise part of the interface used by the clients, as described in gnu lightning's instruction set.

Fortunately, a number of these definitions are common to the different platforms and are defined just once in one of the header files that make up gnu lightning, that is, core-common.h.

Most of the macros are relatively straight-forward to implement (with a few caveats for architectures whose assembly language only offers two-operand arithmetic instructions). This section will cover the tricky points, before presenting the complete listing of the macros that make up the platform-independent interface provided by gnu lightning.