Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site faron.UUCP Path: utzoo!linus!faron!munck From: munck@faron.UUCP (Robert Munck) Newsgroups: net.arch Subject: Re: Using C as an aid to hand writing assembler Message-ID: <566@faron.UUCP> Date: Mon, 12-May-86 22:25:57 EDT Article-I.D.: faron.566 Posted: Mon May 12 22:25:57 1986 Date-Received: Tue, 13-May-86 05:35:29 EDT References: <817@harvard.UUCP> <460@cubsvax.UUCP> Reply-To: munck@faron.UUCP (Robert Munck) Organization: The MITRE Coporation, Bedford, MA Lines: 31 Summary: In article <201@pyuxv.UUCP> sr@pyuxv.UUCP (25220-S Radtke) writes: > >> Some years ago when I was learning 6800 assembler (anybody remember >>D2 kits?) I used to first write everything in C and then hand compile it As a minor addition to the technique (and to show that you're not forced to expose yourself to possible chromosome damage by using C) I wrote the Navy's standard executive for their 16-bit line of computers (AN/UYK-20, -44, AN/AYK-14) first in Ada (as it existed in 1979). Of course, there were no Ada compilers then, so I hand-translated some of the important algorithms -- task scheduling, memory allocation -- into Pascal that I could compile and run. This was used to debug and tune them for speed. Finally, I wrote some assembler macros supporting IF-THEN-ELSE, looping, and subroutine invocation and hand-translated the Ada/Pascal into assembler/macros. The contract was competitive: a team from an unnamed mainframe manufacturer wrote their own version, but all in assembler. There was great emphasis on speed, so they wrote theirs as one giant assembly program to avoid the overhead of subroutine calls. Mine was divided into 60-odd modules. They spent their time on micro- optimization of the assembly; I spent mine on the overall design. Mine was about 10% faster. The OS I'm writing now, for the 80386, will be in Ada from start to finish. If, when it's up and running, I find that 90% of its execution time is in 10% of the code (which is likely), I'll look at that 10% for possible recoding of strategic modules in assembler. I'll also keep the Ada routines that are replaced, for future retargetting. -- Bob Munck