public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Junker <mjscod@gmx.de>
To: linux-8086@vger.kernel.org
Subject: Re: Compilers
Date: Sat, 29 May 2004 13:42:44 +0200	[thread overview]
Message-ID: <40B87734.6050109@gmx.de> (raw)
In-Reply-To: <20040528144700.GH21172@duckman.distro.conectiva>

Eduardo Pereira Habkost schrieb:

> 
> _fnord:
>         push    %bp
>         mov     %sp,%bp
> 
>         movw    2(%bp),%dx
should be "movw    4(%bp),%dx"

>         movw    $0x0,%ax
>         cmpw    $0x0,%dx
>         je      .L15
> .L13:
>         addw    %dx,%ax
>         addw    $0xffffffff,%dx
should be:
addw    $0xffff,%dx

$0xffffffff is a 32 bit constant

>         cmpw    $0x0,%dx
>         jne     .L13
> .L15:
> 
>         leave
"leave" is only available on 186+

>         ret
> 
> Some things that can be noted: There is not 'dec' instruction, yet. It
> can be added. It is using 'leave' for function exit. IIRC, it is a
> 80186 instruction, so it is better have an option to use is better have
> an option for the user choosing to use it or not.
You're right.

> One bug appeared: it is using 2(%bp) for getting the function
> parameter. It doesn't look correct.  :)
Again, you're right. It's not correct

> A -fno-frame-pointer option would be nice, too. I guess that most people
> wouldn't want them on ELKS, and it will make code smaller and use less
> stack space.
This can (sometimes) produce smaller code.

Regards,
Mark Junker


  reply	other threads:[~2004-05-29 11:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-28 10:42 Compilers David Given
2004-05-28 14:44 ` Compilers sandeep
2004-05-28 14:47 ` Compilers Eduardo Pereira Habkost
2004-05-29 11:42   ` Mark Junker [this message]
2004-05-29 11:58     ` Compilers David Given
2004-05-29 12:32       ` Compilers Mark Junker

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=40B87734.6050109@gmx.de \
    --to=mjscod@gmx.de \
    --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