Discussion in 'C Programming' started by jacob navia, May 22, 2014.

  1. jacob navia

    David Brown Guest

    You /might/ load p into an A register, in order to load *p into an A
    register (the same one, or a different one). I didn't bother with that
    detail - especially as p might already be in a register if it is a local
    Since you will use it as an address, putting it into an A register is
    You seem determined to make this sound difficult. Have you ever
    actually /used/ an m68k processor, and programmed it in assembly or
    looked at the output of a C compiler? It really is very easy in
    practice - there are seldom occasions when you have to make a choice of
    A or D registers and where the choice also makes a difference.
    No, it means the x86-64 architecture is screwed up. It is not as badly
    screwed up as the original x86, but it is still a mess - especially
    compared to the m68k.
    This is something you /very/ rarely want to do. And if you do mess
    about with the lower two bits of a 4-byte aligned pointer as something
    other than address bits, you are using it as data rather than a pointer,
    and will typically put it into a D register. But IIRC you are also able
    to do AND operations directly on an A register, so you could use the A
    register if you wanted.
    I don't disagree that the A and D split is a little less orthogonal than
    the register sets you get in architectures like the PPC or ARM. I just
    disagree that it is a problem, and I totally disagree with the bizarre
    idea that it is less orthogonal than the x86.
    David Brown, May 25, 2014
    1. Advertisements

  2. jacob navia

    David Brown Guest

    I guess I meant that the m68k was the most orthogonal popular mainstream
    microcomputer cpu until RISC designs became popular and mainstream.

    By "popular and mainstream", I mean something that turned up in personal
    computers of some sort, or embedded systems, rather than in mainframes
    and minicomputers. I freely admit that that is a subjective definition
    tuned towards "proving" my point.
    David Brown, May 25, 2014
    1. Advertisements

  3. jacob navia

    David Brown Guest

    I never used the PDP11, but I have lots of experience with the msp430
    whose ISA was apparently based on, or inspired by, the PDP11. And
    certainly the msp430 has a very orthogonal instruction set - more so
    than the m68k.
    David Brown, May 25, 2014
  4. jacob navia

    BartC Guest

    (I thought I made it clear, with my three examples of what (*p+i*n+j) might
    be used for, of which only one was going to be immediately used as an actual
    address, that that is not so obvious.

    But Keith is calling time on this sub-thread because it's going off-topic.)
    BartC, May 25, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.