Page 1 of 1

Return value to Register

Posted: Tue Nov 27, 2007 8:55 am
by Lettin03
Guys, I have a code that reads my register

Code: Select all

#define IOBASE 0x4000

void leesRegister( unsigned char* Register )
{
  Register[0] = *( ( unsigned char* ) ( IOBASE + 0x10 ) );
  Register[2] = *( ( unsigned char* ) ( IOBASE + 0x12 ) );
  Register[4] = *( ( unsigned char* ) ( IOBASE + 0x14 ) );
}
The adress of my Register is 0x4000 and I am using 3 Registers. However, I also need a code that writes these Registers (the exact opposite). The headline of this function is

Code: Select all

void schrijfRegister( int Register, unsigned char ddr )
So it contains 2 arguments. I dont know what I am doing wrong but I cant figure out how to write the code. What I have is

Code: Select all

  ( IOBASE + 0x10 ) = ( int ) ( unsigned char );
But this compiles an error E4062C: syntax error near `;'. Can someone see what I am missing or doing wrong?

Posted: Tue Nov 27, 2007 10:35 am
by michielv
Well, for starters, this is a C-boat forum, about canoeing (canoes are also known as c-boats). Not a C as in the programming language forum ;)

I won't mind diving into my old study books to find an answer for you although my C programming days are a long time ago :D

BTW: based upon the names of the functions, you are Dutch or Belgian I assume? If so, that may make things easier to explain sometimes.

Groetjes,

Michiel

PS Now I know why I always hated C programming, I always messed up my pointers ;)

Posted: Tue Nov 27, 2007 12:33 pm
by Bob P
A little Minicell and ducktape will fix anything. You just have to figure out where to put it in the code. :roll:

Posted: Tue Nov 27, 2007 1:04 pm
by Lettin03
Haha this is awesome. Didn't see it untill now, well I don't think I'm going to get much information here. So thanks for your reaction and take care.

P.S: Na me studie geen woord meer programmeren :P

Posted: Tue Nov 27, 2007 1:11 pm
by michielv
Na je studie kun je best gaan programmeren maar doe dan leuke dingen, geen registries in windhoos proberen te gebruiken ;)

BTW: the subtitle of the forum is: "Decked Canoes, Open Canoes, as long as they're canoes", that should have given it away *LOL*

Posted: Tue Nov 27, 2007 1:15 pm
by Sir Adam
For those of you that rememeber the "old" C-forum, this used to happen all the time. Occasionally doubly-C minded folks helped out (usually during non-paddling season). Usually we moderators delete extraneous posts, but I'll leave this one, as the poster was polite, as were the responses, and it is a good reminder to all of us to look at the site and use the search feature before posting :wink:

Posted: Tue Nov 27, 2007 11:00 pm
by kenneth
Ok, now I feel like an idiot. How is it that I, a computer geek at least reasonably familiar with the C programming language, didn't EVER associate "C Forum" or "C Video" or "C Events" with C???? All these years I've overlooked that semantic similarity. Maybe for CBoats v3 I'll rename those areas of the site! :)

Posted: Wed Nov 28, 2007 12:30 am
by Mike W.
Sir Adam wrote:usually during non-paddling season
When is it "non-paddling season"?

Posted: Wed Nov 28, 2007 1:16 am
by pdown2
When you're wife threaten to shove your favorite paddle up your ..... if you go paddle one more ..... weekend with your friends instead of visiting with relatives that came in for the holidays. Just a guess though.

Posted: Wed Nov 28, 2007 1:24 am
by Sir Adam
When the river is frozen over, I don't paddle.

That said, I HAVE been known to paddle in Jan and Feb during thaws....

At least a good snowy winter means good tele skiing, and a great spring paddling season....usually anyway....

Posted: Wed Nov 28, 2007 1:39 am
by Mike W.
pdown2 wrote:When you're wife threaten to shove your favorite paddle up your .....
AHHH, now I see :wink:

Rivers don't freeze down here. Although I did see ice way up North in Richmond last winter :lol:

Posted: Wed Nov 28, 2007 10:11 am
by sbroam
I've seen ice in a glass of tea and yes, that would be sweet tea. ;-) We have had ice on our gear before and my father-in-law tells of a time on the Chattooga when they had to break ice to get back to the shore.

Posted: Wed Nov 28, 2007 5:04 pm
by John Coraor
Mike W. wrote:Rivers don't freeze down here. Although I did see ice way up North in Richmond last winter.

sbroam wrote:I've seen ice in a glass of tea and yes, that would be sweet tea. ;-) We have had ice on our gear before and my father-in-law tells of a time on the Chattooga when they had to break ice to get back to the shore.
All this goes to show that you southern c-boaters are just wusses. REAL c-boaters can be found in the Northeast where "having brass ones" isn't just an expression, its a factual reference to the frozen solid state of the relevant parts of your body.

John

Posted: Wed Nov 28, 2007 5:51 pm
by Randy Dodson
Yes we southern boaters like to use those body parts year round. :)

Posted: Wed Nov 28, 2007 6:35 pm
by sbroam
John Coraor wrote:...

All this goes to show that you southern c-boaters are just wusses. REAL c-boaters can be found in the Northeast where "having brass ones" isn't just an expression, its a factual reference to the frozen solid state of the relevant parts of your body.

John
Are we wusses because our weather is sensible (except maybe in August)? I'd paddle even if it was colder, but why drive that far? :lol: