Home  >  Article  >  Backend Development  >  How to convert c language into assembly language

How to convert c language into assembly language

anonymity
anonymityOriginal
2019-05-05 09:56:1631005browse

How to convert C language into assembly language: You can manually convert into assembly language according to the process and purpose of C language. If we want the workload to be smaller, we can use the simulation software KEIL UVISION3 to perform the conversion.

How to convert c language into assembly language

Method 1:

Completely manually adapt it into assembly language according to the process and purpose of C language, do this A lot of work

Method 2:

For C language, compile and debug first. Use F10 on the DEBUG interface for single-step debugging. There will be an assembly corresponding to C. code. Of course, the readability of this code is very poor and requires some manual processing.

Method three:

Use the simulation software KEIL UVISION3. In the simulation environment, there is a corresponding assembly code. The workload is relatively small, but it can Poor readability.

Step 1: Still use Keil 3 software to open our project, compile and check whether there are any error warnings

Step 2: Click the "Debug Simulation" button in the Keil software (the second one in the picture below) button with a lowercase "d" in the row), enter the software single-step debugging mode, and then open the "Assembly Conversion" window (red circle)

How to convert c language into assembly language

Step 3: Adjust the program display When the swap window is larger than the position, you can see the converted assembly language. Compared with the conversion effect just now, this time we can see the assembly language operation corresponding to each semicolon statement, combined with the single-step debugging function of Keil 3 software , learning is also more convenient.

The following is the effect of single-step debugging mode. Green indicates the statement we have executed, and the yellow arrow indicates the statement we are running at this time.

The above is the detailed content of How to convert c language into assembly language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn