Article 6031 of alt.sys.pdp10: Path: news3.best.com!nntp1.ba.best.com!not-for-mail Newsgroups: alt.sys.pdp10 Subject: Re: Update again, this one's a good one! References: Organization: Chez Inwap From: inwap@best.com (Joe Smith) Date: 03 Oct 1999 10:41:46 GMT Lines: 59 Message-ID: <37f732ea$0$219@nntp1.ba.best.com> NNTP-Posting-Host: shell3.ba.best.com X-Trace: nntp1.ba.best.com 938947306 219 inwap@206.184.139.134 Xref: news3.best.com alt.sys.pdp10:6031 In article , Daniel Seagraves wrote: >There's apparently a document somewhere that has all the little >tricks one can use from user mode to determine what CPU you are running >on. I had to change BLT 'cause apparently BLT behaviour is different from >KA/KI and KL/KS machines. BOOTM used BLT with 0 address and a zeroed AC >to determine which CPU it was on. I just made mine always put the final >BLT address + 1 in the AC, and that fools the check, but it's probably not >correct. Does anyone have this document? Yes. It's called the "DECsystem-10/DECSYSTEM-20 Processor Reference Manual", page 2-112 of the July 1980 edition, under the section "Programming Examples". The BLT behavior is explictly documented on page 2-8 and E-2. Note that the comment in MACTEN.MAC is not true: ; NOTE THERE IS NO WAY TO DISTINGUISH BETWEEN KL-10 AND KS-10 CPU'S The distinction is based on a documented bug in the KL microcode. ==================================================== 2.15 Programming Examples Before continuing to more system-related subjects, let us consider some simple programs that demonstrate the use of a variety of the instructions described thus far. Processor Identification The instruction repertoiers of all PDP-10 processors and the 166 processor used in the PDP-6 are very similar, and most programs require no changes to run on any of them. Because minor differences and the fact that some instructions are not available on the earlier machines, a program that is to be compatible with all should have some way of distinguishing which machine it is running on. This simple test suffices. JFCL 17,.+1 ;Clear flags JRST .+1 ;Change PC JFCL 1,PDP6 ;PDP-6 has PC Change Flag MOVNI AC,1 ;Others do not, make AC all 1s AOBJN AC,.+1 ;Increment both halves JUMPN AC,KA10 ;KA10 if AC = 1000000 (carry BLT AC,0 ; between halves) JUMPE AC,KI10 ;KI10 if AC = 0 MOVEI AC,1 ;KL10 or KS10 if AC = 1,,1 SETZ AC+1, ;Big binary integer MOVEI AC+3,1 ;One digit byte EXTEND AC,[CVTBDO] ;Convert will abort TLNE AC+3,200000 ;Test effect on N JRST KL10 ;KL10 if N set JRST KS10 ;KS10 if N unaffected -- INWAP.COM is Joe Smith, Sally Smith and our cat Murdock. (The O'Hallorans and their cats moved to http://www.tyedye.org/ Nov-98.) See http://www.inwap.com/ for PDP-10, "ReBoot", "Shadow Raiders"/"War Planets"