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]}


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]


_loadtexture [PATH] -> (Image in eax)


_drawtexture [TEXTURE, X, Y, [R, G, B, A]]


_createbuffer [WIDTH, HEIGHT]


_bindbuffer [BUFFER]


_unbindbuffer [BUFFER]


_guibutton [TEXT, X, Y, WIDTH, HEIGHT]


_drawtext [TEXT, X, Y, SIZE, R,G,B,A]


_guitextbox []