MC68000 question: d8(aN,xN) form

Discussion in 'Technical Discussion' started by Andlabs, Jul 6, 2012.

  1. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    Hi. I read the M68000PRM and MC68000 User's Manual and they're not clear on this issue, so:

    d8(aN/pc,[da]N.[bwl]*scale)

    Which of these forms are valid on the MC68000? Thanks. (I don't remember if I asked this question before elsewhere but I probably did... meh)
     
  2. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,143
    5
    18
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    The index register can never be a b, it must be either a w or a l. Specifically for the MC68000, the MC68008, and the MC68010, scale can't be there. In summary:

    d8(aN/pc,[da]M.[wl])

    This information is available in the M68000 family programmer's reference manual, by the way.

    I assume this is about an assembler?

    Aand yeah, you had asked about it on IRC some time ago :v:.
     
  3. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    Thanks. This is for an assembler, yes, and I did look in the PRM and didn't immediately notice anything specific about the MC68000 (unless it's in an entirely different section), and I don't remember but I might have asked some people a long time ago as well... eh

    Should I just leave the scale bits as zero?
     
  4. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,143
    5
    18
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    Yes, the scale bits should be zero; the 3 processors that don't support it should ignore those bits, but an emulator or another might do this wrong -- who knows. And I am sure you know, but the scale bits are how many bits the index register gets shifted left after sign extension (if it is w).

    The place where it is in the PRM is page 2-21 (page 62 from the start); it explains the brief extension word format (again) and talks about how it is the only one supported in the early processors, and how the "new" processors also extend it with the scale bits. I agree that it is not in the most obvious places to look; they really were bad at this.