Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mit-eddie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!barmar From: barmar@mit-eddie.UUCP (Barry Margolin) Newsgroups: net.lang.c Subject: Re: No Such Thing Message-ID: <5118@mit-eddie.UUCP> Date: Tue, 27-Aug-85 03:45:57 EDT Article-I.D.: mit-eddi.5118 Posted: Tue Aug 27 03:45:57 1985 Date-Received: Wed, 28-Aug-85 21:23:25 EDT References: <10176@ucbvax.ARPA> Reply-To: barmar@mit-eddie.UUCP (Barry Margolin) Organization: MIT, Cambridge, MA Lines: 26 To me, the mapping TRUE -> 0 and FALSE -> non-zero doesn't seem obvious, and I'm sure it isn't to most programmers who ever worked in assembler. In assembler, one often writes the following (I'm using pseudocode rather than any particular assembler): compare two values jumpto stuff if zero Which is the assembler equivalent of if (value1 == value2) ; When I was in high school I was programming TRS-80's in both assembler and BASIC, and I had lots of trouble remembering whether BASIC represented truth as zero or -1. No such memory is needed for the assembler, of course, since comparison is merely done by subtraction (a compare instruction is usually just a subtract instruction that doesn't store the result anywhere), so it is obvious what the zero indicator means. It is not so obvious to me that in C 0 should mean false and 1 mean true. -- Barry Margolin ARPA: barmar@MIT-Multics UUCP: ..!genrad!mit-eddie!barmar