Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site utah-cs.UUCP
Path: utzoo!linus!gatech!seismo!utah-cs!brownc
From: brownc@utah-cs.UUCP (Eric C. Brown)
Newsgroups: net.arch
Subject: Re: 386 info
Message-ID: <3530@utah-cs.UUCP>
Date: Fri, 8-Nov-85 11:28:35 EST
Article-I.D.: utah-cs.3530
Posted: Fri Nov  8 11:28:35 1985
Date-Received: Sat, 9-Nov-85 06:24:36 EST
References: <965@mcnc.mcnc.UUCP> <2359@ukma.UUCP> <414@graffiti.UUCP>
Reply-To: brownc@utah-cs.UUCP (Eric C. Brown)
Distribution: net
Organization: Univ of Utah CS Dept
Lines: 21

In article <414@graffiti.UUCP> peter@graffiti.UUCP (Peter da Silva) writes:
>> also possible to use just about any register as an index register.  (I
>> think SP is the only register that can't be used this way - it remains
>> almost exclusively as a stack pointer.)  So it should be a lot easier
>
>Yes, but indexing off the stack pointer is something compilers like to do:
>it's a very convenient way of accessing local storage. If you can't
>index off the SP you have to waste a general purpose register as a base
>register for these local variables...

Well, there are two problems here.  First, Intel defines two sorts of 
addressing modes, based and indexed.  ANY register (including sp) can be
used as a based register, but SP cannot be used as a indexed register.

Also, in the 808x architecture, you use BP instead of SP to access
local storage.  That way you can push stuff on the stack without having to
recalculate all the offsets of the locals.

Eric C. Brown
brownc@utah-cs
...!{ihnp4, seismo}!utah-cs!brownc