home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4850 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  1.3 KB

  1. Path: sparky!uunet!opl.com!scott
  2. From: scott@opl.com (Scott Evernden)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: PASCAL
  5. Message-ID: <1395@ottawa.opl.com.opl.com>
  6. Date: 11 Jan 93 22:06:51 GMT
  7. References: <93008.102758TMVANDER@MTUS5.BITNET>
  8. Sender: news@opl.com
  9. Organization: OPL., Inc.
  10. Lines: 21
  11.  
  12. In article <93008.102758TMVANDER@MTUS5.BITNET> TMVANDER@MTUS5.BITNET writes:
  13. >I'm new to this programming in windows, and I'm curious as to why WinMain
  14. >is alwasy declared as a PASCAL calling sequence.  Please e-mail me.
  15. >      - Todd Vander Woude
  16. >--
  17. >tmvander@major.cs.mtu.edu
  18.  
  19. I believe it's because the Pascal calling convention is slightly more
  20. efficient than the C convention.  With C routines, the caller must cleanup
  21. (pop) arguments passed to a function.  With the PASCAL convention, the
  22. called routine cleans up the stack.  A variation of the INTEL RET opcode
  23. can include a count which will automagically do this stack cleanup as part
  24. of the return operation, saving the caller the trouble and the cycles.
  25.  
  26. Of course, this might not be the reason also...
  27.  
  28. -scott
  29. ----
  30. Technical Consultant      GrayMatter Software      Holliston MA
  31. spe@world.std.com    scott@opl.com    73116.3451@compuserve.com
  32. User interface and application development technology and tools
  33.