Re: A92: Re: A89: Re: Re: "Transfer" of values between C and ASM
[Prev][Next][Index][Thread]
Re: A92: Re: A89: Re: Re: "Transfer" of values between C and ASM
Actually, that code using "mylist" was incorrect (or the explanation was
incorrect, I don't know which because I don't know that list library, but I
do know C). If you define a variable this way:
list *mylist;
then mylist is a pointer to a list. When you are passing mylist to a
function, *mylist is a list, mylist is a pointer to a list, and &mylist is a
pointer to a pointer to a list. So &mylist is correct in the function call
if the function expects a pointer to a pointer to a list, which I suppose is
a possibility. For those of you who are unfamiliar with C but wish to use
ti-gcc, I'd suggest you buy a book on it (Practical C++ Programming is very
good, I think). I'd suggest that during the learning process, you use djgpp
(www.delorie.com, I think), as it's free, and it's the basis of ti-gcc. It
will probably be much easier to learn it first on a fairly easy platform than
to start out on the 92, which promises to be somewhat tricky (although
probably much easier than in assembly).
Of course that's just my opinion, but programming the 92 will require lots of
pointer arithmetic, which is confusing to everyone when he first learns it.
Also, about the suggestion of:
var1,var2 = func(a,b,c);
It would be nice if it worked that way, but unfortunately, it doesn't.
Functions can return only one value. Though if you try it, it will compile
correctly. What that code really does is this: it looks at var1, does
nothing with it, then sets var2 to the return value of func.
-Noah