Hi,
I was looking for something simple to try out with my rather cumbersome (*) but all the same operational
PLASMA Virtual Machine running on the Pico6502. I chose to adapt the Apple][ version that appears above. So the code becomes
[edit] BTW "word" in
PLASMA means a 16-bit object.
Code:
byte[] Z = ".:,;-=+^/%&S$X#@ "
word A, B, C, D, E, F, I, P, Q, S, T, X, Y
F = 50
for Y = -12 to 12
for X = -49 to 29
C = X * 229 / 100
D = Y * 416 / 100
A = C; B = D; I = 1
repeat
Q = B / F; S = B - Q * F
T = (A * A - B * B) / F + C
B = 2 * (A * Q + A * S / F) + D
A = T; P = A / F; Q = B / F
if (P * P + Q * Q) > 4 break
fin
I++
until I >= 17
putc(Z[I])
next
putln
next
puts("FINISHED\n")
done
... which shows a part of the
PLASMA vocabulary. If I run the code through the linux VM, it gives this picture
Code:
......::::::::::::::::::::::,,,,,,,,,;;;;;-=+/S$+^--;;,,,,,,:::::::::::........
.......:::::::::::::::::::::,,,,,,,,,;;;--=%/$ ^^%-;;;;,,,,,:::::::::.........
........::::::::::::::::,,,,,,,,;;;,----==+ %==-;;;;,,:::::::::..........
........:::::::::::,::::,,,,,,,;;;-==++=^^/ %^+==----,,,,::::::..........
.....::::::::::::,,,,,,,,;;;;;;;--=^ &S% ^/^S=-;,::::::::::.......
...:::::::::::,,,,,,,,,,;;;;;;---++^ =;,,,,:::::::::.....
....:::::::::::,,,;;;---------===& %+--;;,,,:::::::......
.....::::::,,,,,,;;-=X++=^ +===+^% &&-;;,,,:::::::......
....::,,,,,,,,;;;;-=+% /$ #/^/% S-;;,,::::::::......
::::::,,,,,,;;;;;-==^/X # -;;,,,::::::::::::.
:::::,,,;;;;-----^/%& =-;;,,:::::::::::::.
::::,,;;--====+=/& $+-;;,,,,,,::::::::::.
::::, %^=--;;,,,,:::::::::::.
::::,,;;--====+=/& $+-;;,,,,,,::::::::::.
:::::,,,;;;;-----^/%& =-;;,,:::::::::::::.
::::::,,,,,,;;;;;-==^/X # -;;,,,::::::::::::.
....::,,,,,,,,;;;;-=+% /$ #/^/% S-;;,,::::::::......
.....::::::,,,,,,;;-=X++=^ +===+^% &&-;;,,,:::::::......
....:::::::::::,,,;;;---------===& %+--;;,,,:::::::......
...:::::::::::,,,,,,,,,,;;;;;;---++^ =;,,,,:::::::::.....
.....::::::::::::,,,,,,,,;;;;;;;--=^ &S% ^/^S=-;,::::::::::.......
........:::::::::::,::::,,,,,,,;;;-==++=^^/ %^+==----,,,,::::::..........
........::::::::::::::::,,,,,,,,;;;,----==+ %==-;;;;,,:::::::::..........
.......:::::::::::::::::::::,,,,,,,,,;;;--=%/$ ^^%-;;;;,,,,,:::::::::.........
......::::::::::::::::::::::,,,,,,,,,;;;;;-=+/S$+^--;;,,,,,,:::::::::::........
FINISHED
If I run it through the 6502 VM, I get this picture
Attachment:
File comment: Picot_6502 Mandelbrot
PLASMA_Mandelbrot.jpg [ 2.71 MiB | Viewed 703 times ]
(*) I can't give any timing for the moment, because the "Pico6502" VM is, in fact, the linux version pushed through cc65 - with stdio and all the rest of it - and it spends 80% of it's time messing around with the C stack and only 20% doing any real work. More news soon on a more "native" 6502 version.