The Assembler will let you create EV3 Bytecode programs (.rbf) outside of the LEGO-provided environment.
The Opcodes are described in the "EV3 Firmware Developer Kit" on The Mindstorms Download Page
There are some minor changes compared to the documentation:
The 'STRINGS' opcode is spelled 'STRING' in EV3Utils
The 'GET_BUMBED' subcode for UI_READ was obviously a typo in the LEGO doc and the EV3Utils uses the correct spelling of 'GET_BUMPED'
For 'INIT_BYTES' and the INIT functions in 'ARRAY', the count of objects is generated by the assember and is not needed.
The EV3Utils assembler has different syntax and features than the one which comes with the LMS2012 source code. Key differences include:
| Feature | LMS2012 | EV3Utils |
|---|---|---|
| Multi-line comments | /* a comment */ | Not supported |
| Single-line comments | // my comment | ; my coment |
| Line continuation | '=' at the end of the line | Not (yet) supported |
| Define | define NAME value | %define NAME value |
| Include Files | Not supported | %include "filename.inc" |
| Line Directives | Not supported | %line 33 myfile.lms |
| Subcall parameters | Listed as local variables | subcall fact(IN_32 n, OUT_32 result) { |
| Arrays and String Sizes | DataS string 32 | DataS[32] string |
| Subcodes | UI_WRITE(LED, LED_RED) | UI_WRITE.LED(LED_RED) |
| Strings | Single-quote delimited | double-quote delimited |
| Character constants | Not supported | Single-quote delimited |
| Preprocessor Arithmetic | ??? | basic math supported |
| Output Listing | Not Supported | The 3rd filename of the assembler is the listing file name |
| Error Checking | Hardly any | Lots...too much, sometimes |
| Relative Jump Size | +/- 32K | +/- 2G |
| Implementation Language | Some LOGO Dialect | JAVA |
| Usability | Hard to use outside of LMS2012 Environment | Single runnable JAR |
Bytecode definitions are based on the 1.07 source code, but can be regenerated in the source by running a perl script to regenerate the java source.