Turbo-BASIC XL

Turbo-BASIC XL is a dialect of the BASIC programming language exclusively for the Atari 8-bit computers. First published in a German computer magazine in 1985, it is backwards compatible with Atari BASIC, but it’s faster. It adds structured programming keywords like WHILE-WEND; and graphics functions such as CIRCLE for quickly drawing circles and ellipses, and easy shape fills.

TBXL is the default language for Atari8BitBot, so you don’t need a directive in brackets to tell it you’re using that language. (On the Atari BASIC page, I implied that it is the default language. That’s not really true — it’s TBXL. But because TBXL is fully compatible with Atari BASIC, your Atari BASIC code will work just fine under TBXL, although perhaps run a bit faster than intended.)

This is important: if the BASIC parser can’t understand something about your program (for instance, if you tell it PRIMT instead of PRINT) it simply won’t respond. On a real Atari, BASIC would tell you right away if something was amiss. On Twitter, it really isn’t feasible without a lot of error codes that could look like spam to Twitter. So if you don’t get a reply within two or three minutes, check your code a try again. Or ask for help — it is Twitter, after all.

Here’s the full documentation for TBXL. If you already know your way around Atari BASIC, this handy one-page TBXL reference sheet will come in handy.

But wait, there’s more! At Atari8BitBot, Atari BASIC and TBXL code go through a pre-processor parser called TBXL-Parser before being handed off to the emulator. This adds some extra benefits that are useful when coding in a constrained number of characters:

  • You can leave out line numbers (unless you need them for something like GOTO or GOSUB.) BASIC needs them, but TBXL parser will add them in for you.
  • You can’t type special ATASCII characters like ♡ and ● in Twitter. (The bot doesn’t understand unicode.) TBXL-Parser lets you include ATASCII characters as codes, such as hex \00 (for the heart) or names [“ball”].

TBXL-Parser has other features, but those two are most relevant to working with Atari8BitBot.

Here’s a TBXL program that (barely) fits in a tweet, that shuffles a deck of cards and deals a hand. It demonstrates using hex codes for ATASCII characters, and lack of line numbers.