# A beginners programming tutorial for MSP430

Started by January 5, 2009
This programming tutorial will be helpful for beginners and newbies.

http://referencedesigner.com/tutorials/msp430/msp430_01.php
> This programming tutorial will be helpful for beginners and newbies.
> http://referencedesigner.com/tutorials/msp430/msp430_01.php

I have seen this before but parts of it seems to be broken. For
example
http://referencedesigner.com/tutorials/msp430/msp430_09.php
is not available for me.
Martin
This "tutorial" has some major bugs in example code. For example:

http://referencedesigner.com/tutorials/msp430/msp430_04.php
P6DIR |= (1< P6OUT|= (1< P6OUT&=~(1<
This code uses P6.1 and not P6.0 because (1<
The code should be:
P6DIR |= BIT0;
P6OUT |= BIT0; // P6.0 High
P6OUT &= ~BIT0; // P6.0 Low

In general, the BITx defines should not be used in a (1 << BITx) form
as they are already defined as follows:
#define BIT0 (1 << 0) // 1
#define BIT1 (1 << 1) // 2
#define BIT2 (1 << 2) // 4
#define BIT3 (1 << 3) // 8
#define BIT4 (1 << 4) // 16
etc.

Somewhere else on the same page:
"Similary, the statement P1DIR |= (1<<0x03), will assign P1.2 to be an
output pin.:

This is also incorrect. (1<<0x03) is 11 in binary, which means the
statement sets bits 0 and 1. Thus P1.0 and P1.1 are set to output mode
and not P1.2.

http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c

regards, Johan.
On Mon, Jan 5, 2009 at 11:46 PM, v_shukla72 wrote:
> This programming tutorial will be helpful for beginners and newbies.
>
> http://referencedesigner.com/tutorials/msp430/msp430_01.php

"Johan Compen" :

> In general, the BITx defines should not be used in a (1 << BITx) form
> as they are already defined as follows:
> #define BIT0 (1 << 0) // 1
> #define BIT1 (1 << 1) // 2
> #define BIT2 (1 << 2) // 4
> #define BIT3 (1 << 3) // 8
> #define BIT4 (1 << 4) // 16

Why not this:
#define BIT0 (1)
#define BIT1 (2)
#define BIT2 (4)
#define BIT3 (8)
?

M.

I do not use c. I believe some c programmers defines BIT1 this way:

#ifndef BIT1_defined
#ifdef BIT0_defined
#define BIT1 (BIT0<<1)
#else
#define BIT1 (2)
#endif
#define BIT1_defined
#endif

--OCY

--- In m..., "Johan Compen" wrote:
>
> This "tutorial" has some major bugs in example code. For example:
>
> http://referencedesigner.com/tutorials/msp430/msp430_04.php
> P6DIR |= (1< > P6OUT|= (1< > P6OUT&=~(1< >
> This code uses P6.1 and not P6.0 because (1< >
> The code should be:
> P6DIR |= BIT0;
> P6OUT |= BIT0; // P6.0 High
> P6OUT &= ~BIT0; // P6.0 Low
>
> In general, the BITx defines should not be used in a (1 << BITx) form
> as they are already defined as follows:
> #define BIT0 (1 << 0) // 1
> #define BIT1 (1 << 1) // 2
> #define BIT2 (1 << 2) // 4
> #define BIT3 (1 << 3) // 8
> #define BIT4 (1 << 4) // 16
> etc.
>
> Somewhere else on the same page:
> "Similary, the statement P1DIR |= (1<<0x03), will assign P1.2 to be an
> output pin.:
>
> This is also incorrect. (1<<0x03) is 11 in binary, which means the
> statement sets bits 0 and 1. Thus P1.0 and P1.1 are set to output mode
> and not P1.2.
>
>
http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c
>
> regards, Johan.
> On Mon, Jan 5, 2009 at 11:46 PM, v_shukla72 wrote:
> > This programming tutorial will be helpful for beginners and newbies.
> >
> > http://referencedesigner.com/tutorials/msp430/msp430_01.php
> >
>
--- In m..., "Johan Compen" wrote:
> > This programming tutorial will be helpful for beginners and newbies.
> >
> > http://referencedesigner.com/tutorials/msp430/msp430_01.php
> >
> >
> This "tutorial" has some major bugs in example code. For example:
>

Or instead of debugging free stuff from the web you can get a book from
amazon without major bugs, that has fifteen chapters with solved
exercises ;-)

http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%
2Fwww.amazon.com%2FMSP430-State-Machine-Programming-ES2274%2Fdp%
2F0975475924%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1214397954%26sr%3D8-

Or if you like tiny links:

http://tinyurl.com/softbaugh-book3

Tom

Getting a book will not solve problems. You still have to read it,
under stand it, apply what you learned and solve problems.

--- In m..., "Tom Baugh" wrote:
>
> --- In m..., "Johan Compen" wrote:
> > > This programming tutorial will be helpful for beginners and newbies.
> > >
> > > http://referencedesigner.com/tutorials/msp430/msp430_01.php
> > >
> > >
> >
> >
> > This "tutorial" has some major bugs in example code. For example:
> > Or instead of debugging free stuff from the web you can get a book from
> amazon without major bugs, that has fifteen chapters with solved
> exercises ;-)
>
> http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%
> 2Fwww.amazon.com%2FMSP430-State-Machine-Programming-ES2274%2Fdp%
> 2F0975475924%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1214397954%26sr%3D8-
>
> Or if you like tiny links:
>
> http://tinyurl.com/softbaugh-book3
>
> Tom
>

> Somewhere else on the same page:
> "Similary, the statement P1DIR |= (1<<0x03), will assign P1.2 to be an
> output pin.:
>
> This is also incorrect. (1<<0x03) is 11 in binary, which means the
> statement sets bits 0 and 1. Thus P1.0 and P1.1 are set to output mode
> and not P1.2.

Just to clarify, and unless I'm terribly mistaken, this statement of
yours is also incorrect. When left-shifting, the MSP fills the new
bits with 0's. It is equivalent to multiplying by a power of 2.
Only when right-shifting a signed integer variable (char, int, etc) in
which a negative value is stored, does the MSP use 1's to fill the new
bits. It is equivalent to dividing by a power of 2.
This means that (1<<0x03) left-shifts 1 by 3 bits, or multiplies 1 by
2^3, which is 1000 in binary or 0x08. I've no idea how you came up
with 11 in binary.

P1DIR |= (1<<0x03), will configure the direction of P1.3 to be an output.

Michael K.
On Thu, Jan 8, 2009 at 4:25 PM, tintronic wrote:
>> Somewhere else on the same page:
>> "Similary, the statement P1DIR |= (1<<0x03), will assign P1.2 to be an
>> output pin.:
>>
>> This is also incorrect. (1<<0x03) is 11 in binary, which means the
>> statement sets bits 0 and 1. Thus P1.0 and P1.1 are set to output mode
>> and not P1.2.
>
> Just to clarify, and unless I'm terribly mistaken, this statement of
> yours is also incorrect. When left-shifting, the MSP fills the new
> bits with 0's. It is equivalent to multiplying by a power of 2.
> Only when right-shifting a signed integer variable (char, int, etc) in
> which a negative value is stored, does the MSP use 1's to fill the new
> bits. It is equivalent to dividing by a power of 2.
> This means that (1<<0x03) left-shifts 1 by 3 bits, or multiplies 1 by
> 2^3, which is 1000 in binary or 0x08. I've no idea how you came up
> with 11 in binary.
>
> P1DIR |= (1<<0x03), will configure the direction of P1.3 to be an output.

Johan.

On Wed, Jan 7, 2009 at 3:49 PM, Matthias Weingart
wrote:
> "Johan Compen" :
>
>> In general, the BITx defines should not be used in a (1 << BITx) form
>> as they are already defined as follows:
>> #define BIT0 (1 << 0) // 1
>> #define BIT1 (1 << 1) // 2
>> #define BIT2 (1 << 2) // 4
>> #define BIT3 (1 << 3) // 8
>> #define BIT4 (1 << 4) // 16
>
>
> Why not this:
> #define BIT0 (1)
> #define BIT1 (2)
> #define BIT2 (4)
> #define BIT3 (8)
> ?

The version with the bitwise left shift operator makes it more clear
that are single bit (1) is shifted N places to the left.
That's all.

Johan.

--- In m..., Onestone wrote:
>
> Of course this is only my opinion, and I'm the only one who cares
> that.
>
> Al
>

This is my opinion too. This guys spending more time to obfuscate the
code than solving the real problems.

Stefan

I know laughing loud in the church is forbidden, but I cannot help myself
now. So I will probably be sent to the electronics' hell where I shall sink
on all kinds of bugs made by newbies and lost in the realm where a byte is
only 8 bits long.

At least we now know the etymology of your blessed nickname.

-Augusto

On the contrary intelligence is necessary for good design,however the
perversion of the term by modern religious zealots trying to
misrepresent the dumb idea of a literal Adam and Eve is pathetically
moronic, and shows the diabolical lengths that some modern religious
fanatics will go to in order to brainwash our children and ensure the
future survival of their misguided beliefs.

By all means believe what you like, just remember that if your religion
is so strong it shouldn't need ramming down anybodys throat.

Al

old_cow_yellow wrote:

>"intelligent design" is the most stupid thing.
>
>--ocy
>
>--- In m..., Onestone wrote:
>
>
>>OF course my response was tongue in cheek, but where do you start?
>>
>>Surely then if the true gods are those who make, or know how top make
>>thje machines to start wiht, then you must go back even further, why
>>
>>
>not
>
>
>>those who know how to make the parts that make the machines, or those
>>that know how to make the machines that make the parts that make the
>>machines? having started in hardware at the age of 9 (17
>>
>>
>professionally)
>
>
>>and been involved in pure hardware design, design of the machines that
>>make the machines, design of the chemical processes that are used by
>>
>>
>the
>
>
>>accolytes of those machines to make the sacristy offerings called
>>'wafers' into more than just a day at the beach, and even been involved
>>in the design of the mystic symbols used to control those witches brew
>>concoctions that make the chemical brews go exactly where they must go
>>to create logic and control from primeval sludge, I have striven at all
>>levels of the Church of the electron to become one of its hallowed
>>moreritualistically written "1 St. One", the firts saint of the church!
>>
>>And your claim that those who came later and simplified the acts of
>>ritual cannot be true, surely, as is evidenced historically, the most
>>power ever wielded by a religious body devolves to those at its origins
>>who keep the layman away by creating a mythic and secret language of
>>ritual. Once that translates from its native, or 'latin', form into the
>>simpler languages understood by the masses, one starts to see the
>>fragmentation of the church, the breaking away into multiple smaller
>>groups, often fanatical about their linguistic misinterpretation of the
>>original texts, and of trivial hysterical significance.
>>
>>Archangel Al
>>
>>Augusto Einsfeldt wrote:
>>
>>
>>
>>>I have to disagree, Al.
>>>
>>>The true Gods are those who make - or know how to make - the
>>>
>>>
>machines and,
>
>
>>>of course, their natural languages. Then there are the first true
>>>
>>>
>followers
>
>
>>>who understand how the machine works and its natural language, and
>>>
>>>
>use it as
>
>
>>>they wish. Next are the priests, who write some kind of bibles
>>>
>>>
>translating
>
>
>>>the simple natural language in some half eaten language that people who
>>>cannot grasp what the machine actually does can eat. Since the half
>>>
>>>
>eaten
>
>
>>>language is easy to chew the next group of people can produce
>>>
>>>
>"results" very
>
>
>>>fast.
>>>
>>>Then we have people trying to get more elaborated result from a
>>>
>>>
>machine they
>
>
>>>cannot understand using a half eaten language. When the result doesn't
>>>happen they ask for working mantras in an email group. Some will
>>>
>>>
>blame the
>
>
>>>Gods for making a machine too complex, others will blame themselves
>>>
>>>
>for not
>
>
>>>reading the bibles correctly (and shall hire a priest to do their
>>>
>>>
>job). Few
>
>
>>>people will actually study the information already available and will
>>>realize the machines are just logic functions with no room for
>>>
>>>
>magic. All
>
>
>>>they do is set or reset bits according to some very strict rules.
>>>
>>>-Augusto
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>-----Mensagem original-----
>>>De: m... [mailto:m...] Em nome de
>>>Onestone
>>>Enviada em: domingo, 11 de janeiro de 2009 07:21
>>>Para: m...
>>>Assunto: Re: [msp430] Re: A beginners programming tutorial for MSP430
>>>
>>>
>>>
>>>Sorry, but no. The last I bothered looking at in this vein was a piece
>>>of c code that visually resembled the symbol Pi, and which when
>>>
>>>
>extraced
>
>
>>>through various pre-processing simply calculated pi to some number of
>>>places. Dumb stuff. That was published in the C programmers Journal in
>>>one of their Obfuscated C competitions. that, and a reference in the
>>>same issue to (C) programmers as gods, and the rest of mankind as
>>>
>>>
>ants,
>
>
>>>made me think that the guys who wrote this shit were an arrogant bunch
>>>of plonkers, so Obfuscated anything is anathema to me (except my
>>>obfusfu@#!\$scated typing. Anyway anybody worth a damn knows that only
>>>those who control the machines in their native tongue are truly Gods,
>>>the rest are merely organic peripherals (just kidding folks [or am I?])
>>>
>>>Cheers
>>>
>>>Al
>>>
>>>old_cow_yellow wrote:
>>>
>>>
>>>
>>>
>>>
>>>>--- In msp430@yahoogroups. com,
>>>>
>>>>
>Onestone
>
>
>>>>
>>>>
>>>>
>>>>
>>> wrote:
>>>
>>>
>>>
>>>
>>>>
>>>>
>>>>
>>>>
>>>>>... It's actually one of the things that totoally put me off
>>>>>the C Programmers Journal, and the self styled C experts. I
>>>>>strife to create clearly readable efficient code, while
>>>>>this shower of idiots take pride in writing stuff that is
>>>>>totally unreadable without intense effort, when, at the end
>>>>>of the day it serves no purpose, there is no security provided
>>>>>by source code scrambling it is therefore apintless excercise
>>>>>largely in the use of define and pragmas. Boring shit in other
>>>>>words...
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Years ago I encountered a book consisting a collection of snippets of
>>>>few lines of c-code. In each case, it challenges the reader to figure
>>>>out what the code does. I forgot the name of the book. Do you know
>>>>such a book?
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>
>>>>
>egroups.com
>
>
>>>>
"intelligent design" is the most stupid thing.

--ocy

--- In m..., Onestone wrote:
>
> OF course my response was tongue in cheek, but where do you start?
>
> Surely then if the true gods are those who make, or know how top make
> thje machines to start wiht, then you must go back even further, why
not
> those who know how to make the parts that make the machines, or those
> that know how to make the machines that make the parts that make the
> machines? having started in hardware at the age of 9 (17
professionally)
> and been involved in pure hardware design, design of the machines that
> make the machines, design of the chemical processes that are used by
the
> accolytes of those machines to make the sacristy offerings called
> 'wafers' into more than just a day at the beach, and even been involved
> in the design of the mystic symbols used to control those witches brew
> concoctions that make the chemical brews go exactly where they must go
> to create logic and control from primeval sludge, I have striven at all
> levels of the Church of the electron to become one of its hallowed
> saints, when finally I received the accolade I desired 'onestone' or.
> moreritualistically written "1 St. One", the firts saint of the church!
>
> And your claim that those who came later and simplified the acts of
> ritual cannot be true, surely, as is evidenced historically, the most
> power ever wielded by a religious body devolves to those at its origins
> who keep the layman away by creating a mythic and secret language of
> ritual. Once that translates from its native, or 'latin', form into the
> simpler languages understood by the masses, one starts to see the
> fragmentation of the church, the breaking away into multiple smaller
> groups, often fanatical about their linguistic misinterpretation of the
> original texts, and of trivial hysterical significance.
>
> Archangel Al
>
> Augusto Einsfeldt wrote:
>
> >I have to disagree, Al.
> >
> >The true Gods are those who make - or know how to make - the
machines and,
> >of course, their natural languages. Then there are the first true
followers
> >who understand how the machine works and its natural language, and
use it as
> >they wish. Next are the priests, who write some kind of bibles
translating
> >the simple natural language in some half eaten language that people who
> >cannot grasp what the machine actually does can eat. Since the half
eaten
> >language is easy to chew the next group of people can produce
"results" very
> >fast.
> >
> >Then we have people trying to get more elaborated result from a
machine they
> >cannot understand using a half eaten language. When the result doesn't
> >happen they ask for working mantras in an email group. Some will
blame the
> >Gods for making a machine too complex, others will blame themselves
for not
> >reading the bibles correctly (and shall hire a priest to do their
job). Few
> >people will actually study the information already available and will
> >realize the machines are just logic functions with no room for
magic. All
> >they do is set or reset bits according to some very strict rules.
> >
> >-Augusto
> >
> >
> >
> >
> >
> >
> >
> >-----Mensagem original-----
> >De: m... [mailto:m...] Em nome de
> >Onestone
> >Enviada em: domingo, 11 de janeiro de 2009 07:21
> >Para: m...
> >Assunto: Re: [msp430] Re: A beginners programming tutorial for MSP430
> >
> >
> >
> >Sorry, but no. The last I bothered looking at in this vein was a piece
> >of c code that visually resembled the symbol Pi, and which when
extraced
> >through various pre-processing simply calculated pi to some number of
> >places. Dumb stuff. That was published in the C programmers Journal in
> >one of their Obfuscated C competitions. that, and a reference in the
> >same issue to (C) programmers as gods, and the rest of mankind as
ants,
> >made me think that the guys who wrote this shit were an arrogant bunch
> >of plonkers, so Obfuscated anything is anathema to me (except my
> >obfusfu@#!\$scated typing. Anyway anybody worth a damn knows that only
> >those who control the machines in their native tongue are truly Gods,
> >the rest are merely organic peripherals (just kidding folks [or am I?])
> >
> >Cheers
> >
> >Al
> >
> >old_cow_yellow wrote:
> >
> >
> >
> >>--- In msp430@yahoogroups. com,
Onestone
> >>
> >>
> > wrote:
> >
> >
> >>
> >>
> >>>... It's actually one of the things that totoally put me off
> >>>the C Programmers Journal, and the self styled C experts. I
> >>>strife to create clearly readable efficient code, while
> >>>this shower of idiots take pride in writing stuff that is
> >>>totally unreadable without intense effort, when, at the end
> >>>of the day it serves no purpose, there is no security provided
> >>>by source code scrambling it is therefore apintless excercise
> >>>largely in the use of define and pragmas. Boring shit in other
> >>>words...
> >>>
> >>>
> >>>
> >>>
> >>>
> >>Years ago I encountered a book consisting a collection of snippets of
> >>few lines of c-code. In each case, it challenges the reader to figure
> >>out what the code does. I forgot the name of the book. Do you know
> >>such a book?
> >>
> >>
> >>
> >>
> >>>
egroups.com
> >>
> >>
OF course my response was tongue in cheek, but where do you start?

Surely then if the true gods are those who make, or know how top make
thje machines to start wiht, then you must go back even further, why not
those who know how to make the parts that make the machines, or those
that know how to make the machines that make the parts that make the
machines? having started in hardware at the age of 9 (17 professionally)
and been involved in pure hardware design, design of the machines that
make the machines, design of the chemical processes that are used by the
accolytes of those machines to make the sacristy offerings called
'wafers' into more than just a day at the beach, and even been involved
in the design of the mystic symbols used to control those witches brew
concoctions that make the chemical brews go exactly where they must go
to create logic and control from primeval sludge, I have striven at all
levels of the Church of the electron to become one of its hallowed
moreritualistically written "1 St. One", the firts saint of the church!

And your claim that those who came later and simplified the acts of
ritual cannot be true, surely, as is evidenced historically, the most
power ever wielded by a religious body devolves to those at its origins
who keep the layman away by creating a mythic and secret language of
ritual. Once that translates from its native, or 'latin', form into the
simpler languages understood by the masses, one starts to see the
fragmentation of the church, the breaking away into multiple smaller
groups, often fanatical about their linguistic misinterpretation of the
original texts, and of trivial hysterical significance.

Archangel Al

Augusto Einsfeldt wrote:

>I have to disagree, Al.
>
>The true Gods are those who make - or know how to make - the machines and,
>of course, their natural languages. Then there are the first true followers
>who understand how the machine works and its natural language, and use it as
>they wish. Next are the priests, who write some kind of bibles translating
>the simple natural language in some half eaten language that people who
>cannot grasp what the machine actually does can eat. Since the half eaten
>language is easy to chew the next group of people can produce "results" very
>fast.
>
>Then we have people trying to get more elaborated result from a machine they
>cannot understand using a half eaten language. When the result doesn't
>happen they ask for working mantras in an email group. Some will blame the
>Gods for making a machine too complex, others will blame themselves for not
>reading the bibles correctly (and shall hire a priest to do their job). Few
>people will actually study the information already available and will
>realize the machines are just logic functions with no room for magic. All
>they do is set or reset bits according to some very strict rules.
>
>-Augusto
>
>-----Mensagem original-----
>De: m... [mailto:m...] Em nome de
>Onestone
>Enviada em: domingo, 11 de janeiro de 2009 07:21
>Para: m...
>Assunto: Re: [msp430] Re: A beginners programming tutorial for MSP430
>
>Sorry, but no. The last I bothered looking at in this vein was a piece
>of c code that visually resembled the symbol Pi, and which when extraced
>through various pre-processing simply calculated pi to some number of
>places. Dumb stuff. That was published in the C programmers Journal in
>one of their Obfuscated C competitions. that, and a reference in the
>same issue to (C) programmers as gods, and the rest of mankind as ants,
>made me think that the guys who wrote this shit were an arrogant bunch
>of plonkers, so Obfuscated anything is anathema to me (except my
>obfusfu@#!\$scated typing. Anyway anybody worth a damn knows that only
>those who control the machines in their native tongue are truly Gods,
>the rest are merely organic peripherals (just kidding folks [or am I?])
>
>Cheers
>
>Al
>
>old_cow_yellow wrote:
>
>
>
>>--- In msp430@yahoogroups. com, Onestone
>>
>>
> wrote:
>
>
>>
>>
>>>... It's actually one of the things that totoally put me off
>>>the C Programmers Journal, and the self styled C experts. I
>>>strife to create clearly readable efficient code, while
>>>this shower of idiots take pride in writing stuff that is
>>>totally unreadable without intense effort, when, at the end
>>>of the day it serves no purpose, there is no security provided
>>>by source code scrambling it is therefore apintless excercise
>>>largely in the use of define and pragmas. Boring shit in other
>>>words...
>>>
>>>
>>>
>>>
>>>
>>Years ago I encountered a book consisting a collection of snippets of
>>few lines of c-code. In each case, it challenges the reader to figure
>>out what the code does. I forgot the name of the book. Do you know
>>such a book?
>>
>>
>>> egroups.com
I have to disagree, Al.

The true Gods are those who make - or know how to make - the machines and,
of course, their natural languages. Then there are the first true followers
who understand how the machine works and its natural language, and use it as
they wish. Next are the priests, who write some kind of bibles translating
the simple natural language in some half eaten language that people who
cannot grasp what the machine actually does can eat. Since the half eaten
language is easy to chew the next group of people can produce "results" very
fast.

Then we have people trying to get more elaborated result from a machine they
cannot understand using a half eaten language. When the result doesn't
happen they ask for working mantras in an email group. Some will blame the
Gods for making a machine too complex, others will blame themselves for not
reading the bibles correctly (and shall hire a priest to do their job). Few
people will actually study the information already available and will
realize the machines are just logic functions with no room for magic. All
they do is set or reset bits according to some very strict rules.

-Augusto

-----Mensagem original-----
De: m... [mailto:m...] Em nome de
Onestone
Enviada em: domingo, 11 de janeiro de 2009 07:21
Para: m...
Assunto: Re: [msp430] Re: A beginners programming tutorial for MSP430

Sorry, but no. The last I bothered looking at in this vein was a piece
of c code that visually resembled the symbol Pi, and which when extraced
through various pre-processing simply calculated pi to some number of
places. Dumb stuff. That was published in the C programmers Journal in
one of their Obfuscated C competitions. that, and a reference in the
same issue to (C) programmers as gods, and the rest of mankind as ants,
made me think that the guys who wrote this shit were an arrogant bunch
of plonkers, so Obfuscated anything is anathema to me (except my
obfusfu@#!\$scated typing. Anyway anybody worth a damn knows that only
those who control the machines in their native tongue are truly Gods,
the rest are merely organic peripherals (just kidding folks [or am I?])

Cheers

Al

old_cow_yellow wrote:

>--- In msp430@yahoogroups. com, Onestone
wrote:
>>... It's actually one of the things that totoally put me off
>>the C Programmers Journal, and the self styled C experts. I
>>strife to create clearly readable efficient code, while
>>this shower of idiots take pride in writing stuff that is
>>totally unreadable without intense effort, when, at the end
>>of the day it serves no purpose, there is no security provided
>>by source code scrambling it is therefore apintless excercise
>>largely in the use of define and pragmas. Boring shit in other
>>words...
>>Years ago I encountered a book consisting a collection of snippets of
>few lines of c-code. In each case, it challenges the reader to figure
>out what the code does. I forgot the name of the book. Do you know
>such a book?
>
>
>> egroups.com
Sorry, but no. The last I bothered looking at in this vein was a piece
of c code that visually resembled the symbol Pi, and which when extraced
through various pre-processing simply calculated pi to some number of
places. Dumb stuff. That was published in the C programmers Journal in
one of their Obfuscated C competitions. that, and a reference in the
same issue to (C) programmers as gods, and the rest of mankind as ants,
made me think that the guys who wrote this shit were an arrogant bunch
of plonkers, so Obfuscated anything is anathema to me (except my
obfusfu@#!\$scated typing. Anyway anybody worth a damn knows that only
those who control the machines in their native tongue are truly Gods,
the rest are merely organic peripherals (just kidding folks [or am I?])

Cheers

Al

old_cow_yellow wrote:

>--- In m..., Onestone wrote:
>
>
>>... It's actually one of the things that totoally put me off
>>the C Programmers Journal, and the self styled C experts. I
>>strife to create clearly readable efficient code, while
>>this shower of idiots take pride in writing stuff that is
>>totally unreadable without intense effort, when, at the end
>>of the day it serves no purpose, there is no security provided
>>by source code scrambling it is therefore apintless excercise
>>largely in the use of define and pragmas. Boring shit in other
>>words...
>>
>>
>>Years ago I encountered a book consisting a collection of snippets of
>few lines of c-code. In each case, it challenges the reader to figure
>out what the code does. I forgot the name of the book. Do you know
>such a book?
>
--- In m..., Onestone wrote:
>
> ... It's actually one of the things that totoally put me off
> the C Programmers Journal, and the self styled C experts. I
> strife to create clearly readable efficient code, while
> this shower of idiots take pride in writing stuff that is
> totally unreadable without intense effort, when, at the end
> of the day it serves no purpose, there is no security provided
> by source code scrambling it is therefore apintless excercise
> largely in the use of define and pragmas. Boring shit in other
> words...
>

Years ago I encountered a book consisting a collection of snippets of
few lines of c-code. In each case, it challenges the reader to figure
out what the code does. I forgot the name of the book. Do you know
such a book?
This is the dumbest thing in the world. It's actually one of the things
that totoally put me off the C Programmers Journal, and the self styled
C experts. I strife to create clearly readable efficient code, while
this shower of idiots take pride in writing stuff that is totally
unreadable without intense effort, when, at the end of the day it serves
no purpose, there is no security provided by source code scrambling it
is therefore apintless excercise largely in the use of define and
pragmas. Boring shit in other words.

Of course this is only my opinion, and I'm the only one who cares about
that.

Al

Matthias Weingart wrote:

>"bungalow_steve" :
>
>
>
>>--- In m..., Onestone wrote:
>>
>>
>>>??? to who does this seem clearer? What is a single bit shift but a
>>>multiplication by 2? Why would something visually more complex be
>>>clearer? The objective is to define single bit values NOT perform a
>>>shift operation. No such operation actually or symbolically exists.
>>>
>>>Al
>>>
>>>
>>Ha! When I first saw that 1 << 0 stuff, I first did a double take,
>>then oh, I thought wow that's bizarre, it was like, someone somewhere
>>has a sole purpose in life to make things more complex then they need
>>to be.
>>
>>Ha! This is nothing. Real master can create nearly unreadable code using C:
>
>http://www.ioccc.org/
>
>M.
>
Guys,

Database guru C. J. Date from the '70s once said something
like "There is no computer problem that cannot be solved by the addition of a few more levels of indirection."

Later,
Mike Raines

________________________________
From: m... [mailto:m...] On Behalf Of Matthias Weingart
Sent: Friday, January 09, 2009 10:27 AM
To: m...
Subject: [msp430] Re: A beginners programming tutorial for MSP430
> Ha! This is nothing. Real master can create nearly unreadable code using
> C:
>
> http://www.ioccc.org/