Abstract:Aiming at the present situation that needs to develop a code review tool for assembly codes, this paper studies the procedure of manual code reviews and proposes a method to detect defects in assembly codes based on static analysis. After the control flow linearization, compiler patterns are used to solve indirect jumps, and node cloning is used to recover the control flow of the delayed branch. In the construction of inter-procedural control flow graph, the recursive function is in-lined by means of a call trace with limited depth. The prototyping tool for ADSP SHARC assembly codes is realized finally. Experimental results show that the tool can effectively detect defects in loops, registers, and memory accessing.