[comp.os.minix] Blitter with fork Really : segments on a 68000

n62@nikhefh.hep.nl (Klamer Schutte) (04/27/89)

In article <14044@louie.udel.EDU> HELMER%SDNET.BITNET@vm1.nodak.edu (Guy Helmer) writes:
>Why all the bother of swapping forked processes around in memory on an
>unprotected 68000 machine?  Why aren't memory references done relative
>to an arbitrarily assigned base register that Minix could change when a
>process forked?  A quick look at a table of 68000 instruction execution times

>-- Guy Helmer
>   BITNET: HELMER@SDNET         uucp: ghelmer@loft386

There are essentially two problems
1 register relative addressing can take place only with a short( 16 bits ).
  The scheme currently used can use a much bigger address space; however the
  16 bits shouldn't be such a big problem because this is also used on minix-pc.2 In this scheme it is not possible to make a nice subroutine call since a
  jsr call pushes an absolute return address;  The code will become something as
	move.w	retaddress-baseaddress,-(SP)
	jmp	functionaddress-baseaddress(BR)
  with BR being the baseregister for the text segment and baseaddress 
  the location it points to.
  Also the ret instruction takes a long from the stack; so this will become :
	move.w	(SP)+,REG
	jmp	0(REG,BR)
  with REG a scratch register. The code overhere is much longer then the used
  code; i think this is the reason there is chosen for absolute code.

Klamer.	
-- 
________________________________________________________________________________
Klamer Schutte			mcvax!nikhefh!n62	      n62@nikhefh.hep.nl