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!burl!ulysses!allegra!bellcore!decvax!wanginst!vaxine!encore!talcott!harvard!seismo!brl-tgr!tgr!cottrell@nbs-vms.ARPA From: cottrell@nbs-vms.ARPA Newsgroups: net.unix-wizards Subject: Clear Core Message-ID: <8931@brl-tgr.ARPA> Date: Mon, 4-Mar-85 20:03:37 EST Article-I.D.: brl-tgr.8931 Posted: Mon Mar 4 20:03:37 1985 Date-Received: Sat, 9-Mar-85 11:05:21 EST Sender: news@brl-tgr.ARPA Lines: 27 /* >> Now, who remembers the one-instruction core clear? >> >>mov -(pc),-(pc) ; .word 014747 > >Ok, you got the easy one. Now here's the harder version of the >question. Write a PDP-11 assembly language program that will set ALL >of memory and all of the registers (except, possibly, for PC) to the >value ZERO. I'll post an answer in a week or two if nobody gets it. How about: clr r0 clr r1 ... clr sp mov (pc)+,@sp ; copy next instruxion jsr pc,-(pc) ; to loc 0 jmp @sp ; execute it The one instruxion repeatedly executes itself, pushing the return address (zero) onto the stack, first at 177776, all the way down to 000000. Core is cleared. Finally, the zero at location 000000 is executed, which is a halt. PC=2. That was fun! jim cottrell@nbs */