Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #1401

Re: What are the various alternate uses for the PC's LSB ?

From whygee <yg@yg.yg>
Newsgroups comp.arch
Subject Re: What are the various alternate uses for the PC's LSB ?
Date 2011-05-09 18:16 +0200
Organization Aioe.org NNTP Server
Message-ID <iq96pc$n6e$1@speranza.aioe.org> (permalink)
References <iq732c$ku0$1@speranza.aioe.org> <7z4o54q72z.fsf@ask.diku.dk>

Show all headers | View raw


Torben Ægidius Mogensen wrote:
> Early ARM processors used the last two bits of the PC to store the
> processor mode.  This was long before Thumb, so the modes were user,
> supervisor, interrupt and fast interrupt.  The same ARMs also used the
> top four bits of the PC to store arithemtic flags.  This had the
> advantage that you could store both PC and flags using a single word,
> but it limited the PC to a 256 MB range.  Later ARM designs moved both
> flags and processor status to a separate (unnumbered) register and later
> still Thumb used the lsb to indicate 16/32-bit mode.

Interesting evolution, I didn't find this information in the recent manuals.
thanks !

> If you want to use the lsb for something, I suggest it is for something
> that is useful to change and/or preserve across jumps or calls, as you
> can change/save it along with the PC.

Yes, that's what worries me... But what to use it for ?

{{ As I reread before hitting "send", I imagine a different approach
where the CPU hangs/traps whenever a 1 is written to the LSB,
which could be useful for debugging and breakpointing }}

After the recent posts in this thread, I have come up with these modifications :

  - the NIP has his LSB always cleared when read on the register read buses by instructions.
      This eases PC-relative computations, such as when I want to access a data byte
      relative to the current instruction, without having to flush the damn LSB
      (which would take 4 more bytes of code and a temp. reg.)

  - I just realised that the Carry bit is NOT used by the instructions as data
      on the register read bus, but only as part of the condition logic.
      That is why I have no need to keep the carry bit coupled to the NIP on the data bus,
      it will be coupled only during save/restore of the state. This directly
      addresses Kym's

However I turn this problem, I don't see yet what "mode" bit could/should be stored
and preserved through calls/returns. There will be enough resources and features
to address most needs in a rather clean way, such as inter-thread calls (that
changes the execution context but not the registers) for inter-mode operation,
including 16-to-32 bits code communication or eventual instruction set "modes".

{{ Now I'm even more curious : has anyone ever used the LSB for breakpoints ? }}

> 	Torben
yg

-- 
http://ygdes.com / http://yasep.org

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-08 23:01 +0200
  Re: What are the various alternate uses for the PC's LSB ? kym@kymhorsell.com - 2011-05-09 04:07 +0000
    Re: What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-09 08:45 +0200
  Re: What are the various alternate uses for the PC's LSB ? "robertwessel2@yahoo.com" <robertwessel2@yahoo.com> - 2011-05-08 23:58 -0700
    Re: What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-09 09:02 +0200
      Re: What are the various alternate uses for the PC's LSB ? Quadibloc <jsavard@ecn.ab.ca> - 2011-05-09 09:43 -0700
    Re: What are the various alternate uses for the PC's LSB ? MitchAlsup <MitchAlsup@aol.com> - 2011-05-09 09:38 -0700
      Re: What are the various alternate uses for the PC's LSB ? "robertwessel2@yahoo.com" <robertwessel2@yahoo.com> - 2011-05-09 11:14 -0700
      Re: What are the various alternate uses for the PC's LSB ? Anne & Lynn Wheeler <lynn@garlic.com> - 2011-05-09 14:51 -0400
  Re: What are the various alternate uses for the PC's LSB ? torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-05-09 16:31 +0200
    Re: What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-09 18:16 +0200
      Re: What are the various alternate uses for the PC's LSB ? mac <acolvin@efunct.com> - 2011-05-09 17:27 +0000
        Re: What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-09 19:38 +0200
          Re: What are the various alternate uses for the PC's LSB ? rpw3@rpw3.org (Rob Warnock) - 2011-05-09 20:23 -0500
            Re: What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-10 03:04 +0200
            Re: What are the various alternate uses for the PC's LSB ? "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-11 14:23 -0700
              Re: What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-12 02:45 +0200
                Re: What are the various alternate uses for the PC's LSB ? "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-12 20:41 -0700
                Re: What are the various alternate uses for the PC's LSB ? George Neuner <gneuner2@comcast.net> - 2011-05-14 23:24 -0400
                Re: What are the various alternate uses for the PC's LSB ? "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-15 09:18 -0700
                Re: What are the various alternate uses for the PC's LSB ? Michael S <already5chosen@yahoo.com> - 2011-05-15 10:00 -0700
                Re: What are the various alternate uses for the PC's LSB ? "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-15 12:06 -0700
                Re: What are the various alternate uses for the PC's LSB ? "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-15 12:12 -0700
                Re: What are the various alternate uses for the PC's LSB ? Michael S <already5chosen@yahoo.com> - 2011-05-15 16:16 -0700
                Re: What are the various alternate uses for the PC's LSB ? nmm1@cam.ac.uk - 2011-05-15 20:58 +0100
                Re: What are the various alternate uses for the PC's LSB ? Michael S <already5chosen@yahoo.com> - 2011-05-15 15:59 -0700
                Re: What are the various alternate uses for the PC's LSB ? nmm1@cam.ac.uk - 2011-05-16 08:58 +0100
                Re: What are the various alternate uses for the PC's LSB ? "Andy \"Krazy\" Glew" <andy@SPAM.comp-arch.net> - 2011-05-16 07:43 -0700
                Re: What are the various alternate uses for the PC's LSB ? Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-16 22:46 +0200
                Re: What are the various alternate uses for the PC's LSB ? timcaffrey@aol.com (Tim McCaffrey) - 2011-05-19 16:13 +0000
                Re: What are the various alternate uses for the PC's LSB ? George Neuner <gneuner2@comcast.net> - 2011-05-15 20:33 -0400
      Re: What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-11 05:53 +0200
        Re: What are the various alternate uses for the PC's LSB ? whygee <yg@yg.yg> - 2011-05-11 07:10 +0200
  Re: What are the various alternate uses for the PC's LSB ? Quadibloc <jsavard@ecn.ab.ca> - 2011-07-04 09:39 -0700
    Re: What are the various alternate uses for the PC's LSB ? Quadibloc <jsavard@ecn.ab.ca> - 2011-07-04 10:23 -0700

csiph-web