Require functionality to designate assembly only sections of code
We require the functionality to specify sections of the code to be left as assembly.
This is because the original section of code itself was ASM and not a higher language. Thus attempts to force high level language structures on the ASM cause a wide variety of errors and stack issues.
This has been spotted in the x86 real 16-bit ms-dos project that I am working on. Specifically after memory or file operations the code calls (via goto's?) ASM code for stack / memory purposes.
The calls do not correspond to standard calling convention and seperate sections of the ASM are called depending on circumstances (Different entry points into the same ASM).
This non-compliance to function calling convention and low level ASM commands causes the decompiled function to be wildly wrong and further propogate stack issues into otherwise valid decompiled functions thus causing the decompiler to choke on variable declarations due to broken stack tracking.
Proposal:
A new [[Reko::AssemblyRegion]] tag (Syntax to be decided)
We'd need to specify a range (0000:1234) to (0001:5678) for the decompiler to ignore and mark as an ASM block. Calls into the ASM block would need to be intercepted and the ASM section lifted as inline to the calling function.
The internal UserProcedure.Decompile flag does almost but not quite want you want. When cleared, it inhibits the generation of HLL, However, it doesn't doesn't attempt to trace execution either, which isn't what you're asking for..
What needs to happen is that the flag is split out into Trace and Dcompile. The Trace flag should have the same behaviour as Decompile has today. Clearing the new Decompile flags still traces the procedure, but doesn't attempt to generate HLL for it. A procedure with a cleared Trace implies a cleared Decompile as well. Further changes need to be made in the GUI and output generator to respect the new flag.