linux-8086.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brad Normand <bigbadbrad@gmail.com>
To: linux-8086@vger.kernel.org
Subject: SDCC porting feasibility study, part 1: the assembler
Date: Sun, 26 Feb 2012 18:18:55 -0600	[thread overview]
Message-ID: <CAGc3vb3wQvdvVcv89UZ6SU=NArnqEbyor13aPGRmz2HXwa4OZg@mail.gmail.com> (raw)

I've started looking at SDCC to try and get an idea how easy it is to
port this to target 8086.

Assuming one starts with the 8051 assembler it already has, I think
these are the main areas needed to make the assembler work:

i8086.h:
-Define numeric IDs for each class of opcode
-Define numeric IDs for each addressing mode
-Define numeric IDs for each register
-Prototypes for i80adr.c and i86mch.c

i86adr.c:
-Assign string names to registers
-Write code to classify arguments to address modes

i86ext.c:
-Define processor name, endianness, and asm file extension

i86mch.c
-Write code to emit machine instructions

i86pst.c:
-Fill in table describing keywords and mnemonics
-Fill in table assigning numbers to registers and register bits

in global assembler code:
-Investigate what, if any, global changes are needed to support 8086.

8051 is very close to 8086 in terms of flags.  Registers are different
and 8086 is perhaps less orthogonal when it comes to some operations,
and addressing modes.  Segmentation doesn't exist natively on 8051 but
there is already some code present to support a weird 8051 with 24 bit
address space.

Another thought, is that it isn't strictly necessary to support every
8086 opcode and addressing mode in the beginning, just what the
compiler emits.

             reply	other threads:[~2012-02-27  0:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-27  0:18 Brad Normand [this message]
2012-02-27 10:05 ` SDCC porting feasibility study, part 1: the assembler Gábor Lénárt
2012-02-27 15:43   ` Brad Normand
2012-02-27 15:46   ` Jody Bruchon
2012-02-27 17:53     ` Brad Normand
2012-02-27 18:52       ` David Given
2012-02-27 19:04         ` Chad
2012-02-27 19:33         ` Brad Normand
2012-02-27 19:37         ` Harley Laue
2012-02-27 20:42           ` Brad Normand
2012-02-27 21:34             ` Jody Bruchon
2012-02-27 22:26           ` David Given

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='CAGc3vb3wQvdvVcv89UZ6SU=NArnqEbyor13aPGRmz2HXwa4OZg@mail.gmail.com' \
    --to=bigbadbrad@gmail.com \
    --cc=linux-8086@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).