VM opcodes and their implementation

If I understand everything correctly the EV3 Brick is basically a 300 MHz ARM processor running some form of Linux, and on top of that there is a program running that is the LEGO MindStorms VM. So all the opcodes I use have been implemented in C and compiled to native code and that C source code is included in the GitHub repository, as well as the source code to the Linux distribution.

So whenever I’m looking for a function or want to know what parameter a function takes and what the parameter is used for I look into the C source. There is a great overview of all opcodes in bytecodes.c/h so that is usually my first stop. That let’s me look for opcodes that seem to be the one I want and I can easily find permutations of opcodes.

The parameters are listed by type but not described, so if I need more information than that I look for the native implementation of an opcode. In the native implementation the parameters are named, there’s usually a useful comment on the function, and if I still don’t understand I can read the C code to try to understand what it does.

I intend to create my own reference of the opcodes, together with descriptions, examples and comments from my experiments.

Leave a Reply