info-c digest v2n226

Scott Bigham sbigham at dukeac.UUCP
Thu Nov 3 10:42:34 AEST 1988


In article <8810242200.AA05011 at lti.com> reg at lti.com (Rick Genter x18) writes:
>The difference [between hardware and software stacks]
>is that a machine with a hardware stack can dereference
>the top of the stack and modify the stack pointer as an atomic operation
>(usually via an addressing mode).  A machine with "only" software stacks
>must use multiple machine instructions to perform this operation...

What of the 68000?  By your argument, it has a hardware stack, since I can
push something onto the stack with MOVE.L #FFFF,-(SP).  But suppose I
allocate a chunk of memory and set another address register (say A3) to the
top of it.  Then I can say MOVE.L #FFFF,-(A3) et al; essentially, I've just
produced my own stack out of thin air.  I would call this a software stack,
since it wasn't there when I turned the machine on.  But then why isn't the
SP-based stack a software stack?  (Remember, SP is just A7)

Just to add my <= $0.02, I would say that a machine has a hardware stack if
you have to go through a bunch of ugly machinations to implement your own
stack; otherwise, it has a software stack.

Someone more net-knowledgeable than myself may wish to redirect followups
elsewhere.  I would if I knew where to.

						sbigham

-- 
Scott Bigham                         "The opinions expressed above represent
Internet sbigham at dukeac.ac.duke.edu   me and everyone that agrees with me.
USENET   sbigham at dukeac.UUCP          If that includes Duke University,
...!mcnc!ecsgate!dukeac!sbigham       I'll be amazed."



More information about the Comp.lang.c mailing list