From: utzoo!decvax!harpo!seismo!hao!hplabs!sri-unix!dbj.rice@Rand-Relay Newsgroups: net.unix-wizards Title: Re: Questions about nil-pointer dereferences (the "plague") Article-I.D.: sri-arpa.798 Posted: Wed Mar 16 22:05:15 1983 Received: Mon Apr 4 02:17:48 1983 From: Dave B Johnson For programs made with "cc" (without running "ld" explicitly), Berkeley 4.1BSD DOES (implicitly) guarantee a zero byte at address 0. The fact that you had problems with this in porting a locally written C program from Unix 4.1 to VMS/Eunice is a bug in Eunice, not a problem with Unix. 4.1BSD crt0.o ALWAYS has a zero register save mask in it and is ALWAYS loaded at address 0 by "cc". Crt0 is written in assembler and has an explicit ".word 0x0000" for a register save mask. In addition, the value of the register save mask in crt0 has no affect on saving registers, since the Unix kernel does not "call" the program, but rather jumps directly into it after the register save mask. Saving the registers is not necessary since there is nowhere to return to abover crt0. In writing our Unix emulator Phoenix, I have been very careful of details like this which cause Unix programs to break. Phoenix will run almost any Unix program under VMS unmodified, even those that depend on undocumented details of the Unix environment such as this. Dave *B* Johnson Dept. of Mathematical Sciences Rice University P.S. Dave *D* Johnson, huh? I like your name...