Pages: 1
  Print  
Author Topic: Bytecode interpreter  (Read 4482 times)
Offline (Male) Yambam
Posted on: August 01, 2016, 11:54:45 pm

Member
Location: The Netherlands
Joined: May 2016
Posts: 67

View Profile WWW


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
Code: [Select]
m "Hello" =
m m " World!" + =
m m " Yay!" + =

Resulting “readable byte code”
Code: [Select]
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.

Code: [Select]
N/A yet.
Simple printing array contents
Code: [Select]
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”
Code: [Select]
l"This""is","an","array",=s""=ssal0@=+" "+=ssbl1@=+" "+=sscl2@=+" "+=ssdl3@=+=ss"."+=as"."+=
Real byte code
Code: [Select]
N/A yet.
Drawing functions
Code: [Select]
x 0 #P0=
y 384 #P0=
{
    2 0 , xx1+= , y , #P0_draw_sprite
    _null #P0_refresh
} U {
    x 1024 >
}

Resulting “readable byte code”
Code: [Select]
x0#P0=y384#P0={2 0 , xx1+= , y , #P0_draw_sprite _null #P0_refresh}U{x1024>}
Real byte code
Code: [Select]
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.
Logged

Offline (Male) Yambam
Reply #1 Posted on: August 03, 2016, 03:48:57 am

Member
Location: The Netherlands
Joined: May 2016
Posts: 67

View Profile WWW
Quote
I don't know what any of the fuck this is but i like it!
OK... What happened to your comment though? xD
Logged

Offline (Unknown gender) time-killer-games
Reply #2 Posted on: August 03, 2016, 11:02:30 pm
"Guest"


Email
OK... What happened to your comment though? xD

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