Searching \ for ' C++' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/language/index.htm?key=c%2B%2B
Search entire site for: 'C++'.

No exact or substring matches. trying for part
PICList Thread
'H8 C++ Complier'
1996\09\19@141618 by Ewan C McNab

flavicon
picon face
I would be grateful if someone could please let me know if you can get a
C++ Complier for the Hitachi H8 series microprocessors.

We are currently using the C complier from IAR so would like to usethat
one if possible

yours

Ewan.
---------------
Ewan C McNab
Trainee Engineer
JMW Systems Ltd
Pentland Industrial Estate, Loanhead
Midlothain, EH20 9QH, SCOTLAND
Tel: 0131 440 3633
Fax: 0131 440 3637


'More on Embedded C++'
1997\08\22@093017 by Rob
flavicon
face
It was late when i wrote the original post on this so i will put more
detail in it now.

The EC++ has the following features eleiminated:

multiple inheritance
virtual base classes
templates
run time-type indentification
namespaces
exceptions
mutable specifiers

The article staes multiple inheritance, exceptions and run time-type
identification incur run-time overhead whether or not they are actually
used in an application.

The article goes on to say one of the stated goals is to take into
consideration the memory limitations of embedded applications.  Reducing
certain features eliminates the need for their corresponding run-time
libraries.

However, the consortium that is putting this together wants to add some
other run-time libraries to support things like input and output to
strings and using allocators for string objects.

Thought this may not be directly PIC related, since the language seems to
be aimed at powerful processors, I thought i'd just pass it along.

Rob


'Best C++ book'
1997\11\17@090849 by ctm
picon face
Hi all-

A while ago someone on the list mentioned a good book for learning C++.
Does
anybody have any recollection of this or, can anybody make a
recommendation?

Thanks,

Chris


'Visual C++ mailling list'
1997\12\29@015858 by Ivan Cenov
flavicon
face
part 0 268 bytes
head>

Happy New Year!

Does anyone in the list know a mailing list for
Microsoft Visual C++ ?

Ivan Cenov
okto7@botev.ttm.bg


'[OT] VERY! Please help->Visual C++'
1998\01\29@030332 by Jacques Vrey
flavicon
face
Sorry to increase the noise ratio but I need some info that maybe
someone can help me with.

Does anyone know of an FAQ or mailing list where I can get some
help/advice on serial communication coding with Visual C++ v5
on Win95. (C/C++ is very new to me).

I'm writing a DLL for serial comms that works perfectly in the lab
but bombs out in the field and I'm at the point of ripping my hair
out!( YES I have modelled the lab side properly )

Thanks



Jacques Vrey
Iscor Steel Profile Products
Internal Post Point 74
PO Box 2
Newcastle
2940
South Africa
Tel: +27 (0)3431 48759
Fax: +27 (0)3431 48001
spam_OUTjvreyTakeThisOuTspamit.new.iscorltd.co.za
The views expressed above are not necessarily
those of Iscor Limited.

I hear and I forget, I see and I remember,
I do and I understand. (Chinese Proverb)

1998\01\29@034448 by Andrew Warren

face
flavicon
face
Jacques Vrey <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU> wrote:

> Does anyone know of an FAQ or mailing list where I can get some
> help/advice on serial communication coding with Visual C++ v5 on
> Win95. (C/C++ is very new to me).

Jacques:

Avoid the various Visual C++ newsgroups if you can; their
signal-to-noise ratios are REALLY low.

Here's a place to start searching the web for helpful Visual C++
information:

   http://home.sol.no/~jarlaase/devel.htm

-Andy

=== Andrew Warren - fastfwdspamKILLspamix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\01\29@125253 by Matt Bonner

flavicon
face
Jacques Vrey wrote:
>
> Sorry to increase the noise ratio but I need some info that maybe
> someone can help me with.
>
> Does anyone know of an FAQ or mailing list where I can get some
> help/advice on serial communication coding with Visual C++ v5
> on Win95. (C/C++ is very new to me).

Jacques,

There is a list similar to the PIClist that is meant for MSVC beginners
(no, I'm not implying that you're a beginner), called (appropriately)
the MSVC-BEGINNERS list.

I'll send you (privately) the message that I received confirming my
sign-on (we all keep those messages, don't we?).  It's fairly long so I
don't want to post it here - maybe you can dig the subscribe info out of
it.

--Matt


'FW: Stroustrup Confesses about C++'
1998\03\19@181120 by John Bellini
flavicon
face
Some of you may find this interesting.

{Quote hidden}

1998\03\20@061831 by wkysag

picon face
On 19 Mar 98 at 12:52, John Bellini wrote:

> Some of you may find this interesting.

PLEASE mark such off-topic stuff as [OT] in the subject
as agreed previously.

Thanks,
Wolfgang

--
Rund um's Geld:
people.frankfurt.netsurf.de/Wolfgang.Kynast/

'(OT) FW: Stroustrup Confesses about C++'
1998\03\20@062316 by alex_holden

picon face
John Bellini wrote:
>
> Some of you may find this interesting.

<BIG snip of interview where Bjarne Stroustrup (allegedly) says he only
invented C++ because he wanted a language so difficult to learn it would
make programmers wages astronomically high>

Does anyone think this was a real interview? I doubt he would really
have said that. Also, I very much doubt the magazine would have declined
to publish such an amazing exclusive if it really was true. I do agree
with a lot of the criticisms of C++ though. Was Windoze really coded in
C++? That might explain a lot.

--
------------------- Linux- the choice of a GNU generation.
--------------------
: Alex Holden- Caver, Programmer, Land Rover nut, and Radio amateur (M1
CJD). :
-------------- www.geocities.com/CapeCanaveral/Lab/1532/
---------------

'Stroustrup Confesses about C++'
1998\03\20@073823 by Caisson

flavicon
face
> Van: John Bellini <EraseMEJBellinispam_OUTspamTakeThisOuTSTATPOWER.COM>
> Aan: PICLISTspamspam_OUTMITVMA.MIT.EDU
> Onderwerp: FW: Stroustrup Confesses about C++
> Datum: donderdag 19 maart 1998 21:52
>
> Some of you may find this interesting.

[Cut]

I would like to see the origional interview
(although I don't really think it exists ...)

Greetz,
 Rudy Wieser

'Stroustrup Confesses about C++ -- RESOLVED!'
1998\03\20@115049 by Don L. Jackson

picon face
I cannot believe how many on this piclist fell for this spoof.  I saw it
originally in Jack Ganssle's enewsletter earlier this month -- at least
when he posted it, he labeled it as ficticious.  This is extracted from his
newsletter:

>The Embedded Muse
>
> Volume 3, Number 5   Copyright 1998 TGG   March 4, 1998
>You may redistribute this newsletter for noncommercial purposes.
>
>Editor's Notes
>---------------
>Today's issue of the Muse is a bit off-format. Somehow, from somewhere,
propagated over the ether of the net in an unending stream of anonymity,
the following interview appeared in my IN-box.
>
>Though the article is a joke, it reinforces my concerns with using any new
language for embedded work. Till a standard exists, and till a cadre of
well trained programmers are at hand, it's risky to bet on any new lingo.
>
>C++ brings many potential benefits to the embedded world, as well as its
own set of baggage. A recent article in Embedded Systems Programming
magazine addressed some of these issues and discussed an alternative -
EC++, a version designed specifically for embedded systems where a lighter
footprint is essential. EC++ preserves most of the neat stuff about C++
while stripping out high-overhead things like multiple inheritance.
>
>So, since the issue of languages seems to bring out the flame wars... and
since it's dangerous to take ourselves too seriously, here it is:
>

I think that most piclisters would be interested in subscribing to his free
newsletter as it covers the general field of embedded systems.  He only
sends it every few weeks, so it is low volume.  I have found it very
interesting.  You may sign up for it at his website:  http://www.ganssle.com/

His website is probably worthwhile exploring also!

Don L. Jackson
Azark Group - Gilbert, AZ

At 09:59 AM 3/20/98 +0100, you wrote:
{Quote hidden}

'(OT) FW: Stroustrup Confesses about C++'
1998\03\20@155733 by Richard Nowak

picon face
Helloooo ?

A similar "interview" was passed around years ago only then it was Dennis
Ritchie commenting on 'C'.

Rich

At 11:22 AM 3/20/98 -0800, you wrote:
{Quote hidden}

At a recent computer expo (COMDEX), Bill Gates reportedly compared
the computer industry with the auto industry and stated:

    "If GM (General Motors) had kept up with technology like the
     computer industry has, we would all be driving twenty-five
     dollar cars that got 1000 mi/gal."

Recently General Motors addressed this comment by releasing the
statement:

    "Yes, but would you want your car to crash twice a day?"

1998\03\20@171303 by Benjamin Britt

flavicon
face
I doubt that it is true.  C++ was originally released by AT&T as a preprocessor
to the C compiler; their compiler generated C code.  There's nothing in the
language that makes it inherently less efficient than C.  Of course it's easy
to use all the baroque bells & whistles in C++ or bloat your program by
linking in
all the libraries but one can write an unreadable or bloated C program
(check out how big a printf("Hello world") program is).

The worst part of C++, in my mind, is that it offers too many non-essential
but alluring gizmos which trip up newcomers to the language.  Of course, this
is true of other programming languages as well.

Ben

'I2C Source For Visual C++'
1998\03\23@162357 by Astman

picon face
Hi all,

I wonder whether some1 can help me and supply me a source code for
visual c++ which initialize and recieve and transmit bits for pic 16
using I2C protocol, i hope some1 can deliver the whole fully source ..
thanks in advance.

1998\03\24@005447 by tjaart

flavicon
face
Astman wrote:

> Hi all,
>
> I wonder whether some1 can help me and supply me a source code for
> visual c++ which initialize and recieve and transmit bits for pic 16
> using I2C protocol, i hope some1 can deliver the whole fully source ..
> thanks in advance.

I've just added a few  I2C links to my page. When I checked, there wasone
with the source code for bit-banging from your LPT1. I can't
remember which one, but you're welcome to check it out.

http://www.wasp.co.za/~tjaart/electronicsearch.html

--
Friendly Regards

Tjaart van der Walt
RemoveMEtjaartTakeThisOuTspamwasp.co.za
_____________________________________________________________
| WASP International http://www.wasp.co.za/~tjaart/index.html |
|       R&D Engineer : GSM peripheral services development    |
|   Vehicle tracking | Telemetry systems | GSM data transfer  |
|    Voice : +27-(0)11-622-8686 | Fax : +27-(0)11-622-8973    |
|              WGS-84 : 26¡10.52'S 28¡06.19'E                 |
|_____________________________________________________________|

1998\03\24@102757 by Keith Howell

flavicon
face
Astman wrote:
>
> I wonder whether some1 can help me and supply me a source code for
> visual c++ which initialize and recieve and transmit bits for pic 16
> using I2C protocol, i hope some1 can deliver the whole fully source ..
> thanks in advance.

I have written a utility for LPT-->I2C, to help develop the product I am working
on.

The source is Visual C++ v5.0, and compiles to the "Console" application model.
That is, I don't have to learn Windows to write it.
I hope to recycle code where possible, so a vanilla C is essential for
ease of porting to microcontrollers which don't have C++ or Windows.

It's been very useful so far. I've had it sending messages to a PIC on a
front panel to get it to change the pattern on a group of LEDs, read the
keyboard pattern, and send bytes to a 2x20char VFD. This checks that
the protocol is okay, without having to program and debug another micro.

A handy feature is reading the 256byte EEPROM and highlighting the
changes from the last time it was read. This lets me confirm what the
PIC thinks it is reading from the EEPROM, and spot where someone else's
micro is writing to the wrong location. Thus I can backup my claims when
bugs lie in the other guy's micro and avoid disputes.

The LPT-I2C adapter board is at the end of a standard 2m printer cable,
so it is not limited to a few inches round the back of the PC.
I strongly recommend opto-isolators. I presume you'll be talking to
experimental circuits, as I am. A covered ass gathers no dick, an
isolated port gathers no nasty voltages, and the employee gathers no P45.
My work PC is very expensive and inconvenient to replace.

I've used two HP2630. These are reasonably fast. Common photo-transistor
isolator chips take several microseconds to operate, and the I2C bus signals
change over similar timescales.

What is your background and application?

'Window's C++ Compiler's.'
1998\03\31@122956 by John Bellini

flavicon
face
Does anyone know of C++ compiler's for the PIC's that run under windows
'95?
If so, can they be integrated and used under MPLAB?

Thank you,
John Bellini
spamBeGonejbellinispamBeGonespamstatpower.com">http://TakeThisOuTjbelliniEraseMEspamspam_OUTstatpower.com

1998\03\31@133447 by Tore Bergvill

picon face
I use my C-compiler ,CC5x with MPLAB.
This is a DOS application, but I use the "run DOS command"-option,
and run a batch file containing the CC5x parameters.
I then have to load the result file into MPLAB memory and copy it
to the chip programmer.
It works fine, and enables me to combine the exellent CC5x code efficiency and
MPLAB environment.

Check out:  http://www.riksnett.no/cc5x
for a trial version of CC5x.

Best regards, Tore Bergvill, Oslo, Norway
Email address:
RemoveMEbergvillspamTakeThisOuTonline.no

*********** REPLY PARTITION ***********

On 31.03.98, at 09:25, John Bellini wrote:

>Does anyone know of C++ compiler's for the PIC's that run under windows
>'95?
>If so, can they be integrated and used under MPLAB?
>
>Thank you,
>John Bellini
>jbelliniEraseMEspam.....statpower.com">http://EraseMEjbellinispamstatpower.com
>

1998\03\31@135028 by John Bellini

flavicon
face
I can get DOS compiler's to run no problem.  You can add and modify
compilers under the 'PROJECT" menu item and have the compiler compile
and have MPLAB do everything for you.  I am doing this now with the Byte
Craft C compiler and it works great.

> {Original Message removed}

1998\03\31@153023 by Richard Nowak

picon face
You might want to download Microchip's manual for MPLAB-C which was
originally written by Byte craft.  In one of the appendices is an article
written by Walter Banks, President of Byte craft, and Derek P. Carlson of
Microchip which talks about the application of C to small embedded control
applications.

Don't forget that whatever compiler you buy that it must produce the code
required to run on a PIC.

I believe that there are just too many restrictions that using a C++
compiler is not justified for PIC firmware development, assuming that it is
even possible.

Rich


At 09:25 AM 3/31/98 -0800, you wrote:
>Does anyone know of C++ compiler's for the PIC's that run under windows
>'95?
>If so, can they be integrated and used under MPLAB?
>
>Thank you,
>John Bellini
>RemoveMEjbelliniEraseMEspamEraseMEstatpower.com">http://RemoveMEjbellinispam_OUTspamKILLspamstatpower.com
>
>

=========================================
= Abolish the Income Tax! Fire the IRS! =
= http://www.nrst.org/                  =
=========================================
=========================================
= Here's a site that wants your views   =
= http://www.not4irs.org/               =
=========================================


'pc ports under c++ and win98'
1999\11\20@141652 by edg
flavicon
face
do somebody now how i can acces the pc ports with c++ under win98/win95
edg
----- Oorspronkelijk bericht -----
Van: Tim Hamel <RemoveMETekPhobiaTakeThisOuTspamspamAOL.COM>
Aan: <EraseMEPICLISTspamspamspamBeGoneMITVMA.MIT.EDU>
Verzonden: samedi 20 novembre 1999 12:17
Onderwerp: Re: [OT] Seeprom + VB + PC


> You are the man! =) I guess the "step -1" REALLY makes a difference. As
far
> as the EEPROM goes, it is 9 bits (Start bit + Opcode (2 bits) + 6 bit
> address). Now, all I do is OR the value that goes out to 378 with 2 and CS
> will be high constantly. Woohoo! I thank you VERY much!
>
> Tim Hamel
>
>
> In a message dated 11/20/99 3:06:32 AM Pacific Standard Time,
RemoveMEralKILLspamspamLCFLTD.COM
> writes:
>
> > Presumably you meant 1100 0000 for the value, as your's above is 9 bits.
> >
> >  To output bit-by-bit starting with msb:
> >
> >           iDiv=2^7
> >           for iPos=7 to 0 step -1
> >             iBit=iData \ iDiv     'this will be 0 or 1 for bit in
position i
> >             call OutPort(&H378,iBit)
> >             iDiv=iDiv \ 2         'shift to next lowest bit
> >          next iPos
> >
>


'where can I download the freeware ARM C and C++ an'
2000\02\17@192934 by gzkwan
flavicon
face
where can I download the freeware ARM C and C++ and asm language
compliyer
on WWW??????

'Stealth Advertising - was C++ for PICmicro'
2000\02\19@062029 by Russell McMahon

picon face
>The new C++ compiler (updated)(shareware)  for PICmicro is
>ready and available to download from:
>
>http://www.geocities.com/SiliconValley/Network/3656/c2c/cpp.html

Pavel,

I have NO complaint about people advertising PIC wares on PICList (or
electronic wares) and
I have NO complaint about people charging money in return for their hard
work and skill

BUT

I think that people offering a "for money" product should note that this is
the case.

This compiler, which may well be an excellent product and may well be worth
what is being asked for it, is shareware and I think that a note to this
effect might profitably be added to your on-list advertisements. Others may
disagree.

That said, keep up the good work - it's nice to have people pushing the
limits with what is available for the PIC.
(When will your ADA be ready :-) ?)

2000\02\20@184854 by John de Stigter

flavicon
face
Russell, look between the words "updated" and "for" and you will see the
word "shareware".
Regards,
John.
{Original Message removed}

2000\02\20@202613 by Randy Glenn

picon face
Mr. McMahon inserted the "shareware" in his post - it wasn't in the original.

-Randy Glenn
E-Mail: PICxpertSTOPspamspamspam_OUTyahoo.com
Web: http://i.am/PICxpert

Currently wondering why I can't get in to Safe Mode - where's a Mac when you need it?

{Original Message removed}

'Free Borland C++ Compiler for Download'
2000\02\21@205654 by Myke Predko

flavicon
face
Hi Folks,

I've gotten a few questions over the past year or so regarding C++.

Borland/Imprise has announced that their C++ is now available for download
at:

http://www.borland.com/bcppbuilder/freecompiler/

myke

2000\02\21@232504 by Randy Glenn

picon face
Cool! Thanks, Myke.

BYW, it's "Inprise", not "Imprise" - though it soon might by called "Corel", since the
Ottawa-based company bought them. Go Canada!

-Randy Glenn
E-Mail: spamBeGonePICxpertSTOPspamspamEraseMEyahoo.com
Web: http://i.am/PICxpert

Currently wondering why I can't get in to Safe Mode - where's a Mac when you need it?

{Original Message removed}

2000\02\22@095124 by Andrew Kunz

flavicon
face
Anybody know how to tell it to make 16-bit DOS apps?

Andy

2000\02\22@112147 by Jim Ham

flavicon
face
First the disclaimer: I don't know what revision 5.5 looks like.

Up to revision 5.1 all the switches for the command line compiler were
documented in the User's Guide. You can get an abbreviated list by entering
BCC with no arguments on the command line. There are quite a few! -mt for
the tiny (ss==ds), -ms for small model, -x- to turn off exceptions (and
reduce the size of the executable by about 1/2). BCC32 can't make dos
executables, only BCC which is the 16 bit compiler.

You then have to link in the DOS startup module and DOS libraries. The
startup module is C0n.LIB where n is s,m,l,c that matches your memory
model. Cn.LIB (same n) is the DOS run time library.

You really need to look at the documents. Hopefully the PDF of the User's
guide is included in the free distribution.

Regards,

Jim Ham

At 09:49 AM 2/22/2000 -0500, you wrote:
>Anybody know how to tell it to make 16-bit DOS apps?
>
>Andy
>
>
Jim Ham, Porcine Associates
(650)326-2669 fax(650)326-1071
"http://www.porcine.com"

2000\02\22@112155 by paulb

flavicon
face
Myke Predko wrote:

> Borland/Imprise has announced that their C++ is now available for
> download at:
> http://www.borland.com/bcppbuilder/freecompiler/

 Is that the version that uses timing loops for delays and can't handle
pentia?
--
 Cheers,
       Paul B.

2000\02\22@114754 by Herbert Graf

picon face
> Anybody know how to tell it to make 16-bit DOS apps?

    If it's anything like ver 4.02, when you create a new project it asks
what executable it should make. Afterwards, in the project window, right
click on the head node and it will let you change the target type. You will
have to rebuild though since you will be using different versions of the
libraries. TTYL

2000\02\23@020121 by Dr. Imre Bartfai

flavicon
face
Hi,
try to use Micro-C from Dunfield. It's excellent!

Regards,
Imre

On Tue, 22 Feb 2000, Andrew Kunz wrote:

> Anybody know how to tell it to make 16-bit DOS apps?
>
> Andy
>
>

2000\02\23@084455 by Andrew Kunz

flavicon
face
>BCC32 can't make dos executables, only BCC which is the 16 bit compiler.

Guess what.  Only BCC32 is in the package :-(

Andy

2000\02\23@090408 by Jim Dossey

flavicon
face
You can also download the Borland Turbo C compiler version 2.01.  I
believe that it creates DOS apps.

"Dr. Imre Bartfai" wrote:
{Quote hidden}

2000\02\23@120101 by Michael Rigby-Jones

flavicon
face
part 0 1674 bytes
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">But it's not a C++ compiler :o(</FONT>
</P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Mike</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">&quot;Dr. Imre Bartfai&quot; wrote:</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; Hi,</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; try to use Micro-C from Dunfield. It's excellent!</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; Regards,</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; Imre</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; On Tue, 22 Feb 2000, Andrew Kunz wrote:</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; &gt; Anybody know how to tell it to make 16-bit DOS apps?</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; &gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; &gt; Andy</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; &gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt; &gt;</FONT>
</P>
</UL>
</BODY>
</HTML>
</x-html>

2000\02\23@120922 by Rich Leggitt

picon face
Also, somewhere on Borland's site is freebie Turbo C 3.0 which, IIRC, was
the last DOS-only version. I think I found the link on slashdot...

On Tue, 22 Feb 2000, Andrew Kunz wrote:

{Quote hidden}

2000\02\23@122753 by Alan Pearce

face picon face
>But it's not a C++ compiler :o(

so get a C -> C++ converter, thats how the original C++ compilers were done. The
only problem is when debugging you have to work around the obfuscated names.

2000\02\23@131359 by WF

flavicon
face
part 0 16 bytes
</x-html>

2000\02\23@132756 by adavis

flavicon
face
Turbo C++ 3.0 is not free from Borland, the slashdot article pointed out that
Turbo C 2.01 and 1.0 were released free.

They also released the last version of turbo pascal.

-Adam

Rich Leggitt wrote:
{Quote hidden}

2000\02\23@203523 by Ryan Pogge

flavicon
face
I need a free  development environment to use with borland C++ 3.0 ...
any good ones available?


----- Original Message -----
From: Andrew Kunz <TakeThisOuTakunzKILLspamspamspamTDIPOWER.COM>
To: <.....PICLISTspamRemoveMEMITVMA.MIT.EDU>
Sent: Wednesday, February 23, 2000 5:40 AM
Subject: Re: Free Borland C++ Compiler for Download


> >BCC32 can't make dos executables, only BCC which is the 16 bit compiler.
>
> Guess what.  Only BCC32 is in the package :-(
>
> Andy


'[OT] Serial class for C++ (was: VC++)'
2000\04\21@154954 by Richard Crisafulli
picon face
Check out this link for a simple serial class for VC++.  It includes a link
to a more robust one as well.
http://codeguru.developer.com/network/serial.shtml

Rich

{Original Message removed}


'[OT] C++ serial comm's under windows'
2000\05\21@224924 by Joe Hamilton
flavicon
face
Can anyone show examples or tell me where to find help on serial comm's (via
comm port) under windows 32 systems using visual c++?

Thanks

Joe

2000\05\21@235511 by Plunkett, Dennis

flavicon
face
22/5/2000

<Flame suite on>
According to past posts this would be:-

       Rubbish in
       Garbage development
       Crap out
<Flame suite off>

Hey come on it's Monday!
Dennis




{Quote hidden}

2000\05\22@001353 by mike

flavicon
face
Hi Joe

Look in the help under Platform SDK - Base Services - Files and I/O -
Communications.

It's pretty straight forward....

If you want example code let me know what you want to do and can't work out
from the documentation and I'll see what I can send you...

Regards,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mike Cornelius                  Internet: TakeThisOuTmikespamspambytethis.com.au
Byte This Interactive           Phone:    +61 2 9310-2157
PO Box 1342 Strawberry Hills    FAX:      +61 2 9319-3948
NSW 2012 Australia              URL:      http://www.bytethis.com.au
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


-----Original Message-----
From: pic microcontroller discussion list
[PICLISTEraseMEspamMITVMA.MIT.EDU]On Behalf Of Joe Hamilton
Sent: Monday, May 22, 2000 12:53 PM
To: RemoveMEPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU
Subject: [OT] C++ serial comm's under windows


Can anyone show examples or tell me where to find help on serial comm's (via
comm port) under windows 32 systems using visual c++?

Thanks

Joe

2000\05\22@023129 by Joe Hamilton

flavicon
face
THANKS DENNIS THAT REALLY HELPED A LOT, I REALLY APPRECIATE THE HELP, I
COULDN'T HAVE DONE IT WITHOUT YOU.

AGAIN THANKS FOR ALL THE TROUBLE YOU WENT THROUGH

JOE

----- Original Message -----
From: Plunkett, Dennis <@spam@dplunkettRemoveMEspamEraseMEAIRINTER.COM.AU>
To: <EraseMEPICLISTspam@spam@MITVMA.MIT.EDU>
Sent: Sunday, May 21, 2000 10:51 PM
Subject: Re: [OT] C++ serial comm's under windows


{Quote hidden}

2000\05\22@084303 by Wesley Moore

flavicon
picon face
This is a useful page:
http://msdn.microsoft.com/library/techart/msdn_serial.htm

___________________________________________
Wesley Moore
RMIT - BEng/BApp.Sc. 2nd Year

wmoorespamBeGonespamcs.rmit.edu.au
http://wmoore.tsx.org/

On Sun, 21 May 2000, Joe Hamilton wrote:

> Can anyone show examples or tell me where to find help on serial comm's (via
> comm port) under windows 32 systems using visual c++?
>
> Thanks
>
> Joe
>

2000\05\22@111750 by Steven Rightnar

flavicon
face
try http://www.marshallsoft.com/
or http://ken.webster.org/codelib/serial.html
These were given to me when I asked the same question last month. I
downloaded the marshallsoft stuff and it works for me. Hope it helps.
                                                                   Steve
----- Original Message -----
From: "Joe Hamilton" <RemoveMEjoeh100@spam@spamspamBeGoneCROSSWINDS.NET>
To: <.....PICLIST@spam@spamEraseMEMITVMA.MIT.EDU>
Sent: Sunday, May 21, 2000 7:52 PM
Subject: [OT] C++ serial comm's under windows


| Can anyone show examples or tell me where to find help on serial comm's
(via
| comm port) under windows 32 systems using visual c++?
|
| Thanks
|
| Joe
|


'[PICLIST] [EE] C++ vs. Visual Basic'
2000\12\31@170539 by Brian Kraut
picon face
I had planned on learning C++ a while ago so I could write general PC
software for various things (data logging, various interfaces to PIC
projects, machinery alarm and monitoring, etc.).  After reading the
first few chapters of a book several times over the last 6 months I
realized that someone who works 60 hours a week, designs and sells PIC
products on the side, has a family and almost no free time, and only
will program occasionally will never learn C++.  I was thinking of
trying VB.  What if anything will I loose by using VB instead and is it
a lot easier to learn than C++?

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservRemoveMEspammitvma.mit.edu with SET PICList DIGEST in the body


2000\12\31@182420 by James Burkart

flavicon
face
Well, there are some basic compilers for pics out there, but either are
expensive or crap. The only exception is, of course, Basic Stamps and
PicBasic.

There is something out there called the OOPic (Object-Oriented Pic). It
comes with an IDE that handles a version of Visual Basic or C if you like.
Not quite as expensive as the Basic Stamp, and a lot cheaper to program
(little or no external hardware to connect it to the PC). They are
specifically designed for robotics, but can be used for most anything.

For more information you might wanna look at the Gernsback (Poptronics
Magazine) Website. They did an article about 4 months back.

http://www.poptronics.com/cgi-bin/texis/webinator/searchc/?db=db&query=OOPic

James Burkart

{Original Message removed}

'[PICLIST] [EE] C++ vs. Visual Basic : TRY BORLAND '
2000\12\31@183630 by ronruss

flavicon
face
I found myself in the same situation. I wanted to learn C++ for the
PC and thought it wouldn't be too bad since I program in C for
embedded systems. C++ requires dedication.

Visual Basic is a good choice but any deliverables take up alot of
space.

I tried Borland's Delphi which is object Pascal and it seems like a
good compromise. I've written DLL's using it as well as many applications.
Delphi lacked a good serial interface unit but there are sources on the
net to help in that area.

Brian Kraut wrote:

{Quote hidden}

--

From: Ron Russ
  EMICROS  - Embedded Micro Software
 (http://www.emicros.com)
  CANPORT  - Lowest cost PC to Controller Area Network Adapter
 (http://www.emicros.com/canport.htm)
  CANTEC11 - 68HC11 SBC with Controller Area Network
 (http://www.emicros.com/cantec11.htm)

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2000\12\31@231646 by Roman Black

flavicon
face
Brian Kraut wrote:
>
> I had planned on learning C++ a while ago so I could write general PC
> software for various things (data logging, various interfaces to PIC
> projects, machinery alarm and monitoring, etc.).  After reading the
> first few chapters of a book several times over the last 6 months I
> realized that someone who works 60 hours a week, designs and sells PIC
> products on the side, has a family and almost no free time, and only
> will program occasionally will never learn C++.  I was thinking of
> trying VB.  What if anything will I loose by using VB instead and is it
> a lot easier to learn than C++?


Forget C++ and get a book on C. C will perform much better
for interface applications, and if you are familiar with
low-level stuff like PICs you will find C pretty easy.

Inheritance and Polymorphism might be nice for people
writing slow clunky things like windows, but if you want
to drive the chips and video and ports in your PC to
max performance you need simple if/else branching and
for statements. C was originally designed as a fairly low
level language that would compile into fast code but
be slightly easier to use than assembler. Turning it into
C++ (and then trying to make that the standard!) was
one of the dumb moves in computing history. Keep a high
performance language high performance I say.

I have a couple of books on C++ and they seem to focus on
the object oriented stuff way too much, when all you really
need to understand is somthing like this:

if(x>0)  do_stuff();
else     do_other_stuff();

:o)
-Roman

PS. A good book is "Learning Turbo C", any instruction
from older years will be better. Also there are some good
freeware C tutorials on the net if you search.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspamspamBeGonemitvma.mit.edu with SET PICList DIGEST in the body



'[PICLIST] [EE] C++ vs. Visual Basic'
2001\01\01@001114 by Peter Tiang
flavicon
face
Hi Brian,

   From your description of the things you
   wish to do with the PC software (data logging,
   monitoring, etc). I think it is best
   you take up VB as it is very suitable
   for these GUI/Interface stuff.
   You'll will be amazed how fast you can
   come up with a GUI vs VC++.

   You won't lose much with VB except for
   speed and some low-level accesses (which
   you can overcome by using .DLL or .OCX).
   VB does have some very good serial IO
   functions built-in.

   It also tends to be a bit large for
   first release (as you have to release
   the run-time library or any ActiveX component
   with it). However subsequent releases are
   just the small VB .EXE file.

   I'm a C freak myself, and naturally there is resistant
   to having learn the syntax of another language.
   But M$ messed up VC++ with it's extensive
   use of MACROs and non-ANSI extensions.

   I think VB is very easy to learn, I
   just spent around one week before getting
   the hang of it, though months to get
   over the initial resistant.

Regards,
Peter/AMQ

{Original Message removed}

2001\01\01@164450 by Tom Mariner

flavicon
face
Heartily endorse VB as a companion to Pic products. Virtually every product
we have done in the past few years has a VB companion for setup, testing,
production, etc.

Would also suggest using Access database behind it since you have permission
to distribute the resulting code royalty-free. Most data we are trying to
track, create, etc. fits nicely into a relational database and Access is
surprisingly powerful and easy to add to one's PC program.

Tom Mariner

> {Original Message removed}

2001\01\02@035447 by Jonathan Smith

flavicon
face
Hi.  At last a question I can help with!

C++ can be useful but it's primarily designed for larger applications than
what you are doing - large programs with several developers - who may change
as the project develops.  You'll probably be better off starting with C.  It
will probably be simpler, it's a much more standardized language (IIRC C++
is still somewhat "in flux" - more than C at any rate), and you will probably
have an easier time understanding the context and concepts behind it since you
are familiar with Assembly.  C++ requires a different way of looking at the
problem (at least in theory).

Visual Basic makes the user interface easier (it's easier to make "pretty"
programs), but I don't know that it will make the actual hardware
interfacing easier -
you've still got to know how to design/develop/debug a program.  With VBasic
you are also tying yourself *strictly* to the Windows platform.  I'm not
even sure if VB supports DOS anymore!  If you should decide to branch out
to any other operating system (like say - a Unix variant) C (or even C++)
is the
way to go.  Cross platform standards *are* your friend.

In summary - try C, it's probably your best bet.  There is lot of stuff out
there - Borland has free compilers, GNU has free compilers (gcc and g++),
there's a few other companies.  I learned on Borland C++ (I was a CS major
for
a while - the "core" classes were taught in C++ with Borland on Microsoft
platforms (NT/95) and GNU compilers on the Unix platforms (Solaris and
Linux).  I took a class in VBasic - it was OK (having the IDE do the user
interface
stuff more or less "automagically" was nice) but it produces big, slow,
ugly code that will only run on Windows - and it's expensive.

At 05:05 PM 12/31/00 -0500, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\02@080456 by David Lions

flavicon
face
Forget this 'C++'.  C++ is a toss, if you ever truly understand all it's
advantages you won't be posting to the piclist about it.  Most of us don't
need C++.  In my brief experience (6 yrs) the best solution is a good plan
and understanding of what you are trying to do.  C++ and microcontrollers
dont mix, end all discussion combining the two here.

Visual Basic for PC 'front ends' is fine, unless you need to stretch the
capabilities of hardware.  Chances are you won't, so for the PC-side of your
PIC project, Visual Basic is fine.

I learnt Visual C++ because it was 'professional', perception only.  I only
use VC++ for 'front ends' also.  You would never use it as the language for
your microcontroller sourcecode.  As for using it in a front end, I spend
most of my time looking through ridiculously compicated descriptions of
classes.  Visual Basic is easier.  VC is more professional but a pain in the
butt.

Summary:
* C for microcontroller
* Visual Basic for PC-based front end (if required)

{Original Message removed}

2001\01\02@110931 by M. Adam Davis

flavicon
face
Background: I work full time as a VB programmer, know C, and finally took
a class on C++.

I started microcontrollers on the basic stamp (the first one, before the
second version came out).  I moved from the basic stamp to assembly and C
on the pic for the same reason I use C and C++ on more and more of my
projects - I can't get VB to go fast enough, make small distributions, and
access the hardware easily enough.  VB has other limitations, but as a
hardware guy I am more concerned about those three.  You cannot make a
complete program in VB that fits on one disk (I haven't tried - I suppose
it might be possible to fit msvbxx.dll on a disk with the other runtime
files).  It is practically impossible to access the pc hardware directly
with VB without extra dlls or activex components.  VB is /SLOW/.  As in
molasses-running-uphill-on-a-cold-day type of slow.  Sure, it gets the job
done, and for many/most projects it is fast enough.  And you can't fight
the fact that sometimes development time is more important than run-time
speed.

But it was good that I started out with basic and understood its
limitations, and it helps you better understand the windows interface and
how events and messages are dealt with - crucial to using vc effectively.

-Adam

Brian Kraut wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\02@112442 by Scott Newell

flavicon
face
>projects - I can't get VB to go fast enough, make small distributions, and
>access the hardware easily enough.  VB has other limitations, but as a

Isn't it also harder to get to the windows API through VB?

'Course, I'm partial to Delphi and C++ Builder myself...I have no patience
or use for VB.


newell

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\02@115712 by M. Adam Davis

flavicon
face
Strictly, yes, it is harder to deal with the windows API directly in VB
than in C, but not much harder at all.  Just have to keep a few things in
mind, and it becomes fairly straightforward.

-Adam

Scott Newell wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\02@121350 by Bob Ammerman

picon face
Couldn't resist chiming in...

I am both a PIC programmer (almost exclusively assembler) and a
PC/MAC/Unix/Embedded_x86 C/C++ programmer. I do use VB or Delphi once in a
while for 'quick and dirty' stuff.

I spend a lot of time in all of these environments.

[Historically I can add VAX/VMS, IBM OS/MVS, Data General AOS[/VS], x86
assembly, Fortran, Forth  and many other platforms (even Cobol :-( ).]

As has been said many times before: Horses for Courses.

VB (or Delphi) is an excellent choice for quick user-interface intensive
hacks on the PC side. If you really have to do any crunching, you're much
better off with C++ (although the Pascal based Delphi can come _very_ close
to C++ [it actually uses the same code generator as Borland's C++ Builder]).

In short, I figure that VB/Delphi is appropriate for most programmers that
don't want to commit to the effort/time required to really understand the
underpinnings of Windoze or (X-Window or MacOS or ... for that matter).
It'll generally let you do what you need to do.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\02@134953 by Randy A.

picon face
Brian:

I too had a similar problem as you and ended up using VB and liking it.  For
all of my applications so far it has proven more than adequate.  Be sure to
get at least the professional version tho as the entry level or standard
version does NOT have the serial I/O functions.  It only took my about a week
to become familiar and then the learning curve was FAST from there.

Randy

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\02@142729 by Nigel Goodwin

flavicon
face
In message <spamBeGone3A51FD18.8A4520C6@spam@spamubasics.com>, M. Adam Davis
<RemoveMEadavisEraseMEspamKILLspamUBASICS.COM> writes
>Background: I work full time as a VB programmer, know C, and finally took
>a class on C++.
>
>I started microcontrollers on the basic stamp (the first one, before the
>second version came out).  I moved from the basic stamp to assembly and C
>on the pic for the same reason I use C and C++ on more and more of my
>projects - I can't get VB to go fast enough, make small distributions, and
>access the hardware easily enough.  VB has other limitations, but as a
>hardware guy I am more concerned about those three.  You cannot make a
>complete program in VB that fits on one disk (I haven't tried - I suppose
>it might be possible to fit msvbxx.dll on a disk with the other runtime
>files).  It is practically impossible to access the pc hardware directly
>with VB without extra dlls or activex components.  VB is /SLOW/.  As in
>molasses-running-uphill-on-a-cold-day type of slow.  Sure, it gets the job
>done, and for many/most projects it is fast enough.  And you can't fight
>the fact that sometimes development time is more important than run-time
>speed.

I've been trying not to get involved in this discussion :-). But what
about Delphi?, it produces standalone .EXE files (no libraries needed
like VB), it's fairly fast, and it's pretty easy to access hardware -
although under Windows NT a driver DLL is required, but that's probably
true of most C++ programs as well (certainly the documentation with the
driver provides C code examples of it's use). The interface is pretty
similar to VB, it's easy and quick to produce nice looking interfaces.
--

Nigel.

       /--------------------------------------------------------------\
       | Nigel Goodwin   | Internet : spamBeGonenigelgspam_OUTspamRemoveMElpilsley.co.uk           |
       | Lower Pilsley   | Web Page : http://www.lpilsley.co.uk       |
       | Chesterfield    | Official site for Shin Ki and New Spirit   |
       | England         |                 Ju Jitsu                   |
       \--------------------------------------------------------------/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\03@030429 by Michael Rigby-Jones

flavicon
face
> -----Original Message-----
> From: M. Adam Davis [SMTP:.....adavisspamRemoveMEUBASICS.COM]
> Sent: Tuesday, January 02, 2001 4:56 PM
> To:   PICLISTspam@spam@MITVMA.MIT.EDU
> Subject:      Re: [EE] C++ vs. Visual Basic
>
> Strictly, yes, it is harder to deal with the windows API directly in VB
> than in C, but not much harder at all.  Just have to keep a few things in
> mind, and it becomes fairly straightforward.
>
> -Adam
>
Can't say I've noticed that particularly.  Sure you have to be a little
careful when declaring the API function, to make sure parameters are
correctly declared as ByVal or ByRef but apart from that I've not had any
problems.  I use VB everyday for programming automated testsets for
production purposes.  We have to use both the Windows API and a GPIB API and
this is quite straightforward.  It *IS* a little slow for heavy duty number
crunching, but at the same time I think it's surprisingly fast for some
operations.  The feature of VB I hold above all others is it's debugging
facilities, which are quite literally second to none.  Because the program
runs in interpreted mode through the VB environment, you can pause program
execution, add or remove code, or change the program execution point and
carry on without having to recompile.  Debugging in C++ Builder and Delphi
is pretty good, but not up to VB standards.

On the negative side, distribution of programs can be problematic, the
runtime libraries are pretty large, but then again, C++ Builder 5 seems to
have bloated quite badly in this area.  As with all languages, it's horses
for courses.  If you want a language that has a short learning curve, and
extremely rapid development time but speed and size are of secondary
importance, then VB is hard to beat.  If your priorities are different, give
Delphi or C++ Builder a look.  If you are some kind of masochist, try Visual
C++ :o)

Regards

Mike

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\01\03@131159 by Don Hyde

flavicon
face
I'll add another vote for Borland.

VB is so grossly bloated and needs so many dll's to distribute a program
that I can't get the job done for all the gagging.

VC++ had the steepest learning curve of any programming environment I've
ever used (I've used 30 different assemblers and just about any high-level
language you care to mention, though not Ada, which I understand might just
give it a run for the  money).

On a new job, I needed to crank out a quick-and-dirty PC thing and somebody
handed me a copy of C++ Builder.  I groaned "You're not going to make me
learn yet another...", but it proved to be as easy to use as VB, and able to
make decent standalone .exe's, so I shut up and have been using it ever
since whenever I need to throw something together.

It really impresses customers when you discuss something on the phone and
then email them a pretty-looking program the next day.

> {Original Message removed}

2001\01\04@024214 by Michael Rigby-Jones

flavicon
face
> -----Original Message-----
> From: Don Hyde [SMTP:EraseMEDonHRemoveMEspamSTOPspamAXONN.COM]
> Sent: Wednesday, January 03, 2001 6:11 PM
> To:   RemoveMEPICLISTKILLspamspamTakeThisOuTMITVMA.MIT.EDU
> Subject:      Re: [EE] C++ vs. Visual Basic
>
> I'll add another vote for Borland.
>
> VB is so grossly bloated and needs so many dll's to distribute a program
> that I can't get the job done for all the gagging.
>
However, if the program has been written as a tool for your own use (which
the majority of  my programs are), then distribution isn't a worry.
As an example of how usefull VB is, I had a project involving a temperature
stabilised laser.  The PIC ran a PID temperature control loop, with a sample
rate of 50 ms.  Adjusting all the loop parameters to optimise control
response was a pain, even with a flash chip, so I stripped out all the
ADC/DAC control routines and hooked them up to the MSSP module running as an
I2C salve.  Then I wrote a VB front end with lots of sliders for controlling
loop parameters and text boxes to show relevant parameters and an I2C master
driver.  Adjusting the PID loop was a snap after that.  The VB program took
maybe a day to write, compared to the previous 3 days of playing with loop
gains but reprogarmming the PIC.  The 50 ms loop time was easily achieved
using the multimedia timers built into windows, and although the period was
sometimes a millisecond or two out it was more than good enough.

> VC++ had the steepest learning curve of any programming environment I've
> ever used (I've used 30 different assemblers and just about any high-level
> language you care to mention, though not Ada, which I understand might
> just
> give it a run for the  money).
>
Agreed, VC++ is definately not for the beginner.  It certainly made my brain
hurt when I first tried it many years back.

> On a new job, I needed to crank out a quick-and-dirty PC thing and
> somebody
> handed me a copy of C++ Builder.  I groaned "You're not going to make me
> learn yet another...", but it proved to be as easy to use as VB, and able
> to
> make decent standalone .exe's, so I shut up and have been using it ever
> since whenever I need to throw something together.
>
Unless things have changed since I last used C++ Builder you can either
staticaly link all the runtimes, producing a huge executable, *or* have to
distribute the run time DLL's with the executable.

> It really impresses customers when you discuss something on the phone and
> then email them a pretty-looking program the next day.
>
>

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\04@135426 by Don Hyde

flavicon
face
I'm looking at the most recent program I did this way.  Statically linked it
was 473K, which by PIC standards is certainly massively bloated, but it is
small enough to get through just about anybody's email server as an
attachment.  All the customer had to do to run it was click on the icon in
his email program, and it just ran without needing to have any dll's copied
to osbcure directories or an elaborate install program.

Of course this meant he trusted me not to have sent him a virus or trojan
horse, but he did, so...

> {Original Message removed}

'[EE]: C++ Programming - Basic Question'
2001\01\25@151014 by Saurabh Sinha

picon face
Hi,

I have three files:
EDR.H
EDR.LIB
PC30.CPP

For some reason (anyone know why?), the PC30.CPP cannot run on its own
unless I create a project. Probably, as the Library file is not used in
'normal running' of the program. Using Borland C++ DOS version, I goto
project, add items and add the above files. The program gives me errors - I
don't think its the CPP file - I am told its error free. Could it be any
other 'administration' procedure that I am missing due to the project
creation process?

C++ gives me problems related to LINKING.

If someone can help, can I send the three files (about 77kb in total)?

Regards,

S. Sinha (Saurabh)
Tel/Fax: (012) 343-4912
E.Mail: spamBeGonessinhaspam@spam@IEEE.ORG
VIsit: http://home.mweb.co.za/si/sinha
ICQ: 82010326

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspam_OUTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\01\26@043027 by JP.BROWN

flavicon
face
Hi Saurabh, try setting the memory model to huge (in the compile/link
options).  ----- John

On Thu, 25 Jan 2001, Saurabh Sinha wrote:

{Quote hidden}

         -----  John P. Brown      J.P.Brownspam_OUTspambradford.ac.uk ----
          \            --- Witty remark goes here ---         /
           --------------------------------------------------

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


'[OT]: C++ Coding Question: Constructors not always'
2001\01\31@161150 by Bourdon, Bruce

flavicon
face
****** Preface:
If I have already asked you about this, I apologize - please disregard this
email.

A workaround is in place, so there is no need for a rapid response. But I
would appreciate your thoughts eventually, if you have something to say on
this.

****** Environment:
Microsoft Visual C++ 6.0, with the latest service packs. O.S.: Win95.

****** Subject:
C++ Coding question: Shouldn't constructors always be called first, before
the objects member functions?

I have a C++ coding problem, and would be happy to hear from anyone that has
an opinion on it.

****** Overview:
As you may know, the C++ language provides functions that are intended to be
used for object (code and data in memory) initialization and cleanup (i.e.
startup and shutdown),  they are the 'Constructor' and the 'Destructor'
respectively.

Now the weird part: Sometimes member functions are called before the objects
constructor, and again after the objects destructor have been called!

In the attached demo code this does not result in a fatal bug, but in real
code this "out of order" sequence can not be tolerated.

I have a workaround, but it is unsatisfactory. I'd like to hear from anyone
that has a better idea.

****** Attachments:
I pasted the relevant portions of a project to demonstrate this problem
below. Please note that the problem will not occur if all code is place in
one big file (and no, this is not a viable alternative). Also note that this
is a  minimal - non-serious example, intended only to illustrate the
problems behavior.

****** Details:
In the real project there are many modules (files), and resources (memory,
etc) are acquired in many sections.

To keep track of the resources (and to prevent leaks, etc.) I wrote a
resource manager class that would be responsible for supplying, freeing and
keeping track of all resources used throughout program execution.

Obviously, the (single) object instantiated from this class needs to be
created before any resources are required and must exist until all resource
users have exited.

To achieve this, I made a single global instance of this class, available to
all modules.

This appeared to work well until recently.

I discovered that when static objects belonging to other objects (static or
non-static) have code that requires resources in their initialization blocks
(constructors), the previously mentioned resource manager gets called - but
its' member functions may execute BEFORE its' constructor!

Results from running the attached code:

When global object is declared in dep.cpp, function sequence is normal:
In CResMgr::CResMgr()...
In CResMgr::ObtainResource...
In CResMgr::ReleaseResource...
In CResMgr::FindResource...
In CResMgr::~CResMgr...

When global object is declared in rmgr.cpp, function sequence is Incorrect:
In CResMgr::ObtainResource...
In CResMgr::CResMgr()...
In CResMgr::~CResMgr...
In CResMgr::ReleaseResource...
In CResMgr::FindResource...

This is because MS-VC++ seems to initialize code in the order of the file
names they are contained within - with code in files that are named
alphabetically first initialized first.

The obvious workaround is to place the code that must be initialized first
in a file that is named appropriately (this is the current method).

And yes, this does work. But it is a serious hole with the potential to
cause someone significant grief down the road should they be charged with
its' maintenance (if they are unaware of this potential bug…).

You may think that eliminating the global object, by having a static member
object shared by pointers to all code that needs to access it would work. It
does not.

Static objects have their constructors called in the same sequence: the
containing file names alphabetically...

I have also tried creating flags, and verifying the value of the flag to
determine the correct action (i.e. create and initialize the global or
static object if the flag is not the expected value). But this does not work
as the code that assigns the initial values to these flags may or may not
have executed - likely not if the containing filename is late in the
alphabet!

In the real code, I am trying to provide support a large volume of existing
code (some c++ and some c). For example, the resource manager overloads the
new and delete functions. Therefore simply adding separate initialization
functions and mandating they be called before resources may be obtained is
not a viable alternative. Neither is some kind of inheritance scheme, where
all the objects that need to access the resource manager object would
inherit some form of knowledge about it, etc...

It also skirts the central issue: why does MS-VC++ allow an objects' member
functions to be called before its' constructor?

Please see demo code below.
Thanks in advance.
Bruce.


==========================================
File: main.cpp

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include <windows.h>
#include "rmgr.h"
#include "dep.h"

///////////////////////////////////////////////////////////////
int main()
{
       class_two c2;

       c2.set_value(1);
       printf(c2.get_value_string());
     
       // done:
   printf("\n\n (press <Enter> to exit)");
   getchar();

       return 0;
}

==========================================
File: dep.cpp

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include <windows.h>
#include "rmgr.h"
#include "dep.h"

///////////////////////////////////////////////////////////////
// globals:
//CResMgr g_ResMgr; // <- if done here, all is well...

///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
// class_one implementation:

///////////////////////////////////////////////////////////////
class_one::class_one(void)
: m_pszMsg(0)
{
       if (g_ResMgr.ObtainResource(&m_pszMsg))
               strcpy(m_pszMsg, "Un-Used");
}

///////////////////////////////////////////////////////////////
class_one::~class_one()
{
       g_ResMgr.ReleaseResource(&m_pszMsg);
}

///////////////////////////////////////////////////////////////
void class_one::store_msg(LPSTR szMsg)
{}
///////////////////////////////////////////////////////////////
LPSTR class_one::get_msg(void)
{
       return m_pszMsg;
}
///////////////////////////////////////////////////////////////
void class_one::delete_msg(LPSTR szMsg)
{}


///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
// class_two implementation:

// static members:
class_one class_two::m_c1;
int class_two::m_nVal;

///////////////////////////////////////////////////////////////
class_two::class_two(void)
{}

///////////////////////////////////////////////////////////////
class_two::~class_two()
{}

///////////////////////////////////////////////////////////////
void class_two::set_value(int nVal)
{
       itoa(nVal, (char*) m_c1.get_msg(), 10);
}

///////////////////////////////////////////////////////////////
LPCSTR class_two::get_value_string(void)
{
       return m_c1.get_msg();
}

==========================================
File: dep.h

#ifndef DEP_H
#define DEP_H

///////////////////////////////////////////////////////////////
class class_one
{
public:
       class_one(void);
       ~class_one();

       void store_msg(LPSTR szMsg);
       LPSTR get_msg(void);
       void delete_msg(LPSTR szMsg);

private:
       LPSTR m_pszMsg;
};

///////////////////////////////////////////////////////////////
class class_two
{
public:
       class_two(void);
       ~class_two();

       void set_value(int nVal);
       LPCSTR get_value_string(void);

private:
       static class_one m_c1;
       static int m_nVal;
};

#endif /* DEP_H */

==========================================
File: rmgr.cpp

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include <windows.h>
#include "rmgr.h"

///////////////////////////////////////////////////////////////
// globals:
CResMgr g_ResMgr;  // <- if done here, problem occurs.

///////////////////////////////////////////////////////////////
// class CResMgr:

///////////////////////////////////////////////////////////////
CResMgr::CResMgr(void)
:       m_nResourceCount(0)
{
       OutputDebugString("In CResMgr::CResMgr()...\n");

       // initialize:
       for (int nCntr=0; nCntr < RES_MGR_MAX_ITEMS; ++nCntr)
               {
               m_ResRecord[nCntr].pszSomeResourceThingy = 0;
               m_ResRecord[nCntr].bSomeKindaFlag = 0;
               // ...
               }

}

///////////////////////////////////////////////////////////////
CResMgr::~CResMgr()
{
       OutputDebugString("In CResMgr::~CResMgr...\n");

       // cleanup:
       for (int nCntr=0; nCntr < RES_MGR_MAX_ITEMS; ++nCntr)
               {
               if (m_ResRecord[nCntr].pszSomeResourceThingy)
                       {
                       delete [] m_ResRecord[nCntr].pszSomeResourceThingy;
                       m_ResRecord[nCntr].pszSomeResourceThingy = 0;
                       m_ResRecord[nCntr].bSomeKindaFlag = FALSE;
                       // ...
                       }
               }
}

///////////////////////////////////////////////////////////////
BOOL CResMgr::ObtainResource(LPSTR* ppTextBuffer)
{
       OutputDebugString("In CResMgr::ObtainResource...\n");

       if (RES_MGR_MAX_ITEMS == m_nResourceCount)
               return FALSE; // error: limit reached.

       *ppTextBuffer = new char [RES_MGR_SILLY_RESOURCE_LENGTH];

       if (NULL != *ppTextBuffer)
               {
               m_ResRecord[m_nResourceCount].pszSomeResourceThingy =
*ppTextBuffer;
               ++m_nResourceCount;
               // ...
               return TRUE;
               }

       return FALSE; // error: failed to obtain storage for resource.
}

///////////////////////////////////////////////////////////////
BOOL CResMgr::ReleaseResource(LPSTR* ppTextBuffer)
{
       OutputDebugString("In CResMgr::ReleaseResource...\n");

       int nIndex;

       if (NULL == *ppTextBuffer)
               return FALSE;

       if (FindResource(*ppTextBuffer, &nIndex))
               {
               delete [] m_ResRecord[nIndex].pszSomeResourceThingy;
               m_ResRecord[nIndex].pszSomeResourceThingy = 0;
               --m_nResourceCount;
               return TRUE;
               }

       return FALSE;
}

///////////////////////////////////////////////////////////////
BOOL CResMgr::FindResource(LPSTR pTextBuffer, int* pnIndex)
{
       OutputDebugString("In CResMgr::FindResource...\n");

       if (NULL == pTextBuffer)
               return FALSE;

       for (int nCntr=0; nCntr < RES_MGR_MAX_ITEMS; ++nCntr)
               {
               if (pTextBuffer == m_ResRecord[nCntr].pszSomeResourceThingy)
                       {
                       *pnIndex = nCntr;
                       return TRUE;
                       }
               }

       return FALSE;
}

==========================================
File: rmgr.h

#ifndef RES_MGR_H
#define RES_MGR_H

///////////////////////////////////////////////////////////////
// globals:
extern class CResMgr g_ResMgr;

///////////////////////////////////////////////////////////////
// constants and stuff:
enum    {RES_MGR_MAX_ITEMS = 10};
enum    {RES_MGR_SILLY_RESOURCE_LENGTH = 64};


// example record structure:
typedef struct tag_RESOURCE_RECORD{
       LPSTR pszSomeResourceThingy;
       BOOL bSomeKindaFlag;
       int     nSomeItherVar;
} RESOURCE_RECORD;


///////////////////////////////////////////////////////////////
// class definition:
class CResMgr
{
public:
              CResMgr(void);
       ~CResMgr();

       BOOL ObtainResource(LPSTR* ppTextBuffer);
       BOOL ReleaseResource(LPSTR* ppTextBuffer);

private:
       BOOL FindResource(LPSTR pTextBuffer, int* pnIndex);

       // Using a fixed array, in real
       // code would use linked list:
       RESOURCE_RECORD m_ResRecord[RES_MGR_MAX_ITEMS];
       int m_nResourceCount;
}; /* CResMgr */

#endif /* RES_MGR_H */

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamBeGonespam.....mitvma.mit.edu


2001\01\31@174815 by Bob Ammerman

picon face
Bruce,

I jumped off a bit half-cocked in my previous response (tho' what I said
there is indeed true). I confess I didn't even fully read your message
before responding to it because I immediately 'knew' what the problem was
(unspecified order of construction of static global objects across files).

You said:

>You may think that eliminating the global object, by having a static member
>object shared by pointers to all code that needs to access it would work.
It
>does not.

I am not sure what you mean by this.

I still stand by the idea of making all code and data members of the entire
resource manager class 'static'.

If you want to make sure that an initialization routine (pseudo-constructor)
runs first you could do this:

class CResMan {
public:
    static void   DoSomething();
    static void   DoSomethingElse();
private:
   static void     Initialize();
};

void CResMan::Initialize()
{
   static bool first_time = true;
   if (first_time)
   {
       first_time = false;
       .. whatever...
   }
}

void CResMan::DoSomething()
{
   Initialize();
}

etc.

This works because static variables in function scope are always initialized
no later than the first time the function is entered.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestspam.....mitvma.mit.edu


2001\01\31@190552 by Michael F. Maddox

flavicon
face
Actually, the Constructor and Destructor are called automagically - the constructor when the object is instantiated (either explicitly on the stack, or on the heap with the new operator), and the destructor when the object leaves scope or is otherwise destroyed (i.e., freed from the heap).  Essentially, this rule is inviolate, as it is essential to the OOP paradigm, as expressed in C++.

Without really digging in the code, I suggest that this code is actually creating two instances of the g_ResMgr, although you're attempting to create only one, and use it statically across all modules.  The problem is, I suspect your second instance is locally scoped, and is thereby overriding the external global you're really trying to use.  This could PROBABLY be made to work by explicit use of namespaces.

Can you explain exactly why you're attempting to reference an external class within its own definition file?  Look at rmgr.h.  It attempts to use the external global (global scope, external linkage) you're creating within the rmgr.cpp file.   I assume you want to use an external global as your resources manager, and allow all files that need it to access the instance.  If I wanted to do this, I would instantiate the resource manager object elsewhere, then allow the other modules to link to the instance externally.  This is a common enough metaphor.

I'll load this up into a project and see if I can't give you a better answer by tomorrow.

Michael Maddox
Senior Software Engineer
Hayes
Tallahassee, Florida, USA

Eat hard, sleep hard, wear glasses if you need them.



  It would appear to me that the header and implementation files should be free of the global.  You should move the creation of this global to the
At 04:09 PM 1/31/2001 -0500, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestRemoveMEspamEraseMEmitvma.mit.edu


2001\01\31@205657 by Bob Ammerman

picon face
>Actually, the Constructor and Destructor are called automagically - the
>constructor when the object is instantiated (either explicitly on the
>stack, or on the heap with the new operator), and the destructor when the
>object leaves scope or is otherwise destroyed (i.e., freed from the
>heap).  Essentially, this rule is inviolate, as it is essential to the OOP
>paradigm, as expressed in C++.

When the constructor/destructor are called are a function of the scope and
location of the object.
Global statics are constructed before the code in main() starts and
destructed after main() exits.

Statics in functions are constructed no later than on the first entry to the
function.

Stack based variables are constructed when they come into scope and
destructed when they leave scope.

Heap based variables are constructed at new time and destructed at delete
time.

>Without really digging in the code, I suggest that this code is actually
>creating two instances of the g_ResMgr, although you're attempting to
>create only one, and use it statically across all modules.  The problem is,
>I suspect your second instance is locally scoped, and is thereby overriding
>the external global you're really trying to use.  This could PROBABLY be
>made to work by explicit use of namespaces.

Namespaces have nothing to do with this.
The external reference in the header file allows other modules to access the
single object. In the module that contains both the extern reference and the
definition the compiler knows that they are really the same thing. (really
no different than having the prototype of a function in a header file -- it
works whether or not you are in the module where the function is declared.)

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestspamspamBeGonemitvma.mit.edu


2001\01\31@221703 by Bob Ammerman

picon face
Also, try looking up "#pragma init_seg" in MSDN.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspammitvma.mit.edu



'[OT]: C++ Coding Question: Constructors not always'
2001\02\01@111715 by Bourdon, Bruce
flavicon
face
Thanks to all for their thoughts and suggestions.

The most attractive method (that actually works) was to either use a static
flag or a static object WITHIN THE FUNCTION used to obtain the objects
pointer/reference/or-call-members/etc...

When the flag (or object) is designated as static within the CLASS, then
there IS NO Garentee of initialization order WHEN THESE STATICS ARE IN
DIFFEENT MODULES (files)!!! (I didn't know this until I read the responses!)

But, as stated by others, when the flag (or object) is designated as static
with a function, it is garanteed to be initialized regardless of whether or
not the code (the caller and calle) are spread across modules (files).

Wow!

Thanks again to all.

Bruce.

{Original Message removed}


'[EE]: Please compile.. C++ ALOHA Simulation'
2001\04\08@184554 by Saurabh Sinha
picon face
part 1 387 bytes content-type:text/plain; (decoded 7bit)

Hi,

Could someone please compile the attached ALOHA program for me and send me
the executable file? [I am running Windows at home or my C++ doesn't have
the drand48 procedure in stdlib.h].

Thank you.

Regards,

S. Sinha (Saurabh)
Tel/Fax: (012) 343-4912
Cell: 0825405577
E.Mail: RemoveMEssinhaspamBeGonespamRemoveMEIEEE.ORG
Visit: http://home.mweb.co.za/si/sinha
ICQ: 82010326



part 2 4904 bytes content-type:application/octet-stream; (decode)

part 3 144 bytes
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\04\09@170044 by P.C. Uiterlinden

flavicon
face
Saurabh Sinha wrote:
>
> Hi,
>
> Could someone please compile the attached ALOHA program for me and send me
> the executable file? [I am running Windows at home or my C++ doesn't have
> the drand48 procedure in stdlib.h].

Sorry, no Win executable, Linux only here.

But here are the results from your program:

pmf[0] = 0.000272
pmf[1] = 0.000651
pmf[2] = 0.001420
pmf[3] = 0.003041
pmf[4] = 0.006498
pmf[5] = 0.013843
pmf[6] = 0.029104
pmf[7] = 0.062127
pmf[8] = 0.132223
pmf[9] = 0.279005
pmf[10] = 0.471816
Sum of pm = 1.000000, Avg occupancy = 9.004324
FRACTION BLOCKED = 0.333412
AVG DELAY = 85.277463  LITTLE's THM = 11.368983

Paul.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\04\09@171933 by Dipperstein, Michael

face picon face
{Quote hidden}

I emailed Saurabh Sinha a Win32 executable and the libraries required to build
it under mingw32.  If anyone else needs a copy, I can mail it out.  The zipped
archive is about 30K and it's probably not worth posting to the list.

-Mike

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


'[EE]: C++'
2001\04\11@114719 by Gary Faria

flavicon
face
I'm looking for a command to clear the screen.

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestSTOPspamspam@spam@mitvma.mit.edu


2001\04\11@115547 by Saurabh Sinha

picon face
Try Clrscr()

Regards,

S. Sinha (Saurabh)
Tel/Fax: (012) 343-4912
Cell: 0825405577
E.Mail: ssinhaspamBeGonespamspamBeGoneIEEE.ORG
Visit: http://home.mweb.co.za/si/sinha
ICQ: 82010326

----- Original Message -----
From: "Gary Faria" <spamBeGonegaryspamCOLORKINETICS.COM>
To: <spam_OUTPICLISTSTOPspamspamMITVMA.MIT.EDU>
Sent: Wednesday, April 11, 2001 8:46 AM
Subject: [EE]: C++


> I'm looking for a command to clear the screen.
>
> --
> http://www.piclist.com hint: To leave the PICList
> RemoveMEpiclist-unsubscribe-requestspamspammitvma.mit.edu
>
>

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestspamspamRemoveMEmitvma.mit.edu


2001\04\11@120601 by Gary Faria

flavicon
face
What header file do I use?

-----Original Message-----
From: Saurabh Sinha [KILLspamssinhaspamspamspam_OUTIEEE.ORG]
Sent: Wednesday, April 11, 2001 8:57 PM
To: PICLISTRemoveMEspamMITVMA.MIT.EDU
Subject: Re: C++


Try Clrscr()

Regards,

S. Sinha (Saurabh)
Tel/Fax: (012) 343-4912
Cell: 0825405577
E.Mail: EraseMEssinhaSTOPspamspamRemoveMEIEEE.ORG
Visit: http://home.mweb.co.za/si/sinha
ICQ: 82010326

----- Original Message -----
From: "Gary Faria" <spam_OUTgaryRemoveMEspamEraseMECOLORKINETICS.COM>
To: <TakeThisOuTPICLISTRemoveMEspam@spam@MITVMA.MIT.EDU>
Sent: Wednesday, April 11, 2001 8:46 AM
Subject: [EE]: C++


> I'm looking for a command to clear the screen.
>
> --
> http://www.piclist.com hint: To leave the PICList
> EraseMEpiclist-unsubscribe-requestRemoveMEspammitvma.mit.edu
>
>

--
http://www.piclist.com hint: To leave the PICList
spampiclist-unsubscribe-request.....spamspammitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspam_OUTspam@spam@mitvma.mit.edu


2001\04\11@120618 by Bob Ammerman

picon face
In what environment?

----- Original Message -----
From: "Gary Faria" <.....garyspamspam.....COLORKINETICS.COM>
To: <PICLISTKILLspamspamEraseMEMITVMA.MIT.EDU>
Sent: Wednesday, April 11, 2001 11:46 AM
Subject: [EE]: C++


> I'm looking for a command to clear the screen.
>
> --
> http://www.piclist.com hint: To leave the PICList
> EraseMEpiclist-unsubscribe-request@spam@spam@spam@mitvma.mit.edu
>
>

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestspamspamKILLspammitvma.mit.edu


2001\04\11@121017 by Gary Faria

flavicon
face
For mac and windows.

-----Original Message-----
From: Bob Ammerman [spamBeGoneRAMMERMANRemoveMEspamEraseMEPRODIGY.NET]
Sent: Wednesday, April 11, 2001 11:55 AM
To: RemoveMEPICLISTKILLspamspamRemoveMEMITVMA.MIT.EDU
Subject: Re: [EE]: C++


In what environment?

----- Original Message -----
From: "Gary Faria" <TakeThisOuTgaryspamCOLORKINETICS.COM>
To: <spamBeGonePICLISTKILLspamspamTakeThisOuTMITVMA.MIT.EDU>
Sent: Wednesday, April 11, 2001 11:46 AM
Subject: [EE]: C++


> I'm looking for a command to clear the screen.
>
> --
> http://www.piclist.com hint: To leave the PICList
> EraseMEpiclist-unsubscribe-request.....spamKILLspammitvma.mit.edu
>
>

--
http://www.piclist.com hint: To leave the PICList
spampiclist-unsubscribe-requestspammitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestSTOPspamspammitvma.mit.edu


2001\04\11@123516 by Bob Ammerman

picon face
There is no ANSI standard way to do this.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestSTOPspamspamKILLspammitvma.mit.edu


2001\04\11@145047 by Olin Lathrop

face picon face
> I'm looking for a command to clear the screen.
>
> For mac and windows.

I don't know about MAC, but on Windows the CLS command will clear the window
it is run in.  This command is internal to the command line shell, so it
only applies to that window.  There is no command to clear the whole screen
in windows.  Besides, clear to what?  Do you mean erase all text, set to
fixed color, or what?  Your quenstion really makes no sense.

If you are asking "what command is there to set the whole screen to black",
there isn't one.  An application could draw to the whole screen and set it
to black, but the underneath windows would be restored when that application
exits.  Again, this whole notion of "clearing" the screen makes no sense.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, @spam@olin.....spamspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
spampiclist-unsubscribe-request.....spam.....mitvma.mit.edu



'[OT]: C++ Users Group'
2001\05\08@200936 by Robert Francisco
flavicon
face
Hello,

I search the web for a Visual C++ users group and found so MANY.
Has any one know of one that is similar in activity and culture as this
list?

TIA,

RF

http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\05\09@060854 by Wendy Olend

flavicon
face
For the Newbie, I suggest alt.comp.lang.learn.c-c++
This was a great help when I needed to brush up on my C.  Lots of very smart
(and patient) people.

Just my $.02 worth,
Wendy

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\09@070545 by Patrik Husfloen

picon face
If you are planning on developing for windows in the future the DOTNET mailing list would be good.
http://discuss.develop.com
Both developers and microsofties reads that, getting vs.NET beta1 might be good too :)

patrik

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


'[PIC]:C / C++ compiler'
2001\05\14@153749 by Joseph A. Zammit

picon face
I am starting to program the large PIC's the F8xx's etc. Due to their
complexity I wish to program them in C or C++. Can you recommend me a good
compiler or else shall I program in assembly? I have extensive experience in
assembly programming but for quicker development I wish to use a higher
level language

Joseph A. Zammit
Malta


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\14@154926 by Drew Vassallo

picon face
>I am starting to program the large PIC's the F8xx's etc. Due to their
>complexity I wish to program them in C or C++. Can you recommend me a good
>compiler or else shall I program in assembly? I have extensive experience
>in
>assembly programming but for quicker development I wish to use a higher
>level language

Funny, I usually try to go the opposite direction; the tougher something is,
the more I'd like to get down to the basics to simplify how everything
operates in my mind's eye.  Besides, it's not so much that those chips are
more "complex" than any others, they simply have more features.  If you
don't want them, don't use them.  I think you'll find that you have to do
the same amount of work whether you use assembly or C/C++.

I haven't used any C compilers for PICs, but I believe generally people
gravitate towards the Hi-Tech C compiler.  I'm sure you will find
information readily available on the web.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\14@161038 by Dale Botkin

flavicon
face
On Mon, 14 May 2001, Joseph A. Zammit wrote:

> I am starting to program the large PIC's the F8xx's etc. Due to their
> complexity I wish to program them in C or C++. Can you recommend me a good
> compiler or else shall I program in assembly? I have extensive experience in
> assembly programming but for quicker development I wish to use a higher
> level language

I use CCS C...  many others use it as well as Hi-Tech C.  I'm not aware of
any C++ compiler for the PIC.  I tried a cople of other compilers before
settling on CCS, some were OK, some were total junk.

Dale
--
A train stops at a train station.  A bus stops at a bus station.
On my desk I have a workstation...

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\14@162915 by embedded engineer

flavicon
face
Drew Vassallo wrote:
>
> >I am starting to program the large PIC's the F8xx's etc. Due to their
> >complexity I wish to program them in C or C++. Can you recommend me a good
> >compiler or else shall I program in assembly? I have extensive experience
> >in
> >assembly programming but for quicker development I wish to use a higher
> >level language
>
> Funny, I usually try to go the opposite direction; the tougher something is,
> the more I'd like to get down to the basics to simplify how everything
> operates in my mind's eye.  Besides, it's not so much that those chips are
> more "complex" than any others, they simply have more features.  If you
> don't want them, don't use them.  I think you'll find that you have to do
> the same amount of work whether you use assembly or C/C++.

At the risk of starting an Assembly versus C flame war, I respectfully
disagree.  Having programmed for the PIC in both, I use C almost
whenever possible.  The important thing is to get used to the kind of
code the compiler produces and choose C instructions that produce the
code that you want.  Make necessary changes in style to accommodate the
compiler.  IMHO, this is much preferred to assembly.  For complex
programs (as you have described) it becomes a nightmare to maximize the
use of registers.  The task is easy for a compiler that keeps track of
the call tree.

> I haven't used any C compilers for PICs, but I believe generally people
> gravitate towards the Hi-Tech C compiler.  I'm sure you will find
> information readily available on the web.

My 0.02 USD (0.00285 FIM): Hi-Tech is a more professional product and
CCS can get you by.

Regards,
David Koski

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\14@162921 by David Cary

flavicon
face
Dear Joseph A. Zammit,

"Joseph A. Zammit" <jozamm.....spamYAHOO.COM> on 2001-05-14 wondered:
> I am starting to program the large PIC's the F8xx's etc. Due to their
> complexity I wish to program them in C or C++. Can you recommend me a good
> compiler or else shall I program in assembly? I have extensive experience in
> assembly programming but for quicker development I wish to use a higher
> level language

You might be interested in checking out some of the open-source compilers:

 http://www.dattalo.com/
 SDCC Pic Port - Is a port of SDCC - Small Device C Compiler to the PIC.

 JAL
 piclist.com/techref/microchip/language/jal/index.htm
 Pascal-like

(did I miss any open-source compilers ?)

I'm sure the developers would be interested in learning about any flaws you
might find.

--
David Cary

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\14@173657 by Jeff DeMaagd

flavicon
face
----- Original Message -----
From: Drew Vassallo <KILLspamsnurplespam_OUTspamHOTMAIL.COM>


> >assembly programming but for quicker development I wish to use a higher
> >level language
>
> Funny, I usually try to go the opposite direction; the tougher something
is,
> the more I'd like to get down to the basics to simplify how everything
> operates in my mind's eye.  Besides, it's not so much that those chips are
[...]
Well, there are lots of schools of thought and they all seem to have merit
within their own contexts and likely best decided on an individual basis.  I
learned asm on PIC because I didn't get a compiler.  To learn how to use a
chip, asm to me was the best, but maybe more painful route.  At least it's
cheaper and one can get pretty darn efficient with asm, in some cases that's
a lot more important.  Most of my applications barely use the performance
capabilities of the chips, but I'm starting a project which I might need to
experiment both ways in terms of ease of maintainability vs. performance as
a downside of asm is that I can't remember everything that every opcode does
without flipping through my quick reference.

I'd honestly like to learn how to mix C and asm code files, has anyone done
this satisfactorily with PIC programming?

> I haven't used any C compilers for PICs, but I believe generally people
> gravitate towards the Hi-Tech C compiler.  I'm sure you will find
> information readily available on the web.

I'll look it up.  Thanks for the tip.

Jeff
demaagd.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\14@191600 by Dale Botkin

flavicon
face
On Mon, 14 May 2001, Jeff DeMaagd wrote:

> I'd honestly like to learn how to mix C and asm code files, has anyone done
> this satisfactorily with PIC programming?

Sure.  I used asm in a C program to generate a precise delay. That's the
only time I've had to do it, and it was completely painless.

Dale
--
A train stops at a train station.  A bus stops at a bus station.
On my desk I have a workstation...

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\14@223642 by Alexandre Domingos F. Souza

flavicon
face
>Funny, I usually try to go the opposite direction; the tougher something is,
>the more I'd like to get down to the basics to simplify how everything
>operates in my mind's eye.  Besides, it's not so much that those chips are
>more "complex" than any others, they simply have more features.  If you
>don't want them, don't use them.  I think you'll find that you have to do
>the same amount of work whether you use assembly or C/C++.

       More or less. In pic asm, you have a great bunch of work, detailing routines. eg: insted of a cmp reg,reg you use some 10 or 12 instructions. But it runs fast, and it's cheap :o)

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\15@011619 by uter van ooijen & floortje hanneman

picon face
>   JAL
>   piclist.com/techref/microchip/language/jal/index.htm
>   Pascal-like
Small correction: the Jal compiler is not open-source, only the libraries
are LGPL. The compiler itself is plain old freeware (an antique concept from
the days before open source?)
Wouter

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2001\05\15@082523 by Drew Vassallo

picon face
>         More or less. In pic asm, you have a great bunch of work,
>detailing routines. eg: insted of a cmp reg,reg you use some 10 or 12
>instructions. But it runs fast, and it's cheap :o)

If you're using 10 instructions to compare two registers in a PIC, you're
doing it wrong:

movf reg1, w
subwf reg2, w
skpc
goto reg1_gt_reg2


Note that Motorola compatible instructions like "cmp" or "jmpz" etc. are
nice and convenient for programming, but they don't save cycle time over PIC
instructions.  Many of those are 3 and 4 cycles long, while PIC instructions
are 1 and 2 cycles in length.  And those that are 2 cycles are really only 1
plus a nop.  And there are also about 80+ of them, compared to 30-something
for PICs.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listserv.....spamRemoveMEmitvma.mit.edu with SET PICList DIGEST in the body



'[OT]: Delphi or C++ Builder'
2001\12\08@051631 by purpen
flavicon
face
Hi,

Just out of curiousity are there any user of the above software around in
the pic world. Its just that I see lots of mention of VB, but not of the
above.

I use Delphi quite extensively in my job at Kanda with GUI work, and C++
builder with any compiler/console apps that I work on.

I have in the past found a few American customers that had not even heard of
Borland/Inprise. Is the Delphi C++ Builder use a European thing. I find that
US customers who want sourcecode with their work prefer MS Visiual C++, if
you've used C++ builder then you'll know what I mean when I say, I hate all
the API stuff that this requires.

Bryan


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 2001-12-05

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\12\08@133343 by mooseman

flavicon
face
X-RebelTech Is Here: http://www.rebeltech.ca
MIME-Version: 1.0
Message-Id: <spam_OUT01120810240806.06922TakeThisOuTspamEraseMEmothership.rebeltech.ca>> Content-Transfer-Encoding: 8bit

i don't think that delphi is a necessisarily european thing, but i also
noticed a geographical pattern to its useage.
on the west coast ( i live in canada) there are not many posted jobs for
delphi programmers, but on the east coast, well, ok, toronto area, there are
significantly more postings (yes there are more people there, but seems not
proportional).

i think it has something to do with the proximity to Redmond, WA and the
amount of advertising bombardment one is subject to.

i have noticed that there does seem to be a higher level of acceptance of
different tools in EU. there seems to be a 'whatever gets the job done best'
type of attitude. not that i live or work there, just most of the best delphi
tips, tricks and tools that i use come from european programmers.

i can't speak for c builder at all, just my observations regarding delphi.

my two cents worth.

moose.


On Saturday 08 December 2001 05:17, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\12\09@205302 by Chuck Mancuso

flavicon
face
At 10:17 12/8/2001 -0000, you wrote:
>Hi,
>
>Just out of curiousity are there any user of the above software around in
>the pic world. Its just that I see lots of mention of VB, but not of the
>above.
>
Good day,

We use Borland c++ Builder 3.0 for the pc interface software to read our
data loggers, and we are a US company.

Chuck


wmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwm
||   Chuck Mancuso           ||     i      AEC Systems     i    ||
||  EraseMEaecsysspamBeGonespamKILLspammosquitonet.com   ||    {|}    Delta Junction  {|}   ||
||                           ||   {{|}}      Alaska      {{|}}  ||
||                           ||  {((|))}       USA      {((|))} ||
|| http://www.mosquitonet.com/      || {{{{|}}}}              {{{{|}}}}||
|| ~aecsys/                  || ____|______________________|____||
wmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwmwm

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\12\10@050133 by Bryan W

flavicon
face
----- Original Message -----
From: "Chuck Mancuso"
Sent: Monday, December 10, 2001 1:48 AM
Subject: Re: [OT]: Delphi or C++ Builder


> Good day,
>
> We use Borland c++ Builder 3.0 for the pc interface software to read our
> data loggers, and we are a US company.
>
> Chuck
>

I used v3 for a while and found that it was very buggy and crashed a lot :)
Then we moved up to Delphi 5, and we got C++ Builder 4, this was a lot more
stable. It also meant that a lot of the Delphi 4 code we had written would
compile with this version of the builder. Its that sort of code sharing that
I like with this software. A lot of the stuff we've done in the past is in
object pascal, which compiles without a problem in v4.

Bryan


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 2001-12-04

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\10@050415 by ichard Phillips

flavicon
face
Hi,

My company uses Delphi exclusively for pc-side interfaces to pic-based
products, and also work in many other areas (TCP/IP, Database, etc.)

We're european based.

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\10@061358 by o-8859-1?Q?K=FCbek_Tony?=

flavicon
face
Hi,

Located in Europe :)
My company uses mostly Delphi but unfortunately
have to code much new stuff in VB ( customer requirment ).

Myself I'm completely sold for Builder, as you say
one can concentrate on the 'real' stuff and not the ittybitty
stuff as with MS Visual C. ( although I use it from time to time )

/Tony

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.



'[OT] C++Builder'
2002\07\24@222049 by Augusto de Conto
flavicon
face
Hi

Does somebody knows a Borland C++Builder Discussion List
as good as this is for pic?

Thank

Augusto de Conto
RemoveMEaugustospamBeGonespamspamautomacao.eng.br

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservspamspammitvma.mit.edu with SET PICList DIGEST in the body


2002\07\24@235323 by williams.engineering

picon face
What specific C++ Builder questions do you have, perhaps I can help.
Also, check inprise's news group listings.  Lots of different discussion
groups there.

There news server is newsgroups.borland.com

Regards,

James


{Original Message removed}


'[PIC]: Are there any C++ Compilers for PICs?'
2003\01\10@155551 by John Hansen
picon face
That is, are there any compilers (free or otherwise)  that support objects?

John Hansen

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2003\01\10@155957 by Spehro Pefhany

picon face
At 03:51 PM 1/10/03 -0500, you wrote:
>That is, are there any compilers (free or otherwise)  that support objects?

IAR, for the PIC18 series is one.

http://www.iar.com/

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffRemoveMEspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body

2003\01\10@162909 by Wouter van Ooijen

face picon face
> That is, are there any compilers (free or otherwise)  that
> support objects?

I assume you mean for PICs, otherwise you would not have asked here?

Real 00 implies (amongs other things) polymorphism, which is AFAIK
mostly implemented as function pointers. This does not match the
fixed-addressing (lack of SP orm BP-relative addressing) ans the fixed
size stack of the 12 and 14 bit PICs. It might be possible on the 16
bits (18F), but it would not use the code space and processor speed very
effective.

But there is Pavel Baranovs C++ compiler, but I suspect it is just some
syntactic sugaring over his C compiler. You could try though.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2003\01\10@165554 by Andy Kunz

flavicon
face
DONGLEWARE ALERT!

Preserve your investment - buy only software which doesn't require a dongle
to run!

Andy


At 03:59 PM 1/10/03 -0500, you wrote:
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamRemoveMEmitvma.mit.edu with SET PICList DIGEST in the body

2003\01\10@165753 by John Hansen

picon face
At 10:25 PM 1/10/03 +0100, you wrote:
> > That is, are there any compilers (free or otherwise)  that
> > support objects?
>
>I assume you mean for PICs, otherwise you would not have asked here?

Yes, that's right

But there is Pavel Baranovs C++ compiler, but I suspect it is just some
>syntactic sugaring over his C compiler. You could try though.

Thanks for the tip... I wasn't aware of this.

John Hansen

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservEraseMEspammitvma.mit.edu with SET PICList DIGEST in the body

2003\01\10@180139 by williams.engineering

picon face
I second that. And besided IAR cost over $2000 for one license.  I have
the 16x series IAR C compiler.  I can tell you that it is not worth it's
cost at all.  And if you want to upgrade for the 18 devices you have to
pay another $2000.

I my opinion it is an overpriced peace of software.  I think HiTech is
better than IAR.

Just my 2 cents.

Regards,

James.

P.S.  Although I have the C compilers, I tend to find myself programming
in assembly in the end because of effency and code space and the lack of
support for array of function pointers or jump tables as I call them.
Which is a very useful thing to do.

{Original Message removed}

2003\01\10@221008 by James Caska

flavicon
face
Keep an eye on the uVM Java Virtual Machine.

http://www.virtualbreadboard.com
http://www.virtualbreadboard.com/uvmFAQ.htm
http://www.virtualbreadboard.com/uvm/metrics/metrics.htm

uVM is a Java Chip based on a pre-programmed bootloader PIC Core.

For the price of the chip, which is about ~50% over the cost of the PIC Core
(Even less in volume) you get free* access to the online compiler.

An announcement for a BETA testing period will be made in the next few weeks
but is expected to begin in the first week of February.

The 12 week BETA period is being run in conjunction with a 12 week free
online course embedded java course being developed by Ted Kosan of Shawnee
State University based on other successful embedded java coursework such the
embedded devices course

http://www.javadevices.org/dtcourse/

A special offer low cost BETA development Kit which includes the free java
course, development board and components, uVM samples and compiler
registration will be made for those who wish to participate in the BETA
testing program.

The call for BETA testers will be made to this list in the coming weeks,
alternatively you can subscribe the uVM special interest group (Low volume
~fornightly newsletter only) to receive this and other uVM related
announcements
Subscribe to the special interest group here.
spamuVM_SIG-subscribespam_OUTspam@spam@virtualbreadboard.com?Subject=uVMBETA

I know many of you wont touch 'beta' products with a 10 foot pole! But this
is a fantastic opportunity to learn about java in a domain that you all
understand - deeply embedded applications.

Its low cost, its fast, its powerful.. what have you got to loose? uVM is
internet ready, with dynamic Java Server Pages (JSP), a growing library of
java packages, with active involvement in opensource communities such as
cork and embeddlets
http://sourceforge.net/projects/cork/
http://sourceforge.net/projects/embedlets/
and the soon to be created uVM sourceforge project which will be the center
of the BETA program so not only will you learn java but valueable
sourceforge and opensource development skills also.


Regards,
James Caska
spamcaska@spam@spamSTOPspamvirtualbreadboard.com

*~$20 Account Creation Fee



{Original Message removed}


'[PIC]: Bound Checker for C++'
2003\02\06@135314 by Tim Webb
flavicon
face
Has anybody heard of Bounds Checker for visual C++?  Its from Nu-Mega.
I have it on CD and it was originally purchased for $499.00

It's pretty expensive and I don't think I have any use for it

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\02\06@142326 by Robert E. Griffith

flavicon
face
It's a product that you compile into your C++ project with minimal code
changes and will catch certain types of common programming mistakes like
improper use of new and delete.  It also does performance profiling.

--BobG

{Original Message removed}

'Languages -ASM, C++, BASIC'
2003\02\17@134544 by Ryan Underbrink

flavicon
face
Quick Question:

I did a bunch of work with PICs in college, and now I'm hobbying around with them, mainly in robots and such. Back then I did all of my programming in ASM, but I want to know what I should use when I'm wanting to speed up the process and just get something working quickly. I have a copy of PICC Lite, but I see that only works for three chips.  Is there a decently priced (<$100) package that can program all the PIC Micros?  I know most of the ones I've seen are $$$$. And what about BASIC? I've never really messed with BASIC Programming, so I'm not sure what capabilities (PWM and the like) are covered in these BASIC Compiler packages.

Thanks,
Ryan
spamBeGonerunderbrinkspamBeGonespam@spam@ev1.net

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@140014 by Stef

flavicon
face
maybe JAL or  XCSB?
http://www.voti.nl

Ryan Underbrink wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@140636 by Wouter van Ooijen

face picon face
read the languages part of http://www.voti.nl/swp

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@143753 by John Pearson

flavicon
face
What a great page. Thanks for writing it.

Anyone know of a similar page for DSPs?

John
----- Original Message -----
From: "Wouter van Ooijen" <wouterKILLspamspamspamVOTI.NL>
To: <spam_OUTPICLIST@spam@spamMITVMA.MIT.EDU>
Sent: Monday, February 17, 2003 11:06 AM
Subject: Re: Languages -ASM, C++, BASIC


{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@150944 by llile

flavicon
face
I have called this "The Never Ending Religious War over C Languages" in
the past <GRIN> , another way to look at it is, if you don't like my
answer, look in the PIC archives and you'll find someone with the opposite
opinion.

1.  Hitech PICC lite is free, and you already know the
advantages/disadvantages of it.  Their full-scale version costs $600-800 I
think (look it up)

2. CCS PCM will do any chip with a 14 bit core, costs $99, and is not a
bad program.  I find it a little easier to learn than Hitech C, and a
little more forgiving to the new user, since it is not strictly ANSI
compliant.  Brothers have come to blows with drawn swords over the
differences and advantages of CCS C vs Hitech C, but the bottom line is
CCS is cheaper up front.  CCS charges a maintenance fee of $99 per year if
you want to keep up with the current chips.  Hobbyists might not need to
bother with this.

3.  If you want a GNU compiler, try Jal from Wouter Van Ooijen (Wouter is
a guy on the PICLIST not a company)  Jal is a high-level language for a number of Microchip PIC (16c84, 16f84,
12c508, 12c509, 16F877) and Ubicom SX (SX18 and SX28) microcontrollers
resembling Pascal. http://www.voti.nl/jal/n_index.html    Between these five PICs you could
accomplish about anything you'd ever want to do with a PIC as a hobby
project.  the '877 will do about anything a PIC will do, and the 12C508 is
as small and cheap as they come.  And you can't beat the price.

Why use C or JAL?  Speed of coding and maintainability of your code, plus
a better understanding of what it is doing.

Why stick with assembler?  Learning curve of C can be steep, other tools
cost money.

There are basic compilers for the PIC too.  If you don't already know
BASIC, then they will be as much work to learn as C and as expensive.
There are also Basic Stamps, which have a Basic interpreter built in and
are pretty easy to program.  I don't know much  else about them except
they are a common entry point for hobbyists.

-- Lawrence Lile





Ryan Underbrink <TakeThisOuTrunderbrinkspam_OUTspamEV1.NET>
Sent by: pic microcontroller discussion list <KILLspamPICLIST.....spamTakeThisOuTMITVMA.MIT.EDU>
02/17/2003 12:49 PM
Please respond to pic microcontroller discussion list


       To:     TakeThisOuTPICLISTEraseMEspamRemoveMEMITVMA.MIT.EDU
       cc:
       Subject:        Languages -ASM, C++, BASIC


Quick Question:

I did a bunch of work with PICs in college, and now I'm hobbying around
with them, mainly in robots and such. Back then I did all of my
programming in ASM, but I want to know what I should use when I'm wanting
to speed up the process and just get something working quickly. I have a
copy of PICC Lite, but I see that only works for three chips.  Is there a
decently priced (<$100) package that can program all the PIC Micros?  I
know most of the ones I've seen are $$$$. And what about BASIC? I've never
really messed with BASIC Programming, so I'm not sure what capabilities
(PWM and the like) are covered in these BASIC Compiler packages.

Thanks,
Ryan
spam_OUTrunderbrinkRemoveMEspam.....ev1.net

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@152017 by Ned Konz

flavicon
face
On Monday 17 February 2003 12:09 pm, spamllileKILLspamspamKILLspamSALTONUSA.COM wrote:
> CCS charges a maintenance fee of $99 per year if
> you want to keep up with the current chips.  Hobbyists might not
> need to bother with this.

More accurately: $99 per year buys the opportunity to try a new
version and see whether it fixed the problems you had without
creating too many others...

At least that's been my experience with their PCH product. I have used
PCM but had to work around a number of its limitations and bugs by
feeding it (pureed and strained) "Baby C".

--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@155306 by Wouter van Ooijen

face picon face
> 3.  If you want a GNU compiler, try Jal from Wouter Van
> Ooijen (Wouter is a guy on the PICLIST not a company)  Jal is a
high-level
> language for a number of Microchip PIC (16c84, 16f84,
> 12c508, 12c509, 16F877) and Ubicom SX (SX18 and SX28) microcontrollers
> resembling Pascal.

Actually Jal more-or-less supports most flash PICs (12F, 16F630/676,
18F818/819, 16F87x, 16F7x, 18Fxx2/8), but the manual and web page are
outdated and indeed state only the chips listed above. An actually I am
both a guy and a one-man company :)

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@155931 by Wouter van Ooijen

face picon face
> 3.  If you want a GNU compiler, try Jal from Wouter Van

(shit, replying again on the same message)

And actually Jal is not a GNU compiler (that would appear to put it in
the same league as gcc, which is far too much honour), but the source to
the compiler is available under GPL license.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@161818 by llile

flavicon
face
Entomology lessons:  Which is the reason I (and many others) forked out
the extra 6 C-notes for Hitech C.    OTOH, I am still more comfortable
using CCS C, despite the continuous entomology lessons.



-- Lawrence Lile





Ned Konz <spamnedspam_OUTspamBIKE-NOMAD.COM>
Sent by: pic microcontroller discussion list <STOPspamPICLISTspam_OUTspamspamBeGoneMITVMA.MIT.EDU>
02/17/2003 02:19 PM
Please respond to pic microcontroller discussion list


       To:     spam_OUTPICLISTspamspamBeGoneMITVMA.MIT.EDU
       cc:
       Subject:        Re: Languages -ASM, C++, BASIC


On Monday 17 February 2003 12:09 pm, EraseMEllilespamKILLspamSALTONUSA.COM wrote:
> CCS charges a maintenance fee of $99 per year if
> you want to keep up with the current chips.  Hobbyists might not
> need to bother with this.

More accurately: $99 per year buys the opportunity to try a new
version and see whether it fixed the problems you had without
creating too many others...

At least that's been my experience with their PCH product. I have used
PCM but had to work around a number of its limitations and bugs by
feeding it (pureed and strained) "Baby C".

--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@163202 by Robert Soubie

flavicon
face
On Mon, 17 Feb 2003 14:09:34 -0600, EraseMEllileRemoveMEspamSALTONUSA.COM wrote on Re:
Languages -ASM, C++, BASIC:

>There are basic compilers for the PIC too.  If you don't already know
>BASIC, then they will be as much work to learn as C and as expensive.

There are different choices among Basics for the PIC; the most
expensive and IMHO best basic is melabs' PicBasic Pro and it is by far
less expensive than some C compilers you mentionned.
Others are LetBasic PicBasic, Basic18, and all are much cheaper in the
US$ or € 50 range.

So Basic is indeed to be considered!

PS: Given the choice I program in Pascal...

* .....soubiespamspam_OUTatlantic-line.fr
* @spam@soubieEraseMEspamspamastrosurf.com
* http://www.astrosurf.com/soubie
* Alimentation thermostatée à découpage AlAudine NT:
* http://www.astrosurf.com/soubie/alaudine.htm
* Au royaume des aveugles, les borgnes sont mal vus... - P.Dac

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@164653 by Stef

flavicon
face
>
>
>PS: Given the choice I program in Pascal...
>
Interesting, which compiler do you use ?
regards,
Stef Mientki

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\17@194215 by Timothy Box

flavicon
face
All my experience with PICS has been through Basic compilers and I only use
ASM for interrupts. I have used both Melabs and PICBASIC PLus. IMHO PICBASIC
PLus is a far better language. If for no other reason than the data
handling. Melabs PBP has virtually none. Also Melabs has been static with no
major command additions for a year or so. PICBASIC Plus has been evolving
with leaps and bounds. (Look out for A new version is to be launched next
month).  LetBasic has been completely re-written too and is to be launched
about the same time. (Both from the same stable).

I have not written in C. Every time I start to think about it I get put off.
It has to be one of the most unreadable languages going.

So you have a choice. ASM, BASIC, or C. (yes I know there are others)

If I could persuade anybody what route to take I would say BASIC but learn
ASM too. As you will never really learn how to use PIC's with out doing so.
It will also help you write better code. There are some terrible programs
written in high level languages. When you are letting the compiler do all
the work and you have no idea what is happening underneath you do not
realise all the code that has to be generated to accommodate the :-

IF A + c - d = x or (z /23)+ y <<4 = 32 then

type statements that people dream up.

Is there a reason to use a High level language if you know ASM. Well Yes.
Why? Because you would be stupid not to. Why bother learning and trying to
implement serial, I2C, Lookup tables, LCD, GLCD, Floating point routines etc
when some one else has done it all for you.

Unless you are really trying to squeeze a quart out of a pint pot it is
really not worth the bother of writing it all in ASM.

I am completely biased toward Picbasic Plus, but I have learnt enough about
PICS and BASIC compilers to know what I am talking about.

Tim


{Original Message removed}

2003\02\17@195043 by Olin Lathrop

face picon face
> I have not written in C. Every time I start to think about it I get put
off.
> It has to be one of the most unreadable languages going.

You've never seen APL I guess.

> If I could persuade anybody what route to take I would say ...

Let's not start that holy war *again*.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\18@003625 by cdb

flavicon
face
I really believe PIC's should be coded in Cobol. Nothing like 25
pages of gobbledygook just to print out "Hello"

Colin
--
cdb, bodgy1TakeThisOuTspamKILLspamoptusnet.com.au on 18/02/2003

I have always been a few Dendrites short of an Axon and believe me it
shows.

Light travels faster than sound. That's why some people appear bright
until they speak!

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\02\18@031129 by dr. Imre Bartfai

flavicon
face
Hi,

I mean Intercal would be a better choice. JFF.

Imre

On Tue, 18 Feb 2003, cdb wrote:

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\02\18@033638 by Timothy Box

flavicon
face
Opps

I don't want to start a war!!! I take it there has been some trouble in the
past? All I would say is Learn ASM and use a high level language as well.
What you use is up to your own preference. But do not just use the High
level stuff with out understanding what goes on underneath.

Tim

{Original Message removed}

2003\02\18@041158 by john chung

flavicon
face
Timothy Box wrote:

> Opps
>
> I don't want to start a war!!! I take it there has been some trouble in the
> past? All I would say is Learn ASM and use a high level language as well.
> What you use is up to your own preference. But do not just use the High
> level stuff with out understanding what goes on underneath.
>

  I use ASM to learn the internal workings of a microprocessor or microcontroller. It is a hate
or love relationship. For me.... ASM for PIC microcontroller is like a tough wife. The instruction
set is odd....... Different families like 16x and etc has different various instruction sets that they support.
Therefore writing for floating operations can be a pain for some and easier on others.

 I love C for it's easier expression that is widely excepted in the embedded and system development world.

 Using any language is ok. But looking for elegance in the solution is a hard quest. Try AWK or PERL for
text processing. Simply great. But when I use C or ASM then I shiver with doubts....... Now I am not saying that C is less superior than PERL or AWK.
The fact remains that each language has a great following and well suited in their fields.

 Just use any language you prefer. But learn to express your solution well in your favourite language is the
main reason why they rather write in their prefered language.

Any opinions or critism?


>
> Tim
>
> {Original Message removed}

2003\02\18@044857 by hael Rigby-Jones

picon face
> -----Original Message-----
> From: Timothy Box [SMTP:@spam@TimSTOPspamspamTJBSYSTEMS.COM]
> Sent: Tuesday, February 18, 2003 12:42 AM
> To:   TakeThisOuTPICLISTTakeThisOuTspamRemoveMEMITVMA.MIT.EDU
> Subject:      Re: [PIC]: Languages -ASM, C++, BASIC
>
> I have not written in C. Every time I start to think about it I get put
> off.
> It has to be one of the most unreadable languages going.
>
I can only that you've been looking at some very badly written code?  C
should not be that hard to read unless deliberately obfuscated.

Mike

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\02\18@051005 by Timothy Box

flavicon
face
Point taken. I'm glad it is not as bad as I had though. I will have to
invest the time into it next go.


Tim
{Original Message removed}

2003\02\18@053117 by Sergio Masci

picon face
XCSB is a structured BASIC. It supports 8, 16 and 32 integers, 32 bit IEEE
754 format floating point. Pointers, arrays, user functions and multi
tasking. The compiler generates optimised native machine code and uses the
XCASM assembler as the backend.

XCASM is a very sophisticated meta assembler. It has high level code
generation capabilities for the PIC. It understands and will generate
optimised code for inline high level expressions (including floating point,
pointer dereferencing, array subscripting and user function invocation).
With it you can write all your control logic in assembler and then your
complex equations (which you might get straight out of a reference book and
not fully understand) in high level notation e.g.

P     .ds_float    1            ; define 32 bit float variable
A    .ds_int        1            ; define 16 bit int variable
Q    .ds             20          ; define array of bytes
J      .ds            1             ; define byte variable

       btfsz    PORTA,0
       goto    lab1

       .let      A = 1 / P * 256 + Q[J]

lab1

XCASM is also directly supported by the ZMech state machine tool

http://www.xcprod.com/titan/XCSB
http://www.xcprod.com/titan/XCASM
http://www.xcprod.com/titan/ZMECH_PIC
http://www.xcprod.com/titan/ZMECH-DOC/generate/state-machine/block-indx.html

Regards
Sergio Masci

{Original Message removed}

2003\02\18@070245 by Imro Konkol

picon face
Are you real BASIC fun? Try http://www.picputer.com/

Seems better than expensive BasicStamps. Anyway, I had no time to play with
it.

Have a nice day.

Imro Konkol

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\02\18@093944 by Olin Lathrop

face picon face
> I don't want to start a war!!! I take it there has been some trouble in
the
> past? All I would say is ...

That's exactly the problem.  Everyone wants to say preach their view, and
nobody wants to listen to other's religious arguments.  This is now the
*second* time you've stated your opinion despite the fact that you say you
don't want to start a war (duh!).  That's already two times too many.
Let's not make it three.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

'[PIC]: Languages -ASM, C++, BASIC mmmmm.mmmmm.....'
2003\02\18@100159 by Timothy Box

flavicon
face
I did not think the last one was controversial! Still point taken
zzzzzipppppp mmmmmmmmm .mmmmmmmmmm.mmmmmmmmmm




{Original Message removed}

2003\02\18@154848 by Nate Duehr

face
flavicon
face
We should all be thankful there are so many excellent options for
programming PIC's... and some not-so-excellent ones too!  ;-)

Nate Duehr, spam_OUTnatespamspam.....natetech.com

{Original Message removed}

2003\02\19@180251 by Peter L. Peres

picon face
On Tue, 18 Feb 2003, cdb wrote:

*>I really believe PIC's should be coded in Cobol. Nothing like 25
*>pages of gobbledygook just to print out "Hello"

Ratfor would be a better choice imho. You don't need 25 pages to do
something in Cobol, but it is a good idea to use the same sectioning even
in assembly imho. I try to in C and asm. Eg. include section, define
section, proto section, code section, main section. Of course they are
just comments and I structure the source that way. It helps later..

Peter

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listserv.....spam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2003\02\19@183141 by Wagner Lipnharski

flavicon
face
Peter L. Peres wrote:
> On Tue, 18 Feb 2003, cdb wrote:
>
> *>I really believe PIC's should be coded in Cobol. Nothing like 25
> *>pages of gobbledygook just to print out "Hello"
>
> Ratfor would be a better choice imho. You don't need 25 pages to do
> something in Cobol, but it is a good idea to use the same sectioning
> even in assembly imho. I try to in C and asm. Eg. include section,
> define section, proto section, code section, main section. Of course
> they are just comments and I structure the source that way. It helps
> later..
>
> Peter


The same to learn how to write in elementary school.
Several issues:

Pencil - Needs to be sharpen all the time.
Paper  - You need to hold it straight, it bends, turn, etc.
Eraser - Always making more mess than the mistake.
Control- The pencil always go to a wrong direction.
Align  - The text seems to always turn to the down side.
Pen    - Nice, but horrible to fix mistakes.
Teacher- Just controlling you all the time.
Parents- Always saying you need to improve the way
        you hold the pencil.
Overall- Difficult to understand why we need to start to use
        the paper from top left to right and down.
        Why everybody all the time complain and ask us
        to use smaller letters and do it round.  It is
        so nice to write using 3 inches letters at the
        begin of text, and then turn it very small when
        by some reason somebody forgot to make the paper
        wider...

It is really a very hard job.  I wonder how we made it.

I always thought that easier than programming is just relax at the Bahamas.

:)

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2003\02\27@035133 by jim barchuk

flavicon
face
Hi Wagner!

On Wed, 19 Feb 2003, Wagner Lipnharski wrote:

> Peter L. Peres wrote:
>
> The same to learn how to write in elementary school.
> Several issues:
>
> Pencil - Needs to be sharpen all the time.
> Control- The pencil always go to a wrong direction.
> Align  - The text seems to always turn to the down side.

And similar to 'insufficient comments,' sometimes, unless I really -try-
to make it legible, three hours later, I can't read what I wrote. I have
-asked- people what things 'looked like.' LOL!

Have a :) day!

jb

--
jim barchuk
EraseMEjb.....spamjbarchuk.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\02\28@041126 by Peter L. Peres

picon face
What is my name doing in that quote ? I did not write that.

Peter

On Thu, 27 Feb 2003, jim barchuk wrote:

*>Hi Wagner!
*>
*>On Wed, 19 Feb 2003, Wagner Lipnharski wrote:
*>
*>> Peter L. Peres wrote:
*>>
*>> The same to learn how to write in elementary school.
*>> Several issues:
*>>
*>> Pencil - Needs to be sharpen all the time.
*>> Control- The pencil always go to a wrong direction.
*>> Align  - The text seems to always turn to the down side.
*>
*>And similar to 'insufficient comments,' sometimes, unless I really -try-
*>to make it legible, three hours later, I can't read what I wrote. I have
*>-asked- people what things 'looked like.' LOL!
*>
*>Have a :) day!
*>
*>jb
*>
*>--
*>jim barchuk
*>spamjbKILLspamspam@spam@jbarchuk.com
*>
*>--
*>http://www.piclist.com hint: The list server can filter out subtopics
*>(like ads or off topics) for you. See http://www.piclist.com/#topics
*>
*>

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\02\28@164816 by jim barchuk

flavicon
face
Hi Peter!

On Thu, 27 Feb 2003, Peter L. Peres wrote:

> What is my name doing in that quote ? I did not write that.
>
> Peter

That's true, sorry, I left in too many attributions after snipping text.

Sometimes I cut -out- too many attributions and there is equal if not
greater confusion. :)

Have a :) day!

jb

Corrected:

{Quote hidden}

--
jim barchuk
RemoveMEjbRemoveMEspamjbarchuk.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


'[PIC] C++ PIC18 Compiler'
2003\06\23@134846 by engen
flavicon
face
 I seeking for a C++ compiler for the PIC18 family. If it runs under linux
it would be better, but windows native are welcome too.

 Best Regards,

 Engen

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\06\23@141023 by Duane

flavicon
face
Check out the PCHL at CCS.   I'm currently using the PCWH, and like to try
the PCML.
http://www.ccsinfo.com/ccscorder.html

Duane


{Original Message removed}

2003\06\23@142838 by engen

flavicon
face
Hi Duane,

  I've checked PCHL, but i think that this is a C Compiler not a C++
  Compiler.
 Thanks


Check out the PCHL at CCS.   I'm currently using the PCWH, and like to try
the PCML.
http://www.ccsinfo.com/ccscorder.html

Duane


{Original Message removed}

2003\06\23@152349 by Byron A Jeff

face picon face
On Mon, Jun 23, 2003 at 06:47:12PM +0100, TakeThisOuTengen@spam@spam@spam@ALUMNI.DEEC.UC.PT wrote:
>   I seeking for a C++ compiler for the PIC18 family. If it runs under linux
> it would be better, but windows native are welcome too.

Good Luck.

C++ has a boatload of overhead. Objects cost both data memory and program
space. C++ simply isn't very efficient for systems at the microcontroller
level. Just think about what it takes to implement virtual/abstract functions
and you'll see what I'm talking about.

How about defining what requirements you need from C++, then see how you can
implement just that subset in C. You'll have a better chance of success.

Again, Good Luck.

BAJ

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\06\23@163516 by Douglas Wood

picon face
While I agree with Byron on the use of C++ in embedded systems, you might
check out EC+. I know it's available to the AVR. Someone might make it for
the PIC (try IAR).

Douglas Wood
Software Engineer
TakeThisOuTdbwoodspamspamkc.rr.com
ICQ#: 143841506

Home of the EPICIS Development System for the PIC
http://epicis.piclist.com

{Original Message removed}

'[PIC] What features of C++ are desirable on PIC a'
2003\06\23@173008 by Walter Banks

picon face
We looked at the code generation issues for C++ for embedded systems. The nature of embedded systems is such that some of the traditional high overhead "features" of C++ can be resolved at compile compile time with substantial reductions in code ram and
execution time.

Many features of C++ may not be needed in an embedded application. EC++ was an attempt at feature reduction with several very interesting demonstration compilers created as a proof of concept (including a EC++ compiler for a 4 bit processor in Japan).
EC++ has not had wide acceptance.

What C++ features would be desirable?

Walter Banks Byte Craft




Douglas Wood wrote:
>
> While I agree with Byron on the use of C++ in embedded systems, you might
> check out EC+.

> From: "Byron A Jeff" <KILLspambyronKILLspamspamspamBeGoneCC.GATECH.EDU>

> > C++ has a boatload of overhead. Objects cost both data memory and program
> > space. C++ simply isn't very efficient for systems at the microcontroller
> > level.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

'[PIC] C++ PIC18 Compiler'
2003\06\25@132621 by M. Adam Davis

flavicon
face
I would contend ( and so does Bjarne Stroustrup) that C++ can be just as
small and efficient as C, the problem is with the compilers, not the
language.  This should be intuitive (complexity of the compiled code
depends on the program itself, not on the language) but it's also
intuitive that each compiler has different problems with bloat and
inefficiency.

IIRC, there are programs out there that convert C++ programs into C
programs.

The main problem, howver, is that C++ was created in order to make C
development faster, as well as introduce a lot of flexibility (STL) and
enhance code reuse.  These assets are not necessarily assets for the PIC
microcontroller, which is currently not well designed to handle C,
nevermind C++.

The larger PICs, with more code and data space and extensions for
handling some C abilities, are better suited to not only C but C++.  It
takes a lot of C to fill up the 32k words of programming code in the
latest PICs.  C++ would make that much smaller, as well as permit
certian development features (such as subsets of the STL) which we don't
have now but could use.

-Adam

Byron A Jeff wrote:

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-request@spam@spamKILLspammitvma.mit.edu>

2003\06\25@154355 by James Caska

flavicon
face
Why not skip C++ in the compiler/language foodchain and go straight to
java...

* The muvium java client is written in java and so will run under
anything that can run java and has an internet connection including
linux, windows or your mobile phone!
* The muvium devices supported start at the 16F877A and the vast
majority of 18F devices immanently
* muvium development kit is available free
http://www.muvium.com/uVMDK/uVMDK.htm
* Support tools including uVM-IDE and Virtual Breadboard,
http://www.virtualbreadboard.com, real-time emulator available iminantly for
free
* Performance of muvium rivals C and out-classes all interpretive VM's
by orders of magnitude http://www.muvium.com/metrics/metrics.htm
* Powerful real-time features such as Prioritised Pre-emptive
Multi-tasking and Abstract Peripheral Toolkit for tight real-time
applications
* Builtin TCP/IP SLIP WebServer with Servlet WebServer for programmatic
Dynamic WebPage generation and soon WebServices Remoting
* Java Packages for Input/OutputStreams, Port Access, Timers, SPIMaster,
PulseMonitor, SerialPort,.... See docs
* To be released LCD's, Graphics LCD's, Sizeable Fonts, Bitmaps, Virtual
Serial Ports, ADC Streams ..
* More packages soon, and re-usable libraries of device drivers under
development interchangeable with other java platforms
* Support group and special interest groups
http://groups.yahoo.com/group/muvium/
http://sourceforge.net/projects/embedlets/
http://sourceforge.net/projects/cork/
* Shortly available features include, wrapping Native Code into java
wrappers for inclusion in applications
* Available now! Get started for $25.. For your uVM-877A samples kit
available online http://shop.muvium.com/
* Those that are coming to PICMASTERS bring a blank 16F87A or 18F452 and
see me at the 3rd Party Bazaar and I will 'upgrade' your cores with the
uVM bootloader as a free uVM sample!

Mini-FAQ ('cause I know your going to ask)
* No the uVMJIT online compiler is not yet available for separate
purchase nor is pricing set
* No you may not download the bootloader HEX yet and program your own
devices
* muvium is in the business of selling the devices, ie we sell PIC cores
pre-programmed with uVM bootloaders and resell the device as a muvium
device with a small royalty per device. The tools are all freely
available.
* Unfortunately the full pricing schedule is not yet available but as a
guide in medium volume the margin is only about 25% and in high volume
5-10%

And because I am feeling generous...how about this for a special offer
only for PICLISTERS

The first 50 PICListers who join the
http://groups.yahoo.com/group/muvium/ and post me a special request
offer by clicking on a link below and sending me their snail mail
details will receive a free uVM-877A(16F877A core) OR a free
uVM-452(18F452 core) sample and we will even cover the shipping costs..
But you need to join the muvium group and I will look for your name in
the list because when you ask questions about muvium I would really like
you to ask the list because there are others who have many of the
answers in the muvium list if I am not available to answer your question

EraseMEsalesRemoveMEspam@spam@muvium.com?subject=Request_FREE_uVM-877A_SAMPLE> RemoveMEsalesspamspamEraseMEmuvium.com?subject=Request_FREE_uVM-452_SAMPLE

Don't forget your snail mail address!!!

P.S These are DIP40 devices - if you need another footprint you will
have to wait just a little while to order them as we are only just
gearing up our device inventory.

James Caska
http://www.muvium.com
uVM - 'Java Bred for Embedded'



{Original Message removed}

2003\06\25@204311 by Michael Davidson

flavicon
face
>IIRC, there are programs out there that convert C++ programs into C
>programs.

If I'm not mistaken, this is pretty much what the C++ compiler does (to an
extent). Member functions get converted to C function passed this as the
first parameter. So;

Object::PerformAction(int item1, char thingo)

Becomes something to the affect of;

PerformAction__5Object(Object *this, int item1, char thing)

Although I'm only looking at it from a very simplified view.

>The main problem, howver, is that C++ was created in order to make C
>development faster, as well as introduce a lot of flexibility (STL) and
>enhance code reuse.  These assets are not necessarily assets for the PIC
>microcontroller, which is currently not well designed to handle C,
>nevermind C++.

The 18 series is touted (first paragraph of DS39564B) as being "Optimized for
high-level languages like ANSI C...".

Michael
--

Think of it!  With VLSI we can pack 100 ENIACs in 1 sq. cm.!

--
http://www.piclist.com hint: To leave the PICList
STOPspampiclist-unsubscribe-request.....spammitvma.mit.edu>

'[PIC] What features of C++ are desirable on PIC a'
2003\06\26@005931 by Peter L. Peres

picon face
I think that having the try/catch/throw construct work at any nesting
level youd be a great thing, even if the struct passed would have to
evaluate to a simple byte or word evaluating to an integer code. I know it
is very hard because of the inaccessible stack on the smaller pics.

Peter

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\06\26@015759 by James Caska

flavicon
face
Hi,

Java exception handling supports try/catch Exception handling for java
with recursive pop-up the call stack call stack looking for handlers and
is supported on the PIC even on the 16F family by the muvium compiler
http://www.muvium.com


James Caska
http://www.muvium.com
uVM - 'Java Bred for Embedded'



{Original Message removed}

2003\06\26@100546 by Daniel Serpell

flavicon
face
On Tue, Jun 24, 2003 at 10:14:46PM +0300, Peter L. Peres wrote:
> I think that having the try/catch/throw construct work at any nesting
> level youd be a great thing, even if the struct passed would have to
> evaluate to a simple byte or word evaluating to an integer code. I know it
> is very hard because of the inaccessible stack on the smaller pics.

Yes, it's not possible to do it without major performance penalties. You
need to push a snapshot of the current execution environment at each
"try", and then restart from there when an exception is thrown. When
you leave the "try" block witouth an exception, the snapshot is poped
from the "exception stack". This approach was called "sjlj" in gcc's
slang (for setjump/longjump).

In modern (big) procesors, another technique can be used, that involves
unwinding the stack using information similar to debug information
embeded in the program code. That's is what gcc does in current versions
on supported architectures. This way, you have _no_ performance penalty
when not throwing an exception.

In PIC's all of the above is very difficult, so it's better to leave
exception handling outside if you want performance from your code, you
can use error fields in objets to signal errors and then check the
fields when it's needed.

I certainly like C++ for embeded programming, I have programed for
PalmOS (motorola 68k, limited to 64kb code and 64kb "local" data),
and found that programing correctly (and without using exceptions and
RTTI) a C++ program can be faster and smaller than the equivalent C
program (that's using gcc and g++). You have to be clever and actually
understand what the compiler is doing to archive that, but I think that
is a must in embeded programming.

Some useful techniques are:
* Not allocating objets from stack: Objets allocated in the stack need
  an stack allocator, stack pointer, etc. thar really hurts on code
  size, adding complexity to your functions. ¿Do you really need
  dynamic object allocation?
* Using static methods whenever posible: Many objets you program are
  meant to be used only once in the program. So, making the methods
  static you avoid passing the object pointer to the method, and avoid
  indirect memory acces (througth the object's "this" pointer) to each
  field.
* Using inline methods: Inline methods are very efficient, the compiler
  can optimize they and eliminate the object pointer completely. The
  downside is added code size, but in simpler methods it's not much.


   Daniel.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


'[OT]: C++ gui and characters from other languages'
2003\10\16@210607 by stesquib
picon face
Hey guys,

I've been looking for a good tutorial on how to create gui apps for windows
using visual C++. I've also been trying to display japanese characters in a
consol application. If anyone knows how to do either of these I would appreciate
some ideas/links.

Thanks,
Steve

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\10\16@211432 by Liam O'Hagan

flavicon
face
Check out the CodeProject (http://www.codeproject.com) for *HEAPS* of source code
(numbering in the thousands!), tutorials and examples for creating any sort
of app you want...

They have very good programming related forums too, pick the one you want
and post a questions. Just don't post programming questions in the Lounge!

> {Original Message removed}

2003\10\17@025634 by ISO-8859-1?Q?Ruben_J=F6nsson?=

flavicon
face
You probably also want to take a look at MFC in that case.  
Take a look at "Special Edition Using Visual C++ 6" on the web. It's an
online book/tutorial covering the basics and some advanced stuff for VC++ 6
using MFC. <http://yanorel.pcupdate.easyspace.com/vc/>
Also take a look at messages and subclassing, which is a vital key to all serious MFC programming.  
Here is one link about MFC and message handling/routing:
<http://www.microsoft.com/msj/0795/dilascia/dilascia.aspx>
I can also recommend the book "The MFC answer book" by Eugene Kain.
Ruben

{Quote hidden}

==============================
Ruben Jönsson
AB Liros Electronic
Box 9124, 200 39 Malmö, Sweden
TEL INT +46 40142078
FAX INT +46 40947388
spamBeGonerubenRemoveMEspamRemoveMEpp.sbbs.se
==============================

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body

2003\10\17@030918 by Ian McLean

flavicon
face
Quite honestly, I would not bother with MFC if you are new to it.  Besides
being a dogs breakfast, it is on the way out in favour of the .NET FCL
libraries.

If you do not want to delve into the complexities of .NET yet
(understandable), then a *much* better option, IMHO, is to look at STL
(standard template library).

Just my opinion.

Rgs
Ian

{Original Message removed}

2003\10\17@052431 by Mike Singer

picon face
stesquib@MINES.EDU wrote:
> Hey guys,
>
> I've been looking for a good tutorial on how to create
> gui apps for windows using visual C++. I've also been
> trying to display japanese characters in a consol
> application. If anyone knows how to do either of these
> I would appreciate some ideas/links.
>
> Thanks,
> Steve

  I wonder, what's the motivation of asking PICList about
a good MS visual C++ tutorial? I do admit you have right
to ask anything, I'm just wondering.
  I bet, MS visual C++ could be a world winner on amount
of good docs about it scattered here, there and everywhere,
not to say MSDN contains more than enough.
  If you have problem even with finding one, perhaps another
more simple language would fit better.

  Good Luck,

  Mike.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservspamspammitvma.mit.edu with SET PICList DIGEST in the body


'[OT] Win32 Thread Priority in C++ (C runtime Libra'
2004\01\30@194803 by annirack
flavicon
face
I know that MSVC++ has a whole library around threading.  And that there is a C rtl thread library, but what I can't figure out is how to convert from the C runtime library thread handle (an unsigned int) to the Win32 API thread handle (void*).

The sole reason that I need to do this is so that I can change a thread's priority.

I'm using _beginthread() to create my thread, and all my threadding works... except the thread priority portion.

Anyone know how to do this?

--Brendan

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamlistservspamspamspammitvma.mit.edu with SET PICList DIGEST in the body

.

2004\01\30@203026 by Richard Crossley

flavicon
face
Hi,

A simple cast should be all you need;

uintptr_t res = _beginthread(...);
if(res != -1){
       HANDLE h = (HANDLE)res;
       ...
}

However if you plan to use the returned handle then you should not be using
_beginthread as there are potential race conditions. _beginthread will
automatically close the thread handle once the thread procedure returns,
windows reuses closed handles so the returned handle may in fact be
referencing a completely different thread by the time you access it.

Look at using _beginthreadex in conjunction with CloseHandle instead.

HANDLE h = (HANDLE)_beginthreadex(...)
if(h){
       // Do stuff...
       CloseHandle(h);
}

Regards,

Richard.


> {Original Message removed}

2004\01\30@225410 by Bob Ammerman

picon face
----- Original Message -----
From: <spamBeGoneannirackKILLspamspamKILLspamSHAW.CA>
To: <TakeThisOuTPICLISTspamspamMITVMA.MIT.EDU>
Sent: Friday, January 30, 2004 7:36 PM
Subject: [OT] Win32 Thread Priority in C++ (C runtime Library)


> I know that MSVC++ has a whole library around threading.  And that there
is a C rtl thread library, but what I can't figure out is how to convert
from the C runtime library thread handle (an unsigned int) to the Win32 API
thread handle (void*).

Believe it or not, i am pretty sure you just have to cast it:   (HANDLE)
threadh


unsigned long ht = __beginthread(...);
HANDLE hThread = (HANDLE) ht;


Bob Ammerman
RAm Systems

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspammitvma.mit.edu with SET PICList DIGEST in the body

.


'[OT]: Win32 Thread Priority in C++'
2004\02\04@175317 by annirack
flavicon
face
I'm writing a DLL that does threading, but I'm not using the MSVC++ library.  I'm using the C runtime library.

what I can't figure out is how to convert from the C runtime library thread handle (an unsigned int) to the Win32 API thread handle (void*).

The sole reason that I need to do this is so that I can change a thread's priority.

Any other means of changing the thread priority works for me, but the C runtime library specifically states that you should use _beginthread() rather than calling the equivalent Win32 API.

I'm using _beginthread() to create my thread, and all my threading works... except the thread priority portion.

How do I alter the priority of a thread created by _beginthread()?  Will casting the unsigned int to a a void* have the desired effect or will it start randomly crashing things?

--Brendan

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservEraseMEspammitvma.mit.edu with SET PICList DIGEST in the body

2004\02\04@211019 by Daniel Imfeld

flavicon
face
annirack@SHAW.CA wrote:

{Quote hidden}

Here's the relevant code snippet, from the VS .NET 2002 CRT:

if ( (ptd->_thandle = thdl = (uintptr_t)
             CreateThread( NULL,
                           stacksize,
                           _threadstart,
                           (LPVOID)ptd,
                           CREATE_SUSPENDED,
                           (LPDWORD)&(ptd->_tid) ))
            == (uintptr_t)0 )
       {
               errcode = GetLastError();
               goto error_return;
       }

       /*
        * Start the new thread executing
        */
       if ( ResumeThread( (HANDLE)thdl ) == (DWORD)(-1) ) {
               errcode = GetLastError();
               goto error_return;
       }

       /*
        * Good return
        */
       return(thdl);

Casting should work fine.  As you can see, the code for _beginthread returns
the value returned when it calls CreateThread if there is no error, so you
can use the handle as if you had just called CreateThread.

Daniel Imfeld

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspam_OUTspam.....mitvma.mit.edu with SET PICList DIGEST in the body

2004\02\04@211850 by Bob Ammerman

picon face
I checked the source code of the _beginthread() routine and it indeed
returns the Win32 thread handle.

You can safely do the simple cast.

Bob Ammerman
RAm Systems

{Original Message removed}

2004\02\04@233648 by Brendan Moran

flavicon
face
Perfect!
Thankyou,
--Brendan

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservKILLspamspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


'[OT:] C++ AnsiString conversion?'
2004\05\27@142108 by Nigel Duckworth
picon face
Could someone point me in the right direction please...

I wish to convert a Hex number from an AnsiString ("6F" for example) to it's
ASCII character ("o" in this case) for appending to another AnsiString.

i.e. "48 65 6C 6C 6F" becomes "Hello"

I can split the first string and append to the second no problem, it's the
conversion in the middle I'm stuck on. I thought StrToInt(); might be the
way to go but it throws an exception on the non-numeric text. It seems
logical to me to keep it Ansi rather than convert to a char, atoi(); it then
convert back again or is that the only way? Googling has provided just about
every conversion but the one I need and Borlands help... isn't any! :) I'm
using Builder 6 but perhaps this is done in Delphi?

I know there are groups out there specifically for C++ etc. but the PICList
is such a good information/experience resource I thought I'd try here first.

Thanks in advance.

Nigel Duckworth

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\05\27@145011 by Daniel Serpell

flavicon
face
El Thu, May 27, 2004 at 07:12:55PM +0100, Nigel Duckworth escribio:
> Could someone point me in the right direction please...
>
> I wish to convert a Hex number from an AnsiString ("6F" for example) to it's
> ASCII character ("o" in this case) for appending to another AnsiString.
>
> i.e. "48 65 6C 6C 6F" becomes "Hello"
>
> I can split the first string and append to the second no problem, it's the
> conversion in the middle I'm stuck on. I thought StrToInt(); might be the
> way to go but it throws an exception on the non-numeric text. It seems
> logical to me to keep it Ansi rather than convert to a char, atoi(); it then
> convert back again or is that the only way? Googling has provided just about
> every conversion but the one I need and Borlands help... isn't any! :) I'm
> using Builder 6 but perhaps this is done in Delphi?

Borland's StrToInt() doesn't work because you have an HEX number, not
decimal. There isn't any VCL function to do that, you can:

* Use [standard C] strtol function, passing 16 as the base;
* Write some simple function to do the conversion.

   Daniel.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\05\27@145842 by Anthony Toft

flavicon
face
> > i.e. "48 65 6C 6C 6F" becomes "Hello"
>
> Borland's StrToInt() doesn't work because you have an HEX number, not
> decimal. There isn't any VCL function to do that, you can:
>
>  * Use [standard C] strtol function, passing 16 as the base;
>  * Write some simple function to do the conversion.


use the strtol to convert the "48"  to 0x48, then cast it to a char to turn the
0x48 to "H"

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\05\28@063450 by Nigel Duckworth

picon face
Thanks guys, the following works a treat :)


 long result;
 char * endptr;
 char* cp = new char[ TextString.Length() + 1 ];

 strcpy( cp, TextString.c_str() );

 result = strtol(cp, &endptr, 16);

 ResultString = (char) result;

 Memo2->Lines->Add(ResultString);


I have to say Borlands description of StrToInt is very misleading;

"StrToInt converts the string S, which represents an integer-type number in
either decimal or hexadecimal notation, into a number".

Nigel Duckworth



{Original Message removed}

2004\05\28@090530 by Bob Ammerman

picon face
>
>   long result;
>   char * endptr;
>   char* cp = new char[ TextString.Length() + 1 ];
>
>   strcpy( cp, TextString.c_str() );
>
>   result = strtol(cp, &endptr, 16);
>
>   ResultString = (char) result;
>
>   Memo2->Lines->Add(ResultString);

Don't forget to:

   delete [] cp;

>
> I have to say Borlands description of StrToInt is very misleading;
>
> "StrToInt converts the string S, which represents an integer-type number
in
> either decimal or hexadecimal notation, into a number".

I think that if  StrToInt will properly handle the input "0xAB"

Bob Ammerman
RAm Systems

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2004\05\28@130842 by Nigel Duckworth

picon face
Hi Bob,

> Don't forget to:   delete [] cp;
I had forgotten, thank you.

> I think that StrToInt will properly handle the input "0xAB"
It does indeed, thanks again.

Nigel Duckworth



{Original Message removed}


'[EE:] Visual C++ toolkit from microsoft'
2004\07\30@031841 by Luis Moreira
flavicon
face
Hi Guys
has anyone used the free toolkit for Visual C++ from microsoft and if so how
do you rate it. Does it come with IDE ?
regards
       Luis

{Original Message removed}

2004\07\30@080656 by John J. McDonough

flavicon
face
I haven't tried the free C++, I already have the paid one .. well, OK, a
couple versions back.  However, I did give the Visual C# kit a peek and it
is outstanding.  In fact, to give you a feel for the new stuff, there is a
recording of 3 webinars on VC#.  You might take a look at the first one (the
second two were a different presenter and not as good, but instructive
nonetheless).  There is actually a six part series on C++, but it focuses
more on the language features, and really doesn't focus on the IDE or the
free version.  The C# series is specifically on C# Express.

I suspect much of the really cool stuff in C# won't be in C++, but still I
expect it to be a whole different league than the other stuff out there.

--McD

{Original Message removed}

2004\07\30@093947 by Robert B.

flavicon
face
I've been playing around with the free visual C toolkit all morning (since I
found out it was available!).  As with most free versions of commercial
compilers, there's no IDE or even a code editor included.  If you don't mind
doing things through the command line it seems to work great, it had 100%
success rate at compiling old projects created in the for-pay version of
VC++6, mostly c projects.  I'm personally a fan of the command line.  It
takes a bit longer to learn, but gets in the way a lot less in the long run.
Overall I rate it as an A, since it does what its supposed to do, and is
free.  The only annoying part is the officious installation routine typical
of windows products in general.


{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\07\30@095403 by Luis Moreira

flavicon
face
Thanks Robert/John
I will have to go and have a look at the tutorials, I did use some comand
line before but normally tend to use the IDE, probably not a very good
thing... I will also have a look at the examples.
regards
       Luis

{Original Message removed}


'[OT]: embedded C++ compiler'
2005\01\10@162203 by John Waters
picon face
Hi All,

I'm currently using the sdcc embedded C compiler, but want to try the C++
version, is there any embedded C++ compiler available for free?

Thanks in advance!

John


2005\01\10@164111 by 8859-1?Q?M=E1rcio_Barbiani?=

flavicon
face
How reliable is SDCC for the PIC platform?



'[OT]: C++/Serial port read/write??'
2005\02\27@134702 by Ale[x] Garbino
picon face
I'm done with all the PIC side of code, which I tought would be the hard
part to learn. Until I tried reading the serial port!

I assumed a simple:
ofstream serial ("/dev/ttyS1", ios::out | ios::app);
if ( !serial.is_open() ) {
 cout << "Can't open serial port" << endl;
 return 0;
 }
serial << "Hello";

Would do the trick, but although echo & cat works fine from the command
line, the serial port doesn't react the same.

I'm trying to write a bit of code that reads a byte stream and through
appropriate bitwise manipulation, gets the relevant information I need. I
also wanted to write a simulator that writes properly-formatted bytes to the
other serial port, so with the use of a null-modem cable I could make sure
my program was working fine.

Does anyone have some simple way to read/write the serial port??

-Alex



More details:
I'm running 2.6.x, on a Gentoo linux box, with the latest glibc, and using
gcc to compile.

I've been looking all over the place, and nowhere does it seem anyone has a
decent way to interact with the serial port.
There is the
www.linuxdocs.org/HOWTOs/Serial-Programming-HOWTO/
which has about a page of complicated code to do something that should be
simple (after all, the setserial command/serial kernel driver already does
all the baud/parity stuff!!).

http://cpp.snippets.org/browser.php
Makes a separate class...


groups-beta.google.com/group/comp.lang.c++.moderated/browse_thread/thread/adb3fc9386015236/fbacf9c056983538?q=serial&_done=%2Fgroup%2Fcomp.lang.c%2B%2B.moderated%2Fsearch%3Fq%3Dserial%26start%3D10%26&_doneTitle=Back+to+Search&&d#fbacf9c056983538
reads to a stream buffer, but doesn't work when I run it...

There is also this:
http://www.erlenstar.demon.co.uk/unix/faq_4.html#SEC49

And I also found something with outb similar to :

#include <stdio.h>
#include <unistd.h> /* needed for ioperm() */
#include <sys/io.h> /* for outb() and inb(), from another site */
//   #include <asm/io.h> /* for outb() and inb() */

  int main(void)
  {
  if (iopl(3)) {
       printf("Sorry, you were not able to gain access to the ports\n");
       printf("You must be root to run this program\n");
       return 0;
       }
  outb(34324,0x03f8); /* Sends 0011 0010 to the Data Port */
  return 0;
  }


2005\02\27@140415 by Ake Hedman

flavicon
face
Hi,
I have a class I usually use for serial communication on Windows/Linux. I can send it of list to you if you want it.

Regards
/Ake


Ale[x] Garbino wrote:

{Quote hidden}

--  ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org

2005\02\27@150320 by Ale[x] Garbino

picon face
Please do!
Alex

From: Ake Hedman &lt;akhespam_OUTspamspameurosource.se&gt;
Reply-To: &quot;Microcontroller discussion list - Public.&quot; &lt;piclistspamspam@spam@mit.edu&gt;
To: &quot;Microcontroller discussion list - Public.&quot; &lt;spamBeGonepiclist.....spammit.edu&gt;
Subject: Re: [OT]: C++/Serial port read/write??
Date: Sun, 27 Feb 2005 20:03:57 +0100

Hi,
I have a class I usually use for serial communication on Windows/Linux. I can send it of list to you if you want it.

Regards
/Ake


Ale[x] Garbino wrote:

&gt;I'm done with all the PIC side of code, which I tought would be the
&gt;hard part to learn. Until I tried reading the serial port!
&gt;
&gt;I assumed a simple:
&gt;ofstream serial (&quot;/dev/ttyS1&quot;, ios::out | ios::app);
&gt;if ( !serial.is_open() ) {
&gt;  cout &lt;&lt; &quot;Can't open serial port&quot; &lt;&lt; endl;
&gt;  return 0;
&gt;  }
&gt;serial &lt;&lt; &quot;Hello&quot;;
&gt;
&gt;Would do the trick, but although echo &amp; cat works fine from the
&gt;command line, the serial port doesn't react the same.
&gt;
&gt;I'm trying to write a bit of code that reads a byte stream and
&gt;through appropriate bitwise manipulation, gets the relevant
&gt;information I need. I also wanted to write a simulator that writes
&gt;properly-formatted bytes to the other serial port, so with the use
&gt;of a null-modem cable I could make sure my program was working fine.
&gt;
&gt;Does anyone have some simple way to read/write the serial port??
&gt;
&gt;-Alex
&gt;
&gt;
&gt;
&gt;More details:
&gt;I'm running 2.6.x, on a Gentoo linux box, with the latest glibc, and
&gt;using gcc to compile.
&gt;
&gt;I've been looking all over the place, and nowhere does it seem
&gt;anyone has a decent way to interact with the serial port.
&gt;There is the
&gt;www.linuxdocs.org/HOWTOs/Serial-Programming-HOWTO/
&gt;which has about a page of complicated code to do something that
&gt;should be simple (after all, the setserial command/serial kernel
&gt;driver already does all the baud/parity stuff!!).
&gt;
&gt;http://cpp.snippets.org/browser.php
&gt;Makes a separate class...
&gt;
&gt;
&gt;groups-beta.google.com/group/comp.lang.c++.moderated/browse_thread/thread/adb3fc9386015236/fbacf9c056983538?q=serial&amp;_done=%2Fgroup%2Fcomp.lang.c%2B%2B.moderated%2Fsearch%3Fq%3Dserial%26start%3D10%26&amp;_doneTitle=Back+to+Search&amp;&amp;d#fbacf9c056983538
&gt;
&gt;reads to a stream buffer, but doesn't work when I run it...
&gt;
&gt;There is also this:
&gt;www.erlenstar.demon.co.uk/unix/faq_4.html#SEC49
&gt;
&gt;And I also found something with outb similar to :
&gt;
&gt;#include &lt;stdio.h&gt;
&gt;#include &lt;unistd.h&gt; /* needed for ioperm() */
&gt;#include &lt;sys/io.h&gt; /* for outb() and inb(), from another site */
&gt;//   #include &lt;asm/io.h&gt; /* for outb() and inb() */
&gt;
&gt;   int main(void)
&gt;   {
&gt;   if (iopl(3)) {
&gt;        printf(&quot;Sorry, you were not able to gain access to the
&gt;ports\n&quot;);
&gt;        printf(&quot;You must be root to run this program\n&quot;);
&gt;        return 0;
&gt;        }
&gt;   outb(34324,0x03f8); /* Sends 0011 0010 to the Data Port */
&gt;   return 0;
&gt;   }
&gt;
&gt;


--
---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org


'[OT]: C++/Serial port read/write??'
2005\03\01@034315 by Peter L. Peres
picon face


On Sun, 27 Feb 2005, Ale[x] Garbino wrote:

{Quote hidden}

use setserial to set the speed and set option low_latency for the used
serial port.

then use stty clocal cread cs8 raw crtscts on that port, then run your
program. C++ io also has buffering and such which you may want to turn
off.

Most of these settings can be set using ioctls on linux.

Peter


'[OT]: Optimizing Visual C++ compiler for free'
2005\08\31@101050 by Electron
flavicon
face

Hello dudes,
look here if you're interested in VisualC++ (without IDE, but there are free ones) and the PSDK for free:

Visual C++ Toolkit 2003:
www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-49FD-9CB0-4BFA122FA91B&displaylang=en
http://www.microsoft.com/downloads/thankyou.aspx?familyId=272BE09D-40BB-49FD-9CB0-4BFA122FA91B&displayLang=en

Windows® Server 2003 SP1 Platform SDK Full Download
http://www.microsoft.com/downloads/details.aspx?familyid=EBA0128F-A770-45F1-86F3-7AB010B398A3&displaylang=en


'[EE] selecting the right C++ STD library memory bu'
2006\02\24@192828 by James Newtons Massmind
face picon face
The programmer I hired to help with this is sick and make take some time to
reply so I'll write the list with this question in hopes of finding an
answer faster.

I'm writing Win32 code in C/C++ (MS Visual C++ 2005 Express Edition) and
part of this code manipulates data that is handed to it in a memory buffer.
I may have to insert things and thereby increase the size of the data beyond
the size of the source buffer. So I need to allocate a buffer of my own,
copy from the source and insert my bits, the return the result in place of
the source. No problems so far.

The issue is what class to use for my buffer. Here are the requirements:
1. It should be as efficient and fast as possible. E.g. I don't need file IO
so there is no reason to use a iostream class.

2. The data is binary. By that I mean the byte values will range from 0 to
255. Some of the data I will put into the buffer is binary, but other data
will be text and some data will be binary values (int, short, etc...) that I
will need to convert to decimal characters and append. E.g. if it was an
std::basic_stringstream I would use:

std::basic_stringstream<wchar_t> buffer;
int I = 123;
buffer << "I is:" << I;

So the issue is this combination of needs: copying in parts of a binary char
array, text, or decimal values of variables.

What class does all that? And more importantly, where is there any
documentation that would help a poor newbie like me figure out what they do
and don't?

I've been advised to use vector but that doesn't support the << and the copy
as far as I can see.

I've also been advised not to use streams as they don't play well with
binary?

Any advice appreciated.

---
James Newton: PICList webmaster/Admin
.....jamesnewton@spam@spampiclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com


2006\02\24@224458 by Chris Levin

flavicon
face
James Newtons Massmind wrote:

{Quote hidden}

Take a look at the ArrayList class. It can do the things you need. It
can grow dynamcially, it takes any object types  and it can be efficient
in speed and memory. Check out the documentation to see how it's used
and see some samples. That will let you know for sure if it meets your
needs.

-Chris

2006\02\27@105157 by William Killian

flavicon
face


> -----Original Message-----
> From: piclist-bouncesRemoveMEspammit.edu [spampiclist-bouncesspammit.edu] On
Behalf
> Of James Newtons Massmind
> Sent: Friday, February 24, 2006 7:28 PM
> To: 'Microcontroller discussion list - Public.'
> Subject: [EE] selecting the right C++ STD library memory buffer
>
> The programmer I hired to help with this is sick and make take some
time
> to
> reply so I'll write the list with this question in hopes of finding an
> answer faster.
>
> I'm writing Win32 code in C/C++ (MS Visual C++ 2005 Express Edition)
and
> part of this code manipulates data that is handed to it in a memory
> buffer.
> I may have to insert things and thereby increase the size of the data
> beyond
> the size of the source buffer. So I need to allocate a buffer of my
own,
> copy from the source and insert my bits, the return the result in
place of
> the source. No problems so far.
>
> The issue is what class to use for my buffer. Here are the
requirements:
> 1. It should be as efficient and fast as possible. E.g. I don't need
file
> IO
> so there is no reason to use a iostream class.
>
> 2. The data is binary. By that I mean the byte values will range from
0 to
> 255. Some of the data I will put into the buffer is binary, but other
data
> will be text and some data will be binary values (int, short, etc...)
that
> I
> will need to convert to decimal characters and append. E.g. if it was
an
> std::basic_stringstream I would use:
>
>  std::basic_stringstream<wchar_t> buffer;
>  int I = 123;
>  buffer << "I is:" << I;
>
> So the issue is this combination of needs: copying in parts of a
binary
> char
> array, text, or decimal values of variables.
>
> What class does all that? And more importantly, where is there any
> documentation that would help a poor newbie like me figure out what
they
> do
> and don't?
>
> I've been advised to use vector but that doesn't support the << and
the
> copy
> as far as I can see.

Derive a class from any of the C++ STL and you can add any features you
want.

One of the annoying things about C++ is that they broke some of the
simplicity of C.  What do you want << to mean?  Do you mean send the
whole structure to an iostream?  Binary shift some or all of the
elements?

All C++ STL container classes can be copied.  What do you mean by that?

> I've also been advised not to use streams as they don't play well with
> binary?

Depends what you mean by play nice.  I use binary elements into streams
all the time.


>
> Any advice appreciated.

STL container type choice depends upon what the most common operation
is.

I can help you with this on or off list but I'd need a better
specification of exactly what kind of data you want to handle.

Is it this sort of stuff?  This was a five minute type in using Visual
Studio.Net  (even though I hate .net)

// CharList.cpp : Defines the entry point for the console application.
//

#include <list>
#include <iostream>

typedef std::list < unsigned char > charList;

unsigned char a [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
unsigned char b [];

int main(int , char* )
{
       charList l;

       for (unsigned idx = 0; idx <= sizeof(a); ++idx)
       {
               // an insert before for no particular reason
               if ( a [idx] == 2)
               {
                       l.push_back(2);
               }
               l.push_back ( a [idx] );

               // an insert after again for no aprticular reason
               if (a [idx] == 7)
               {
                       l.push_back( 11 );
               }
       }

       for ( charList::iterator itr = l.begin();
               itr != l.end();
               ++itr )
       {
               if ( *itr == 6 )
               {
                       l.insert ( itr, 250 );
               }
       }

       for ( charList::const_iterator itr = l.begin();
                 itr != l.end();
                 ++ itr)
       {
               std::cout << (unsigned)*itr << std::endl;
       }

       return 0;
}



-------------------------------------  Notice of Confidentiality ----------------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the
individual or entity to whom they are addressed. If you have received this email in error please notify
postmasterspam_OUTspamTakeThisOuTvgt.net. This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not disseminate, distribute or
copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the intended recipient you are notified
that disclosing, copying, distributing or taking any action in reliance on the contents of this information
is strictly prohibited.

2006\02\27@142905 by James Newton, Host

face picon face
<snip>

> >I may have to insert things and thereby increase the size of
> the data
> >beyond the size of the source buffer. So I need to allocate
> a buffer of
> >my own, copy from the source and insert my bits, the return
> the result
> >in place of the source. No problems so far.
> >
> >The issue is what class to use for my buffer. Here are the
> requirements:
> >1. It should be as efficient and fast as possible. E.g. I don't need
> >file IO so there is no reason to use a iostream class.
> >
> >2. The data is binary. By that I mean the byte values will
> range from 0
> >to 255. Some of the data I will put into the buffer is binary, but
> >other data will be text and some data will be binary values (int,
> >short, etc...) that I will need to convert to decimal characters and
> >append.

<snip>

> Take a look at the ArrayList class. It can do the things you
> need. It can grow dynamcially, it takes any object types  and
> it can be efficient in speed and memory. Check out the
> documentation to see how it's used and see some samples. That
> will let you know for sure if it meets your needs.

Thanks for the advice, but ArrayList seems to keep a series of separate
arrays each as an entry in a list. I need something that can be returned as
a solid, contiguous block of memory. I have to return a pointer to a large
array of characters and I'm trying to find easy ways to append thing to the
end of that array.

I guess I was under the impression that C++ actually made things /easier/ to
do than what was available in just C. It appears that C++ gives you many
more interesting things that you can do, but they are all more complex and
so far as I can see actually /more/ difficult.

Just for the sake of discussion and to see if there are any other points of
view out there...

In VB or something like that I could just do

i = 0
S = s & "hello" & Chr(i) & CStr(i) & Chr(27)
REM the CStr probably isn't required, but makes it more clear.

And I would have a buffer with the following hex values in it:
68 65 6C 6C 6F 00 30 1b
"h "e "l "l "o  i (i)27

In Perl, I would use the pack function:

$i = 0;
$s = pack("AXCAXC", "hello", $i, $i, "\x1b");
# the X after the A "backs up" the result to overwrite the space
# which is added by default after an ASCII string.

The equivalent code in C is something like

char I = 0;
char s[999];
char *si = s;

si = strcpy( *si, "hello");
*si++ = i;
si += sprintf( *si, "%c", i);
*si++ = 0x1b;

And I've probably made some stupid mistake there as I'm a little rusty on C
code. The problem with that is that the buffer may grow very large and so
the dynamic increase in size of the vector class in C++ is really nice. But
as far as I can see, you can only use .push_back(char) to add one character
at a time to the buffer. To add strings and decimal values, I apparently
have to write some abortion like this?

typedef std::vector<char> buffer;
typedef std::istreambuf_iterator<buffer::value_type> bufiter;
   
buffer s;
char i = 0;
std::basic_stringstream<char> temp1;
std::basic_stringstream<char> temp2;

temp1 << "hello";
std::copy(bufiter(temp1),bufiter(),std::back_inserter(s));
s.push_back(i);
temp2 << i;    
std::copy(bufiter(temp2),bufiter(),std::back_inserter(s));
s.push_back(0x1b);

But at least I can keep doing stuff like that as long as I want... And with
a good C++ compiler, that will run pretty fast. Of course, something has to
be done about the temp variables as I can't for the life of me seem to find
a method that clears out a basic_stringstream to allow it to be reused...

But this can NOT be right, right? The C++ standard library must have made it
easier to append text, binary values, and decimal conversions of values to a
contiguous array of characters? It just can NOT be that Visual Basic is
better for this...

P.S. If someone will check my C (and other) code and post the corrections,
I'll put this up on the web site as an example of how to do the same basic
thing in VB, Perl, C and C++

---
James Newton: PICList webmaster/Admin
spam_OUTjamesnewton@spam@spamRemoveMEpiclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com


2006\02\27@143814 by James Newton, Host

face picon face
> > I've been advised to use vector but that doesn't support the << and
> the
> > copy
> > as far as I can see.
>
> Derive a class from any of the C++ STL and you can add any
> features you want.

Ahh... Well... Probably beyond me at this point.

> One of the annoying things about C++ is that they broke some
> of the simplicity of C.  What do you want << to mean?  Do you
> mean send the whole structure to an iostream?  Binary shift
> some or all of the elements?

It is confusing, yes...

> All C++ STL container classes can be copied.  What do you
> mean by that?

How do I copy something into a std:vector other than looping through it one
character at a time and using push_back? Or better yet, see the other post I
just sent on this subject.

> > I've also been advised not to use streams as they don't
> play well with
> > binary?
>
> Depends what you mean by play nice.  I use binary elements
> into streams all the time.

www.sunsite.ualberta.ca/Documentation/Gnu/libstdc++-2.90.8/html/27_io
/howto.html but again, I don't really need io, so it seems wastefull to use
a class that supports it.

> > Any advice appreciated.
>
> STL container type choice depends upon what the most common
> operation is.
>
> I can help you with this on or off list but I'd need a better
> specification of exactly what kind of data you want to handle.

Best to see my other post as it gives an example that (I hope) makes it more
clear.

Thanks for responding...

---
James Newton: PICList webmaster/Admin
spamjamesnewtonspamspampiclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com


2006\02\27@170415 by William Killian

flavicon
face


> -----Original Message-----
> From: @spam@piclist-bouncesspam_OUTspammit.edu [.....piclist-bouncesspam.....mit.edu] On
Behalf
{Quote hidden}

need
> > >file IO so there is no reason to use a iostream class.
> > >
> > >2. The data is binary. By that I mean the byte values will
> > range from 0
> > >to 255. Some of the data I will put into the buffer is binary, but
> > >other data will be text and some data will be binary values (int,
> > >short, etc...) that I will need to convert to decimal characters
and
{Quote hidden}

separate
> arrays each as an entry in a list. I need something that can be
returned
> as
> a solid, contiguous block of memory. I have to return a pointer to a
large
> array of characters and I'm trying to find easy ways to append thing
to
> the
> end of that array.
>
> I guess I was under the impression that C++ actually made things
/easier/
> to
> do than what was available in just C. It appears that C++ gives you
many
> more interesting things that you can do, but they are all more complex
and
> so far as I can see actually /more/ difficult.
>
> Just for the sake of discussion and to see if there are any other
points
{Quote hidden}

This will work in C++ nearly all C programs are C++ programs as well.



>
> And I've probably made some stupid mistake there as I'm a little rusty
on
> C
> code. The problem with that is that the buffer may grow very large and
so
> the dynamic increase in size of the vector class in C++ is really
nice.
> But
> as far as I can see, you can only use .push_back(char) to add one
> character
> at a time to the buffer. To add strings and decimal values, I
apparently
{Quote hidden}

Istreams suck.  Use the C I/O most of the time.  It's all still there.
Don't use the "basic_XX" stuff - use the more specialized ones that
match your needs.  You want 8 bit ascii use stringstream NOT
basic_stringstream.  You want wchar_t instead of char use wstringstream.

To match your C above - it makes more sense than your C++:

I'll assume cases mismatches were unintentional and you email like mine
'corrects' things it shouldn't...  

And that I is a char intended to first be added as NUL I think you
duplicated code in the C with '*si++ = i and the ssprintf version

Did you mean to put a 0x00 followed by 0x30?  Or 0 as binary and 0 as
ACII?  Lets assume you did.  You should have used a %d not %c for that

stringstream (#include <sstream>) might be what you want.



// replaces char s[] AND char * si

std::string stream ss;
// char I = 0 from your code?
Const char esc = 0x1B;
char i = 0;

// A char goes through as 'binary' while an int is converted to ASCII

ss << "hello";        // Add hello as text
ss << i;                // Add I as a NULL single byte 0
ss << (int)i;        // Add I as an ASCII string or 0x30
ss << esc;                // Add escape caharacter

Or more briefly

ss << "hello" << i << (int)i << esc;

You can then access ss as a C string as ss.str() for something like

char output [256];
memcpy(output,ss.str());

If you want to put a ascii version of an int - what you usually used
sprintf() type stuff for in C you can do

std::stringstream ss;
int ii;

ss << i and it is like you sent i to std::cout in that it gets turned
into ASCII.



>
> But at least I can keep doing stuff like that as long as I want... And
> with
> a good C++ compiler, that will run pretty fast. Of course, something
has
> to
> be done about the temp variables as I can't for the life of me seem to
> find
> a method that clears out a basic_stringstream to allow it to be
reused...


Easiest way is destruct and construct.

       for (;;)
       {
               std::stringstream ss;        // all constructed clean and
empty new

               // do new stuff to go to ss
               ss << goobledyGook();

               // now do something with the completed buffer

               doneWith(ss.str());

       } // when flow gets here the ss is destructed and goes away
}

This all make more sense?

>
> But this can NOT be right, right? The C++ standard library must have
made
> it
> easier to append text, binary values, and decimal conversions of
values to
> a
> contiguous array of characters? It just can NOT be that Visual Basic
is
> better for this...
>
> P.S. If someone will check my C (and other) code and post the
corrections,
> I'll put this up on the web site as an example of how to do the same
basic
> thing in VB, Perl, C and C++

I can fix the C and C++ when I really know what you meant.


-------------------------------------  Notice of Confidentiality ----------------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the
individual or entity to whom they are addressed. If you have received this email in error please notify
spampostmasterKILLspamspamvgt.net. This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not disseminate, distribute or
copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the intended recipient you are notified
that disclosing, copying, distributing or taking any action in reliance on the contents of this information
is strictly prohibited.

2006\02\27@182432 by James Newton, Host

face picon face

> To match your C above - it makes more sense than your C++:

No doubt. <grin>

{Quote hidden}

Ah... Right, yes, 0x00 then 0x30 was intended so I should have used %d. And
%c would have made 0x00 then 0x00, yes, I see that is true and not what I
intended. Correct code would be:

char I = 0;
char s[999];
char *si = s;

si = strcpy( *si, "hello");
*si++ = i;
si += sprintf( *si, "%d", i);
*si++ = 0x1b;

And the result would be
68 65 6C 6C 6F 00 30 1b
"h "e "l "l "o  i (i)27

> stringstream (#include <sstream>) might be what you want.
>
>
>
> // replaces char s[] AND char * si
>
> std::string stream ss;

I'm assuming the space between string and stream is your spell checker and
it should have been "stringstream".

> // char I = 0 from your code?
> Const char esc = 0x1B;
> char i = 0;
>
> // A char goes through as 'binary' while an int is converted to ASCII
>
> ss << "hello";        // Add hello as text
> ss << i;                // Add I as a NULL single byte 0

Oh? That works? Cool! Why does that work? If "i" had been 123 it would have
appended 0x7B?

> ss << (int)i;        // Add I as an ASCII string or 0x30

And if "i" had been 123 then it would have appended 0x30,0x31,0x32?

{Quote hidden}

See, that won't work. I will have to find the length of ss, then allocate a
char array on the heap, memcpy it and then return the char array, I guess.

> If you want to put a ascii version of an int - what you usually used
> sprintf() type stuff for in C you can do
>
> std::stringstream ss;
> int ii;
>
> ss << i and it is like you sent i to std::cout in that it
> gets turned into ASCII.

But this is only because the type is int rather than char? That is confusing
as all get out. So the << appends the binary value if the types match and
the decimal value if they don't? That is NOWHERE in my documentation. Time
to start a web page...

<snip>

{Quote hidden}

I guess so. Isn't the point of an object oriented language to enable the
objects to know what to do with themselves? Why isn't it ss.doneWith? But
that isn't a question for you, rather a question for whoever writes the C++
language.

It's a strange world. But then I say that about Perl as well. And I'm sure
others feel the same about C or asm.

Thanks again.

---
James Newton: PICList webmaster/Admin
RemoveMEjamesnewtonRemoveMEspampiclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com



2006\02\27@210731 by Gerhard Fiedler

picon face
James Newton, Host wrote:

> In VB or something like that I could just do
>
> i = 0
> S = s & "hello" & Chr(i) & CStr(i) & Chr(27)
> REM the CStr probably isn't required, but makes it more clear.
>
> And I would have a buffer with the following hex values in it:
>  68 65 6C 6C 6F 00 30 1b
>  "h "e "l "l "o  i (i)27
>
> In Perl, I would use the pack function: [...]

Sounds like you wanted the string and stringstream classes...

Gerhard

2006\02\27@212130 by James Newton, Host

face picon face
Gerhard Fiedler Sent: 2006 Feb 27, Mon 18:07
>
> James Newton, Host wrote:
>
> > In VB or something like that I could just do
> >
> > i = 0
> > S = s & "hello" & Chr(i) & CStr(i) & Chr(27) REM the CStr probably
> > isn't required, but makes it more clear.
> >
> > And I would have a buffer with the following hex values in it:
> >  68 65 6C 6C 6F 00 30 1b
> >  "h "e "l "l "o  i (i)27
> >
> > In Perl, I would use the pack function: [...]
>
> Sounds like you wanted the string and stringstream classes...

As I understand it, string and stringstream do not actually maintain a
contigous area in memory where their content is accessable. E.g. you can't
point to one and read out bytes that contain what the string in basic or the
result of the pack function returns.

You then have to convert them to such an array of characters by calling
their .str() function to make an actual string from the result.

But, yes, it sounds like that is as close as it gets.

---
James Newton: PICList webmaster/Admin
KILLspamjamesnewton.....spamKILLspampiclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com


2006\02\27@222124 by Gerhard Fiedler

picon face
James Newton, Host wrote:

> As I understand it, string and stringstream do not actually maintain a
> contigous area in memory where their content is accessable. E.g. you
> can't point to one and read out bytes that contain what the string in
> basic or the result of the pack function returns.

If you return a string object (or a pointer to one), you can access
individual elements. Like with .operator[], or with .data(). I never had to
look into that in detail, but it seems to me, from the description of
data(), that the string data is contiguous.

> You then have to convert them to such an array of characters by calling
> their .str() function to make an actual string from the result.

Isn't that pretty much the same as the other languages you mentioned? (I'd
look into .data() for this.)

Gerhard

2006\02\28@103740 by William Killian

flavicon
face


> -----Original Message-----
> From: piclist-bouncesspam_OUTspamspam_OUTmit.edu [KILLspampiclist-bouncesspam@spam@mit.edu] On
Behalf
> Of James Newton, Host
> Sent: Monday, February 27, 2006 6:24 PM
> To: 'Microcontroller discussion list - Public.'
> Subject: RE: [EE] selecting the right C++ STD library memory buffer
>
[...]
> > Did you mean to put a 0x00 followed by 0x30?  Or 0 as binary
> > and 0 as ACII?  Lets assume you did.  You should have used a
> > %d not %c for that
>
> Ah... Right, yes, 0x00 then 0x30 was intended so I should have used
%d.

Or %u if unsigned.

> And
> %c would have made 0x00 then 0x00, yes, I see that is true and not
what I
{Quote hidden}

and
> it should have been "stringstream".

Yes.  Me or Outlook.  Yeah I'll blame Outlook. <g>

>
> > // char I = 0 from your code?
> > Const char esc = 0x1B;
> > char i = 0;
> >
> > // A char goes through as 'binary' while an int is converted to
ASCII
> >
> > ss << "hello";        // Add hello as text
> > ss << i;                // Add I as a NULL single byte 0
>
> Oh? That works? Cool! Why does that work? If "i" had been 123 it would
> have
> appended 0x7B?

That is the stream part of stringstream.  It is a string builder that
works like an ostream.  Along the lines of how sprintf relates to
fprintf.


> > ss << (int)i;        // Add I as an ASCII string or 0x30
>
> And if "i" had been 123 then it would have appended 0x30,0x31,0x32?

Yes.

{Quote hidden}

allocate
> a
> char array on the heap, memcpy it and then return the char array, I
guess.

Do you have a function of some type that needs a char[]?  Can you just
save away the stringstream and later use the .str()?  

Could you save the string stream instead of an array of char?

Stringstream * func()
{
 stringstream * pSS = new stringstream();

 // Do your stuff
 *pss << "hello";

 return pss;
}

And return or save away the string stream instead of a char array.

{Quote hidden}

It is exactly the %c versus %d thing in a different set of functions.  A
char is by default treated as a %c type operation and an int like a %d
operation.

> So the << appends the binary value if the types match and
> the decimal value if they don't? That is NOWHERE in my documentation.
Time
> to start a web page...
>
> <snip>

Huge books are written on stl.

<sarcasm>
And Microsoft has always had documentation of the same quality as the
rest of their products -
</sarcasm>
So yeah if its in there is is darned hard to find.

> > > find a method that clears out a basic_stringstream to allow it to
be
{Quote hidden}

the
> objects to know what to do with themselves? Why isn't it ss.doneWith?
But
> that isn't a question for you, rather a question for whoever writes
the
> C++
> language.

I'm not real fond of what they did to C++ since the early versions.

The idea is that you create them when you need them and destroy them
when done.  The equivalent of malloc and free.   In C the style would be
to allocate a buffer use it, free it.  When you need to start over you
start with a fresh malloc.


> It's a strange world. But then I say that about Perl as well. And I'm
sure
> others feel the same about C or asm.

It's a mindset.  You get used to a tool by learning its idioms.
Although I have written object oriented assembly.  That was unusual to
many old assembly hacks.

>
> Thanks again.

You're welcome.  No problem.  Returning the favor of people helping me.




-------------------------------------  Notice of Confidentiality ----------------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the
individual or entity to whom they are addressed. If you have received this email in error please notify
@spam@postmasterRemoveMEspamvgt.net. This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not disseminate, distribute or
copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the intended recipient you are notified
that disclosing, copying, distributing or taking any action in reliance on the contents of this information
is strictly prohibited.

2006\02\28@105143 by William Killian

flavicon
face
> -----Original Message-----
> From: piclist-bounces@spam@spamEraseMEmit.edu [spam_OUTpiclist-bouncesspam_OUTspamRemoveMEmit.edu] On
Behalf
{Quote hidden}

can't
> point to one and read out bytes that contain what the string in basic
or
> the
> result of the pack function returns.

Actually they do.  That is what std::string::c_str() and
std::stringstream::str() do.  You read out the bytes contained by
calling those methods.

But in the OO world the implementation hiding is considered a good
thing.

You can get to individual elements of std::string easily with substr(),
insert characters in the middle with insert().

> You then have to convert them to such an array of characters by
calling
> their .str() function to make an actual string from the result.

That is reading out the bytes.  No 'conversion' per se, just limited
access to the char[] buffer inside.

> But, yes, it sounds like that is as close as it gets.

They are weird until you get used to them.  Now that I am I still think
I would have doen them differently (Bill's first law of software
engineering: All other programmers are idiots.  Tongue is extremely
firmly in cheek when I say that.)

Play with them and get used to them.  I/O formatting is weird but it
works.  Printf is still better in many cases though -  and probably more
efficient at a cost of making you do a lot of work and probably end up
with something not much more efficient at the end.


-------------------------------------  Notice of Confidentiality ----------------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the
individual or entity to whom they are addressed. If you have received this email in error please notify
RemoveMEpostmasterspam.....vgt.net. This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not disseminate, distribute or
copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the intended recipient you are notified
that disclosing, copying, distributing or taking any action in reliance on the contents of this information
is strictly prohibited.

2006\02\28@110359 by Alan B. Pearce

face picon face
>You get used to a tool by learning its idioms.
>Although I have written object oriented assembly.

Any pointers on where to get info on doing this? I tried to get the info
from Microsoft that was presented on this at last years Masters, without
success.

The nearest I have come to OOP in assembler is by using linkable modules.

2006\02\28@112924 by William Killian

flavicon
face


> -----Original Message-----
> From: spampiclist-bounces@spam@spammit.edu [piclist-bouncesTakeThisOuTspammit.edu] On
Behalf
> Of Alan B. Pearce
> Sent: Tuesday, February 28, 2006 11:04 AM
> To: Microcontroller discussion list - Public.
> Subject: Re: [EE] selecting the right C++ STD library memory buffer
>
> >You get used to a tool by learning its idioms.
> >Although I have written object oriented assembly.
>
> Any pointers on where to get info on doing this? I tried to get the
info
> from Microsoft that was presented on this at last years Masters,
without
> success.
>
> The nearest I have come to OOP in assembler is by using linkable
modules.

Hand rolled in 68k assembler.  I did all the class equivalent stuff
myself.  It was not the clean syntax of an object oriented language.  

OO is a mindset not a language.  Some languages just make it easier and
some (old BASIC for example) make it really really hard.




-------------------------------------  Notice of Confidentiality ----------------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the
individual or entity to whom they are addressed. If you have received this email in error please notify
.....postmasterspamTakeThisOuTvgt.net. This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not disseminate, distribute or
copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by
mistake and delete this e-mail from your system. If you are not the intended recipient you are notified
that disclosing, copying, distributing or taking any action in reliance on the contents of this information
is strictly prohibited.

2006\02\28@114440 by Alan B. Pearce

face picon face
>Hand rolled in 68k assembler.  I did all the
>class equivalent stuff myself.  It was not
>the clean syntax of an object oriented language.

OK, I just figured that maybe you had some specific methodology that helped.

>OO is a mindset not a language.

Yeah, appreciate that. I did find that using linkable modules (in this case
built through Olins environment) helped the OOP mindset with assembler as it
was possible to maintain a certain degree of "hidden detail" because of the
modules and the PIC banking (it was on a 16F876).

2006\02\28@190047 by Peter

picon face

On Tue, 28 Feb 2006, Alan B. Pearce wrote:

>> You get used to a tool by learning its idioms.
>> Although I have written object oriented assembly.
>
> Any pointers on where to get info on doing this? I tried to get the info
> from Microsoft that was presented on this at last years Masters, without
> success.
>
> The nearest I have come to OOP in assembler is by using linkable modules.

I think that you can use the usual 'system call interface' paradigm. All
data is private to a set of subroutines, which form an object. There is
a single entry point and you select the function (method) using a
parameter. Inheritance is by forwarding calls to an inherited object.

Peter

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...