Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!csg From: csg@pyramid.UUCP (Carl S. Gutekunst) Newsgroups: net.arch Subject: Re: Using C as an aid to hand writing assembler Message-ID: <358@pyramid.UUCP> Date: Thu, 8-May-86 15:39:18 EDT Article-I.D.: pyramid.358 Posted: Thu May 8 15:39:18 1986 Date-Received: Sun, 11-May-86 00:38:01 EDT References: <2336@phri.UUCP> Reply-To: csg@pyramid.UUCP (Carl S. Gutekunst) Organization: Pyramid Technology Corp., Mountain View, CA Lines: 22 In article <2336@phri.UUCP> roy@phri.UUCP (Roy Smith) writes: >... I used to first write everything in C and then hand compile it >into M6800 asm.... >as long as you keep your code simple, the conversion is trivial and can be >done in your head as fast as you can write down the asm code. Perhaps the >simplicity of the M6800 makes this easier than for something like a vax.... Interestingly enough, this is exactly the way Roy Harrington wrote all of Z80 Cromix. The entire kernel was written first in C, then hand compiled into Z80 assembler. It's the only assembler program of that magnitude (40K of code) that I've ever worked with that was easy and pleasant to maintain. (Roy's C coding was very clean as well, which helped.) The penalty was that many of the C constructs needed for a Unix-like OS did not map well into the Z80's instruction set, or required use of the highly inefficient IX and IY instructions. Hence the OS was both bigger and slower than it could have been. On the other hand, the tty driver was written using more "classical" coding style, with all the usual sorts of "clever" tricks you can do in assembler. It was slower than frozen mud, buggy, and impossible to maintain.