Jump to content
IGNORED

FastBasic 4.4 - Spring 2020 Release


dmsc

Recommended Posts

Hi!

 

Finally I released the new FastBasic version, with all the improvements from the last beta version and a few more fixes. From the github release text:

 

Changes in the IDE:

  • BREAK key handling in the IDE - this was long overdue, now you can press BREAK key to return to the IDE from your program.
  • COPY/PASTE of lines to the editor, you need to press CONTROL-C to make a line to copy, then when you press CONTROL-V that line is copied after the current one. Pressing CONTROL-V multiple times copies multiple lines. This needed a change from CONTROL-V to CONTROL-I for the page-down action.
  • Go to Line, pressing CONTROL-G moves the cursor to any given line, this makes editing larger programs easier.
  • Allows usage of the page-up and page-down keys on the 1200XL keyboard (SHIFT-F1 and SHIFT-F2), in addition to CONTROL-U and CONTROL-I.

 

Changes to the language:

  • Adds CLR statement, that un-dimension arrays and sets all variables to 0.
  • Adds WSYNC command to the DLI, allows setting multiple lines in one DLI.
  • Adds & operator for abbreviating the ADR() function.
  • Allows abbreviations for some BASIC functions and operators and skipping the parenthesis on most functions, allowing to write shorter code, see the manual for details.
  • Minor incompatible change: The abbreviations for ELSE, ENDIF, PMGRAPHICS and PMHPOS changed to make them more consistent and smaller.

 

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.
  • Adds a DATA FILE statement that includes binary data from external files.
  • The CC65 tools are included in the distribution, you don't need to install CC65 to use the cross-compiler anymore.

 

 

The new release is over github, download at: https://github.com/dmsc/fastbasic/releases/tag/v4.4

 

  • Like 7
  • Thanks 3
Link to comment
Share on other sites

  • 3 months later...

I'm thinking about using FastBasic for a scripting language in one project aiming 6502. Reason is that Basic is much easier to write than Pascal or C and community could use it for making simple games. Reading https://atariwiki.org/wiki/Wiki.jsp?page=FastBasic Is FastBasic done in a way that "core" of the language could be extracted to some project easily (without Atari Specific Functions, Console, IO, Floating Point, IDE, with programs precompiled to IL form)?

Link to comment
Share on other sites

Hi!

Quote

I'm thinking about using FastBasic for a scripting language in one project aiming 6502. Reason is that Basic is much easier to write than Pascal or C and community could use it for making simple games. Reading https://atariwiki.org/wiki/Wiki.jsp?page=FastBasic Is FastBasic done in a way that "core" of the language could be extracted to some project easily (without Atari Specific Functions, Console, IO, Floating Point, IDE, with programs precompiled to IL form)?

Yes, it is possible. The interpreter is fairly portable, and it is possible to call it simply with:

 lda #<bytecode_addr
 ldx #>bytecode_addr
 jsr interpreter_run

At start, the interpreter closes I/O channels 1 to 7, stops sounds and clears all variables to 0 (see src/interpreter.asm file). When the interpreter encounters the END instruction (or reaches the end of the interpreted program), it restores the stack pointer and returns to the caller.

 

The cross-compiler uses the ld65 linker, so that only the code for the used instructions is linked to the resulting binary.

 

To modify the language (for example, to add/remove statements or functions), you need to edit the grammar at the "src/basic.syn" file, IMHO the grammar syntax is fairly easy to understand.

 

If you have any question, just ask!

 

Have Fun!

Edited by dmsc
Link to comment
Share on other sites

Hi!

21 minutes ago, ilmenit said:

Roughly how big is the interpreter?

It depends on how many different tokens are used in your program - as those are only included if used. Measuring the current git version:

 

Minimal size: 255 bytes.

Using multiplications and variables: 500 bytes.

Using arrays (DIM), loops: 850 bytes.

 

PRINT adds about 40 bytes,

String operations add about 100 bytes.

 

Full game joyas.bas: 1459 bytes.

Full game wazers.bas: 1613 bytes.

 

Maximum size without FP (all the tokens, including P/M graphics and I/O): 2314 bytes.

Maximum size including FP: 3202 bytes.

 

Also, the interpreter needs from 20 to 32 bytes of ZP.

 

Have Fun!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...