Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nntp-server.caltech.edu!toddpw From: toddpw@nntp-server.caltech.edu (Todd P. Whitesel) Newsgroups: comp.sys.apple2 Subject: Re: Multitasking on a II Message-ID: <1990Dec14.060502.1328@nntp-server.caltech.edu> Date: 14 Dec 90 06:05:02 GMT References: <&RF^T6-@rpi.edu> <10063@darkstar.ucsc.edu> <7TF^W^=@rpi.edu> Organization: California Institute of Technology, Pasadena Lines: 24 gwyn@smoke.brl.mil (Doug Gwyn) writes: >In article <7TF^W^=@rpi.edu> floyd@pawl.rpi.edu (Patrick J Wetmore) writes: >Without an MMU, the main difference in operation is that relocation >must be provided as task images are loaded into memory for execution >(except if position-independent code is involved, but normally that >imposes too stiff a speed penalty and requires cooperating compilers). position-independent code is easier than it looks. you just have to be prepared to do without an index register. for example, assuming PHK PLB is already in effect, execute PER baseaddress PLX and voila, you can access 64K starting at baseaddress by using Abs,X -- LDA |variable-baseaddress,x ;'|' forces Abs addressing since you can use nearly any register/memory instruction with Abs,X this is a big win, because you can do the same operations on globals as you can on locals (direct page). I have pondered the idea of writing a tiny C compiler that outputs ORCA/M assembly (I'm not about to tackle OMF, ok?) but I've got other, more immediately useful projects to worry about. Todd Whitesel toddpw @ tybalt.caltech.edu