I would like to simulate ARM code. For example, I want to run code like this:
MOV R0, #5
ADD R0, R0, #1
//somehow output R0
And it would output 6 on some software on my Ubuntu. Is it possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Keil MDK can be used to simulate the ARM codes. It provides a Simulate/Debug perspective which can be used to probe the ARM register set, memory content, etc…
MDK-Lite evaluation version is available free of cost for a maximum code size of 32KB.
Linux version of MDK is not available. But Keil MDK works perfectly over WINE in Ubuntu.
Keil uVision MDK Installation on WINE:
Step 1: Install wine on Ubuntu
Open a terminal and type:
Step 2: Download Keil MDK.
Step 3: Install MDK
Right-Click on MDK executable file and select “Open With Wine Windows Program Loader” option.
Step 4: Invoke Keil uVision MDK on Ubuntu
Open a terminal and type:
Step 5: Install Flash Magic (Optional)
Flash Magic is a tool used to download software for Keil boards. Download Flash Magic Software and install it on wine (refer previous steps).
Create a COM1 link to serial port. Open a terminal and type:
Keil uVision MDK Project Creation and Debugging:
Step 1: Create a Keil UVision project for ARM7 target.
In Keil UVision tool bar select Project –> New Project.
Navigate to a location where you want to create this project.
Enter a project name and click Save.
Select ARM –> ARM7(Little Endian) as device for Target. Click OK.
Step 2: Create an assembly source file for the target
In Keil UVision tool bar select File –> New. Add the following code to the newly created file:
Provide tab-space before each assembly statement as done above. Save the file with ‘.s’ extension.
Step 3: Add source file to project
In Project window (located left side of UVision), Right click on Source Group 1 and select “Add Files to Group Source Group 1” option.
Select test.s and click ‘Add’. (Select File Type as ASM Source file)
Step 4: Build source file
In Keil UVision tool bar select Project –> Build target or Press F7 to compile the source file.
Step 5: Simulate/Debug application
In Keil UVision tool bar select Debug–> Start/Stop Debug Session or Press Ctrl + F5.
The debug perspective opens up with a Register view at left side, Code View at center, Memory view at right bottom, etc…
Use the debugging keys to execute the code:
Observe Register view at end of program execution:
In Keil UVision tool bar select Debug–> Start/Stop Debug Session or Press Ctrl + F5 to come out of Debugging Perspective.