public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert de Bath <robert$@mayday.cix.co.uk>
To: Riley Williams <rhw@InfraDead.Org>
Cc: Manuel Novoa III <mjn3@codepoet.org>,
	Linux-8086 <linux-8086@vger.kernel.org>
Subject: More dev86 changes (0.16.5)
Date: Wed, 24 Jul 2002 22:17:16 +0100 (BST)	[thread overview]
Message-ID: <449ac7bad6f7380a@mayday.cix.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.21.0207151956320.4272-100000@Consulate.UFP.CX>


> 1) #elif support.
In 0.16.5
Do we want #elifdef too?

> 2) #warning support (at least for non-continued lines).
In 0.16.5

> 3) Support asm() at file scope.  This is to allow the equivalent
>    of #asm/#endasm in macros.
In 0.16.5

> 4) Limited support for things like "#define stdio stdio".  Stock bcc
>    goes into an infinite loop when encounting this.  The implementation
>    has flaws, but it does what I needed.  You see this a lot in the
>    glibc headers we're using with uClibc (yes I'm working on a port).
Recursive defines are now trapped and skipped; it even protects against
problems like:

   #define x z
   #define y x
   #define z y
   x y z

> 6) True support for the "signed" keyword. At the moment, any file
>    using it has to include a "#define signed" line to remove it for
>    bcc, and in some cases, even that isn't enough as the code stops
>    working as a result.
In 0.16.5, including 'signed char' typedefs, casts, variables and
constant folding. AFAIK it all works as it should. However please
note the _default_ char type is still unsigned.

> 7) At least a warning message if any unrecognised options are given
>    on the command line. At the moment, unrecognised options are just
>    silently ignored!
The bcc.c driver now checks options it would pass to ld86 and warns if
there are any it doesn't know.

So in all this now compiles and generates correct code in both 16 and 32
bit modes:
(Or at least similar to: gcc -funsigned-char )

---CUT-HERE------CUT-HERE------CUT-HERE------CUT-HERE------CUT-HERE---
#include <stdio.h>
#include <errno.h>

#define strong_alias(Y,X) asm(\
   "export _" "X", \
   "_" "X" " = _" "Y" \
   );

#if __STDC__
#define comb(x,y) x##y
#warning Using Ansi combine
#elif __BCC__
#define comb(x,y) x/**/y
#warning Using bcc combine
#else
#define comb(x,y) x/**/y
#warning Using K&R combine
#endif

#define signed unsigned
#define unsigned signed

#ifdef signed
typedef signed char t_sc;
typedef comb(un,signed) char t_uc;
#endif

char c;
t_sc sc;
t_uc uc;

strong_alias(main,zulu);
main()
{
   int i1, i2, i3;

   c = -6;
   uc = -6;
   sc = -6;

   printf("%ld, ", (long)c);
   printf("%ld, ", (long)uc);
   printf("%ld\n", (long)sc);

   printf("%d, ", c);
   printf("%d, ", uc);
   printf("%d\n", sc);

   i1 = c; i2 = uc; i3 = sc;

   printf("%d, ", i1);
   printf("%d, ", i2);
   printf("%d\n", i3);

   i1 = (char) 200 + (char) 50;
   i2 = (t_uc) 200 + (t_uc) 50;
   i3 = (t_sc) 200 + (t_sc) 50;

   printf("%d, ", i1);
   printf("%d, ", i2);
   printf("%d\n", i3);

   c = 200; uc = 200; sc = 200;

   i1 = c  + (long) 50;
   i2 = uc + (long) 50;
   i3 = sc + (long) 50;

   printf("%d, ", i1);
   printf("%d, ", i2);
   printf("%d\n", i3);
}
---CUT-HERE------CUT-HERE------CUT-HERE------CUT-HERE------CUT-HERE---

-- 
Rob.                          (Robert de Bath <robert$ @ debath.co.uk>)
                                       <http://www.cix.co.uk/~mayday>



  parent reply	other threads:[~2002-07-24 21:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-14 14:05 C compiler, assembler and linker Harry Kalogirou
2002-07-14 17:27 ` Manuel Novoa III
2002-07-15  6:07   ` Riley Williams
2002-07-15 17:02     ` Manuel Novoa III
2002-07-15 19:13       ` Riley Williams
2002-07-15 22:02         ` Manuel Novoa III
2002-07-16  6:27           ` Riley Williams
2002-07-17  1:31             ` Manuel Novoa III
2002-07-17  6:33               ` Riley Williams
2002-07-18 12:03                 ` Minix vs. ELKS Feher Tamas
2002-07-18 12:27                   ` Javier Sedano
2002-07-02 15:07                     ` (unknown) Miguel A. Bolanos
2002-07-18 13:40                   ` Minix vs. ELKS Alan Cox
2002-07-22 21:41                 ` C compiler, assembler and linker Robert de Bath
2002-07-23  8:16               ` Robert de Bath
2002-07-23 16:25                 ` Manuel Novoa III
2002-07-23 19:09                   ` Robert de Bath
2002-07-24 21:17         ` Robert de Bath [this message]
2002-07-24 22:02           ` More dev86 changes (0.16.5) Riley Williams
2002-07-25 15:42             ` Manuel Novoa III
2002-07-26  7:55               ` Robert de Bath
2002-07-26 15:12                 ` Manuel Novoa III
2002-07-26  8:22             ` Robert de Bath
2002-07-24 22:26           ` Paul Nasrat
2002-07-25 16:34             ` Manuel Novoa III
2002-07-22 23:26       ` C compiler, assembler and linker Robert de Bath
2002-07-23  0:34         ` Riley Williams
2002-07-23  0:58           ` Manuel Novoa III
2002-07-23  0:46         ` Manuel Novoa III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=449ac7bad6f7380a@mayday.cix.co.uk \
    --to=robert$@mayday.cix.co.uk \
    --cc=linux-8086@vger.kernel.org \
    --cc=mjn3@codepoet.org \
    --cc=rhw@InfraDead.Org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox