MjIL assembler language - AtomCrafty/MajiroTools GitHub Wiki

MjIL assembler language

This page documents the homegrown language created for disassembling and assembling Mjo scripts.

Recommended References:

Table of contents


Comments

Line comments do not support the EOL \ escape to continue to the next line.

; information line comment
// line comment
/* block comment */

Labels

Branch labels

block_000ae6:
  //...
  br       @block_000ae6

Address labels

Address labels are standard numeric hex that state the original bytecode address of an instruction.

001b74: ldc.i    0

Functions

func $1D128F30(int, float) {
  //...
}

Directives

Entrypoint

Declare the main entrypoint function of the script.

Entrypoint functions are expected to be void return with no parameters. All ret instructions should be passed 0 from the stack.

func $1D128F30() entrypoint {
  //...
}

Readmark

Enable/disable the read flag mark, which is used to mark story messages as read or not.

readmark enable|disable

Group

Warning: This is not supported, and is only a proposed addition.

Specify the default group appended to named declarations without a group defined. (by default this is GLOBAL)

group "GROUPNAME"

Aliasing

Warning: This is not supported, and is only a proposed addition.

Alias opcodes, function names, variable names, hashes, etc.


Instructions

Implicit behavior