The invention discloses a code analysis and
conversion method, device and equipment and a readable storage medium. In the code analysis stage, embedded program codes are sequentially partitioned,
process control instructions in all code blocks are analyzed, the code blocks are divided into sub-code blocks, and the process relation and jump conditions between the sub-code blocks are established; and performing iterative
processing until splitting cannot be continued, constructing a register mapping structure by utilizing the target code in a
code conversion stage, converting each code block instruction into a target
instruction set instruction through an instruction conversion
library, packaging sub-code blocks containing a circulation process by using a target circulation instruction, and splicing the converted code blocks according to an execution process to generate the target code. Through block analysis and dynamic instruction conversion, an embedded
program code is disassembled into atomic units according to a process structure, a mapping relation is established, automatic
transplantation of a cross-architecture code is realized based on register architecture
adaptation and semantic conversion of an instruction
library, the
workload of manual
transplantation is remarkably reduced, and functional consistency is ensured.