M680*0 "small model"

Jim Hanko hanko at mot.UUCP
Wed Jun 26 07:54:19 AEST 1985


> I don't think it's quite fair to compare this "small model" with
> the small model provided by the Intel 8086 or 8088.  ...

> The real problem is if your 68000 system does not have an MMU.  ...
> In this case, you
> are limited to one "small model" process running at once, and it is
> very unlikely that the range ffff8000 to ffffffff is available.  You
> also have to watch out for the interrupt vectors.

> A fairer "small model" for the 68000 would use (Am,Dn.W) addressing
> modes, with the 16-bit pointer in Dn and some kind of base address
> in Am.  This would provide closer to the same capability that Intel
> small model provides.  But of course this would be slower than the
> large model!
> 
> --- Steve Villee (asuvax!anasazi!steve)
>     International Anasazi, Inc.


     Actually, one non-MMU M680*0 "small model" would involve using two
A-registers as the base of the code and data segments.  Then, the d(An) modes
could be substituted for the absolute short modes.  (Note: other formulations
are possible, including pointing to the middle of the segments, allowing
64K program and 64K data).

     Note that this would not "be slower than the large model!", but would
in fact cause the SAME SIZE AND SPEED code to be generated as my original
M680*0 "small model", which required an MMU.  The only loss it suffers is
that two of the A registers would no longer be available for register
variables (are they segment registers? :-). 

     The (Am,Dn.W) modes you mentioned would be used, as in the original
"small model", to index into arrays after their base is loaded into an A
register. 

		eg. a[i + 1] = c;  /* i int; c char; a char array */

	MMU small model:		non-MMU small model:
	(absolute short modes)		(assume A5 has base address of data)

	LEA.W	a,A0			LEA.W	a(A5),A0
	MOVE.W	i,D0			MOVE.W	i(A5),D0
	MOVE.B	c,1(A0,D0.W)		MOVE.B	c(A5),1(A0,D0.W)

     Both implementations require 14 bytes and 43 cycles on an M68000. 


================================
Jim Hanko, UNIX group, Motorola Microsystems, Tempe, AZ U.S.A
{seismo | ihnp4 } ! ut-sally ! oakhill ! mot ! hanko
================================
Disclaimer: the opinions expressed here are my own, but anyone may adopt them.



More information about the Comp.lang.c mailing list