🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #28646

Re: question of the day

#28646
From: Tomas Rokicki
Date: Sat, 10 Oct 1987 19:57
30 lines
1743 bytes
>		movea.l	#go1,a0
>		movea.l	#go2,a1
>	go1:	move.w	(a0)+,(a1)+
>	go2:

If you turn to Appendix E of the Motorola MC68000 Programmer's
Manaul, it describes the prefetch which is breaking that program.
To quote:

	The MC68000 uses a two-word tightly coupled instruction
	prefetch mechanism to enhance performance.  ...  When
	execution of an instruction begins, the operation word
	and the word following have already been fetched ...

Thus, the instruction at go2: is fetched *before* the instruction
at go1: is executed, since move.w (a0)+,(a1)+ is a one-word
instruction.  If you inserted another move.w (a0)+,(a1)+ before
go1, it should work on a 68000, but will break on a 68020 for
several reasons . . .

It works under RAID because RAID most likely has turned instruction
tracing on, which does a software interrupt on each instruction,
thus killing the prefetch with the implicit branch . . .

> We are so interested in understanding the behavior of this program that
> I have been authorised to award a bust of Abraham Lincoln made from steel
> to the first person that clears up the mystery.

Thanks!
Technical Details
Message-ID: <656@rocky.STANFORD.EDU>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!sri-unix!sri-spam!ames!ucbcad!ucbvax!decvax!decwrl!labrea!rocky!rokicki
References: <36500013@iuvax>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!sri-unix!sri-spam!ames!ucbcad!ucbvax!decvax!decwrl!labrea!rocky!rokicki
From: rokicki@rocky.STANFORD.EDU (Tomas Rokicki)
Newsgroups: comp.sys.atari.st
Subject: Re: question of the day
Message-ID: <656@rocky.STANFORD.EDU>
Date: Sat, 10-Oct-87 15:57:17 EDT
Article-I.D.: rocky.656
Posted: Sat Oct 10 15:57:17 1987
Date-Received: Mon, 12-Oct-87 19:06:54 EDT
References: <36500013@iuvax>
Reply-To: rokicki@rocky.UUCP (Tomas Rokicki)
Organization: Stanford University Computer Science Department
Lines: 30