Return value to Register

Decked Canoes, Open Canoes, as long as they're canoes!

Moderators: kenneth, sbroam, TheKrikkitWars, Mike W., Sir Adam, KNeal, PAC, adamin

Post Reply
Lettin03
Posts: 2
Joined: Tue Nov 27, 2007 8:47 am
Location: Student

Return value to Register

Post 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?
michielv
C Boater
Posts: 28
Joined: Tue Nov 14, 2006 1:40 pm

Post 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 ;)
Bob P
CBoats Addict
Posts: 770
Joined: Thu Jan 16, 2003 10:04 pm
Location: Connecticut

Post 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:
Bob P
Lettin03
Posts: 2
Joined: Tue Nov 27, 2007 8:47 am
Location: Student

Post 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
michielv
C Boater
Posts: 28
Joined: Tue Nov 14, 2006 1:40 pm

Post 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*
Sir Adam
CBoats.net Staff
Posts: 4136
Joined: Mon Apr 08, 2002 12:00 am
Location: Adirondacks, NY State, USA
Contact:

Post 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:
Keep the C!
Adam
User avatar
kenneth
CBoats.net Staff
Posts: 540
Joined: Fri Apr 05, 2002 12:00 am
Location: Prescott, AZ
Contact:

Post 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! :)
User avatar
Mike W.
CBoats.net Staff
Posts: 2206
Joined: Fri Jan 03, 2003 10:52 pm
Location: Roanoke Rapids, NC
Contact:

Post by Mike W. »

Sir Adam wrote:usually during non-paddling season
When is it "non-paddling season"?
pdown2
C Guru
Posts: 157
Joined: Wed Sep 06, 2006 12:56 am
Location: Atlanta, GA

Post 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.
Sir Adam
CBoats.net Staff
Posts: 4136
Joined: Mon Apr 08, 2002 12:00 am
Location: Adirondacks, NY State, USA
Contact:

Post 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....
Keep the C!
Adam
User avatar
Mike W.
CBoats.net Staff
Posts: 2206
Joined: Fri Jan 03, 2003 10:52 pm
Location: Roanoke Rapids, NC
Contact:

Post 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:
User avatar
sbroam
CBoats.net Staff
Posts: 3969
Joined: Thu Nov 07, 2002 2:12 am
Location: Lexington, SC
Contact:

Post 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.
John Coraor
CBoats Addict
Posts: 545
Joined: Tue Mar 29, 2005 9:38 pm
Location: Long Island, NY

Post 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
Randy Dodson
C Guru
Posts: 187
Joined: Fri Sep 23, 2005 2:12 pm
Location: Arkansas

Post by Randy Dodson »

Yes we southern boaters like to use those body parts year round. :)
Parrot Head Paddler
User avatar
sbroam
CBoats.net Staff
Posts: 3969
Joined: Thu Nov 07, 2002 2:12 am
Location: Lexington, SC
Contact:

Post 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:
Post Reply