Search the Community
Showing results for tags 'Interpreter'.
-
Hi all! Finally I published the new FastBasic 4.5 release!! From the 4.5 beta, I added: - The "ADR()" function and the "&" operator now allow taking the address of a variable, so this code will print 123: " A = 1 : DPOKE &A, 123 : ? A ". - The "EXEC" statement can be abbreviated to a "@", this makes calling procedures more natural, this will also print 123: " PROC Test A : ? A : ENDPROC : @Test 123 " This in addition to the added features of the 4.5 beta: - Parameters for the PROC/EXEC, see the test-release docs, - Arbitrary characters in string constants by using the hex value, like: PRINT "Hello"$9B"World", - Added PAUSE without a parameter, this is the same as PAUSE 0, "wait for vsync", - PROC has a shorter abbreviation: PR., - The parser is more robust to syntax errors, I discovered some erroneous inputs that could slow down the parser a lot. Many improvements to the editor: - Much faster COPY/PASTE operations, - Restores left-margin value on exit to DOS, - Remove P/M graphics when returning to the editor from user programs. And improvements to the cross-compiler: - Better error messages from some syntax errors, and fixes in parsing of big numbers. - Check for PROC and EXEC parameters mismatch. - An option to write an expanded and indented listing from an abbreviated listing, "-l" After a lot of optimizations, I managed to keep the integer IDE at 8192 bytes and the floating-point IDE at 9457 bytes. EDIT: Current release is 4.5.2, adds a few bugfixes and minor optimizations, now the integer IDE is 8166 bytes. As always, you can download the ATR, the manual and the cross-compiler from github: https://github.com/dmsc/fastbasic/releases/ Have Fun!
- 110 replies
-
- 20
-
Hi All! As @777ismyname said, I just published a test version for the new FastBasic release. Please, help me testing it so I can make a new release in time for the BASIC 10 liner contest There is a big new feature: parameters for the PROC/EXEC, like this example: exec Test 1, 2 for i=1 to 4 exec Test 5 - i, i next proc Test a b ? "Testing: "; a, b endproc Notice that in the EXEC the parameters are separated with commas, but in the PROC the corresponding variables are separated with spaces. Also, the variables in the proc are not "local" like most languages, as all variables in FastBasic are global and the parameters are simply variables, the above code is basically equivalent to: a=1 : b=2 : exec Test for i=1 to 4 a=5-1 : b=i : exec Test next proc Test ? "Testing: "; a, b endproc Also, in the Atari IDE the parser does not verify that the number of arguments passed to the EXEC is the same as received by the PROC, I plan to add a check to the floating-point version in a future version. In addition to the above, there are other changes to the language: - You can include arbitrary characters in string constants by using the hex value, like: PRINT "Hello"$9B"World" . So, now you can easily include he EOL character in strings directly, and in the cross compiler you can write Atari characters in strings simply by the ATASCII code. - Added PAUSE without a parameter, this is the same as PAUSE 0, "wait for vsync". - PROC has a shorter abbreviation: PR., - The parser is more robust to syntax errors, I discovered some erroneous inputs that could slow down the parser a lot. Many improvements to the editor: - Much faster COPY/PASTE operations, - Restores left-margin value on exit to DOS, - Remove P/M graphics when returning to the editor from user programs. And improvements to the cross-compiler: - Better error messages from some syntax errors, and fixes in parsing of big numbers. - Check for PROC and EXEC parameters mismatch. - An option to write an expanded and indented listing from an abbreviated listing, "-l" Adding the support for PROC parameters while keeping the integer IDE under 8kb was a lot harder than expected, but I finally managed to squeeze a few bytes from the editor and made it fit, currently the "FBI.XEX" file is 8189 bytes! As always, you can download the ATR, the manual and the cross-compiler from github: https://github.com/dmsc/fastbasic/releases/tag/v4.5-rc I plan to do a few extra commits before the release, but nothing big. Have Fun!
- 59 replies
-
- 11
-
I finally managed to finish the DLI work, so here is the new FastBasic version, ready for the 2020 tenliners! You can now create a DLI with a simple syntax, capable of changing registers at multiple locations in the screen. The full documentation is in the manual at https://github.com/dmsc/fastbasic/blob/master/manual.md#display-list-interrupts , but here is a little sample of the DLI support, showing how to multiplex two P/M to create 4 moving two-color sprites: ' Player shapes DATA p1() BYTE = $E7,$81,$81,$E7 DATA p2() BYTE = $18,$3C,$3C,$18 ' Players horizontal positions DATA pos() BYTE = $40,$60,$80,$A0 ' Players colors DATA c1() BYTE = $28,$88,$C8,$08 DATA c2() BYTE = $2E,$80,$CE,$06 ' Our DLI writes the position and ' colors to Player 1 and Player 2 DLI SET d3 = pos INTO $D000, pos INTO $D001, DLI = c1 INTO $D012, c2 INTO $D013 ' Setup screen GRAPHICS 0 : PMGRAPHICS 2 ' Setup our 4 DLI and Players FOR I = 8 TO 20 STEP 4 POKE DPEEK(560) + I, 130 MOVE ADR(p1), PMADR(0)+I*4+5,4 MOVE ADR(p2), PMADR(1)+I*4+5,4 NEXT ' Activate DLI DLI d3 ? "Press a Key" ' Move objects! REPEAT PAUSE 0 pos(0) = pos(0) + 2 pos(1) = pos(1) + 1 pos(2) = pos(2) - 1 pos(3) = pos(3) - 2 UNTIL KEY() ' Disable DLI and ends DLI Attached is the resulting XEX, this is the resulting screen: The new release is over github, download at: https://github.com/dmsc/fastbasic/releases/tag/v4.3 Have Fun! dlitest.xex
- 34 replies
-
- 20
-
Hi all! I have a new beta (test) version of the next FastBasic release (4.4), I need your help testing the IDE - specially the editor, as it has many changes under the hood to make it smaller. The changes in this version are: - Adds BREAK key handling to the IDE - this was long overdue, now you can press BREAK key to return to the IDE from your program. - Adds COPY/PASTE to the editor, you need to press CONTROL-M to "mark" a line in the editor, then when you press CONTROL-C that line is copied after the current one. Pressing CONTROL-C multiple times copies multiple lines. Changes to the language: - Adds "CLR" statement, that un-dimension arrays and sets all variables to 0. Changes to the cross-compiler: - Allows to compile to code that can be put in a cartridge - by removing all uses of self-modifying-code and adding a stub to copy the zeropage interpreter from ROM to RAM at startup. - Allows accessing to DATA's from external assembly files. - The CC65 tools are included in the distribution, you don't need to install CC65 to use the cross-compiler anymore. Have Fun! EDIT: See newer beta version at: fastbasic-v4.4-beta-macosx.zip fastbasic-v4.4-beta-win32.zip fastbasic-v4.4-beta.atr fastbasic-v4.4-beta-linux64.zip
- 39 replies
-
- 17
-
UPDATE: There is now a new version at: Hi all! To start the new year, and to provide a better Basic for all the new ten-liners, I'm releasing version 4.0 of FastBasic. The major changes in this version are under the hood: The interpreter has been changed from a stack-base virtual machine to a register plus stack, this makes the interpreter from 10% to 20% faster depending in the program. In the SIEVE.BAS benchmark, the Atari version is 13% faster and in the cross-compiler is 19% faster, but programs depending on fast PEEK and POKE should be much faster. There is now a full test-suite to automatically catch regressions in the parser and interpreter, ensuring that bugs don't re-appear. Also, there are some user visible changes: There is now a command-line compiler "FBC.COM", this allows compiling large programs that don't fit in the full editor. Currently, "FBC" accepts the full floating-point syntax. Added minimal support for Player/Missile graphics: PMGRAPHICS (abbreviated PM.) statements setups P/M, PMHMOVE (abbreviated PMH.) horizontal moving a a player/missile, PMADR() returns the address of the given player/missile data. Many small bugs fixed. In this version the integer IDE is 8188 bytes in size (we still have 4 bytes less than 8K), and the floating-point IDE is 9405 bytes. As always, full sources and binaries for Atari, Linux, Windows and MacOS are available over Github: https://github.com/dmsc/fastbasic/releases
- 51 replies
-
- 25
-
Hi all! A new release of FastBasic is available, this is Release 3. This release has with many enhancements, mayor ones: - Added string comparison operators, - Interpreter is about 3% faster in FOR loops and other simple operations. SIEVE benchmark now takes 17 seconds. - The integer-only IDE is now less than 8KB, the floating point IDE is 9.2kB, and there are 200 bytes more available for the programs. - Cross compiler produces smaller executables by only including used parts of the runtime, a simple '? "Hello"' compiles to 453 bytes, including the interpreter and runtime. Minor improvements to the IDE and language: - The IDE now can edit files with lines of up to 255 bytes. - The IDE is a little faster to parse large files. - More abbreviations to the statements, The list of abbreviations is in the manual. Mayor improvements to the cross-compiler and optimizer: - New scripts for the cross-compilers allows passing options to the compiler and linker, also writes label files for debugging. - Cross compiler gives better errors in many cases. - Optimizer for NEG/MUL/DIV/MOD and all bitwise operations. - Optimizer ignores comments and can span multiple lines. - Adds tail-call optimizations (replaces CALL/RET with JUMP and JUMP to RET with RET) And many fixes: - Optimizer no longer ignores negative numbers, - Correct corner cases with MOVE / -MOVE, updates docs. - Cleanup all variables and arrays on run, fixes on memory-clearing function. - Fixes some cases of integer to floating point comparisons. - Fixes parsing of NOT with parenthesis and NOT/NOT. - Fixes errors on line numbers > 255 in the IDE. - Fixes some corner cases in the IDE editor with lines at top/bottom of screen. - Parsing of statements after a ':' ignored errors. As always, full sources and binaries for Atari, Linux, Windows and MacOS are available over Github: https://github.com/dmsc/fastbasic/releases Have fun! Edit: current version is v4, announcement at https://atariage.com/forums/topic/288617-fastbasic-40-tenliners19-release/
- 121 replies
-
- 16
-
Hi Guys, yesterday I have run into a nasty Syntax Error in Extended Basic, which also occurs in RXB. I don't understand it and wonder if the line really contains a Syntax Error or this is a Interpreter Bug. Version 1: 1 IF A=1 THEN 2 ELSE FOR I=1 TO 2 :: PRINT I :: NEXT I 2 END Version 2: 1 IF A=1 THEN 2 :: FOR I=1 TO 2 :: PRINT I :: NEXT I 2 END Both versions complain about a Syntax Error in Line 1. I would like to analyze it with the help of you and maybe RXB can be even fixed.
- 2 replies
-
- extended basic
- rxb
-
(and 4 more)
Tagged with:
-
Note: a new version is available over this post. Hi all As a new-year present, I released a new version of FastBasic. It's only a minor bugfix release from last one: - Fixes a bug with floating-point comparisons - Adds more usage information to the cross-compiler. - Fixes display corruption in the editor. - Allows comments after any statement. As always, the full source is over github, and you can download the release at https://github.com/dmsc/fastbasic/releases/full manual at https://github.com/dmsc/fastbasic/blob/master/manual.md and sample programs are included in the ATR or in the source at https://github.com/dmsc/fastbasic/tree/master/samples/int and https://github.com/dmsc/fastbasic/tree/master/samples/fp Over github I included the cross-compiler for Linux, Windows and macOS, but I only tested the Linux and Windows ones. For usage instructions of the cross-compiler, see at https://github.com/dmsc/fastbasic/blob/master/compiler/USAGE.md fastbasic-r2.atr
- 43 replies
-
- 20
-
Hi! There is a new version of my FastBasic interpreter available, now with optional *floating point* support. Also, I have written a full language manual, you can browse it at: https://github.com/dmsc/fastbasic/blob/fastbasic-fp/manual.md Note that the manual is also included in the disk image. The two files contain the two versions: - Integer only, currently 8633 bytes, a "?FRE()" minimal program reports 30458 bytes. - Integer and floating point, currently 9431 bytes, a "?FRE()" minimal program reports 29642 bytes. Note that FP variables end with a "%" sign, and use the OS mathpack, so FP calculations are slow. Also, you can't have two variables of different type and same name (so "var%" and "var$" are not allowed). As always, full sources are at github, see https://github.com/dmsc/fastbasic/tree/fastbasic-fpfor the floating point version and https://github.com/dmsc/fastbasic/tree/master for the integer only version. And you can compile the sources to get the cross-compiler, build from the same sources as the atari compiler. Enjoy, and report any problem! fastbasic-int-20170719.atr fastbasic-fp-20170719.atr
- 29 replies
-
- 13
-
Hi! Over the last months I have been writing a new Basic interpreter for the Atari 8-bit computers. My goals are: - Integer variables - Small size (currently less than 6k) - Fast execution (currently, about 15% faster than compiled TurboBasicXL in the "sieve.bas" benchmark) - Modern (no line numbers, many control structures) - "alike" TruboBasicXL. Attached is my current "beta" release. What is missing is an editor, currently it only runs text programs from disk, and possibly more commands. Also, parsing speed is slow, main reason is that the file is read a line at a time, if the file were read from memory the parser would be a lot faster. I ported one of my ten-liners to the interpreter, and included some demonstration programs. Well, bug reports and new ideas are welcomed ----- cheat sheet ----- All statements and variable names can be lower or uppercase, the parser is case insensitive. No line numbers are allowed. Supported integer operators, in order of precedence: + - : addition, subtraction * / MOD : multiplication, division, modulus & ! EXOR : binary AND, OR and EXOR + - : unary "+" and "-" Supported functions: TIME : time in jiffies ABS(N) SGN(N) PEEK(N) PADDLE(N) PTRIG(N) STICK(N) STRIG(N) RAND(N) : random from 0 to N DPEEK(N) FRE() : free memory ERR() : last I/O error ADR(array) : address of array in memory ADR(string) LEN(string) VAL(string) ASC(string) Supported boolean operators, in order of precedence: OR : Logical OR AND : Logical AND NOT : Logical NOT <= >= <> < > = : Integer comparison Strings: String variables don't need DIM, are of max 255 bytes length. String constants can have embedded " by duplicating (" my string ""hello"" ") Arrays: Arrays must be DIM before use. After array name, you can specify "WORD" or "BYTE" to give a type. DIM Array1(10) Word, SmallArray(32) Byte Variables: Variables are always INT (from -32768 to 32767), must be assigned before use. Statements: ' : Comment (REM) . : Comment (REM) ? : PRINT BGET # BPUT # CLOSE # COLOR DIM DO / LOOP DPOKE DRAWTO END : Terminates parsing, go to command mode EXEC EXIT : Exits from DO, REPEAT, WHILE or FOR FILLTO FOR / TO / NEXT FOR / TO / STEP / NEXT GET : Get from Keyboard GET # GRAPHICS IF / ELSE / ENDIF IF / THEN INC INPUT MOVE / -MOVE OPEN # PAUSE PLOT POKE POSITION PRINT PROC / ENDPROC PUT : Put to E: PUT # REPEAT / UNTIL SETCOLOR SOUND : With no parameters silences all sounds. WHILE / WEND XIO # fastbas.atr
- 59 replies
-
- 23
-
Here is something I have worked on the weeking. It's some testfiles for un-crunching BASIC programs. The txt files are the LIST output of those programs, so they are matching exactly the way the BASIC INTERPRETER does the uncrunching of each basic line of the program. (Classic99 was used with LIST "CLIP" to generate those txt files) If you compare that to the available tools (TI99DIR, imagetool,...) you will see that all have some issues in recreating that same syntax. Example: Output from TI99dir of Line 4 of XBCMD1 4 ACCEPTVALIDATE("YN"):R$ Output from TiImageTool of Line 4 of XBCMD1 4 ACCEPT VALIDATE ("YN"):R$ while if you LIST the program in the TI99 you will see: 4 ACCEPT VALIDATE("YN"):R$ XBCMD1 contains examples for XB commands from A-P XBCDM2 contains examples for XB commands from P-Z XBCMD3 contains quote examples XBCMD4 contains all characters within strings from 0 to 255. Here the txt File fails for line 100 because it interprets some control character. The examples for XB commands are mostly taken from the XB Manual and are only extended by me if insufficient. I will create some more testfiles and add them as Unit Tests to Web99, so in case i touch the code, I immediately see if I broke some behavior. Feel free to do the same for your projects or use the files to manually test your tool during development. Btw: The programs can be loaded, but running them makes no sense, their purpose is to find out if your Tool decodes a TiFile into the Basic Source Code the same way the Basic Interpreter does. Please provide feedback if you want to use it, so I can provide you with updates. unittest.dsk XBCMD1.txt XBCMD2.txt XBCMD3.txt XBCMD4.txt
-
Hello together, Recently I heard, that tiny c associates, OSS, Inc., Thomas A. Gibson and Scott B. Guthery have published a C interpreter in 1978 and 1982! From Atari FAQ (thanks to Michael Current, Freddy and all the others) we find: First sold C compiler by OSS. This compiler was used to compile itself! First true language "bootstrap" on any 8-bit machine (it was also available for Apple and CP/M machines). Derived from Dr.Dobbs "Small C". Compiles to 6502 code which emulates the 8080 instruction set. Thanks to Jason Scott and archive.org, we do have the manual: tiny-c_manual.pdf ; size: 2.6 MB https://archive.org/details/tiny-c_manual and some other infos: https://atariwiki.org/wiki/Wiki.jsp?page=C But the main important question is: does an atr-image of the disk exists? So many thanks in advance for helping us. ?
-
We would love it if you could check out our Applesoft / Integer BASIC interpreter, DiscoRunner. Unlike most interpreters, we've closely simulated the graphical and sound capabilities of the Apple II, allowing most BASIC listings to run faithfully (it comes with almost a thousand of them!) It has some rudimentary 3D camera support; later versions will add more complex 3D and digital sound capabilities. You can download it for Windows, Mac and Linux at http://discorunner.com Please let us know what you think of it so far! Thanks, April and Melody Ayres-Griffiths