Hi
I have a lot of ASM snippets and I am in the process of trying to recode most of them to C. It is a long and tedious process it seems to make sure they are identical and function identically.
Is there any scripts or tooling that can automate this process to rebuild the structural syntax and I relabel the global and local defines as needed after the process completes?
To call assembly from C, you simply use the normal C syntax for a function call. This assumes, of course, that the assembly function was written using the C calling conventions.
If not, there's no way to call the function, because it wasn't designed to be callable from C. (You could hack some special cases such as void (void), or try to inline the call setup and hope the code generator doesn't interfere, but why?) If the assembly doesn't conform to Keil C calling conventions and isn't structured, then it will be hard for a tool to convert to C to any good effect. (It won't help to create a C program that simply apes the assembler line-by-line; if the tool cannot extract higher level control structures and meaningful identifiers, then the code won't get any more readable, and might be less.)