Searching \ for '[PIC] New open-source BASIC compiler' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/languages.htm?key=basic
Search entire site for: 'New open-source BASIC compiler'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] New open-source BASIC compiler'
2006\08\16@101442 by Hugh Considine

flavicon
face
Hello all,

I've been working on a free, open-source BASIC compiler for PIC
microcontrollers. It's called Great Cow BASIC, has a similar syntax to
FreeBASIC/QBASIC, and supports 10/12/16 series chips. It's a work in
progress at present, but most features are implemented and working well.

If you are interested, please visit http://gcbasic.sourceforge.net and
have a look - I'd be very interested to hear some feedback on it!

Hugh Considine

2006\08\16@132136 by Vasile Surducan

face picon face
On 8/16/06, Hugh Considine <spam_OUThconsidineTakeThisOuTspambigpond.com> wrote:
> Hello all,
>
> I've been working on a free, open-source BASIC compiler for PIC
> microcontrollers. It's called Great Cow BASIC, has a similar syntax to
> FreeBASIC/QBASIC, and supports 10/12/16 series chips. It's a work in
> progress at present, but most features are implemented and working well.
>
> If you are interested, please visit http://gcbasic.sourceforge.net and
> have a look - I'd be very interested to hear some feedback on it!
>
> Hugh Considine

Hi Hugh,

Following the jallist group  http://groups.yahoo.com/group/jallist/
for a few years, I think I could give you a few advices if you want
this compiler to grow:

- you need to create a group of betatesters having both hardware and
software guys (yahoogroups or gmail groups could be fine)
- you need a developing platform ( a hardware schematic at least)
which may be easily used by any beginners (basic it's a program for
beginners).
- you need a much detailed user manual and a bug tracker
- you need an IDE for your compiler

success,

Vasile

2006\08\16@132529 by John Scott

flavicon
face
Hi Hugh

How do you dynamically alter the PWM settings at runtime?

Regards

John

Hugh Considine wrote:
{Quote hidden}

2006\08\16@135604 by stef mientki

flavicon
face

> Hi Hugh,
>
> Following the jallist group  http://groups.yahoo.com/group/jallist/
> for a few years, I think I could give you a few advices if you want
> this compiler to grow:
>  
Or why not increase your (and our) productivity,
by joining the JAL development team ?

Just a thought,
but if you're interested, contact me off line.

cheers,
Stef Mientki

2006\08\16@170827 by D. Jay Newman

flavicon
face
> > Following the jallist group  http://groups.yahoo.com/group/jallist/
> > for a few years, I think I could give you a few advices if you want
> > this compiler to grow:
> >  
> Or why not increase your (and our) productivity,
> by joining the JAL development team ?
>
> Just a thought,
> but if you're interested, contact me off line.

Or perhaps he could do both? JAL is nice, but some people *really*
prefer Basic. Why, I don't know, but it seems to be popular as
shown by the popularity of the Basic Stamp.

Just remember: Those whom the gods would destroy, they first teach BASIC. :)
--
D. Jay Newman           ! Author of:
.....jayKILLspamspam@spam@sprucegrove.com     ! _Linux Robotics: Programming Smarter Robots_
http://enerd.ws/robots/ ! "Heros aren't born, they're cornered."

2006\08\16@173034 by Tamas Rudnai

face picon face
What about to make a Lisp for PICs -- never seen such like before :-)))) --
just joking



On 16/08/06, D. Jay Newman <jayspamKILLspamsprucegrove.com> wrote:
{Quote hidden}

> -

2006\08\16@174125 by Marc Nicholas

picon face
I wrote a COBOL interpreter for the PIC. Email me if interested.

-marc

On 8/16/06, Tamas Rudnai <EraseMEtamas.rudnaispam_OUTspamTakeThisOuTgmail.com> wrote:
{Quote hidden}

2006\08\16@174907 by stef mientki

flavicon
face
Tamas Rudnai wrote:
> What about to make a Lisp for PICs -- never seen such like before :-)))) --
> just joking
>  
I'm not familiar with LISP, but I would vote for PHP for PICs,
whether you like C-style or Pascal-Style,
both and a lot more flexibility is supported.

cheers,
Stef

2006\08\16@175843 by Marc Nicholas

picon face
I'm also the author of Perl for PICs!

-marc

On 8/16/06, stef mientki <KILLspams.mientkiKILLspamspammailbox.kun.nl> wrote:
{Quote hidden}

> -

2006\08\16@193920 by D. Jay Newman

flavicon
face
> What about to make a Lisp for PICs -- never seen such like before :-)))) --
> just joking

Well, I think it *could* be done. Maybe not a full Common Lisp, but if a
Forth compiler can be made then so can a Lisp subset.
--
D. Jay Newman           ! Author of:
RemoveMEjayTakeThisOuTspamsprucegrove.com     ! _Linux Robotics: Programming Smarter Robots_
http://enerd.ws/robots/ ! "Heros aren't born, they're cornered."

2006\08\17@044425 by John Scott

flavicon
face
I can shed some light as to why BASIC is still so popular.

There is a large amount of instumentation / electronics people about who
never had the good furtune of learning "proper" programming when they
were training. Now, in order for them to use their extensive knowledge
of industrial systems to solve industry issues, they choose to design
their own instruments, and BASIC is one of the most "human readable"
languages ever invented - a natural chioce for non-programmers to use.

Most of these people will rather learn enough to accomplish the
engineering task at hand - and don't want to become hardcore
programmers, and go through the arduous task of learning a complicated
language like C or Assembly, which would be counterproductive
considering their primary objective is completion of a project, not
leaing to program.

Regards

John

D. Jay Newman wrote:
{Quote hidden}

2006\08\17@054019 by Forrest W Christian

flavicon
face
Marc Nicholas wrote:

>I'm also the author of Perl for PICs!
>
Now that I'd like to see :)

The regexp library itself has to be bigger than most pic's will handle..

-forrest

2006\08\17@055422 by Tamas Rudnai

face picon face
Well, the most human readable is the flowchart based 'languages' so that you
see what is going on by 'reading' the charts. For..Step..Next means nothing
to me but seeing an arrow means a lot. So I think that a graphical language
would be much easy for the non-programmers. The data file for such a
flowchart could be a text based one, an XML or any structured one therefore
the traditional stack based tokenizers would work on that pretty well just
as all of the traditional text processors -- I was actually thinking on such
a language a lot but have never had the time to make it.

Tamas


On 17/08/06, John Scott <spamBeGonejohnspamBeGonespamraystorm.co.uk> wrote:
{Quote hidden}

> -

2006\08\17@055600 by Tamas Rudnai

face picon face
That one is based on a serial connector that sends the Perl program to a PC
which sends back the results :-)

On 17/08/06, Forrest W Christian <TakeThisOuTforrestcEraseMEspamspam_OUTimach.com> wrote:
>
> Marc Nicholas wrote:
>
> >I'm also the author of Perl for PICs!
> >
> Now that I'd like to see :)
>
> The regexp library itself has to be bigger than most pic's will handle..
>
> -forrest
> -

2006\08\17@062256 by Victor Fraenckel

flavicon
face
I agree with John Scott:

>There is a large amount of instumentation / electronics people about who
>never had the good furtune of learning "proper" programming when they
>were training. Now, in order for them to use their extensive knowledge
>of industrial systems to solve industry issues, they choose to design
>their own instruments, and BASIC is one of the most "human readable"
>languages ever invented - a natural chioce for non-programmers to use.


I find it very interesting that some members of this group use subtle
methods, mainly ridicule,  to disparage the efforts of someone who is
not in "programming language" agreement with them. There are plenty of
interesting PIC projects out there being done with BASIC, Pascal and
Pascal-like JAL.

Give the OP a break!

Vic

*____________________________________________________________________________________________*

*Victor Fraenckel
KC2GUI
victorf ATSIGN windreader DOT com**
*


2006\08\17@062628 by John Scott

flavicon
face
I would say, that if a flowchart type programming language is the
answer, function blocks are a logical inclusion.

Tamas Rudnai wrote:
{Quote hidden}

>> --

2006\08\17@071447 by Tony Smith

picon face
> Well, the most human readable is the flowchart based
> 'languages' so that you see what is going on by 'reading' the
> charts. For..Step..Next means nothing to me but seeing an
> arrow means a lot. So I think that a graphical language would
> be much easy for the non-programmers. The data file for such
> a flowchart could be a text based one, an XML or any
> structured one therefore the traditional stack based
> tokenizers would work on that pretty well just as all of the
> traditional text processors -- I was actually thinking on
> such a language a lot but have never had the time to make it.
>
> Tamas


They exist, have a look at http://www.picaxe.com for a current example.  Basic on a
PIC, similar concept to BasicStamp.

For a non-programmer, these are fine.  After all, it's no different to the
circuit simulator programs.  Unless you prefer the crusty old SPICE stuff.

The only downside these have is a lot of them don't let you create custom
functions out of a flowchart you've made (circuit programs do).  They'll
also let you create a listing from the flowchart, but won't handle the
reverse.  Not a flowchart chart problem per se, just with the
implementation.  In the case of the PicAxe, the programs are a bit small
anyway so it doesn't matter.

One place I found a 'code by flowchart' thingy was in a telephony box, the
IBM DT-6 IVR (ran on AIX).  Apparently the flowchart option was added as a
sales tool to show the executive how easy all this coding stuff was.  As
such, it has a few interesting quirks, like deciding to move all the boxes
to the top left corner.  The platform itself has a few odd quirks too, such
as deleting all of your voice files if you picked a certain option on the
menu (no, it wasn't labelled 'delete all my stuff').  I was told that bug
got fixed.

I wrote a Basic interpreter years ago (for a report generator), maybe I
should use Visio as the front end.  All I need now is a reason!  Hmmm,
FlowJAL.

Tony

2006\08\17@075213 by Tamas Rudnai

face picon face
Well, there are lots of flow chart generators -- maybe not for PIC
programming , but there are some very expensive softwares that do that. But
all of them are converting a program listing to a flow chart or generates
program listings from that. Which I meant is a 'native' flowchart, so that
when you would say 'BCF GPIO,5' you would put the relevant function box or
whatever instead like:


           |
           V
  +------------------+
  |                  |
  |  SET PORT 5 LOW  |
  |                  |
  +------------------+
           |

and instead of a loop like:

           |<-----------------+
           V                  |
  +------------------+        |
  |                  |        |
  |  DECREMENT TEMP  |        |
  |                  |        |
  +------------------+        |
           |                  |
           |                  |
           V                  |
          /\                  |
         /  \                 |
        /    \                |
       /IS IT \______N________|
       \ZERO? /
        \    /
         \  /
          \/
           |Y
           V

Something like that, and you have several level of detail view, this is the
lowest, but you could see higher level normally so when you double click on
the 'SEND PWM' box for example you will get the detail of that. Even
libraries would be written like that -- maybe it is a bad way, I do not
know?

Tamas
PS: Pls, do not look at the bad ASCII graphics I have been made :-)


On 17/08/06, Tony Smith <ajsmithEraseMEspam.....rivernet.com.au> wrote:
{Quote hidden}

> -

2006\08\17@075214 by Tamas Rudnai

face picon face
Well, there are lots of flow chart generators -- maybe not for PIC
programming , but there are some very expensive softwares that do that. But
all of them are converting a program listing to a flow chart or generates
program listings from that. Which I meant is a 'native' flowchart, so that
when you would say 'BCF GPIO,5' you would put the relevant function box or
whatever instead like:


           |
           V
  +------------------+
  |                  |
  |  SET PORT 5 LOW  |
  |                  |
  +------------------+
           |

and instead of a loop like:

           |<-----------------+
           V                  |
  +------------------+        |
  |                  |        |
  |  DECREMENT TEMP  |        |
  |                  |        |
  +------------------+        |
           |                  |
           |                  |
           V                  |
          /\                  |
         /  \                 |
        /    \                |
       /IS IT \______N________|
       \ZERO? /
        \    /
         \  /
          \/
           |Y
           V

Something like that, and you have several level of detail view, this is the
lowest, but you could see higher level normally so when you double click on
the 'SEND PWM' box for example you will get the detail of that. Even
libraries would be written like that -- maybe it is a bad way, I do not
know?

Tamas
PS: Pls, do not look at the bad ASCII graphics I have been made :-)


On 17/08/06, Tony Smith <EraseMEajsmithspamrivernet.com.au> wrote:
{Quote hidden}

> -

2006\08\17@075505 by Gerhard Fiedler

picon face
Tamas Rudnai wrote:

> Well, the most human readable is the flowchart based 'languages' so that you
> see what is going on by 'reading' the charts. For..Step..Next means nothing
> to me but seeing an arrow means a lot. So I think that a graphical language
> would be much easy for the non-programmers. The data file for such a
> flowchart could be a text based one, an XML or any structured one therefore
> the traditional stack based tokenizers would work on that pretty well just
> as all of the traditional text processors -- I was actually thinking on such
> a language a lot but have never had the time to make it.

Not for PICs, but National's LabVIEW is probably the most widely used of
such systems.

Gerhard

2006\08\17@085011 by Tony Smith

picon face
> Well, there are lots of flow chart generators -- maybe not
> for PIC programming , but there are some very expensive
> softwares that do that. But all of them are converting a
> program listing to a flow chart or generates program listings
> from that. Which I meant is a 'native' flowchart, so that
> when you would say 'BCF GPIO,5' you would put the relevant
> function box or whatever instead like:


The http://www.picaxe.com software is what you describe, as was the IBM system.
Screenshot on their website -
http://www.rev-ed.co.uk/picaxe/images/editorbig.jpg - looks like your ASCII
one  :)

For PicAxe, the commands are at the lowest level, so each box is a single
command.  The IBM software could have subroutines, double clicking that box
brought up its flowchart.

You don't get assembly, the program gets converted to tokens & downloaded
(RS232) to the chip.  Naturally, it runs a lot slower than a compiled Basic
or native assembler.  The editor is a 26 meg download.

The PicAxe is a PIC chip, either an 8-pin (16F629A), 18-pin (16F628A) or
28-pin (can't remember).

Tony

2006\08\17@090050 by Tamas Rudnai

face picon face
OK, then I will not find out something that has already been invented :-)

Tamas

On 17/08/06, Tony Smith <RemoveMEajsmithEraseMEspamEraseMErivernet.com.au> wrote:
{Quote hidden}

> -

2006\08\17@095452 by Tony Smith

picon face
> > The http://www.picaxe.com software is what you describe, as was
> the IBM system.
> > Screenshot on their website -
> > http://www.rev-ed.co.uk/picaxe/images/editorbig.jpg - looks
> like your
> > ASCII one  :)
> >
> > For PicAxe, the commands are at the lowest level, so each box is a
> > single command.  The IBM software could have subroutines, double
> > clicking that box brought up its flowchart.
> >
> > Tony
>
>
> OK, then I will not find out something that has already been
> invented :-)
>
> Tamas


I did like how their flowchart & yours almost matched.

It's a fairly well-worn path, although doing JAL by flowchart could be
amusing.  Might even force me to learn Visio properly.

One thing I forgot to mention is that you can simulate the program, as you
run it the boxes highlight and so on.

Tony

2006\08\17@105433 by Daniel Serpell

picon face
Hi!

On 8/17/06, Tamas Rudnai <RemoveMEtamas.rudnaispam_OUTspamKILLspamgmail.com> wrote:
> Well, there are lots of flow chart generators -- maybe not for PIC
> programming , but there are some very expensive softwares that do that. But
> all of them are converting a program listing to a flow chart or generates
> program listings from that. Which I meant is a 'native' flowchart, so that
> when you would say 'BCF GPIO,5' you would put the relevant function box or
> whatever instead

See KTechLab:

 http://ktechlab.org/screenshots/0.3/flowcode.png

   Daniel.

2006\08\17@124159 by stef mientki

flavicon
face

> Not for PICs, but National's LabVIEW is probably the most widely used of
> such systems.
>  
And I've  heard the rumour they even have patented this way of programming.
There is add on for Delphi, called open wire,
from which the author said it's blocked because of these patents.

cheers,
Stef
> Gerhard
>
>  

2006\08\17@124636 by stef mientki

flavicon
face

> It's a fairly well-worn path, although doing JAL by flowchart could be
> amusing.
Yes, very amusing,
bacuse JAL by flowchart is impossible,
which not only yield for JAL, but for all structured languages.
But there's an alternative, called Finite State Machines,
and that is (although very premature) available for JAL (an Delphi).
see here:
 http://oase.uci.kun.nl/~mientki/data_www/pic/jalcc/help/state_machine.html

I hope to update it this weekend for the new case-statement just became
available in JAL.

cheers,
Stef

2006\08\17@130410 by D. Jay Newman

flavicon
face
>  I find it very interesting that some members of this group use subtle
> methods, mainly ridicule,  to disparage the efforts of someone who is
> not in "programming language" agreement with them. There are plenty of
> interesting PIC projects out there being done with BASIC, Pascal and
> Pascal-like JAL.

I'm sorry if you include me in thee above catagory. While I rarely use
Basic now, it was the first programming language I learned (then APL
which was a *very* different experience).

Yes, I tend to joke about Basic, but then I try to not take anything
too seriously.
--
D. Jay Newman           ! Author of:
RemoveMEjayTakeThisOuTspamspamsprucegrove.com     ! _Linux Robotics: Programming Smarter Robots_
http://enerd.ws/robots/ ! "Heros aren't born, they're cornered."

2006\08\17@130610 by Tamas Rudnai

face picon face
Well, there are other type of diagrams, as far as I remember for Pascal the
Jackson was widely used -- and as I can see JAL is a kind of Pascal but I
may wrong?

Tamas


On 17/08/06, stef mientki <EraseMEs.mientkispamspamspamBeGonemailbox.kun.nl> wrote:
{Quote hidden}

> -

2006\08\17@131016 by Tamas Rudnai

face picon face
Ooooh, do not worry too much about patents, they patented almost everything
on how to detect computer viruses, so only one or two companies would be
able to do that. Some times ago Apple patented the mouse (by the time nobody
else had that kind of device -- I mean the mouse with the ball). But the
patent included that it has only one button -- that't why everybody else has
two or more... So patent is a money throwed out of the window.

Tamas


On 17/08/06, stef mientki <RemoveMEs.mientkiKILLspamspammailbox.kun.nl> wrote:
{Quote hidden}

> -

2006\08\17@135948 by Wouter van Ooijen

face picon face
> and BASIC is one of the most "human readable"
> languages ever invented - a natural chioce for non-programmers to use.

I must disagree, or at least comment. Original Basic is very easy to
read for very simple programs. For slightly more complex programs it
gets much more difficult. This is (partially) addressed by later
(structured) Basics, but these are not as easy for the absolute beginner
(they are in fact almost the same as C/Pascal/Ada/Jal etc.)

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu


2006\08\17@145326 by John Scott

flavicon
face
Of the few modern basic compilers for PIC I have seen, the complexity is
largely removed by using the built in and add-on functions provided by
the compiler authors - making some fairly complex programming easy in
just a few easy to understand steps.

For instance, I designed a 4-20mA source using a PIC and written in
Basic. It took about 40 lines of easily readable Basic, which translated
into 150 lines of assembly - which to the untrained eye - is meaningless.

I agree that early versions of Basic lack structure and make programming
complex applications difficult - but using modern programming principles
and a modern compiler  - Basic is really easy to use.

I would like to try JAL though - it sounds interesting.

Just my opinion :)

Regards

John Scott

Wouter van Ooijen wrote:
{Quote hidden}

2006\08\17@153108 by Tony Smith

picon face
> > It's a fairly well-worn path, although doing JAL by
> flowchart could be amusing.
>
> Yes, very amusing, bacuse JAL by flowchart is impossible,
> which not only yield for JAL, but for all structured languages.


Hmm.  Scratches head.  Really?  Why's that then?  

I've used 'code by flowchart' tools.  And certainnly drawn enough flowcharts
for programs (big ones too, 90 pages in one case, bleh).  I can't see any
major hinderances, unless you have a different definition of structured.

I can see some commands could be annoying, such as case, but that's just a
goto in diguise.

Now I'm curious.

BTW, how long has the FSM tool been there?

Tony

2006\08\17@153640 by Tamas Rudnai

face picon face
Most of the high level languages (HLL) like C are for make something faster,
easier and more reliable as you do not have to rewrie something that had
zalready been written and comprehensively tested (like substracting 16 bit
sined numbers). There are some other languages that was originally designed
for training purposes like Basic and Pascal. Basic was good for get ordinary
people closer to the computer while Pascal was good at teaching structured
programming for professionals. Now both had been extended to be able to deal
with more complex tasks as just too many people know each. Jal is like a
Pascal clone with some modified syntax as I have seen in the documentation.
Which is good in that is that you can insert assembly lines which gives you
some freedom. With GCBASIC I can't see the same -- maybe I missed it or it
will be implemented I do not know. The other thing which was strange to me
that there are some instruction that is new to a Basic programmer, however,
have the equivalent in the original basic -- like there was a GOSUB command
and RETURN and I can't find them but instead there is an EXIT SUB. Also for
accessing to EEPROM there is a new command EPRead EPWrite instead of EPEEK
EPOKE. BTW PEEK and POKE has two arguments, the high and low part of the
address while I would not want to fiure out it if I am usin a HLL. Neverless
to say it is definetly makes the programming very easy and I can see that
many people who uses PIC for robotic projects for example would prefer that
one instead of JAL, C or Assembly.

Keep working on both as each one of them has the purpose :-)

Tamas



On 17/08/06, John Scott <johnSTOPspamspamspam_OUTraystorm.co.uk> wrote:
{Quote hidden}

> -

2006\08\17@160659 by Wouter van Ooijen

face picon face
>> Yes, very amusing, bacuse JAL by flowchart is impossible,
>> which not only yield for JAL, but for all structured languages.
>
>
> Hmm.  Scratches head.  Really?  Why's that then?  

*unrestricted* flowcharts (where arrows can point everywhere can not be
translated (directly) to strutured programming constructs (while, for,
if, *no* goto). Note that such a flowchart *can* be translated to a
language that allows GOTOs.

It is of course possible to restrict the flowchart to being composed of
a finite set of 'structures' that correspond to the structured
programming constructs, which yields a flowchart that can be translated
to a structured language.

Personally I don't like such restricted flowcharts, they seem to imply a
level of freedom (pointing arrows where you would like them to point)
that they in fact do not allow.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu


2006\08\17@162103 by stef mientki

flavicon
face
Tony Smith wrote:
>>> It's a fairly well-worn path, although doing JAL by
>>>      
>> flowchart could be amusing.
>>
>> Yes, very amusing, bacuse JAL by flowchart is impossible,
>> which not only yield for JAL, but for all structured languages.
>>    
>
>
> Hmm.  Scratches head.  Really?  Why's that then?  
>
> I've used 'code by flowchart' tools.  And certainnly drawn enough flowcharts
> for programs (big ones too, 90 pages in one case, bleh).
Well I believe you,
every structured program can be drawn as a flowchart (at least I think),
but not every flowchart can be translate into a structured language,
simple because a structured language doesn't support "GOTO".

So indeed a analytical person will be able to make good designs with
flowcharts ;-)

{Quote hidden}

About one or 2 years ago I developed it (very quickly and dirty),
simply because I needed it.
I think I even mentioned it in this list, but I did certainly at the
JALlist,
where nobody saw the advantages ;-)
And it has already proven its benifits,
just think about discussions with non technical people about patient
alarm systems,
papers full of text, can be replaced by a simple drawing
and everyone can follow the discussion again ;-)
The major power has still to build in this FSM:
- testing of all possible transistions are covered (or generating the
missing transistions)
- hierachical design
Further more th drawing of lines is a bit clumsy.
But it's there.

cheers,
Stef

2006\08\17@165229 by Tony Smith

picon face
{Quote hidden}

GW-Basic (GeeWhiz!) was about the last of the old unstructured Basics, often
called BASIC.  When people sneer at Basic, this is what they are referring
to.

Structured Basic came about with versions like QuickBasic and TurboBasic.
The major difference is variables were no longer Global.  This has huge
implications for reliability and development speed.

10        X = 0
20        For Y = 1 to 20
30        GoSub 100
40        Next Y
50        Print X
60        End
100        REM increment number
110        X = X + 1
120        Return

Ah, old school Basic.  In this routine, X will wind up being equal to 20.
Structures Basic  does things a little difference, introducing variable
scope.  Variable scope means that not all variables are available to each
part of the program, this leads to more reliable programs as you stop
accidently modifying things you shouldn't...  Think of the Sub / End sub
pairs as walls, nothing gets in or out unless you allow it.

10        X = 0
20        For Y = 1 to 20
30        Call Increment
40        Next Y
50        Print X
60        End
100        Sub Increment
110        X = X + 1
120        End Sub

Similar looking, but the GoSub has been replaced with a real subroutine.
The variables in the subroutine only exist within the routine, they are said
to be Local.  This code doesn't actually work, X winds up being zero.

Later Basics like VB still have GoSub, but only for backwards compatibility.
Like GoTo, no-one uses it.

The reason is there are 2 X's, the one in the main section, and the one in
the subroutine.  When the subroutine is called, it's X is created, then
destroyed at the end.  Because of this, the X in the main section never gets
updated.

X = 0
For Y = 1 to 20
   Call Increment(X)
Next Y
Print X

Sub Increment (Number)
   Number = Number + 1
End Sub

Modern Basics let you ditch the line numbers, and even the end statement in
this case, as the Subroutine will not execute by itself, it needs to be
called.  Personally, I find this easier to read.  To get the variable X to
increment, we need to pass the variable thru.  When the Call Increment(X)
line is run, the value is passed to the subroutine.  The subroutine creates
a copy (which I've called Number to show it's really a different variable),
adds 1 to it, and this updated value is passed back to the main loop,
replacing the previous value of X

The Exit Sub lets you terminate a Subroutine early.

Sub Increment (Number)
   If Number >= 10 Then
       Exit Sub
   Else        
       Number = Number + 1    End If
End Sub

Silly example, but no matter how many times you call the routine, it won't
increment beyond 10.  The "Number = Number + 1" line doesn't run.  It has a
possible bug, in that if you pass 15, for example, it will return 15.
Should it reset to 10?

This technique lets you create little chunks of code (similar to macros),
and drop them into your programs with the knowledge that you won't have
double ups in variable names to cause problems (unlike macros).

In truth, the Sub should have been a Function, but that's a minor(ish)
quibble.

Pascal is similar to structured Basic (in reality, the reverse is true), and
has a few more nice features.  That said, if you understand Basic, then
Pascal is not a problem.  Given a C listing (without pointers), you should
be able to muddle your way thru understanding that too.

Tony

2006\08\17@171024 by Gerhard Fiedler

picon face
Tony Smith wrote:

> Pascal is not a problem.  Given a C listing (without pointers),

And without macros...

> you should be able to muddle your way thru understanding that too.

Gerhard

2006\08\17@173927 by Tony Smith

picon face
> > Hmm.  Scratches head.  Really?  Why's that then?  
> >
> > I've used 'code by flowchart' tools.  And certainnly drawn enough
> > flowcharts for programs (big ones too, 90 pages in one case, bleh).
> >
> Well I believe you, every structured program can be drawn as a flowchart
(at
> least I think), but not every flowchart can be translate into
> a structured language, simple because a structured language
> doesn't support "GOTO".
>
> So indeed a analytical person will be able to make good
> designs with flowcharts ;-)


You don't need GoTo, even on a flowchart.

I'll agree code --> flowchart could be a bit hard, but I can't really see
why the reverse wouldn't work.

The 90 page flowchart actually detailed a system written in an unstructured
language.  It was horrible.  The slowness of basic with the friendliness of
assembly.

It didn't really have variables, just registers, like @1, @2 up to @1000.
So what I did was divided them into groups, and each group had a set role.
@1-@99 were for config, @100-@110 was scratchpad, etc and a library routine
got its own block, eg @900-@920.  So calling a routine meant copying
variables, calling, then copying them back.  It beat the alternative.

For the flowchat, each page represented a routine, so page 1 had the main
loop.  Each call represented another page, so you could treat the pages as a
stack.  Took me the best part of week to draw, dang client wanted it.  I
hope they liked it.

The language had GoTo, but I never used it, I treated it as a while loop
end.

Reminds me of an old version of basic that could do self modifying code.
Sort of.  Normally Goto needs a line number (or label), but this one could
have a variable, the contents of the variable determine the jump line.  So
"Goto X" depended on what X equaled.  Scary stuff.  Gosub too, so "Gosub X,
A, B, C" was possible.  Ha, debug that!

Fairly sure it was an early DOS Basic.  I did make use of it, and was upset
when it vanished.  I will now go and stand out in the cold, and hit myself
with a stick for having such unclean thoughts.


{Quote hidden}

You should use Visio as the front-end  :)

I thought a flowchart would have easier than a FSM to convert to code, it's
just box = line of code.  Interesting stuff.  Having the Case statement made
your life easier.

Tony

2006\08\17@174421 by Tony Smith

picon face

> Tony Smith wrote:
>
> > Pascal is not a problem.  Given a C listing (without pointers),
>
> And without macros...
>
> > you should be able to muddle your way thru understanding that too.
>
> Gerhard


Yeah, them too!  I guess I should mention Pascal's in-line assembly code -
that stops most people dead.  He he he.  That one's a job saver.

Tony

2006\08\17@174444 by peter green

flavicon
face

> *unrestricted* flowcharts (where arrows can point everywhere can not be
> translated (directly) to strutured programming constructs (while, for,
> if, *no* goto). Note that such a flowchart *can* be translated to a
> language that allows GOTOs.
they can be translated into block based languages too its just you have to
introduce a state variable and the results are rather messy ;)

allocate each block on the flowchart a number then do the following (in this
example state 1 is the first block and state 0 represents program exit).

int state =1
while (state != 0) {
 switch state{
   case 1
     //do stuff
     //set next state
     break;
   case 2
     //do stuff
     //set next state
     break;
.................................
   case 50
     //do stuff
     //set next state
     break;
 }
}

2006\08\17@175414 by peter green

flavicon
face

> called BASIC.  When people sneer at Basic, this is what they are referring
> to.
we sneer at those yes but at least they had a good excuse given the current
state of home computer technology.

but at least some modern basics are still pretty bad. VB can't even do
function pointers (well it can get a function pointer from a function but it
has no way to call through it so its only usefull for passing as a parameter
to external dlls). it has a very screwy object model (when i tried it the
whole default perameters thing made it virtually impossible to tell if an
object reference was null), has terrible binary file handling (last i
checked it read a word at a time making it impossible to make files with odd
numbers of bytes and making it very slow) and generally feels like a peice
of crap.

are other basics better than VB in theese regards?

2006\08\17@181717 by stef mientki

flavicon
face

>
> You should use Visio as the front-end  :)
>  
Visio isn't free and not fully controlable ...
... I've chozen Diagram Designer, because it's open source.
Can Visio draw electronic circuits, vero board design ?
Diagram designer (at least within JALcc) can !

cheers,
Stef

2006\08\17@181818 by Tamas Rudnai

face picon face
Fair enough, however, I would say it is not even a Basic, it is like you
would say Pascal instead of Jal. It is the same with Visual Basic -- I can't
even see the relation. For me Basic is with the numbered lines with all the
goods with it without the need to understanding the structured programming,
variable scopes, predeclared variables etc. And of course Basic for me is
always an interpreted language however, I know it would be very hard to be
implemented in a PIC (maybe with a series of CALL instructions to the
relevant library functions, I really do not know). Anyway, your
implementation may will be a much better language than I have ever seen, so
I keep my eyes on it -- I mean it.

BTW, if I would like to be honest I like Pascal much more than C -- well,
Turbo Pascal, because the original Pascal by prof. Wirth is useless for real
purposes. Most of the security issues in the existing computer industry are
coming from the heritage of the C and the common architecture / calling
conventions they use for implementing it. At least Pascal stores strings by
having the size in front of the string, while C has that bloody '\0' at the
end -- which may not be there, may not be counted by the programmer so that
not enough memory space occupied etc. Also in C there is no bit rotation
just a shift which is really annoying sometimes. In addition C acts like a
structured language, while still have goto, break and continue in it -- but
has no proper way to exit from iterations to be able to implement different
exit handlers. I mean from a for or while there is only one way to exit even
if you use multiple breaks and after the iteration you have to check why it
had been exited -- with an assembly it is no problem for doing that at all
-- well, Pascal can't do it either. In C you cannot even break from a nested
iteration etc. OK, I stop it :-) but C is not an efficient language for low
level programming and C++ even worse.

Tamas


On 17/08/06, Tony Smith <spamBeGoneajsmithSTOPspamspamEraseMErivernet.com.au> wrote:
{Quote hidden}

> -

2006\08\17@182313 by John Scott

flavicon
face
With respect to all Basic compilers, Im not sure if any are really great
for complex application development. There are however a few good Linux
projects like Gambas / Phoenix etc that are pretty good.

This conversation was not so much about Basic compilers, as about Basic
compilers for the PIC. There are a few offerings available, and theyre
mostly really good. They're about as complex as they need to be,
offering all or most standard Basic commands, while the authors have
written many useful PIC specific functions like PWM, I2C, ADC, CAN,
Ethernet, Compact Flash etc.

This makes Basic a viable programming language for PIC MCU's  and allows
access to complex applications for relatively inexperienced programmers.

Check some of them out:

My favourite: *Proton IDE* | *Proton* Development Suite
http://www.picbasic.org/*proton*_*ide*.php <http://www.picbasic.org/proton_ide.php>
Mikrobasic
www.mikroelektronika.co.yu/english/product/compilers/mikrobasic/index.htm
PicBasic Pro http://www.microengineeringlabs.com/pbpdemo.htm

Regards
John


peter green wrote:
{Quote hidden}

2006\08\17@183925 by Jack Smith

picon face

>
> This makes Basic a viable programming language for PIC MCU's  and allows
> access to complex applications for relatively inexperienced programmers.
>
> Check some of them out:
>
> My favourite: *Proton IDE* | *Proton* Development Suite
> http://www.picbasic.org/*proton*_*ide*.php <http://www.picbasic.org/proton_ide.php>
> Mikrobasic
> www.mikroelektronika.co.yu/english/product/compilers/mikrobasic/index.htm
> PicBasic Pro http://www.microengineeringlabs.com/pbpdemo.htm
>
> Regards
> John
>  
>
Agreed. There's a really first-class BASIC that will be released in
November, Swordfish, (some details at
http://www.sfcompiler.co.uk/swordfish/)

It's for 18F devices only, and I can't say enough good things about it.
I'm close to shipping a reasonably complicated PIC-based device with the
code 100% Swordfish. (Started with the alpha test compiler and am now
onto the beta compiler.) You can see my project at
http://www.cliftonlaboratories.com. A long time friend has used Swordfish beta
version to develop his PIC-based wattmeter, and you can see it at
http://www.telepostinc.com. Telepostinc's LP100 wattmeter has been shipping for
a two or three months now.

Jack

2006\08\17@184236 by stef mientki

flavicon
face

> This makes Basic a viable programming language for PIC MCU's  and allows
> access to complex applications for relatively inexperienced programmers.
>
> Check some of them out:
>
> My favourite: *Proton IDE* | *Proton* Development Suite
> http://www.picbasic.org/*proton*_*ide*.php <http://www.picbasic.org/proton_ide.php>
> Mikrobasic
> www.mikroelektronika.co.yu/english/product/compilers/mikrobasic/index.htm
> PicBasic Pro http://www.microengineeringlabs.com/pbpdemo.htm
>
>  
And don't forget Myke Predko Basic87x,
not suited for members of this list,
but you really will be surprised,
seeing how fast newbies / children / and even almost non-technicians,
can handle this language + hardware, given a good environement (yes
again JALcc ;-)
http://oase.uci.kun.nl/~mientki/data_www/pic/jalss/basic_87x__terminal.html

cheers,
Stef

2006\08\17@191231 by Tony Smith

picon face
> > called BASIC.  When people sneer at Basic, this is what they are
> > referring to.
> we sneer at those yes but at least they had a good excuse
> given the current state of home computer technology.
>
> but at least some modern basics are still pretty bad. VB
> can't even do function pointers (well it can get a function
> pointer from a function but it has no way to call through it
> so its only usefull for passing as a parameter to external
> dlls). it has a very screwy object model (when i tried it the
> whole default perameters thing made it virtually impossible
> to tell if an object reference was null), has terrible binary
> file handling (last i checked it read a word at a time making
> it impossible to make files with odd numbers of bytes and
> making it very slow) and generally feels like a peice of crap.
>
> are other basics better than VB in theese regards?


Well, you got 0 / 3, so it's a bit hard to compare.

1. You can, but fiddly, and why?  Go use C++.

2. Using default properties is a bad habit.  Do that to check an object
status fails because you just initialised it.  Use "If object Is Nothing"
instead.

3. File handling hasn't changed much since IBM BasicA.  Open as Binary, and
use Input(#Bytes, File#) function.  What were you using?

I've seen people read files byte by byte too, and complain it's slow.  VB
handles 2 gigabyte long strings, so load the entire file in one hit.  Make
it a function to save typing.

       FileNumber = FreeFile
       Open "Binary.dat" For Binary As #FileNumber
               BinaryData = Input$(LOF(FileNumber), FileNumber)
       Close #FileNumber
       'do stuff to the BinaryData string

Or there's the FSO, but not guaranteed as some admins remove scripting.

A lot of VB sucks, but it's mainly people not using it right, as above.
Error handling springs to mind.  On Error Goto indeed.  I've seen people
write C++ programs to call VB DLLs, and then complain about it.  I mean,
WTF?  Or not understand what binary compatibility means.  

VB is for writing front ends for enterprise systems, that's what ActiveX is
about , not Internet stuff.  VB's main problem is you can't compile it to a
.Exe like you could back with DOS basics (PDS, not QB).  So DLLs need the
runtime, make it slow etc.  There's a 3rd party compiler available.

It also suffers from people hanging onto the old crap like Option Base and
Def.  VB6 should have been much better than what it was though.

The IDE was head & shoulder above everything else.  Not perfect, but it got
the neat stuff first.

There's Liberty Basic or RealBasic.  RealBasic was a free download for a
while.

With .Net it's a all moot point anyway.

Tony

2006\08\17@195610 by Tony Smith

picon face
{Quote hidden}

Basic with line numbers (BASIC) ended in the late '80s with the introduction
of Borland TurboBasic & Microsoft QuickBasic.  (You could get Microsoft
Pascal too!)

Yes, at that point Basic became like Pascal.  VB.Net is yet another jump.
VB has the 'Exit For' command to break out of loops, and has 2 gigabyte
strings.  All languages have their pluses & minuses.  It's a trade-off.

Have a look at the PicAxe, it literally is Basic on a PIC chip.  It's not
structured Basic, but the programs are fairly limited in size so it doesn't
matter.  No line numbers, so that's good.  It'll be fairly similar to COW.
More info: http://www.hippy.freeserve.co.uk/picaxe.htm.  They're a British
company, but you can get them all over the world.

Blinky light program, flash a LED on Pin 2:

   main:
       high 2
       pause 500
       low 2
       pause 500
       goto main

Tony

2006\08\17@201941 by John Scott

flavicon
face
Pixaxe is cool, but it uses a bootloader. The other Basic compilers I
mentioned before convert to assembly before compiling. Its just as quick
to blink an LED with Proton or PicBasic. Also, you can program assembly
in line, and at any time, pull up an assembly view of your program. The
thing I like about the Basic IDE's is that theyre really user friendly -
and the documentation is really good. It negates the need to know the
data sheet backward before implementing a function. Comes back to simply
Input, Process, Output. Less time is spent developing the software,
allowing more time for refinements, features and testing.

John

Tony Smith wrote:
{Quote hidden}

2006\08\18@010530 by William Chops Westfield

face picon face

On Aug 17, 2006, at 10:09 AM, Tamas Rudnai wrote:

> Some times ago Apple patented the mouse (by the time nobody
> else had that kind of device -- I mean the mouse with the
> ball). But the patent included that it has only one button

The Mouse was invented at SRI (1963!) (patent US3541541.)  The
"ball mouse" was invented in the early 70s at Xerox PARC.  It was
in use on (ie) Xerox Altos long before the Mac came into existence.
Apple might have patented some specifics to one-button mice
(legitimately novel ideas, even...)

See wikipedia.

BillW

2006\08\18@022628 by William Chops Westfield

face picon face

On Aug 17, 2006, at 4:55 PM, Tony Smith wrote:

> Yes, at that point Basic became like Pascal.

Heh.  Even GWBasic (still with line numbers) was pretty far
beyond the types of BASIC that people sneered at.  I mean,
it had ELSE.  It had variables names beyond "Z9".  It had
integers and functiondefs.  I first learned programming using
a basic that didn't have ELSE.  Very painful.  (at least it
no longer required the LET keyword on assignments, IIRC.)

There's probably a lesson here somewhere about not standardizing
a language too early.  BASIC survives today by pretty much ignoring
the original basic language spec and doing what people wanted.
C survives because it rode the tides.  More strongly standardized
languages (Pascal, Cobol, Fortran, PL/1, APL) have died, mutated
into things with different names, or resigned themselves to niches.

BillW

2006\08\18@083248 by Gerhard Fiedler

picon face
William ChopsWestfield wrote:

> There's probably a lesson here somewhere about not standardizing
> a language too early.  BASIC survives today by pretty much ignoring
> the original basic language spec and doing what people wanted.

I'm not sure it makes sense to speak of "the BASIC language has survived".
It's more the name that has survived, not the language. I don't see that
VB.NET is any closer to the original BASIC than Delphi to Pascal. Or C99 to
K&R C.

I think one of the reasons for the extremely widespread adoption of C is
its reasonable standardization. With a dialect mess a la BASIC, C wouldn't
be what it is today. With BASIC, your problem is not to move from one
platform to the other, it is to move from one compiler to the other.

> C survives because it rode the tides.  More strongly standardized
> languages (Pascal, Cobol, Fortran, PL/1, APL) have died, mutated
> into things with different names, or resigned themselves to niches.

I'm not sure, but I think that the COBOL and FORTRAN "niches" are probably
considerable. (Not sure how to measure this, but maybe in development
dollars spent in code that is in use somewhere?) They didn't make much of a
dent in the PC and embedded markets, but then they hadn't been created for
that environment. BASIC has been. You maybe can say that they didn't make
the move from mainframe to PC, but that's a different story.

IMO one of the main components of BASIC popularity is Microsoft's adoption
of it in the form of VB. Without VB, BASIC would be a niche language today,
much more niche than FORTRAN or COBOL. And this was a pretty much arbitrary
decision (arbitrary in terms of language, not in terms of business or
marketing). Delphi is similar in many respects (one is that Pascal would be
quite a niche language without it); it's just not quite as widespread
because it's not from Microsoft. (BTW, it is my impression that Delphi is
much less common in the USA than elsewhere, more specifically Brazil and
Europe.)

Gerhard

2006\08\18@093052 by Paul James E.

picon face

Stef,

Yes, actually it can.   I have even drawn 3D drawings with Visio, much
to the engineers amazement.   He just couldn't figure out how I was
drawing a 3D perspective drawing with a 2D package.

                                         Regards,

                                           Jim



{Quote hidden}

> --

2006\08\18@100913 by John Scott

flavicon
face
And - dont forget that Delphi is a far superior language to VB.

I had issues trying to compile a C program for a Symbol handheld barcode
reader. The stipulation from their end was that only Visual C ver 1.5
would work. I thought Blah - and decided to try a number of C compilers,
both free and non-free. Well, to cut a long story short - the scanner
has been scrapped for a newer model, because of 2 libraries that they
used which are specific to Visual C - and not backward compatible....VC
6.0 didnt work - and VC 1.5 is like hens teeth....

These libraries do not exist in any other C compiler that I could find.

Regards

Gerhard Fiedler wrote:
{Quote hidden}

2006\08\18@140154 by Stef Mientki

flavicon
face
Jim,

some illusions are really great,
http://www.grand-illusions.com/images/articles/opticalillusions/dragon_illusion/dragon.pdf

cheers,
Stef

Paul James E. wrote:
{Quote hidden}

>> --

2006\08\18@145452 by David VanHorn

picon face
>
> Reminds me of an old version of basic that could do self modifying code.
> Sort of.  Normally Goto needs a line number (or label), but this one could
> have a variable, the contents of the variable determine the jump line.  So
> "Goto X" depended on what X equaled.  Scary stuff.  Gosub too, so "Gosub
> X,
> A, B, C" was possible.  Ha, debug that!



Piffle..

Go to Verifone's page, and pull the docs for their TCL language.
I used to write, and debug self-modifying code written in that, by people
who weren't programmers!

2006\08\18@151722 by M. Adam Davis

face picon face
Fortunately self-modifying code is rarely necessary or useful.  AI
seems to be the area where it's most useful (aside from viruses).

Newer processors throw exceptions when memory marked "code" is
modified, and memory marked "data" is executed, so it's becoming
harder to write native self modifying code.  Still, interpretted
languages don't receive any benefit to either protection so they may
still be self modifying.  (Actually there is nothing to flag "code"
and "data", but the processor can have fine grain memory block read,
write, and execute exceptions that when handled by a good OS will
yield the same effective result)

I do recall one GWBASIC program that truly was self modifying - it
located the area the code was stored in memory and altered itself as
it was running, nevermind the aformentioned goto x, a, b, c commands
(which are really nothing more than switch and select case control
statements anyway)

IIRC, it was a proof of concept, rather than fulfilling a useful need
in the program.

-Adam

On 8/18/06, David VanHorn <KILLspamdvanhornspamBeGonespammicrobrix.com> wrote:
{Quote hidden}

> -

2006\08\18@152218 by Wouter van Ooijen

face picon face
> > Reminds me of an old version of basic that could do self
> modifying code.
> > Sort of.  Normally Goto needs a line number (or label), but
> this one could
> > have a variable, the contents of the variable determine the
> jump line.  So
> > "Goto X" depended on what X equaled.  Scary stuff.  Gosub
> too, so "Gosub
> > X,
> > A, B, C" was possible.  Ha, debug that!

On my first sort-of job (In was still at the university) when had to
interafce to a hospital laboratory administration system. It was a Wang
minicomputer, running line-oriented Basic. It had a (very often used)
MERGE command to load the text of a program into the memory, *merging
line-wise it with the current program in memory*. The programmers who
had written the system were no quiche eaters, they often used this
technique to put new lines inbetween the lines of the current program.
Debug that, mister Holmes!

The programmers had long left (Wang had done this as a pilot, but the
product was never marketed). There was an old lady who more or less kept
the system going. She knew nothing of programming, but for every problem
that had occured in the past she had written down the symptom and the
cure as given to here by the original programmers. Which was often
something like "delete lines 840 .. 960; merge phase3.bas". When a
problem ocurred she just started trying cures (ignoring the symptoms)
untill she found one that seemed to work.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu



2006\08\18@155704 by David VanHorn

picon face
In this case, you are building code to interpret a response packet, based on
the response packet.  It is a useful technique.

The language itself is pretty cryptic, and all jumps/calls are absolute.
If you change the length of a routine, then uncorrected jumps will go to the
wrong places, unless you fix it in advance.

B1.1  ;select buffer 1
G      ;clear it
J'BCAKE'  ;append time of day (obvious, isn't it?)
V1.1.1.1   ;Display
R            ;Append field separator
M           ;Get magstripe data
N           ;Print it

That sort of thing.

Throw in some subroutine calls, and some skip (In) commands, and it gets
interesting real fast.

Lots of dead code typically, data storage can overwrite code, and if you
left off any of those semicolons in front of the comments, then it would
cheerfully execute your comments, with amusing results.

Now add to the fun, other people sticking their applications in, and
overwriting locations that you were storing code/data in... What fun!

Now tangle about 30k of that mess up good, and send it in the form of a raw
dump of the terminal's memory to me for debugging.

2006\08\18@170048 by Tony Smith

picon face
> > You should use Visio as the front-end  :)
> >  
> Visio isn't free and not fully controlable ...
> ... I've chozen Diagram Designer, because it's open source.
> Can Visio draw electronic circuits, vero board design ?
> Diagram designer (at least within JALcc) can !


You're right about Visio not being free, relatively few people have it
installed.  I think you need to get the full Office suite or buy it
separately.

It is fully controllable, as with all of the Office apps you can use them as
components.  You don't need to use VBA.  Everything can be fiddled with,
from the menus to the VBA IDE.

It does have a library of electonic components, so circuits diagrams are
possible, but no engineer would use it, unless their regular software caught
fire or something.

Tony

2006\08\18@171840 by Gerhard Fiedler

picon face
Tony Smith wrote:

>> Visio isn't free and not fully controlable ...

> You're right about Visio not being free, relatively few people have it
> installed.  

FWIW, Microsoft provides a free Visio viewer.

Gerhard

2006\08\18@171856 by Tamas Rudnai

face picon face
Well, self modifying codes are still widely used in the Windows system. One
of the good example is Microsoft itself that patches back the code after
resolving kernel API addresses. Other examples are the exepackers that
compresses the code, data and resources to achieve smaller file on the disk
and they uncompress the code automatically when it spawned. Most of them not
just creates a new code segment for that but also after the uncompression do
the hard job on relocating the code (patches the code with API addresses
that normally done by the operation system). Also some people things that a
code can be hidden from the trained eyes so they use executable encryptors
that basically do the same, except some of them continuously decrypts and
the reencrypts the code to avoid the situation when the entire code is
unencrypted in memory. Some others use hardware keys that calculates
addresses or decrypts parts of the code using public keys. And yes, viruses,
trojans, spywares and adwares uses code patching as well as some rootkits.

But I agree that is not useful (maybe with some very tricky way when the
timeing is absolute critical and there is no other way to do it. But it is
not all about the good OS, it is about the language you use (the C and its
heritage -- basically all exploits are about how to alter the data) and also
the architect -- see how hardward architect is better on that then this John
von Neumann thing. Never mix code / data and stack (as most of the exploits
are about to modifying data on stack and execute code on stack, just very
few of them about to modifying data on heap to overwrite jump tables or to
trick the program to jump to places within itself that normally would not).

Tamas


On 18/08/06, M. Adam Davis <EraseMEstienmanspamEraseMEgmail.com> wrote:
{Quote hidden}

2006\08\18@172235 by David VanHorn

picon face
>
> It does have a library of electonic components, so circuits diagrams are
> possible, but no engineer would use it, unless their regular software
> caught
> fire or something.


That was the funniest thing I've heard all day!

?What, no visio to eagle translator??  :)

2006\08\18@172235 by David VanHorn

picon face
>
> It does have a library of electonic components, so circuits diagrams are
> possible, but no engineer would use it, unless their regular software
> caught
> fire or something.


That was the funniest thing I've heard all day!

?What, no visio to eagle translator??  :)

2006\08\18@172707 by Tamas Rudnai

face picon face
But you can't use it as an interface, can you?

Tamas


On 18/08/06, Gerhard Fiedler <spamBeGonelistsspamKILLspamconnectionbrazil.com> wrote:
{Quote hidden}

> -

2006\08\18@181057 by Tony Smith

picon face
> > Yes, at that point Basic became like Pascal.
>
> Heh.  Even GWBasic (still with line numbers) was pretty far
> beyond the types of BASIC that people sneered at.  I mean, it
> had ELSE.  It had variables names beyond "Z9".  It had
> integers and functiondefs.  I first learned programming using
> a basic that didn't have ELSE.  Very painful.  (at least it
> no longer required the LET keyword on assignments, IIRC.)


Z9 style variables, that was Apple as well, wasn't it?  

To compare Dartmouth BASIC with VB.Net is a bit of a stretch...  I wonder if
anyone ever used True Basic.  

Compared to the current languages, all old stuff sucks to a certain degree.
It's a bit like sneering at Fords because your great-grandpappy didn't like
the Model-T.  Like the previous 'VB sucks' poster whose problems were mainly
due to a lack of RTFM.

Tony

2006\08\18@181927 by Gerhard Fiedler

picon face
Tamas Rudnai wrote:

> But you can't use it as an interface, can you?

You mean to talk to the Visio COM interfaces? I don't know, but I don't
think so.

Gerhard

2006\08\18@183500 by Tony Smith

picon face
> > Reminds me of an old version of basic that could do self
> modifying code.
> > Sort of.  Normally Goto needs a line number (or label), but
> this one
> > could have a variable, the contents of the variable
> determine the jump
> > line.  So "Goto X" depended on what X equaled.  Scary stuff.  Gosub
> > too, so "Gosub X, A, B, C" was possible.  Ha, debug that!
>
>
> Piffle..
>
> Go to Verifone's page, and pull the docs for their TCL language.
> I used to write, and debug self-modifying code written in
> that, by people who weren't programmers!


Have the headaches stopped?

I last used TCL back in the early '80.  Can't say I miss it all that much,
but I never even did any self-modifying code with it.  

You can do self-modifying code with VBA in much the same way, re-write the
source and start again.  Not quite the same thing as changing it on the fly
in memory.  Can't remember how COBOL did it.  Not a good idea, but possible.

Tony

2006\08\18@183500 by Tony Smith

picon face
> > Reminds me of an old version of basic that could do self
> modifying code.
> > Sort of.  Normally Goto needs a line number (or label), but
> this one
> > could have a variable, the contents of the variable
> determine the jump
> > line.  So "Goto X" depended on what X equaled.  Scary stuff.  Gosub
> > too, so "Gosub X, A, B, C" was possible.  Ha, debug that!
>
>
> Piffle..
>
> Go to Verifone's page, and pull the docs for their TCL language.
> I used to write, and debug self-modifying code written in
> that, by people who weren't programmers!


Have the headaches stopped?

I last used TCL back in the early '80.  Can't say I miss it all that much,
but I never even did any self-modifying code with it.  

You can do self-modifying code with VBA in much the same way, re-write the
source and start again.  Not quite the same thing as changing it on the fly
in memory.  Can't remember how COBOL did it.  Not a good idea, but possible.

Tony

2006\08\18@183551 by Tony Smith

picon face
> I'm not sure it makes sense to speak of "the BASIC language
> has survived".
> It's more the name that has survived, not the language. I
> don't see that VB.NET is any closer to the original BASIC
> than Delphi to Pascal. Or C99 to K&R C.
>
> IMO one of the main components of BASIC popularity is
> Microsoft's adoption of it in the form of VB. Without VB,
> BASIC would be a niche language today, much more niche than
> FORTRAN or COBOL. And this was a pretty much arbitrary
> decision (arbitrary in terms of language, not in terms of
> business or marketing). Delphi is similar in many respects
> (one is that Pascal would be quite a niche language without
> it); it's just not quite as widespread because it's not from
> Microsoft. (BTW, it is my impression that Delphi is much less
> common in the USA than elsewhere, more specifically Brazil and
> Europe.)


Also when the 'home computer' industry started, Basic was on practically
every one of those machines.  After all, that's how Bill Gates got started,
he was first with Basic for the Altair.  It's no surprise that Microsoft
pushes Basic, even if just in name alone these days.  Even that's done
half-heartedly.

MS Office helps with VBA, the VBA engine appears in a surprisingly large
number of products, including non-MS, such as AutoCAD.

IIRC, there was a licencing issue with USCD Pascal, there was a case where
the licence got pulled, leaving a few people upset.  That wouldn't have
helped it spread.

Practically every language survives in a little niche somewhere, I did Y2K
work on a Borland Pascal system.  Still plenty of COBOL out there.  

Almost all of those hand-held bar code scanners have some sort of Basic
variant in there.  I always liked these -
http://www.microassociates.net/mars-electronics/meq-300.html.

Same Mars as makes the chocolates.  The keypad rotates 180 degrees for
left/right hand use, optical RS232 (+ a 9-pin), battery in the handle so it
had a nice balance.

Tony

2006\08\18@183915 by Tony Smith

picon face
> On 18/08/06, Gerhard Fiedler <.....listsspam_OUTspamconnectionbrazil.com> wrote:
> >
> > Tony Smith wrote:
> >
> > >> Visio isn't free and not fully controlable ...
> >
> > > You're right about Visio not being free, relatively few
> people have
> > > it installed.
> >
> > FWIW, Microsoft provides a free Visio viewer.
> >
> > Gerhard
> >
> But you can't use it as an interface, can you?
>
> Tamas


No, the viewers don't support VBA, nor let you change the file (obviously),
nor act as a component for other programs.

Tony

2006\08\18@190928 by David VanHorn

picon face
> I last used TCL back in the early '80.  Can't say I miss it all that much,
> but I never even did any self-modifying code with it.


Not THAT tcl.. Verifone's.  That didn't exist till about 84-85.

2006\08\18@234138 by Robert Ammerman

picon face
> You can do self-modifying code with VBA in much the same way, re-write the
> source and start again.  Not quite the same thing as changing it on the
> fly
> in memory.  Can't remember how COBOL did it.  Not a good idea, but
> possible.


010-SOME-PARAGRAPH.
       GOTO  020-SOME-OTHER-PARAGRAPH.



-- someplace else in the program --

       ALTER 010-SOME-PARAGRAPH TO PROCEED TO 030-YET-ANOTHER-PARAGRAPH.


Yech!

Bob Ammerman
RAm  Systems

2006\08\19@085011 by Howard Winter

face
flavicon
picon face
Bob,

On Fri, 18 Aug 2006 23:40:55 -0400, Robert Ammerman wrote:

{Quote hidden}

Indeed!  When I was a newly-trained COBOL programmer (over 30 years ago) the first thing I was told was that in our firm ALTER ...TO PROCEED TO
was absolutely banned, and what would happen to my gonads if I ever used it!  :-)

Having tried to debug other peoples' code where they tried to get clever, and didn't say what they were doing or why, even without self-modifying
code, I agree completely.  I always told new members of my team that any program in a live environment is likely to have much more time spent
reading it than it took to write, so saving yourself time at the expense of understandability is not only terribly selfish but counter-productive.  And
would elicit a similar gonad-retribution from me!  :-)

Cheers,


Howard Winter
St.Albans, England


2006\08\23@094842 by Paul James E.

picon face

Stef,

I printed this, cut it out and assembled it per the instructions.
It's been on my desk for about 30 - 40 minutes, and already 4 people have
commented on it, ranging from "Cute" to "What the hell is that?
And if you follow the instructions about viewing it, it really does look
realistic.  Very neat illusion.  

Thanks for sending it to me.

                                         Regards,

                                           Jim


> Jim,
>
>some illusions are really great,
> http://www.grand-
illusions.com/images/articles/opticalillusions/dragon_illusion/dragon.pdf
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...