🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #11879

Re: new instructions

#11879
From: Danny Boulet
Date: Thu, 30 May 1991 16:09
32 lines
1649 bytes
In article <4711.2843a523@iccgcc.decnet.ab.com> herrickd@iccgcc.decnet.ab.com writes:
>In article <12526@mentor.cc.purdue.edu>, hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
>[Herman supplies some of the specifics people have been asking for]
>
>> There are provisions for octal and hex
>> integers [in c],
>
>I thought so too, and one day I tried to write an integer constant
>in octal.  The compiler said, "Nuts to you!"  It took some hours,
>but I finally convinced myself that the compiler manual and then
>Kernigan and Ritchie provide octal notation for CHARACTERS.  Nothing
>else!  I thought it was a major design flaw and was no accident.
>
>dan herrick
>herrickd@iccgcc.decnet.ab.com

Octal constants are written with the first digit zero.  The following
program

    main()
    {
	printf("test number is %d\n",01234567);
	printf("reverse is 0%o\n",342391);
	exit(0);
    }

produced the following output using cc on my Sun Sparc IPC running
SunOS 4.1.1 and should produce identical output on any 32-bit int
implementation of C:

    test number is 342391
    reverse is 01234567
Technical Details
Message-ID: <1991May30.160914.5251@ccu.umanitoba.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!ubitrex.mb.ca!dab
References: <9105200213.AA05095@ucbvax.Berkeley.EDU> <12526@mentor.cc.purdue.edu> <4711.2843a523@iccgcc.decnet.ab.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!ubitrex.mb.ca!dab
From: dab@ubitrex.mb.ca (Danny Boulet)
Newsgroups: comp.arch
Subject: Re: new instructions
Message-ID: <1991May30.160914.5251@ccu.umanitoba.ca>
Date: 30 May 91 16:09:14 GMT
References: <9105200213.AA05095@ucbvax.Berkeley.EDU> <12526@mentor.cc.purdue.edu> <4711.2843a523@iccgcc.decnet.ab.com>
Sender: andchan@ccu.umanitoba.ca (Andrew Chan)
Organization: Ubitrex Corporation, Winnipeg, Manitoba, Canada
Lines: 32