Pages: 1
Author Topic: Bytecode interpreter  (24,455 Views)
Offline (Unknown gender) Yambam

Member
Joined: May 2016
Posts: 67
View profile WWW
Posted on: August 02, 2016, 04:54:45 AM


Executable: https://www.dropbox.com/s/0a5vmkwsw9bsfbd/Byte%20code.exe?dl=0
GM:Studio: https://www.dropbox.com/s/a9qa0pn9s9gzhz2/Byte%20code.gmz?dl=0

Here are the examples:

Hello World Program
m "Hello" =
m m " World!" + =
m m " Yay!" + =


Resulting "readable byte code"
m"Hello"=mm" World!"+=mm" Yay!"+=

Real byte code
The real byte code consists of the "readable" byte code, with each symbol replaced with its equivalent byte code representation.

N/A yet.

Simple printing array contents
l "This" "is" , "an" , "array" , =
s "" =
s s a l 0 @ = + " " + =
s s b l 1 @ = + " " + =
s s c l 2 @ = + " " + =
s s d l 3 @ = + =


Resulting "readable byte code"
l"This""is","an","array",=s""=ssal0@=+" "+=ssbl1@=+" "+=sscl2@=+" "+=ssdl3@=+=ss"."+=as"."+=

Real byte code
N/A yet.

Drawing functions
x 0 #P0=
y 384 #P0=
{
    2 0 , xx1+= , y , #P0_draw_sprite
    _null #P0_refresh
} U {
    x 1024 >
}


Resulting "readable byte code"
x0#P0=y384#P0={2 0 , xx1+= , y , #P0_draw_sprite _null #P0_refresh}U{x1024>}

Real byte code
N/A yet.

Non-single-character variable names and GM functions start with an underscore (_), add #P0 (= don't push) before a function name or assignment operator to avoid pushing unwanted values to the stack.
Offline (Unknown gender) Yambam

Member
Joined: May 2016
Posts: 67
View profile WWW
Reply #1 Posted on: August 03, 2016, 08:48:57 AM
QuoteI don't know what any of the fuck this is but i like it!
OK... What happened to your comment though? xD
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #2 Posted on: August 04, 2016, 04:02:30 AM
Quote from: Yambam on August 03, 2016, 08:48:57 AM
OK... What happened to your comment though? xD

I removed it realizing I've done enough useless postings for one short time frame.
Pages: 1