Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 v7 ucbtopaz-1.8; site ucbtopaz.CC.Berkeley.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ucbvax!ucbtopaz!mwm From: mwm@ucbtopaz.CC.Berkeley.ARPA Newsgroups: net.lang,net.arch Subject: Re: Assembly VS HOL: A (admittedly biased) Challenge. Message-ID: <916@ucbtopaz.CC.Berkeley.ARPA> Date: Thu, 2-May-85 21:52:15 EDT Article-I.D.: ucbtopaz.916 Posted: Thu May 2 21:52:15 1985 Date-Received: Sun, 5-May-85 02:15:39 EDT References: <1220@topaz.ARPA> <511@terak.UUCP> <1440@amdahl.UUCP> <518@terak.UUCP> <741@mako.UUCP> Reply-To: mwm@ucbtopaz.UUCP (Praiser of Bob) Organization: Missionaria Phonibalonica Lines: 42 Xref: watmath net.lang:1567 net.arch:1146 Summary: In article <741@mako.UUCP> jans@mako.UUCP (Jan Steinman) writes: >Here's a short register dump routine. Would others care to demonstrate >HOL approaches to the problem, preferably in a friendly, non-inflamitory >manner? I can't resist :-). The problem is obviously machine-dependent, so here are solutions for two different architectures, In two different languages. First, for DEC mainframes and compatibles, we have a C macro: #define dump_regs(label) do \ {static int *r = (int *) 0; \ printf("%s\n%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d%8d", \ label, r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], \ r[010], r[011], r[012], r[013], r[014], r[015], \ r[016], r[017]); \ } while (0) Unfortunately, I don't have access to a system to test it on, but it compiles, and should work. Now, for any true stack machine, this clu proc will work: dump_regs = proc (label: string) signals (no_registers) signal no_registers end dump_regs And, just to prove that I really am I Unix wizard, I'll note that you can write a C routine to do exactly what you want on any Unix box, with "just a small kernel mod" (in C, of course) :-). The point? You mean I was supposed to have a point? Well, I do. The entire discussion of HOL vs. asmbumbler is silly. There are problems that are suited to both. Things that need lots of speed, or need to get into the nitty-gritty of the hardware should probably be done in assembler (but may not have to). Things that you want to be portable to many machines should be done in a HOL. Enough,