https://github.com/blagojeblagojevic/bbasic
Simple Basic Like Iterpreter
https://github.com/blagojeblagojevic/bbasic
basic c interpreter programing-language
Last synced: 9 months ago
JSON representation
Simple Basic Like Iterpreter
- Host: GitHub
- URL: https://github.com/blagojeblagojevic/bbasic
- Owner: BlagojeBlagojevic
- Created: 2023-12-19T15:59:18.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-20T20:03:38.000Z (about 2 years ago)
- Last Synced: 2025-04-08T09:48:24.856Z (about 1 year ago)
- Topics: basic, c, interpreter, programing-language
- Language: C
- Homepage:
- Size: 1.3 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# БBasic
Simple Basic Like Iterpreter.
Currently supported instructions are:
1. **VAR** -> Declaring variable
2. **LABEL** -> Declaring label
3. **GOTO** -> Go to line number
4. **GOTOSUB** -> Go to label
5. **IF** -> Condition statement if TRUE do line + 1 else skip
6. **END** -> Used to indicate end of the program
7. **RAND** -> Generate random number
8. **INPUT** -> Allows to enter a variable
9. **LOAD** -> Load variable B to A START : STOP
10. **GRAPHICS** -> Initialize graphics see below
11. **PIXEL** -> Put pixel on screen
12. **RENDER** -> Renders the screen
There are 2 build of the interpreter:
1. **bbasic.c** This build does not suport last 3 instructions and not depends on anything except standard library
2. **bbbasicgraphics.c** This build does suport last 3 instuction and depends on SDL
To compile it you need first to compile header libary for desired build.
1. gcc bbasic.h
2. gcc basicgraphics.h
Then compile desired build.
1. gcc bbasic.c -lm -O0
2. gcc bbbasicgraphics.c -lm -lSDL2 -lGL -O0
Then run program
1. ./a.out filePathToProgram
In example folder we will fine examples of programs.
This implementation currently is 2 time slower then python in fizzbuzz test on my PC.