My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

About DK-BASIC

DK-BASIC is a BASIC interpreter, written in C, inspired by GW-BASIC. The target platform is 8-bit AVR microcontrollers.

Size

At this early stage of the project, code size and interpreter speed has not been optimized. Already, with only a limited feature set, the compiled code is nearly 32 KB. Execution should be possible in < 1 KB RAM, but extensive use is made of dynamically allocated memory and complex programs and many variables will consume additional memory.

Speed

There is overhead associated with program execution in DK-BASIC due to it being an interpreter rather than a compiler. While resource-intensive applications are better suited to C or assembler, many types of control and user-interface applications can be implemented using DK-BASIC.

Project status

The project is at an alpha stage - it is currently has limited usability. A small subset of GW-BASIC functions have been implemented and few AVR-specific features have been added.

Compatibility with GW-BASIC

DK-BASIC aims to be an equivalent of the GW-BASIC interpreter, for AVR microcontrollers. Some features differ (low-level functions, use of assembly-language functions), but where possible and practical, compatibility will be maintained.

Program editor and direct mode

An interactive interface is available in which programs can be edited by entering a line number, and statements entered without a line number are executed immediately.

Supported features

  • Integer, floating point, and string variables (note: arrays not yet supported)
  • Decimal, hexadecimal, binary, and octal numbers
  • IF/THEN/ELSE, FOR/NEXT, WHILE/WEND
  • GOSUB/RETURN
  • PEEK()/POKE
  • PRINT and INPUT statements using serial port
  • Save program in EEPROM

More information about features:

Known bugs

For a list of known bugs, see the Issues page.

Contact information

Questions about DK-BASIC can be sent to info@dk-basic.com.

Example BASIC program

10 A = PEEK(&h29) AND 1  ' save initial status of PIND
20 PRINT "Waiting for button press..."
30 B = PEEK(&h29) AND 1  ' read status of PIND
40 IF B = A THEN GOTO 30 ' loop until PIND.0 changes
50 PRINT "Button pressed!"
Powered by Google Project Hosting