----------8<-----{20180904-0502-GMT}----->8----------
New BASIC compiler for Prop1 and Prop2
Eric schafft das!
Ganz bestimmt!!!
Reinschauen, während die BASIC-Bits noch gemeißelt, gefeilt und poliert werden, kann man beispielsweise
im Log des Branchs "basic" der spin2cpp-Quelltextlagerstätte.
----------8<-----{20180904-0850-GMT}----->8----------
Code: Alles auswählen
$ ./fastspin
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2018 Total Spectrum Software Inc.
Version 3.8.8-beta Compiled on: Sep 4 2018
usage: ./fastspin
[ -h ] display this help
[ -L or -I <path> ] add a directory to the include path
[ -o ] output filename
[ -b ] output binary file format
[ -e ] output eeprom file format
[ -c ] output only DAT sections
[ -l ] output DAT as a listing file
[ -f ] output list of file names
[ -q ] quiet mode (suppress banner and non-error text)
[ -p ] disable the preprocessor
[ -D <define> ] add a define
[ -u ] ignore for openspin compatibility (unused method elimination always enabled)
[ -2 ] compile for Prop2
[ -O# ] set optimization level:
-O0 = no optimization
-O1 = basic optimization
-O2 = all optimization
[ -w ] compile for COG with Spin wrappers
[ --code=cog ] compile for COG mode instead of LMM
[ --fcache=N ] set FCACHE size to N (0 to disable)
...so weit keine großen Überraschungen.
Code: Alles auswählen
$ cat btest003.bas
class FDS input "FullDuplexSerial.spin"
dim ser as FDS
dim i as byte
ser.start(31, 30, 0, 115_200)
for i = 1 to 10
ser.dec(i)
ser.tx(13)
ser.tx(10)
next i
waitcnt(0)
Back dat!
Code: Alles auswählen
$ ./fastspin -O2 -L /opt/parallax.spin.src/spin btest003.bas
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2018 Total Spectrum Software Inc.
Version 3.8.8-beta Compiled on: Sep 4 2018
btest003.bas
|-FullDuplexSerial.spin
btest003.pasm
Done.
Program size is 1676 bytes
$ /opt/parallax/bin/spinsim -b btest003.binary
1
2
3
4
5
6
7
8
9
10
... da fehlt nun noch die Cogs sauber runterzufahren, damit SpinSim terminiert, aber diese Feinheit irgorieren wir jetzt mal... ok?
----------8<-----{20180904-1155-GMT}----->8----------
Code: Alles auswählen
class FDS input "FullDuplexSerial.spin"
dim ser as FDS
dim i as byte
ser.start(31, 30, 0, 115_200)
for i = 1 to 10
ser.dec(i)
ser.tx(13)
ser.tx(10)
next i
waitcnt(clkfreq+getcnt())
ser.stop()
...terminiert dann auch brav in SpinSim, aber warum "clkfreq" eine Variable zu sein scheint und "cnt" ansich nicht existiert, wohl aber als Funktion "getcnt()", das durchblick ich grad nicht wirklich und wer weiß, ob das nach weiteren Revisionen noch immer so sein wird. Wie Spins "<<" in BASIC heißt hab ich auch noch nicht raus, ansonsten hätt ich längst mit Fixpunktarithmetik rumgemacht... mwhuaaahaahahahaaaa...
***flöööt!***
----------8<-----{20180905-1130-GMT}----->8----------
Hmmmm.... ich seh auch nicht wo und wer da den Quarzplutimikator und die Quarzfreqenz setzt. Gear meint, das Kompilat sei für die typischen 5MHz mal 16 konfiguriert, aber das find ich nicht in der PASM-Ausgabe.
Vermutlich ist das Alles noch eher näher an einer Alpha- als einer Beta-Release, aber ich bleibe dabei: Eric schafft das! Ich werd ihn mal nicht mit Fragen bestürmen, sondern ihn einfach wuppen lassen...
----------8<-----{20180907-1612-GMT}----->8----------
Heiliges GOTO!!!
Code: Alles auswählen
$ cat moo.bas
yipyip:
print"Moo!"
goto yipyip
$ /opt/spin2cpp/src/spin2cpp.basic/build/fastspin -O2 moo.bas
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2018 Total Spectrum Software Inc.
Version 3.8.8-beta Compiled on: Sep 7 2018
moo.bas
moo.pasm
Done.
Program size is 500 bytes
$ /opt/spinsim/bin/spinsim -b moo.binary | head
Moo!
Moo!
Moo!
Moo!
Moo!
Moo!
Moo!
Moo!
Moo!
Moo!
...das "| head" sorgt nur für einen Abbruch nach 10 Zeilen.
----------8<-----{20180907-1621-GMT}----->8----------
Code: Alles auswählen
$ cat tinpb.bas
print"This is not PropBASIC!"
let x%=(1+2)*3
rem ^ ^
rem ...alles klar?
print"(1+2)*3=",x%
$ /opt/spin2cpp/src/spin2cpp.basic/build/fastspin -O2 -q tinpb.bas
$ /opt/spinsim/bin/spinsim -b tinpb.binary
This is not PropBASIC!
(1+2)*3=9
...eeendlich ein ordentlicher Ausdrucksparser!
----------8<-----{20180909-1133-GMT}----->8----------
Ich kann es einfach nicht lassen:
Code: Alles auswählen
$ cat mandelbrot16.bas
'
' translated to BASIC from mandelbrot16-20180406-fds.spin
'
'++
' I need printing without forced LF at the end, so:
'
class FDS input "FullDuplexSerial.spin"
dim ser as FDS
ser.start(31,30,0,115200)
'--
'++
' as constants
'
let xmin%=-8601
let xmax%=2867
let ymin%=-4915
let ymax%=4915
let maxiter%=32
let MPX%=79 ' 0..79
let MPY%=24 ' 0..24
let dx%=(xmax%-xmin%)/MPX%
let dy%=(ymax%-ymin%)/MPY%
let c4%=4<<12
'--
'++
' ...aaaaand action!
'
let cy%=ymin%
for py%=0 to MPY%
let cx%=xmin%
for px%=0 to MPX%
let x%=0
let y%=0
let iter%=0
while iter%=<maxiter%
' let x2%=(x%*x%)>>12
let x2%=ssr(x%*x%,12)
' let y2%=(y%*y%)>>12
let y2%=ssr(y%*y%,12)
if x2%+y2%>c4% goto breakwhile
' let y%=((x%*y%)>>11)+cy%
let y%=ssr(x%*y%,11)+cy%
let x%=x2%-y2%+cx%
let iter%=iter%+1
end while
breakwhile:
let cx%=cx%+dx%
ser.tx(iter%+32)
next px%
let cy%=cy%+dy%
ser.tx(13)
ser.tx(10)
next py%
'--
'++
' let FDS transmit potentially queued chars before shutdown
'
waitcnt(80_000_000+cnt)
ser.stop()
'--
'++
' signed shift right
'
function ssr(x%,n%)
if x%>=0 return x%>>n%
return -((-x%)>>n%)
end function
'--
$ /opt/spin2cpp/src/spin2cpp.basic/build/fastspin -O2 -L /opt/parallax.spin.src/spin mandelbrot16.bas
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2018 Total Spectrum Software Inc.
Version 3.8.8-beta Compiled on: Sep 8 2018
mandelbrot16.bas
|-FullDuplexSerial.spin
mandelbrot16.pasm
Done.
Program size is 2436 bytes
$ /opt/parallax/bin/spinsim -b mandelbrot16.binary
!!!!!!!!!!!!!!!"""""""""""""####################################""""""""""""""""
!!!!!!!!!!!!!"""""""""#######################$$$$$$$%'+)%%%$$$$$#####"""""""""""
!!!!!!!!!!!"""""""#######################$$$$$$$$%%%&&(+,)++&%$$$$$$######""""""
!!!!!!!!!"""""#######################$$$$$$$$$$%%%%&')*5:/+('&%%$$$$$$#######"""
!!!!!!!!""""#####################$$$$$$$$$$%%%&&&''),AAAAAAA,'&%%%%%$$$$########
!!!!!!!"""####################$$$$$$$$%%%&'())((())*-AAAAAA/+))('&&&&)'%$$######
!!!!!!""###################$$$$$%%%%%%&&&'+.AA=/;AAAAAAAAAAAAAAA/++A..;5%%$#####
!!!!!"################$$$%%%%%%%%%%&&&&'),+2AAAAAAAAAAAAAAAAAAAAAAAAA1(&&%$$####
!!!!"##########$$$$$%%&(-('''''''''''((*,5AAAAAAAAAAAAAAAAAAAAAAAAAAAA+)-&%$$###
!!!!####$$$$$$$$%%%%%&'(*-A1.+.A-4+))**AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4-(&%$$$##
!!!!#$$$$$$$$$%%%%%%'''++.6AAAAAAAAA8/0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3(%%$$$$#
!!!#$$$$$$$%&&&&''()/-7.5AAAAAAAAAAAAA>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'&%%$$$$#
!!!(**+/+<524/40046>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4+)'&&%%$$$$#
!!!#$$$$$$$%&&&&''().-2/AAAAAAAAAAAAAA?AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'&%%$$$$#
!!!!#$$$$$$$$$%%%%%&'''/,/7AAAAAAAAA;/0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0'%%$$$$#
!!!!####$$$$$$$$%%%%%&'(*-;2.,/>-5+))*+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4+(&%$$$##
!!!!"##########$$$$$%%&(,(''''(''''''((*-4AAAAAAAAAAAAAAAAAAAAAAAAAAA4+).&%$$###
!!!!!"################$$$%%%%%%%%%%&&&&'):,4AAAAAAAAAAAAAAAAAAAAAAAAA/('&%%$####
!!!!!!""##################$$$$$$%%%%%%&&&'*.AAA0AAAAAAAAAAAAAAAA1,,A//9)%%$#####
!!!!!!!"""####################$$$$$$$$%%%&(())((()**-AAAAAA/+)))'&&&')'%$$######
!!!!!!!!""""#####################$$$$$$$$$$%%%&&&''(,AAAAAAA+'&&%%%%%$$$########
!!!!!!!!!"""""#######################$$$$$$$$$$%%%%&')*8A0+('&%%%$$$$$#######"""
!!!!!!!!!!!"""""""######################$$$$$$$$$%%%&&(+-).*&%$$$$$$######""""""
!!!!!!!!!!!!!"""""""""#######################$$$$$$%%'4(%%%$$$$$######""""""""""
!!!!!!!!!!!!!!!""""""""""""#####################################""""""""""""""""
$ █
Ein das Vorzeichen erhaltendes Shift-Right gibt es leider noch nicht.
FIX: Teuer (lahmsan) selber zimmern.
Wie man "print" den Zeilenvorschub abgewöhnt, weiß ich nicht. Es ist vermutlich noch ein fehlendes Feature.
FIX: Spin's FDS stattdessen nehmen.
Wie man "while"-Schlaufen ohne "goto" verläßt, seh ich auch noch nicht.
FIX: "goto" nehmen.
----------8<-----{20180909-1820-GMT}----->8----------
Ok: Aus Typenkonsequenz sollte obige Funktion "ssr" doch eher "ssr%" heißen. Das wird in weiteren Versionen korrigiert oder einer Funktion für die komplette Fixpunkt-Multiplikation weichen. Eines Tages soll es auch Vorzeichen erhaltendes Bitschieben geben, schrieb Eric, aber das soll Hand in Hand gehen mit mehr Typen (signed und unsigned Integer). Bis dahin brauch ich halt die eigenen Shift- oder Plutimizier-Funktionen...
----------8<-----{20180909-2205-GMT}----->8----------
Code: Alles auswählen
$ cat mandelbrot16.bas
'
' translated to BASIC from mandelbrot16-20180406-fds.spin
'
'++
' as constants
'
let xmin%=-8601
let xmax%=2867
let ymin%=-4915
let ymax%=4915
let maxiter%=32
let MPX%=79 ' 0..79
let MPY%=24 ' 0..24
let dx%=(xmax%-xmin%)/MPX%
let dy%=(ymax%-ymin%)/MPY%
let c4%=4<<12
'--
'++
' ...aaaaand action!
'
let cy%=ymin%
for py%=0 to MPY%
let cx%=xmin%
for px%=0 to MPX%
let x%=0
let y%=0
let iter%=0
while iter%=<maxiter%
' let x2%=(x%*x%)>>12
let x2%=ssr%(x%*x%,12)
' let y2%=(y%*y%)>>12
let y2%=ssr%(y%*y%,12)
if x2%+y2%>c4% goto breakwhile
' let y%=((x%*y%)>>11)+cy%
let y%=ssr%(x%*y%,11)+cy%
let x%=x2%-y2%+cx%
let iter%=iter%+1
end while
breakwhile:
let cx%=cx%+dx%
print chr$(iter%+32);
next px%
let cy%=cy%+dy%
print
next py%
'--
'++
' signed shift right
'
function ssr%(x%,n%)
if x%>=0 return x%>>n%
return -((-x%)>>n%)
end function
'--
'++
' chr$() (from ersmith)
' (I didn't see the "@" possibilities or they are new)
'
'' this is a bit of a hack for now, until we have
'' a standard string library
dim buf(2) as ubyte
function chr$(x)
buf(1) = x
return @buf(1)
end function
'--
Es gab Code-Updates vom Meister!
"print irgendwas;" unterdrückt jetzt den Zeilenvorschub und ich bekam einen Tip, wie man "chr$(n)" selber bauen kann. Somit kann FDS nun wieder rausfliegen. So schnell kann Fortschritt zuschlagen.
Code: Alles auswählen
$ make mandelbrot16.binary -B
/opt/spin2cpp/src/spin2cpp.basic/build/fastspin -O2 mandelbrot16.bas
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2018 Total Spectrum Software Inc.
Version 3.8.8-beta Compiled on: Sep 9 2018
mandelbrot16.bas
mandelbrot16.pasm
Done.
Program size is 1512 bytes
Ohne FDS ist das Binary doch deutlich geschrumpft.
Das entstehende Apfelbrötchen hat sich dadurch nicht verändert und wird daher nicht nochmal hierreinge-control-v-t.
----------8<-----{20180910-0210-GMT}----->8----------
Keine Atempause! Integer mit und ohne Vorzeichen werden nun unterschiedlich bitweise nach rechts geschubst und somit kann die "ssr"-Funktion nun entfallen und wo sie benutzt wird die darüber wegkommentierte Zeile statt der Zeile mit "ssr" benutzt werden.
----------8<-----{20180911-1122-GMT}----->8----------
Das 32-bittige Apfelbrötchen mit 24 Nachkommabits ist nun auch ge
BASICt:
Code: Alles auswählen
$ cat mandelbrot32hacks.spin
pub mul(x,y)
return (x**y)<<8 | (x*y)>>24
pub multimes2(x,y)
return (x**y)<<9 | (x*y)>>23
$ cat mandelbrot32.bas
' translated from mandelbrot32-20180317-b.spin
'++
class hacks input "mandelbrot32hacks.spin"
dim hack as hacks
' hack.mul(x,y) does s8p24 fp multiplication
' hack.multimes2(x,y) does mul(x,y)*2
'--
'++
' constants
let xmin%=(-21<<24)/10
let xmax%=( 7<<24)/10
let ymin%=(-12<<24)/10
let ymax%=( 12<<24)/10
let maxiter%=32
let MPX%=79
let MPY%=24
let dx%=(xmax%-xmin%)/MPX%
let dy%=(ymax%-ymin%)/MPY%
let c4%=4<<24
'--
'++
' was main
let cy%=ymin%
for py%=0 to MPY%
let cx%=xmin%
for px%=0 to MPX%
let x%=0
let y%=0
let iter%=0
while iter%<=maxiter%
let x2%=hack.mul(x%,x%)
let y2%=hack.mul(y%,y%)
if x2%+y2%>c4% goto breakwhile
let y%=hack.multimes2(x%,y%)+cy%
let x%=x2%-y2%+cx%
let iter%=iter%+1
end while
breakwhile:
let cx%=cx%+dx%
print chr$(iter%+32);
next px%
let cy%=cy%+dy%
print
next py%
'--
'++
' chr$() (from ersmith)
'
'' this is a bit of a hack for now, until we have
'' a standard string library
dim buf(2) as ubyte
function chr$(x)
buf(1) = x
return @buf(1)
end function
'--
$ make mandelbrot32.log
/opt/spin2cpp/src/spin2cpp.basic/build/fastspin -O2 mandelbrot32.bas
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2018 Total Spectrum Software Inc.
Version 3.8.8-beta Compiled on: Sep 11 2018
mandelbrot32.bas
|-mandelbrot32hacks.spin
mandelbrot32.pasm
Done.
Program size is 1488 bytes
/opt/parallax/bin/spinsim -b mandelbrot32.binary 2>&1 | tee mandelbrot32.log
!!!!!!!!!!!!!!!"""""""""""""####################################""""""""""""""""
!!!!!!!!!!!!!"""""""""#######################$$$$$$$%'0(%%%$$$$$#####"""""""""""
!!!!!!!!!!!"""""""#######################$$$$$$$$%%%&&(++)++&$$$$$$$######""""""
!!!!!!!!!"""""#######################$$$$$$$$$$%%%%&')*A;/*('&%%$$$$$$#######"""
!!!!!!!!""""#####################$$$$$$$$$$%%%&&&''),AAAAAA@+'&%%%%%$$$$########
!!!!!!!"""####################$$$$$$$$%%%&'())((())*-AAAAAA.+))('&&&&+&%$$######
!!!!!!""###################$$$$$%%%%%%&&&'+.AAA08AAAAAAAAAAAAAAA/+,A//A)%%$#####
!!!!!"################$$$%%%%%%%%%%&&&&')-+7AAAAAAAAAAAAAAAAAAAAAAAAA4(&&%$$####
!!!!"##########$$$$$%%&(,('''''''''''((*-5AAAAAAAAAAAAAAAAAAAAAAAAAAA3+)4&%$$###
!!!!####$$$$$$$$%%%%%&'(*-A1.+/A-4+))**AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3+'&%$$$##
!!!!#$$$$$$$$$%%%%%%'''++.7AAAAAAAAA9/0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<6'%%$$$$#
!!!#$$$$$$$%&&&&''().-2.6AAAAAAAAAAAAA>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'&%%$$$$#
!!!379<@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2+)'&&%%$$$$#
!!!#$$$$$$$%&&&&''().-2.6AAAAAAAAAAAAA>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'&%%$$$$#
!!!!#$$$$$$$$$%%%%%%'''++.7AAAAAAAAA9/0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<6'%%$$$$#
!!!!####$$$$$$$$%%%%%&'(*-A1.+/A-4+))**AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3+'&%$$$##
!!!!"##########$$$$$%%&(,('''''''''''((*-5AAAAAAAAAAAAAAAAAAAAAAAAAAA3+)4&%$$###
!!!!!"################$$$%%%%%%%%%%&&&&')-+7AAAAAAAAAAAAAAAAAAAAAAAAA4(&&%$$####
!!!!!!""###################$$$$$%%%%%%&&&'+.AAA08AAAAAAAAAAAAAAA/+,A//A)%%$#####
!!!!!!!"""####################$$$$$$$$%%%&'())((())*-AAAAAA.+))('&&&&+&%$$######
!!!!!!!!""""#####################$$$$$$$$$$%%%&&&''),AAAAAA@+'&%%%%%$$$$########
!!!!!!!!!"""""#######################$$$$$$$$$$%%%%&')*A;/*('&%%$$$$$$#######"""
!!!!!!!!!!!"""""""#######################$$$$$$$$%%%&&(++)++&$$$$$$$######""""""
!!!!!!!!!!!!!"""""""""#######################$$$$$$$%'0(%%%$$$$$#####"""""""""""
!!!!!!!!!!!!!!!"""""""""""""####################################""""""""""""""""
$ █
Die in BASIC noch unbekannte spinsche "**"-Operation hab ich auf dem Umweg über Spin bereitgestellt.
Edit @20180914-0625-GMT: Graphischer Output des 32-Bit-BASIC-Mandelbrotprogrammes ist samt dafür modifizierten Quellen in einem Nachbarthread zu finden.
----------8<-----{20180914-1523-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.1 hat geschrieben:This release fixes various bugs in 3.8.7. It also includes the framework for supporting BASIC in fastspin, but that code is not production ready yet.
fastspin is a command line tool that compiles Spin code to executable PASM code. On P1 it produces LMM code by default; on P2 it produces hubexec code. Because the output is executable instructions rather than Spin bytecodes, the binaries produced by fastspin are larger than the ones produced by the PropTool or openspin, but also much much faster.
spin2cpp is a command line tool to convert Spin code to C++ or C code, which may then be compiled with PropGCC (or other C compilers; in some cases spin2cpp output may be used on a PC or other device).
...also eher Bugfix-Release für den Ast ohne BASIC. Z.B. ist ein fetter Bug für FastSpin-Spin's ASM/ENDASM-Feature gekillt worden.⁽¹⁾
1) An dem ich viel zu lange scheiterte und mich dämlicherweise für viel zu plööt für LMM-PASM hielt, statt einen Fehler zu unterstellen und diesen zu melden, aber das ist ein anderes Drama und nun glücklicherweise Kaffee von Vorgestern!
----------8<-----{20180918-2102-GMT}----->8----------
Es hat sich viel getan in FastSpin-BASIC. Insbesondere gibt es nun umschaltbar einen 16.16-Fixpunkt-Typ und Fließkommazahlen. Normal kompiliert ist "single" ein echter Float, mit "--fixed" kompiliert werden es Fixpunktzahlen mit je 16 Bit für Vor- und Nachkommastellen. Ein paar andere Neuerlichungen machen den "chr$()"-Hack überflüssig, per "const" definierte Konstanten sind hübscher und wie man "let" ausfallen lassen darf hab ich nun auch verinnerlicht...
Code: Alles auswählen
'
' translated to BASIC from mandelbrot16-20180406-fds.spin
'-------------------------------------------------------------------------------
'++
const xmin = -2.1
const xmax = 0.7
const ymin = -1.2
const ymax = 1.2
const maxiter = 32
const MPX = 79 ' 0..79
const MPY = 24 ' 0..24
const dx = (xmax-xmin)/MPX
const dy = (ymax-ymin)/MPY
const c4 = 4.0 ' square of escape radius
'--
'++
' was main
'
dim x,y,x2,y2,cx,cy as single
dim iter as integer
cy = ymin
for py = 0 to MPY
cx = xmin
for px = 0 to MPX
x = 0.0
y = 0.0
iter = 0
while iter < maxiter
x2 = x*x
y2 = y*y
if x2+y2 > c4 goto breakwhile
y = 2.0*x*y+cy
x = x2-y2+cx
iter = iter+1
end while
breakwhile:
cx = cx+dx
print \(iter+32);
next px
cy = cy+dy
print
next py
'--
Noch Fragen, Kienzle?
----------8<-----{20180921-1620-GMT}----->8----------
Code: Alles auswählen
$ /opt/spin2cpp/bin/fastspin
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2018 Total Spectrum Software Inc.
Version 3.9.2 Compiled on: Sep 21 2018
usage: /opt/spin2cpp/bin/fastspin
[ -h ] display this help
[ -L or -I <path> ] add a directory to the include path
[ -o ] output filename
[ -b ] output binary file format
[ -e ] output eeprom file format
[ -c ] output only DAT sections
[ -l ] output DAT as a listing file
[ -f ] output list of file names
[ -q ] quiet mode (suppress banner and non-error text)
[ -p ] disable the preprocessor
[ -D <define> ] add a define
[ -u ] ignore for openspin compatibility (unused method elimination always enabled)
[ -2 ] compile for Prop2
[ -O# ] set optimization level:
-O0 = no optimization
-O1 = basic optimization
-O2 = all optimization
[ -w ] compile for COG with Spin wrappers
[ --code=cog ] compile for COG mode instead of LMM
[ --fcache=N ] set FCACHE size to N (0 to disable)
[ --fixedreal ] use 16.16 fixed point in place of floats
...das "-beta" hinter der Versionsnummer verschwand mit den neuen Commits und die Dokumentation wächst deutlich.
----------8<-----{20180921-2121-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.2
----------8<-----{20180925-1649-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.3
Mehr dazu:
http://forums.parallax.com/discussion/c ... nt_1446411
----------8<-----{20180926-1533-GMT}----->8----------
Code: Alles auswählen
$ cat asm.bas
function asmadd(a,b as integer) as integer
dim r as integer
asm
mov r,a
add r,b
end asm
return r
end function
print asmadd(1337,4711)
waitcnt(getcnt()+clkfreq)
$ make asm.log -B
/opt/spin2cpp/bin/fastspin -O2 asm.bas
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2018 Total Spectrum Software Inc.
Version 3.9.4 Compiled on: Sep 26 2018
asm.bas
asm.pasm
Done.
Program size is 700 bytes
/opt/parallax/bin/spinsim -b asm.binary 2>&1 | tee asm.log
6048
----------8<-----{20181003-0150-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.4
Mehr dazu:
https://forums.parallax.com/discussion/ ... nt_1447574
----------8<-----{20181015-1745-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.5
----------8<-----{20181019-1837-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.6
----------8<-----{20181021-2202-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.7
----------8<-----{20181027-0018-GMT}----->8----------
Fast noch zu heiß, um es zu erwähnen:
FastSpin-C kann schon fast ein Mandelbrötchen-C-Programm kompilieren.
Aber von mir hab ihr das nicht!?!?!
Klar???
----------8<-----{20181027-1715-GMT}----->8----------
- mbi.c
- (898 Bytes) 740-mal heruntergeladen
----------8<-----{20181027-1825-GMT}----->8----------
Da kneif mich doch mal jemand!
- mbf.c
- (595 Bytes) 755-mal heruntergeladen
Nicht nur Fixpunkt-Brötchen, sondern sogar Fleißkomma-Brötchen klappen schon!
----------8<-----{20181028-1710-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.8
Mehr dazu:
https://forums.parallax.com/discussion/ ... nt_1451157
Eric hat geschrieben:There's also an undocumented feature which will be obvious to those who've read the source, but isn't ready for prime-time yet so I've left it as an "easter egg".

(Hint: .bas is no longer the only file extension that's handled specially).
Jetzt ist es also quasi offiziell, was ich oben schon erwähnte. Als großen Bruch irgendwelcher Geheimhaltung hatte ich das nie aufgefaßt, denn die Änderungen in Spin2CPPs Quelltextlagerstätte verfolgen konnte ja nicht nur ich und die ersten Indizien für C lagen dort schon länger herum. Ich schaute dann erst genauer hin, als im Verzeichnis mit den Tests auch C-Quellen auftauchten.
----------8<-----{20181031-0340-GMT}----->8----------
\o/
----------8<-----{20181106-1618-GMT}----->8----------
Langsam bekomm ich Routine im Zusammenschmeißen von Spin Objekten und BASIC Hauptprogrammen.
Nebenan im GEARigen Thread finden sich zwei Beispiele für das Benutzen der 512x384x1-Monochrom-Graphik in FastSpin-BASIC.
----------8<-----{20181107-1650-GMT}----->8----------
Spin to C / C++ / PASM converter version 3.9.9
Mehr dazu:
https://forums.parallax.com/discussion/ ... nt_1452473
----------8<-----{FastSpin!}----->8----------