home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!sschaem
- From: sschaem@teleport.com (Stephan Schaem)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: PPC compilers
- Date: 5 Jan 1996 21:12:17 GMT
- Organization: Teleport - Portland's Public Access (503) 220-1016
- Message-ID: <4ck47h$g07@maureen.teleport.com>
- 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
- NNTP-Posting-Host: linda.teleport.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Organization: Teleport - Portland's Public Access (503) 220-1016
- Distribution: world
-
- Lars Duening (duening@ibr.cs.tu-bs.de) wrote:
- : In article <4cgo3i$b8n@sunsystem5.informatik.tu-muenchen.de> fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) writes:
- : >Lars Duening (duening@ibr.cs.tu-bs.de) wrote:
- : >
- : >: That doesn't count because in C you don't need to know if this statement
- : >: compiles to a .w, to a .l or even to a .q .
- : >
- : >but when the .l meets a real-world color-register, you will notice
- : >your claim is not always true.
-
- : If a have to access hardware registers (never had to so far), I will
- : not do this by direct pointers, but instead define a structure
- : representing them. This is then the only place where I have to worry
- : about .c, .w and .l, everywhere else I can write
- : 'chipregs->blt0con = *b++;' and let the compiler figure the rest out.
- : HLLs win again here: the compiler will warn if *b is of the wrong
- : type, and if I defined the structure wrong (your .w/.l example), I
- : just have to correct the structure, not the n statements where it is
- : used. And the compiler would even take care of bitshifts where
- : necessary.
-
- You let the compiler tell you AFTER you write your code about the type?
- Beleive me, you need to know before you write that line what type
- is chipmems->blt0con...
- What if blt0con was a pointer to an array of sub structure wich hold
- a pointer to a function that set blt0con according to the video mode?
- Dont you need to know that before you write your code? Do you really
- think the C ocmpiler will convert your line into what is really
- needed to do to set correctly the register?
-
- I cant see how people can write code without knowing what data or type
- they manipulate...
-
- : Your 'move.w (a0)+,(a1)+' doesn't tell you if the '.w' is correct or
- : not, unless you read the context and discover that a1 points to the
- : chip registers. It doesn't tell you either if the data pointed to by (a0)
- : is organized in words or in longwords - it just assumes that it is
- : organized in words.
-
- Yea, I agree... move.w (ax)+,(a1)+ just mean : "Copy 2 bytes from a0 to
- a1, and increment both address by 2"
- In C the equivalent to move.? (a0)+,(a1)+ is
-
- A++ = B++;
-
- And that beying defined somewhere:
-
- ushort *A,*B;
-
- Same thing to me... Aside that in ASM you dont get type checking at
- compile time.
-
- Do you really write code where you dont know what you are writting?
-
- Stephan
-