bytecode.md

April 12, 2026 ยท View on GitHub

Documentation

Bytecode

When you compile a BIPLAN program with bcc, you are just translating your program in a more compact form designed to be efficiently interpreted.

For example, this is a short BIPLAN program of 45 characters:

print "Hello World!"
@a = 3 + 3
print @a
stop

This is the program above compiled in 24 characters of BIP bytecode:

p"Hello World!"}\$3+3p}$x

When executed prints:

Hello World!6

The BIP bytecode is just an ASCII string saved in a .bip file that can be browsed as any other text file. In BIP bytecode numbers, arithmetic operators and strings are still human readable, instead system functions, variables and other constructs are compiled in a shorter form. Here is a table of the substitutions required to compile the BIPLAN example above in BIP bytecode:

BIPLANBIP
printp
@a}$
stopx

After removing LF, CR, TAB and SPACE the final BIP bytecode is obtained.

The variable @a is compiled in }$, where } is the numeric variable identifier and $ is the address (36, or $ means address 0).

BIPLAN supports up to 87 functions, variables, parameters, strings and cycles. Using the ASCII encoding and representing addresses with one character restricts their number to 87 (the first 35 characters and :, f, ~, }, @, # are reserved).

Not to drastically limit the memory available BIP bytecode supports a memory read and write instruction that expects a numeric address, so depending on the machine you are running BIPLAN on, you may be able to address 2322^{32} or 2642^{64} bytes of memory.

The following table contains the whole BIPLAN to BIP bytecode dictionary.

DescriptionCharacterDecimal
else!33
literal string separator"34
for variable (followed by address)#35
$36
modulus%37
bitwise and&38
'39
open round parenthesis(40
closed round parenthesis)41
multiplication*42
addition+43
function parameter separator,44
subtraction-45
.46
division/47
number048
number149
number250
number351
number452
number553
number654
number755
number856
number957
: (followed by address):58
next;59
less than<60
=61
greater than>62
if?63
for (followed by address)@64
logic andA65
breakB66
--C67
delayD68
ioE69
endF70
G71
greater or equalH72
less than or equalI73
adcJ74
bit shift rightK75
bit shift leftL76
millisM77
bitwise notN78
logic orO79
P80
== equals toQ81
randomR82
:[]S83
not equalT84
memU85
@[]V86
W87
X88
Y89
Z90
[[91
backslash\92
]]93
^^94
_97
++`96
indexa97
charb98
continuec99
d100
inpute101
function (followed by address)f102
serialg103
stringh104
i105
j106
pipek107
l108
sizem109
n110
fileo111
printp112
numberq113
returnr114
s115
t116
u117
v118
whilew119
endx120
cursory121
restartz122
{123
bitwise or|124
numeric variable, function parameter (followed by address)}125
function call (followed by address)~126
DEL127