SYSTEM.EMITH Problem
Posted: Wed Dec 27, 2023 1:54 am
This test code
results in a compiler exception (Astrobe for M0, v9.0.3):
After I had run into this in my "real code" (the SEV = send event instruction is part of the initialisation sequence to get the second CPU core on the RP2040 going), I have tested some other 16 bit values, random and "around" the offending one, which all compiled.
Can I work around this by inserting a NOP together with SEV, and use SYSTEM.EMIT?
Code: Select all
MODULE TestEMITH;
IMPORT SYSTEM;
CONST SEV = 0BF40H;
BEGIN
SYSTEM.EMITH(SEV)
END TestEMITH.
Code: Select all
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Decode.Decode.Op16IfThen(Int32 instr)
at Decode.Decode.Decode16(Int32 instr)
at DecObj.DecObj.DecodeFile1(Writer w, Char[] path, Boolean& ok)
at Compiler.Compiler.Compile(String source, Writer w, Int32& errcnt)
Can I work around this by inserting a NOP together with SEV, and use SYSTEM.EMIT?
Code: Select all
CONST NOPSEV = 046C0BF40H;
...
SYSTEM.EMIT(NOPSEV)