Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site amdahl.UUCP Path: utzoo!linus!decvax!decwrl!sun!amdahl!mat From: mat@amdahl.UUCP (Mike Taylor) Newsgroups: net.works,net.arch Subject: Re: Assembly VS HOL: A (admittedly biased) Challenge. Message-ID: <1478@amdahl.UUCP> Date: Thu, 2-May-85 17:26:20 EDT Article-I.D.: amdahl.1478 Posted: Thu May 2 17:26:20 1985 Date-Received: Tue, 7-May-85 20:05:56 EDT References: <1220@topaz.ARPA> <511@terak.UUCP> <1440@amdahl.UUCP> <518@terak.UUCP> <741@mako.UUCP> Organization: Amdahl Corp, Sunnyvale CA Lines: 36 Xref: linus net.works:774 net.arch:955 > Here's a short register dump routine. It works fine on UTek (a Berklyoid), > but I don't have access to V or true 4.2. It is probably non-portable to > those. I wrote it in under an hour and it worked the first time. I used > assembly because I couldn't figure out how to do it in C, but I don't claim to > be a seasoned C hacker. Would others care to demonstrate HOL approaches to > the problem, preferably in a friendly, non-inflamitory manner? > > To assemble on your favorite NS32000-based system: > The following routine steals registers off the stack on my system (Amdahl) in C. It isn't much more portable than yours, though. I don't have an NS32000 and I didn't finish the job, but it's similar, and it seems to work. regs(message) char *message; { struct r { int regval[6]; } rinst; char *format = "\t%s\n r14 r13 r12 r10 r9 r8 \n%8x %8x %8x %8x %8x %8x\n"; int *point; point = &rinst ; point = point + 14; /* this is a cheat */ printf(format,message,point->regval[5], point->regval[4], point->regval[3], point->regval[2], point->regval[1], point->regval[0]); } -- Mike Taylor ...!{ihnp4,hplabs,amd,sun}!amdahl!mat [ This may not reflect my opinion, let alone anyone else's. ]