I have looked for other ways of programming the cortex but they seem more complicated and much more buggy(there will be no VM to handle some exceptions if you use GCC ARM toolchain), so i still use robotc, but in my opinion, robotc’s compiler and its IDE are a bit buggy,though the VM works pretty well. I tried to disassembly the robotc IDE and i tried to fix some of the bugs by myself, but i failed because it’s not open-source. Then i plan to make my own compiler using the robotc VM(or a compiler with GCC or Clang frontend but a custom backend to generate robotc opcodes), then i begin studying the inside mechanisms in the RobotC(mostly the format of compiled robotc bytecode). But i found hard to understand. According to the java bytecode format that i’ve studied and what the disassembly window has told me, i guess the format should be like that:
header:
magic numbers to validate the program(maybe)
firmware version(maybe)
program info(maybe)
functions declaraions that records the entry point of each function(i’m sure it exists but i don’t know the exact format)
constant pool(i’m sure it exists but i don’t know the exact format)
functions:
bytecodes of function1
bytecodes of function2
bytecodes of function3
bytecodes of function4
bytecodes of function5
…
most of the compiled bytecodes can be known using the disassembly so understanding the ‘functions’ part should be easier to understand, what i don’t know is the header part.
as you can see from attachments, i’ve made a little progress on understanding the real bytecode, is there anyone who did similar attempts before?