My reply is at the bottom. Please put your reply there too.
On Fri, 4 Oct 2019, TK Chia wrote:
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).
This approach worked splendidly. Thanks!
--
David Griffith
d...@661.org
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel