Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!gatech!seismo!brl-tgr!tgr!cottrell@nbs-vms.arpa From: cottrell@nbs-vms.arpa (COTTRELL, JAMES) Newsgroups: net.lang.c Subject: PDP-11 as 68000 Cloner Message-ID: <3418@brl-tgr.ARPA> Date: Tue, 19-Nov-85 20:14:56 EST Article-I.D.: brl-tgr.3418 Posted: Tue Nov 19 20:14:56 1985 Date-Received: Thu, 21-Nov-85 07:08:08 EST Sender: news@brl-tgr.ARPA Lines: 37 /* >> = Me, > = Ron Natalie > > Of course there are *some* differences. And of course the 68000 is a > > 32-bit machine (crammed onto a 16-bit bus) while the pdp is a 16-bit one. > > And it has the bytes in the wrong order. Great! Another Little Endian! > > As far as relative code, the pdp is missing something. How do you > > load the address of a variable relative to the PC? This way: > > > > mov pc,r0 ; address of `here' > > here: add #foobar-here,r0 ; make relative > > > Bad example, now what are you going to do with this loaded > address? PDP-11 instructions allow things like > > tst foobar(pc) > > which is exactly equivalent to > > tst foobar Bad example, now what can I do with that loaded question? You see, foobar just happens to be an array! What I need to do is get it's address into a register so I can auto-{in,de}crement the bugger. Or maybe I want to pass it's address as a parameter to str{cpy,cat,cmp,mung}. Since this ain't no VAX, we can't double index as tst foobar(pc)[r0]. And it's just a box of rain, I don't know who put it there Believe if if you need it, or leave it if you dare jim cottrell@nbs */ ------