We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

CTBASIC

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

CTBASIC is a compiled Sinclair BASIC inspired language imagined by User:Salpynx targeting a cyclic tag system "fantasy console" architecture.

The language is written using high-level output commands and compiled into a range of cyclic tag dialects, such as CT {0, 1, ;}, or BCT {0, 1}.

Data string output convention

The key feature of the CTBASIC architecture is a particular set of output conventions which distinguish a CTBASIC machine from a plain cyclic-tag interpreter. This output feedback assists writing and evaluating cyclic tag system programs.

Byte strings can be encoded and recognised within the data-string:

  • 8 bit bytes are encoded within a 10 bit data-frame with start-bit 1 and end-bit 0.
  • A string is a series of 10-bit frames beginning with the ASCII C0 STX character (0x02), and terminated by the ETX character (0x03).
  • When a valid string is completed, (i.e. the stop-bit 0 of the ETX is appended to the right of the data-string) the complete string is sent to output.

Output is a serial byte-stream, with flexible destinations.

  • The CTBASIC language has drawing commands which when compiled produce serial byte output that can be recognised by wikipedia:Tektronix_4010 compatible terminals.
  • Non-graphical serial terminals are also intended to be supported for character output.

Commands are effectively macros to simplify forming output using the provided conventions.

  • PRINT, CHR$, CLS, PLOT, DRAW, and INK for output.
  • BIN, DATA, FILL, ZFILL, ASM for internal data.
  • CLEAR unconditionally clears bits from the data string.

All control flow is provided by the underlying cyclic tag mechanism.

Examples

REM Hello, World! output example.
PRINT "Hello, World!"

External resources