home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 531 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.8 KB

  1. Path: newsserver.rrzn.uni-hannover.de!tubsibr!duening
  2. From: duening@ibr.cs.tu-bs.de (Lars Duening)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 8 Jan 1996 23:12:14 GMT
  6. Organization: TU Braunschweig, Informatik (Bueltenweg), Germany
  7. Distribution: world
  8. Message-ID: <4cs8ce$ljg@ra.ibr.cs.tu-bs.de>
  9. References: <john.hendrikx.40ka@grafix.xs4all.nl> <4b77tq$htp@serpens.rhein.de> <MQAQx*XOe@yaps.rhein.de> <4bqhnf$6g5@sunsystem5.informatik.tu-muenchen.de> <jasonb.820051107@cs.uwa.edu.au> <4c9i2l$h3i@sunsystem5.informatik.tu-muenchen.de> <4cf0ep$233@ra.i <4ck37m$g07@maureen.teleport.com>
  10. Reply-To: duening@ibr.cs.tu-bs.de (Lars Duening)
  11. NNTP-Posting-Host: kastor.ibr.cs.tu-bs.de
  12.  
  13. In article <4ck37m$g07@maureen.teleport.com> sschaem@teleport.com (Stephan Schaem) writes:
  14. >Organization: Teleport - Portland's Public Access (503) 220-1016
  15. >Distribution: world
  16. >
  17. >Jim Cooper (jamie@jamie.interpath.net) wrote:
  18. >: In article <4cgo3i$b8n@sunsystem5.informatik.tu-muenchen.de> fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) writes:
  19. >: > Lars Duening (duening@ibr.cs.tu-bs.de) wrote:
  20. >: > : That doesn't count because in C you don't need to know if this statement
  21. >: > : compiles to a .w, to a .l or even to a .q .
  22. >: > 
  23. >: > but when the .l meets a real-world color-register, you will notice
  24. >: > your claim is not always true.
  25. >
  26. >: Why do you insist on making this seem harder than it needs to be?
  27. >
  28. >: The answer is quite simple and straightforward:
  29. >
  30. >: In ASM, *you*, the programmer, must remember to add the '.w' by hand every
  31. >: time you reference the "real-world color-register," otherwise, possible
  32. >: fireworks.
  33. >
  34. >: In C, the structure is defined *once*, in a system header file, in fact, and
  35. >: the programmer never needs to know if the compiler will generate '.w', '.l',
  36. >: or anything else.
  37. >
  38. > Just a reminder... in C or ASM you need to know what a color register
  39. > is if you want to operate on it, unless you call high level function
  40. > to do the job for you (Even them you need to look in the .h or doc
  41. > what type is needed as parameter).
  42.  
  43. I need to know if it's a scalar type (further subdivided into integer
  44. and floating types), an array, a structure, a pointer or else, but I
  45. do not need to know it's exakt size in byte when using it.
  46.  
  47. Sometimes I don't even need to know the exact type 'cause the compiler
  48. will create conversion code plus overflow checking (I'm not talking
  49. just C here).
  50.  
  51. In optimum cases, the values of the chipregs have been assigned own
  52. types, so I can just write 'blt0con_t *b;' or less specific 'int32
  53. *b;'. Again I don't need to know the size of the type, just which of
  54. the scalar integer types it is.
  55.  
  56. > Otherwise you need to know that color0 is a word holding 12bit
  57. > of valid data grouped in 4bit nibles, 
  58.  
  59. typedef struct {
  60.   int r : 4;
  61.   int g : 4;
  62.   int b : 4;
  63. } color0_t;
  64.  
  65. color0_t color0;
  66. -- 
  67. Lars Duening; duening@ibr.cs.tu-bs.de
  68.