RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

A forum for users of EhBASIC (Enhanced BASIC), a portable BASIC interpreter for 6502 microcomputers written by Lee Davison.
Post Reply
Martin_H
Posts: 837
Joined: 08 Jan 2014

RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

Post by Martin_H »

I just tried the ASCII Mandelbrot BASIC example from the RC2014 Gitgub repo and it works unmodified in EhBasic. Here's a link:

https://github.com/RC2014Z80/RC2014-BAS ... brot/Ascii

I plan to time it on my 1 MHz 65c02 and compare it to my Forth version.
Last edited by Martin_H on Thu Dec 29, 2016 3:25 pm, edited 1 time in total.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: RC2014 ASCII Mandlebrot BASIC Example Runs in EhBasic

Post by BigDumbDinosaur »

Martin_H wrote:
I just tried the ASCII Mandlebrot BASIC example from the RC2014 Gitgub repo and it works unmodified in EhBasic. Here's a link:

https://github.com/RC2014Z80/RC2014-BAS ... brot/Ascii

I plan to time it on my 1 MHz 65c02 and compare it to my Forth version.
A little fine-tuning of the program may yield a little more performance. Some statements can be combined on a single line of code, which reduces the amount of work the interpreter has to do in following the internal line links.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: RC2014 ASCII Mandlebrot BASIC Example Runs in EhBasic

Post by Martin_H »

The elapsed execution time was 21 minutes 48 seconds and produced this output:

Code: Select all

...............................,,,,,,,,,,,,,,,,,...............................
...........................,,,,,,,,,,,,,,,,,,,,,,,,,...........................
........................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,........................
......................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,......................
....................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....................
..................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,~~..................
.................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,';~~'.................
................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~~~''~................
..............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~~~''~',,..............
.............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~~~~''~',,,,.............
............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'^~~~''~',,,,,,............
...........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'!~~~''!'',,,,,,,...........
..........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~!~~!'';'',,,,,,,,,..........
.........''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,''^!~~:~~^!',,,,,,,,,,,.........
........''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~:!~~^~~!^'',,,,,,,,,,,,........
........''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,'':!!~~^~~^!'',,,,,,,,,,,,,........
.......!^~''''''',,,,,,,,,,,,,,,,,,,,,,,,,''~[!!~!;~~^!'',,,,,,,,,,,,,,,.......
......''!:~''''''''',,,,,,,,,,,,,,,,,,,'''~//!!!!:~~^:~'',,,,,,,,,,,,,,,,......
.....'''^!:~~'''''''''',,,,,,,,,,,,,''''~<;^!!!;:~~^!;'',,,,,,,,,,,,,,,,,,.....
.....''''^!:~~~''''''''''''''''''''''~~ : :!!!#:!~;!:''',,,,,,,,,,,,,,,,,,.....
....''''''^![!~~~~'''''''''''''''~~~~?[ &&::;/:^!:O!~'',,,,,,,,,,,,,,,,,,,,....
....''''''';![!~~~~~~~~~~~~~~~~~~~~/x       ?; /:/ &''',,,,,,,,,,,,,,,,,,,,....
...,'''''''':![^~~~~~~~~~~~~~~~~! O         <  :?<[~''',,,,,,,,,,,,,,,,,,,,,...
...,''''''''<:!<^!~~~~~~~~~~~~!:             [x?X^ '''',,,,,,,,,,,,,,,,,,,,,...
..,,,''''''''<:!?^!~~~~~~~~~!^;                 /[&''',,,,,,,,,,,,,,,,,,,,,,,..
..,,,''''''''<::!?;^!!~~~~!!^^                  /:^''',,,,,,,,,,,,,,,,,,,,,,,..
..,,,''''''''':::! /^^^!!!^^^[                  [:;''',,,,,,,,,,,,,,,,,,,,,,,..
.,,,''''''''''!: :: ?;^^^^^:/                    : ~''',,,,,,,,,,,,,,,,,,,,,,,.
.,,,''''''''''!x[ :/<<[;;;;&                      : ~'',,,,,,,,,,,,,,,,,,,,,,,.
.,,,'''''''''''<     <?<//&                       <^</!,,,,,,,,,,,,,,,,,,,,,,,.
.,,'''''''''''!:      xxOx                         [ :^!,,,,,,,,,,,,,,,,,,,,,,.
,,,'''''''''''![                                    &:!~,,,,,,,,,,,,,,,,,,,,,,,
,,'''''''''''~!                                   [ ~~''',,,,,,,,,,,,,,,,,,,,,,
,,''''''''''~!!                                  X/~~'''',,,,,,,,,,,,,,,,,,,,,,
,~~~~~~'~~~~!!                                     ~'''''',,,,,,,,,,,,,,,,,,,,,
,~^~~~~~~~!!!                                       '''''',,,,,,,,,,,,,,,,,,,,,
~~~&^~~~!!!!?                                    &!!''''''',,,,,,,,,,,,,,,,,,,,
~~~^:^^!!!:<                                     <~~''''''',,,,,,,,,,,,,,,,,,,,
!![^&:;;::?                                    [!!~~~'''''',,,,,,,,,,,,,,,,,,,,
                                             &;:^!~~~''''''',,,,,,,,,,,,,,,,,,,
!![^&:;;::?                                    [!!~~~'''''',,,,,,,,,,,,,,,,,,,,
~~~^:^^!!!:<                                     <~~''''''',,,,,,,,,,,,,,,,,,,,
~~~&^~~~!!!!?                                    &!!''''''',,,,,,,,,,,,,,,,,,,,
,~^~~~~~~~!!!                                       '''''',,,,,,,,,,,,,,,,,,,,,
,~~~~~~'~~~~!!                                     ~'''''',,,,,,,,,,,,,,,,,,,,,
,,''''''''''~!!                                  X/~~'''',,,,,,,,,,,,,,,,,,,,,,
,,'''''''''''~!                                   [ ~~''',,,,,,,,,,,,,,,,,,,,,,
,,,'''''''''''![                                    &:!~,,,,,,,,,,,,,,,,,,,,,,,
.,,'''''''''''!:      xxOx                         [ :^!,,,,,,,,,,,,,,,,,,,,,,.
.,,,'''''''''''<     <?<//&                       <^</!,,,,,,,,,,,,,,,,,,,,,,,.
.,,,''''''''''!x[ :/<<[;;;;&                      : ~'',,,,,,,,,,,,,,,,,,,,,,,.
.,,,''''''''''!: :: ?;^^^^^:/                    : ~''',,,,,,,,,,,,,,,,,,,,,,,.
..,,,''''''''':::! /^^^!!!^^^[                  [:;''',,,,,,,,,,,,,,,,,,,,,,,..
..,,,''''''''<::!?;^!!~~~~!!^^                  /:^''',,,,,,,,,,,,,,,,,,,,,,,..
..,,,''''''''<:!?^!~~~~~~~~~!^;                 /[&''',,,,,,,,,,,,,,,,,,,,,,,..
...,''''''''<:!<^!~~~~~~~~~~~~!:             [x?X^ '''',,,,,,,,,,,,,,,,,,,,,...
...,'''''''':![^~~~~~~~~~~~~~~~~! O         <  :?<[~''',,,,,,,,,,,,,,,,,,,,,...
....''''''';![!~~~~~~~~~~~~~~~~~~~~/x       ?; /:/ &''',,,,,,,,,,,,,,,,,,,,....
....''''''^![!~~~~'''''''''''''''~~~~?[ &&::;/:^!:O!~'',,,,,,,,,,,,,,,,,,,,....
.....''''^!:~~~''''''''''''''''''''''~~ : :!!!#:!~;!:''',,,,,,,,,,,,,,,,,,.....
.....'''^!:~~'''''''''',,,,,,,,,,,,,''''~<;^!!!;:~~^!;'',,,,,,,,,,,,,,,,,,.....
......''!:~''''''''',,,,,,,,,,,,,,,,,,,'''~//!!!!:~~^:~'',,,,,,,,,,,,,,,,......
.......!^~''''''',,,,,,,,,,,,,,,,,,,,,,,,,''~[!!~!;~~^!'',,,,,,,,,,,,,,,.......
........''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,'':!!~~^~~^!'',,,,,,,,,,,,,........
........''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~:!~~^~~!^'',,,,,,,,,,,,........
.........''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,''^!~~:~~^!',,,,,,,,,,,.........
..........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~!~~!'';'',,,,,,,,,..........
...........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'!~~~''!'',,,,,,,...........
............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'^~~~''~',,,,,,............
.............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~~~~''~',,,,.............
..............,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~~~''~',,..............
................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'~~~''~................
.................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,';~~'.................
..................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,~~..................
....................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....................
......................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,......................
........................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,........................
...........................,,,,,,,,,,,,,,,,,,,,,,,,,...........................
...............................,,,,,,,,,,,,,,,,,...............................
ArnoldLayne
Posts: 109
Joined: 28 Dec 2014
Location: Munich, Germany
Contact:

Re: RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

Post by ArnoldLayne »

On my homebrew 65c02 machine, execution time of the unmodified program was 2.43 minutes @8MHz.
I then tried using INC COUNTER instead of COUNTER=COUNTER+1 in line 150 and got 2.35 minutes.
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

Post by Martin_H »

ArnoldLayne wrote:
On my homebrew 65c02 machine, execution time of the unmodified program was 2.43 minutes @8MHz.
I then tried using INC COUNTER instead of COUNTER=COUNTER+1 in line 150 and got 2.35 minutes.
That makes perfect sense as it is roughly 1/8 the time and your machine clocks 8 times faster. I bet my Forth version would finish in about 30 seconds on your machine.
ArnoldLayne
Posts: 109
Joined: 28 Dec 2014
Location: Munich, Germany
Contact:

Re: RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

Post by ArnoldLayne »

Martin_H wrote:
I bet my Forth version would finish in about 30 seconds on your machine.
I am really intrigued to test that, but unfortunately I do not have Forth running on my machine yet. But as soon as I do, I'll let you know.
Which Forth flavour would you recommend?
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

Post by Martin_H »

ArnoldLayne wrote:
Martin_H wrote:
I bet my Forth version would finish in about 30 seconds on your machine.
I am really intrigued to test that, but unfortunately I do not have Forth running on my machine yet. But as soon as I do, I'll let you know.
Which Forth flavour would you recommend?
An ANS Forth compliant version would be best, as that allows GForth programs to run unmodified.

I ported Tali Forth to my machine because it conforms to modern Forth syntax. Here's a link:

https://github.com/scotws/TaliForth
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

Post by BillO »

Forth is a neat idea, but on a 65C02 SBC without external storage how do you save CREATE d word definitions?

I suppose you could have them in a text file that is re-submitted every time you boot Forth. Or perhaps there is a method to save the RAM library?

My Forth concepts are a little rusty, so I may be missing something.
Bill
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

Post by GARTHWILSON »

You could save compiled images in a tiny flash module or something like that, but on my workbench computer, I just send it the source code every time I use it, and it compiles or assembles or interprets on the fly, as appropriate.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Martin_H
Posts: 837
Joined: 08 Jan 2014

Re: RC2014 ASCII Mandelbrot BASIC Example Runs in EhBasic

Post by Martin_H »

BillO wrote:
Forth is a neat idea, but on a 65C02 SBC without external storage how do you save CREATE d word definitions?

I suppose you could have them in a text file that is re-submitted every time you boot Forth. Or perhaps there is a method to save the RAM library?
I upload them from a file on a host computer over a serial link and let them be recompiled. I have an IEC port on my SBC, so one of these days I plan to get an SD2IEC working with Forth.
Post Reply