BASIC implementation for AVR
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ashe Connor 00e7b39a30
README
2 years ago
interp if/elseif/else/end 2 years ago
keyboard Update README.md 2 years ago
.dockerignore we can let a% = 1 2 years ago
.gitignore local runner 2 years ago
COPYING COPYING 2 years ago
Makefile print prints! 2 years ago
Makefile.common shift pins around to make room for SPI 2 years ago
README.md README 2 years ago
at_display.c flush after print, input str 2 years ago
at_display.h start on INPUT 2 years ago
at_main.c start on new pheap 2 years ago
at_main.h refine 2 years ago
avrbasic.elf-gdb.py gdb yo 2 years ago
running.jpg resize 2 years ago
u8g2.h move to c 2 years ago
u8g2_box.c move to c 2 years ago
u8g2_buffer.c move to c 2 years ago
u8g2_d_memory.c move to c 2 years ago
u8g2_d_setup.c move to c 2 years ago
u8g2_font.c move to c 2 years ago
u8g2_fonts.c move to c 2 years ago
u8g2_hvline.c move to c 2 years ago
u8g2_intersection.c move to c 2 years ago
u8g2_ll_hvline.c move to c 2 years ago
u8g2_setup.c move to c 2 years ago
u8x8.h move to c 2 years ago
u8x8_8x8.c move to c 2 years ago
u8x8_byte.c move to c 2 years ago
u8x8_cad.c move to c 2 years ago
u8x8_d_st7920.c fix add/get line 2 years ago
u8x8_display.c move to c 2 years ago
u8x8_gpio.c move to c 2 years ago
u8x8_setup.c move to c 2 years ago

README.md

avrbasic

An interactive BASIC interpreter for the ATmega328p.

Re-live your TRS-80 memories with your ATmega. Maybe.

I'll do a hardware diagram and stuff like that soon.

Parts list:

  • ATmega328p
  • ST7920, headers, lots of pin–plug header cables
  • the keyboard in /keyboard, or anything else that uses UART
  • Whatever you use to program and power your AVR

Language description:

  • Integers and strings are supported.
    • Integers are any string of numbers from -32768 to 32767.
    • Strings are any set of characters within double-quotes. No escaping is permitted.
  • Variables are identified by labels ending in % (integers) or $ (strings).
    • Only the first two letters are significant.
    • XY% and XYZ% are the same (integer) variable.
    • XY$ is a (distinct) string variable.
  • Expressions are numbers, strings, labels (variable references), in conjunction with any combination of +, -, *, /, = (equality test).
    • Usual binding order applies. Override with parentheses.
    • Numbers support all operators. Strings only support + and =.
    • Testing equality results in the number 1 (true) or 0 (false) regardless of the operand types.
  • The following statements are supported:
    • LET label = expr — assign a variable
    • PRINT expr[, expr …] — output any expression
    • INPUT ["MESSAGE",] label — get user input
    • IF expr THEN — start executing code only if expr is a non-zero integer or non-empty string
    • ELSEIF expr THEN — during an IF, if a previous block has not executed, start executing code if expr evaluates as above
    • ELSE — during an IF/ELSEIF, if no previous block has executed, start executing code
    • END IF — end an IF/ELSEIF
    • [number] stmt — store program code at the given line number
    • GOTO number — transfer program control to given line during RUN
    • RUN — run stored program
    • LIST — list stored program code
    • CLEAR – erase stored program (use if pheap runs out)