# Forum: ARM programming with GCC/GNU tools Basic understanding of commands

 Author: Stefan Ludwig (stefanl38) Posted on: 2006-09-29 16:44

Rate this post
 0 ▲ useful ▼ not useful
Hello,

im very new to ARM-GCC and c itself

so i have two very basic questions.
So "almost"-newbies have the pleasure to give an answer too.

what does the "~" do ?

example:

VICIntSelect &= ~0x00000040;

i was googling a lot but did not find anything at all
related to "c"

VICIntSelect is just a constant defined in the headerfile lpc2xxx.h

#define VICIntSelect   (*((volatile unsigned long *) 0xFFFFF00C))

das the commandline

VICIntSelect = 0x00000040;

mean: store value "0x00000040" in Memory-Adress "0xFFFFF00C" ?

greetings

Stefan

 Author: Stefan (Guest) Posted on: 2006-09-29 17:46

Rate this post
 0 ▲ useful ▼ not useful
Stefan Ludwig wrote:
> what does the "~" do ?

~ (tilde) 1's complement

in German: "Komplementierung aller Bits eines Integer-Wertes
(NOT/Einer-Komplement)."

Examples:
~00000000 == 11111111
~11111111 == 00000000
~11001101 == 00110010

http://www.schellong.de/c.htm#oper (German)
http://www.lysator.liu.se/c/bwk-tutor.html#bit

> VICIntSelect = 0x00000040;
> mean: store value "0x00000040" in Memory-Adress "0xFFFFF00C" ?

Yes.

Another Stefan ;-)

 Author: Clifford Slocombe (clifford) Posted on: 2006-09-30 03:05

Rate this post
 0 ▲ useful ▼ not useful
Stefan Ludwig wrote:
> i was googling a lot but did not find anything at all
> related to "c"
What did you googler on? Obviously typing '~' into google would not get
you far! Googling of "C Operators" would have got you the answer - as
would any good C reference (in fact even a bad reference!). Get yourself
a copy of K&R for example.

Clifford

 Author: Clifford Slocombe (clifford) Posted on: 2006-10-18 20:34

Rate this post
 0 ▲ useful ▼ not useful
Clifford Slocombe wrote:
> Stefan Ludwig wrote:
>> i was googling a lot but did not find anything at all
>> related to "c"
> What did you googler on? Obviously typing '~' into google would not get
> you far! Googling of "C Operators" would have got you the answer - as
> would any good C reference (in fact even a bad reference!). Get yourself
> a copy of K&R for example.
>
> Clifford

Just for the record, this is the response this ilicited from Stefan by
privaed e-mail:

====================================
so you're just another one of this arrogant guys
throwing around special TLA*s like "K&R"

What if I even did not know that "~" is an OPERATOR?

====================================

I am sorry Stephan, if you found the response unhelpful. That was not
answered, so rather than duplicate the information I thought that
perhaps a better approach to problem solving than posting to a forum
might be helpful. Also the suggestion would have provided information on
all the other C operators as well. It is interesting that you found that

It did not seem unreasonable to me that if you are going to use a
programming language that you should have some sort of language
reference. "The C Programming Language" by Kernighan and Ritchie (K&R)
is the seminal work on the language. It commonly referred to as K&R, and
Google'ing on just that will certainly tell you what it is if you were
not familiar.

If you did not realise that '~' was an operator, than you don't really
understand the syntax of C. All the more reason to get a reference.

 Author: FordP (Guest) Posted on: 2006-10-19 23:21

Rate this post
 0 ▲ useful ▼ not useful
Another suggestion if you find a search engine does not work for you, is
to head over to wikipedia which will always lead to a starting point to

Good Luck with learning ANSI C, I have been using it for 18 years so I
think I have the hang of it now!

 Author: FordP (Guest) Posted on: 2006-10-20 00:23

Rate this post
 0 ▲ useful ▼ not useful
I took some of my own medcine and found this :-

http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B

FordP wrote:
> Another suggestion if you find a search engine does not work for you, is
> to head over to wikipedia which will always lead to a starting point to
> find out about such things.
>
> Good Luck with learning ANSI C, I have been using it for 18 years so I
> think I have the hang of it now!

• Post long source code as attachment, not in the text

### Formatting options

• [c]C code[/c]
• [avrasm]AVR assembler code[/avrasm]
• [code]code in other languages, ASCII drawings[/code]
• $formula (LaTeX syntax)$
 Name: E-mail address (not visible): Subject: Searching for similar topics... Attachment: Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one. Text: