Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdcsu.UUCP Path: utzoo!watmath!watnot!watdcsu!herbie From: herbie@watdcsu.UUCP (Herb Chong [DCS]) Newsgroups: net.works Subject: Re: Not again!? Assembler vs High-Level languages Message-ID: <1228@watdcsu.UUCP> Date: Thu, 11-Apr-85 11:29:06 EST Article-I.D.: watdcsu.1228 Posted: Thu Apr 11 11:29:06 1985 Date-Received: Fri, 12-Apr-85 00:01:55 EST References: <483@terak.UUCP> <2251@wateng.UUCP> <492@terak.UUCP> <5461@utzoo.UUCP> Reply-To: herbie@watdcsu.UUCP (Herb Chong [DCS]) Organization: U of Waterloo Lines: 54 Summary: In article <5461@utzoo.UUCP> laura@utzoo.UUCP (Laura Creighton) writes: >I have mostly used assembler, not when I needed something *fast* as >when I needed something *real small*. But there it is easy -- write the >code in C, produce the assembler and then tighten that. (but not on the >pdp-8, though. I don't think there *is* a C compiler for the pdp-8) > >Laura Creighton >utzoo!laura on some systems other than unix, assembler is used because of the special restrictions of the design of the system. in VM/CMS, many system services are awkward to get at directly from a high-level language (poor design) but are very useful. other system services are designed to not be accessible from a high level language. CMS itself occupies a part of the user's address space but is protected against write by ordinary programs. a special area (called the transient area) is reserved for commands that are not part of the kernel but are often used. it's only 8k in size, but there are many compelling reasons to write commands that use that area. i wrote a version of the Boyer-Moore string matching algorithm to fit in 8K, and it contains a shell sort, error handler, and interrupt handler. the most important reasons for making it transient was to make it available to be called by any high-level language program and to use system services not available otherwise. because CMS is in the same address space as a user program, it is possible to use kernel code by branching directly to it instead of doing a system call (SVC) provided certain conditons are met. i do i/o by branching directly to the i/o routines in the kernel. execution time is reduced by 1/3 because i bypass the system call interface. this is a well documented, but seldom used, feature of CMS because of the restrictions on write access to the kernel. it is possible (using our Waterloo C compiler) to write a C program that fits in the transient area, but the minimal library occupies about 4K, leaving 4K for code and variables. using assembler partly depends also upon the coding style used. everyone writes it their own way unless compelled to do otherwise. writing code that is meant to be modified by others requires discipline and consistency. at waterloo, we modify and maintain our own version of VM/SP3 that is sufficiently different from others that it takes getting used to. it's all written in /370 assembler. maintaining it is no more trouble, in my opinion, than 4.2bsd code, not because /370 assembler is so good, but because badly written C code (as most of 4.2bsd is) is worse than well written assembler. miscellaneous ramblings from the keyboard of Herb Chong... I'm user-friendly -- I don't byte, I nybble.... UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!water!watdcsu!herbie CSNET: herbie%watdcsu@waterloo.csnet ARPA: herbie%watdcsu%waterloo.csnet@csnet-relay.arpa NETNORTH, BITNET, EARN: herbie@watdcs, herbie@watdcsu