BRAZIL

v1.0

Basic (oR more Accurately) Zack's Interpreted Language

It's a mix of Microsoft BASIC, and more modern languages.

Syntax:

LINE NUMBER (space) COMMAND

# or $ is hex
! is binary
No symbol is decimal.

Examples:

Basic Looping Program

10 x = 0
20 x++
30 GOTO 20

More Advanced Program

(Well, the assembly version was more advanced.)

10 x = 1
20 y = 10
30 WHILE x != y
40 x++
50 THEN
60 y += 10
70 GOTO 30

Variables

myVar = expression

10 x = 5
20 y = x * 5^2

Math:

All math expressions are what you'd expect (*, /, +, -) except for exponents which are ^ instead of **

10 x = 5
20 y = x * 2

Parenthasis () have not been implemented yet.

Math + assignment is handled like modern languages

x += 5
y--
z *= 5^x

If:

IF expression
// Your Code Here
THEN

or

IF expression
// Your Code Here
ELSE
// More Code Here
THEN

10 x = 0
20 IF x < 5
30 x += 5
40 THEN

Loops:

WHILE expression
// Your Code Here
THEN

10 x = 10
20 WHILE x > 0
30 x--
40 THEN
50 PRINT x

FOR variable IN RANGE(start, end)
// Your Code Here
THEN

10 FOR y IN RANGE(0, 32)
20 PRINT y
30 THEN
40 GOTO 10

Use BREAK to exit a loop early.

READ():

READ(address)

x = READ(#AF40)
y = READ(32)
PRINT x

WRITE():

WRITE(address, data, length)

10 WRITE(#8000, 5)
20 PRINT #8000

Misc:

GOTO

Continues execution at the specified line number.