Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site cyb-eng.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!ut-sally!cyb-eng!bc From: bc@cyb-eng.UUCP (Bill Crews) Newsgroups: net.lang.c Subject: Re: Uses of "short" ? Message-ID: <710@cyb-eng.UUCP> Date: Fri, 13-Sep-85 13:49:53 EDT Article-I.D.: cyb-eng.710 Posted: Fri Sep 13 13:49:53 1985 Date-Received: Sat, 14-Sep-85 17:01:11 EDT References: <486@houxh.UUCP> <2761@sun.uucp> <697@cyb-eng.UUCP> <2789@sun.uucp> Organization: Cyb Systems, Austin, TX Lines: 28 > Even when writing grubby device driver code, you should use C as a > higher-level language. There's no benefit to be gained from thinking of, > say, the I/O operation/buffer header queue of a disk driver as a bunch of > words, some of which contain addresses, some of which contain counts, etc.. > The ability of C to get "close to the machine" is vastly overemphasized; 99% > of the code people write, even in OSes and the like, doesn't need to get > "close to the machine" in the same sense as an assembler language gets > "close to the machine" and, in most cases, *doesn't* get "close to the > machine" in that sense. > > Guy Harris You are invited to write a 3Com Ethernet driver that works on a PC (16-bit int) and on a Cyb machine (32-bit int) without referring to longs or shorts. I.e., a 16-bit hardware register is a 16-bit hardware register, despite your desire for abstraction. I doubt we disagree fundamentally; I just think you are stating the case too strongly. My goal is to introduce environment dependencies only as needed. I nevertheless believe, for instance, that when Internet protocol specifies that the header checksum is a 16-bit 2's-complement number, it is wise to comply, if you want the packets to fly properly. -- / \ Bill Crews ( bc ) Cyb Systems, Inc \__/ Austin, Texas [ gatech | ihnp4 | nbires | seismo | ucbvax ] ! ut-sally ! cyb-eng ! bc