[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

1317.0. "Write order for 68000 long word access?" by YNGSTR::WALLACE () Tue Oct 06 1992 15:46

Does anyone know what order address' are accessed in when you do a long word
write with the 68000? For example, if I have two registers like this:

		ADDRESS	NAME
		-------	----
		1000	REG1
		1002	REG2

and I do a longword write to address 1000, both registers will get written.
The question is which register will get written first? I'm guessing that REG1
will get written first, but I can't find any mention of it in my 68000 manuals
and I don't have an oscilloscope to check it with.

NOTE: This is not a question of what data gets written where, I understand
that part.

  Thanks,

	Ray
T.RTitleUserPersonal
Name
DateLines
1317.1How would an oscope help?AIDEV::MISKINISTue Oct 06 1992 20:006
Hi Ray,

	I don't have an answer for you...  But I'm curious as to how
	one would use an oscilloscope to find out?

_John_
1317.2ASD::MIDIOT::POWERSBill Powers ZKO3-2/S11Wed Oct 07 1992 09:0813
Ray,

   I took a look in my 68000 book here, and it doesn't mention the write
ordering for moves.  I also looked up the movep instruction.  So for example
suppse I did a movep.l d0,1000H, the byte at 1000h would get written, then
the byte at 1002h, then 1004h, then 1006h. The manual explicitly told me 
that it writes the bytes in ascending order like this.  So I would assume that
a standard move like you are doing would also write them in ascending order.  
Thus reg1 would get written first, then reg2.  But my manual does not explicitly
state this.

bill

1317.3Test loops, it's been years since I've done this stuffYNGSTR::WALLACEThu Oct 08 1992 13:5142
Thanks for the info Bill.

John, as far as scoping goes, I would hang a probe on each of the two "chip
selects" (ie: uds & rd/-wt & A1) then run a program something like the one
below. What I would expect to see is something like:

        Loop n                Our wonderfull delay       Loop n+1

Probe ----+   +------------------------------------------+   +--------------
on adr    |___|                                          |___|
1000

Probe ---------------+   +------------------------------------------+   +---
on adr               |___|                                          |___|
1002
          1'st       2'nd                                1'st       2'nd
          Register   Register                            Register   Register
          to be      to be                               to be      to be
          written    written                             written    written

This particular timing supports the "current theory" that address 1000 is
getting written before addressd 1002.

volatile long *Reg1 = 1000;
main( )
{
  while( 1 ) {
    /* Add a little delay (not much) so we can tell where the beginning of the
     * loop is. You can't do a printf() or anything that would take a long
     * time here. If the delay is too long it will a pain/impossible to scope.
     */
    nop();

    *Reg1 = 0;
  }
}

nop( ) {};	/* May have to do something else for good good compilers that
                 * would optimize this into oblivion.
                 */

	Ray