Shop OBEX P1 Docs P2 Docs Learn Events
SimpleIDE and Propware -- I'm missing something. - Page 2 — Parallax Forums

SimpleIDE and Propware -- I'm missing something.

2»

Comments

  • DavidZemonDavidZemon Posts: 2,973
    edited 2016-05-03 16:27
    deleted
  • Heater.Heater. Posts: 21,230
    edited 2016-05-03 16:27
    greybeard,
    Propeller has registers??
    Certainly. A COG has 512 of them. It keeps it's data there, like the registers of any other CPU. It's instructions operate on those registers, like any other CPU.

    The only weird part is that a COG also executes it's instructions from those registers. And only those registers. Unlike any other CPU I know of.

    That's before we talk about the special purpose OUTA and other registers.

    All of that is still true even if you use the Prop Tool and PASM.

  • ersmith wrote: »
    No, that isn't correct for PropGCC. Arguments are passed in registers (at least the first 6 are), and the return address is placed in the "lr" register.

    @greybeard, Eric put "lr" in quotes because just like you already thought, the Propeller does not have a dedicated link register. However, GCC was never written with the intention of running on such a platform, it's unheard of! So, PropGCC reserves a few of the 496 registers in the Propeller and uses them to fool GCC into thinking that the architecture is a little more "normal."
  • Heater.Heater. Posts: 21,230
    Ah yes, sorry, the GCC "virtual" registers, maintained by the LMM virtual machine.
  • Some of the local memory in the cog is used as registers, because that's the kind of execution environment expected by GCC. It's the kind of detail you generally don't need to be aware of unless you're getting really close to the metal.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2016-05-04 01:33
    heater wrote:
    Certainly. A COG has 512 of them. It keeps it's data there, like the registers of any other CPU. It's instructions operate on those registers, like any other CPU. The only weird part is that a COG also executes it's instructions from those registers. And only those registers. Unlike any other CPU I know of.
    Not so weird. It's a rather classic von Neumann architecture with a two-address instruction set that obviates the need for a separate accumulator.

    We've gotten so used to the PIC-like Harvard architectures that we tend to forget our von Neumann roots. :)

    -Phil
  • Heater.Heater. Posts: 21,230
    edited 2016-05-04 10:49
    Phil,

    The way I look at it is that either:

    a) The Prop COG has no user accessible registers (Let's ignore the program counter), data and code all live in the same RAM. A memory to memory architecture as you say. That is pretty weird. Out of all the machines I have worked on from Motorola, Intel, MIPS, ARM, AVR, PDP/11, Locus 16, and others I forget I have not seen another machine like that.

    b) The Prop COG has 512 registers. That already weird by the huge number of registers, even RISCs only have 32 or 64. More weird because it can only execute code from within it's own register set.

    c) We give up and say the Prop COG does not have a register/RAM distinction. True but weird.

    In order to convince me it's "not so weird" you'll have to produce a list of processors that look like Propeller COGs that people may have heard of.

    Edit: The ZPU machine I write an emulation of for the Prop, Zog, had no registers. But then that was a weird stack based thing.

    Other edit: The Texas Instruments TMS9900 kept its registers in RAM. There was an internal, programmer accessible, register that pointed at the register set in RAM. So that was "memory to memory". But still the instruction set referred to registers.
Sign In or Register to comment.