linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Kirilenko <icedank@gmx.net>
To: linux-kernel@vger.kernel.org
Subject: Re: Stored data missed in setup.S
Date: Wed, 23 Apr 2003 16:39:57 +0300	[thread overview]
Message-ID: <200304231639.57148.icedank@gmx.net> (raw)
In-Reply-To: <Pine.LNX.4.53.0304230925150.23037@chaos>

Hello!

> > I feel myself stupid, when fighting against setup.S. Here is small piece
> > of code (/arch/i386/boot/setup.S)
> >
> > --->
> > start_of_setup: # line 160
> > 	# bla bla bla - some checking code
> >         movb    $1, %al
> >         movb    %al, (0x100)
> > ....
> > ....
> >         pushw   %ax
> >         movb    (0x100), %al
>
> You put something from offset 0x100 into %al.
>
> >         cmpb    $1, %al
>
> Then you compared it against 1. This is where the comparaison
> occurred.
>
> >         popw    %ax # pop don't change any flags - 386 asm reference
>
> Then you put something else into %ax. Whatever it is, doesn't count.
>
> >         je     bail820 # and it don't jump -- al != 1
>
> Then you jumped based upon the comparison you made before you
> destroyed the contents of %al by poping %eax (%eax is (%ah << 8) | %al).
>
> If you don't want to muck with registers, just do:
>
> 		cmpb	$1, (0x100)
> 		jz	wherever
>
> You don't need to put memory oprands into registers to compare.
>
> > meme820: # line 300
> > <---

OK. And now code looks like:
-->
start_of_setup: # line 160
	# bla bla bla - some checking code
        movb    $1, %al
        movb    %al, (0x100)
....
....
	cmpb    $1, (0x100)
	je bail820 # and it DON'T jump here
<--

I'm sure, I'm doing something wrong. But what???

Best regards,
Andrew.


  reply	other threads:[~2003-04-23 13:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-23 13:17 Stored data missed in setup.S Andrew Kirilenko
2003-04-23 13:33 ` Richard B. Johnson
2003-04-23 13:39   ` Andrew Kirilenko [this message]
2003-04-23 14:36     ` Richard B. Johnson
2003-04-23 14:50       ` Andrew Kirilenko
2003-04-23 15:06         ` Richard B. Johnson
2003-04-23 14:51       ` Randy.Dunlap
2003-04-23 15:11         ` Richard B. Johnson

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=200304231639.57148.icedank@gmx.net \
    --to=icedank@gmx.net \
    --cc=linux-kernel@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 NNTP newsgroup(s).