home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vms
- Path: sparky!uunet!utcsri!torn!spool.mu.edu!think.com!yale.edu!newsserver.jvnc.net!darwin.sura.net!udel!rochester!rit!whd0675
- From: whd0675@cs.rit.edu (Walter H Dick, III)
- Subject: Yet another VAX C problem
- Message-ID: <1993Jan25.162602.4980@cs.rit.edu>
- Sender: news@cs.rit.edu
- Nntp-Posting-Host: silver
- Organization: Rochester Institute of Technology, Rochester, NY
- Date: Mon, 25 Jan 1993 16:26:02 GMT
- Lines: 37
-
- void test(unsigned int *ip)
- {
- *ip = (*ip + 511) / 512;
- }
-
- In VAX C 3.2, it generates:
-
-
- 0000 test:
- 000C 0000 .entry test,^m<r2,r3>
- 5E 04 C2 0002 subl2 #4,sp
-
- 53 04 AC D0 0005 movl 4(ap),r3
- 52 63 000001FF 8F C1 0009 addl3 #511,(r3),r2
- 51 D4 0011 clrl r1
- 50 52 D0 0013 movl r2,r0
- 52 00000200 8F D0 0016 movl #512,r2
- 09 18 001D bgeq vcg.1
- 50 52 D1 001F cmpl r2,r0
- 09 1A 0022 bgtru vcg.2
- 51 D6 0024 incl r1
- 05 11 0026 brb vcg.2
- 0028 vcg.1:
- 50 51 50 52 7B 0028 ediv r2,r0,r1,r0
- 002D vcg.2:
- 63 51 D0 002D movl r1,(r3)
-
- 04 0030 ret
-
-
- Command Line
- ------------
- CC/MAC/LIST/SHOW=NOSOURCE TEST2.C
-
- Why is the question?
-
- whd0675@cs.rit.edu
-