Path: utzoo!utgpu!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!ucbvax!purdue.edu!comer From: comer@purdue.edu (Douglas Comer) Newsgroups: comp.os.xinu Subject: Re: disable macro in V6 XINU Message-ID: <8811031232.AA03013@merlin.cs.purdue.edu> Date: 3 Nov 88 12:32:54 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 40 >> I am using version 6 of Xinu on a PDP/11. I am attempting to >> disable the interrupts and am having a few problems. >> The first question is why when you use the disable macro must >> you use the symbol ps (ie disable(ps))? The disable macro is a kludge. We chose it because calling a procedure is too expensive on slow machines. The cc11 command inserts an awk script between the compiler and assembler to substitute correct offsets in place of the text "~ps". It only works with variable name "ps" because the cpp used doesn't substitute parameters inside quoted strings. >> Where is the space >> for this symbol defined? Why does the compiler not care if >> you did not define it in your program? You must define a local variable "ps" in any procedure that calls disable() restore(). >> My second question is why the statement "disable( ps)" make >> the compiler spit up with the following error: "/tmp/ctm3a###" >> followed by an "r 20" on the line immediately below it. The >> ### represents a random number. That's an assembler error messages (no kidding, that's what the original UNIX C compiler used -- really short, cryptic messages). It's a relocation error on line 20 of the temporary file that the C compiler has produced for you. You must have an old version of cc11 and the substitution script. The version of cc11 we've distributed for many years is a C program and the awk script is updated to catch missing ps declarations and report them. You should get the latest version. >> Finally, what does the ~ tell the assembler? (ie asm("mfps ~ps")) It means that the symbol is to be relocated wrt the local stack (i.e., it's a local variable in the code being assembled). Cheers, Doug