Hello Steve, hello David,

SET_WORD(H_FLAGS, z_header.(struct zcode_header_struct)flags);

I am quite sure this change should fix the problem on Turbo C.  But it
seems to me that it will also inadvertently break the non-DOS ports,
which do not define SET_WORD in terms of an asm { ... }.

#ifdef __TURBOC__?


Having #ifdef __TURBOC__ in the platform-independent portion of the code
is kind of weird. :-)

To avoid this, I think one way would be to tweak the (platform-specific)
SET_WORD definition for DOS, to move the use of `v' outside the `asm' block:

#define SET_WORD(addr, v) do {\
        _AX = (v); \
        asm les bx,zmp;\
        asm add bx,addr;\
        asm xchg al,ah;\
        asm mov es:[bx],ax; } while (0)

This will allow `v' to be pretty much any arbitrary C expression.  It
uses the magic _AX variable which is specific to Turbo C (it works on
Turbo C 2.01, and should work on 3.00 too).

Thank you!

--
https://github.com/tkchia


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to