Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!amdahl!drivax!tyler From: tyler@drivax.UUCP (William Tyler) Newsgroups: comp.arch Subject: Re: 32-bit CPUs ( NEC V70 ) and silly examples Message-ID: <1526@drivax.UUCP> Date: Mon, 11-May-87 14:38:55 EDT Article-I.D.: drivax.1526 Posted: Mon May 11 14:38:55 1987 Date-Received: Sat, 16-May-87 01:33:52 EDT References: <3810030@nucsrl.UUCP> <491@necis.UUCP> <3530@spool.WISC.EDU> <4016@necntc.NEC.COM> <162@auvax.UUCP> Reply-To: tyler@drivax.UUCP (William Tyler) Followup-To: comp.arch Distribution: na Organization: Digital Research, Monterey Lines: 29 Keywords: V60, V70, not so silly examples Summary: Not so silly In article <162@auvax.UUCP> rwa@auvax.UUCP (Ross Alexander) criticizes the following example C code & V60/V70 implementation as being contrived. >> _______________________________________________ >> | struct sttyp { >> | unsigned first, second, third; >> | struct sttyp *fourth; >> | double fifth, a,b,c,d,e;} *stru >> C code: | >> | >> | stru->fourth->fourth->third = 2; >> |============================================== >> | mov.w _stru+0xc,r0 # &(stru->fourth) in R0 >> Assembly: | >> | mov.w #2,0x8[0xc[r0]] # stru->fourth-> >> | # fourth->third = 2; >> |______________________________________________ In programs dealing with complex data structures, this sort of construction comes up fairly often. Just as an exercise, I used egrep on one modest sized (about 1K lines) C program of mine that deals primarily with data structure manipulation. I came up with 2 pages of lines that contained '->' at least three times, most of them in constructs roughly equivalent to the example above. In the context of the application, the usages were not contrived, nor were they particularly difficult to understand. -- Bill Tyler ... {seismo,hplabs,sun,ihnp4}!amdahl!drivax!tyler