JSON Knowledge is recommended since this uses a lot of JSON terms.
JSON Structure
Since Nebassembly is a JSON based language, your program
needs to have a proper structure.
Data section
The Data section contains program metadata such as Copyright.
Metadata Keys
copyright
Human readable copyright
nbgf
The application icon written in NBGF
EXE_TYPE
Whether it is an executable or a library
Can be either "standalone" or "library"
Example Data Section
"data": {
"EXE_TYPE": "standalone",
"nbgf": [],
"copyright": "© Annes Widow & Contributors - 2026 - Paint"
}
Text section
This section is where the functions of your program are.
To create a function, simply create a dictionary key with the name of your function.
Note: the "main" function is your program's entrypoint.
Example Text Section
"text": {
"draw": [
{"cal": ["_clearbg", 0, 0, 0, 255]}
],
"main": [
{"cal": ["_setupdrawbuffer", 400, 300]},
{"cal": ["_setloop", "_DRAWLOOP", "draw"]},
{"mov": ["_NEBWIN", true]},
{"mov": ["_WINTITLE", "Paint"]}
]
}
Mnemonics
To use a mnemonic, you need to put a dictionary in a function.
Syntax: { "mnemonic" : [args] }
mov
the mov istruction moves a value into an address.
Can be used to make variables or modify NebulaOS values
Syntax: {"mov" : ["address", value]}
Example (setting the window title):
{"mov" : ["_WINTITLE", "Hello!"]}
Functions
These docs put functions in the way they were coded.
_setupdrawbuffer [WIDTH, HEIGHT]
This sets up the draw buffer that will be shown in the program window
_setloop [LOOP, FUNCNAME]
Set a loop so that when it is called, FUNCNAME is called.
_drawcircle [[X, Y], RADIUS, [R, G, B, A]]
Draw circle in selected framebuffer
_drawrect [[X, Y], [WIDTH, HEIGHT], [R, G, B, A]]
Draw Rectangle in selected framebuffer
_clearbg [R, G, B, A]
fill the selected framebuffer with a color
_startloop [LOOP]
Run LOOP
_len [LIST] -> (int in eax)
Get the length of a list, or other iterable
_checkcollisionrecs [[X1, Y1], [W1, H1]] [[X2, Y2], [H2, H2]] -> (bool in eax)
Return true if the rectangles are colliding
_rand [MIN, MAX] -> (int in eax)
Return a random number between MIN and MAX
_toint [OBJ] -> (int in eax)
Return OBJ converted to an integer
_tostr [OBJ] -> (string in eax)
Return OBJ converted to a string
_getfilecontents [PATH] -> (bytes in eax)
Get contents of a virtual file
_getfileext [PATH] -> (string in eax)
Get final extension of a virtual file
_getfilename [PATH] -> (string in eax)
Get final name of a virtual file
_createfile [NAME, EXT, CONTENTS]
_exportimage [rlIMG, PATH]
_loadtexture [PATH] -> (Image in eax)
_geticon [ICON] -> Image
_drawtexture [TEXTURE, X, Y, [R, G, B, A]]
_createbuffer [WIDTH, HEIGHT] -> FrameBuffer
_bindbuffer [BUFFER]
bind the BUFFER to start drawing to it.
_unbindbuffer
unbind the binded buffer to draw to the main screen again.
_drawbuffer [BUFFER]
_createcolor [R,G,B,A] -> Color
Helper function to convert an RGBA list into a Color.
_listcolor [COLOR] -> [R,G,B,A]
like _createcolor but reversed.
_guibutton [TEXT, X, Y, WIDTH, HEIGHT] -> bool
Draws a button and returns true if it is pressed.
_guicolorpicker [X,Y,W,H, TEXT, COLOR]
Draws a Color picker so that the user can modify COLOR directly
_guislider [X,Y,W,H, TEXTLEFT, TEXTRIGHT, VALUE, MINVALUE, MAXVALUE] -> float
Draws a slider so that the user can modify VALUE, returns the modified VALUE.
_drawtext [TEXT, X, Y, SIZE, R,G,B,A]
_guitextbox [TEXT, LENGTH, X,Y,W,H] -> str
Draws a textbox so that the user can modify TEXT and returns the modified TEXT.
_guimultitextbox [TEXT, X,Y, LENGTH, R,G,B,A] -> str
Similar to _guitextbox, but multiline is possible.
3D drawing
_make3dcam [[X,Y,Z], [TX,TY,TZ], [UX, UY, UZ], FOV, PROJ] -> Camera3D
NOTE: for camera to be shown it needs to be moved to address "cam"
_update3dcam [CAM, MODE]
_drawgrid [SLC, SPC]
_drawcube [[X,Y,Z], W, H, L, R,G,B,A]
_drawsphere [[X,Y,Z], RAD, R,G,B,A]
_loadmodel [PATH] -> Model
_drawmodel [MOD, [X,Y,Z], SIZE, CLR]
Generic functions
_getattr [OBJ, VAL] -> Any
_setattr [OBJ, VAL]
_print [OBJ]
_println [OBJ]
_equals [VAL1, VAL2] -> bool
_index [LIST, INDEX] -> Any
_listappend [LST, OBJ]
_listpopback [LST]
_listpop [LST, IND]
_listremove [LST, OBJ]
Input Functions
_iskeypressed [KEY] -> bool
_iskeydown [KEY] -> bool
_getmousepos -> [X,Y]
Python functions
_py [CODE]
_pytype [CODE] -> Any
_pyeval [CODE] -> Any