Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!iuvax!rutgers!mcnc!ecsvax!dukeac!sbigham From: sbigham@dukeac.UUCP (Scott Bigham) Newsgroups: comp.lang.c Subject: Re: info-c digest v2n226 Message-ID: <1075@dukeac.UUCP> Date: 3 Nov 88 00:42:34 GMT References: <8810242200.AA05011@lti.com> Reply-To: sbigham@dukeac.UUCP (Scott Bigham) Organization: Academic Computing, Duke University, Durham, NC Lines: 28 In article <8810242200.AA05011@lti.com> reg@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@dukeac.ac.duke.edu me and everyone that agrees with me. USENET sbigham@dukeac.UUCP If that includes Duke University, ...!mcnc!ecsgate!dukeac!sbigham I'll be amazed."