# [Write Arm Assembler functions](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/asm/)

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/asm/)
- [Keil MDK versions](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/asm/intro/)
- [Setting up a Project in Keil Studio (VS Code)](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/asm/setup_mdk6/)
- [Setting up a Project in Keil MDK (μVision)](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/asm/setup_mdk5/)
- [Writing assembly functions](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/asm/coding/)
- [Next Steps](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/asm/_next-steps/)

## About this Learning Path

| Skill level:          | Introductory               |
|-----------------------|----------------------------|
| Reading time:         | 1 hr                       |
| Last updated:         | 08 Jul 2026                |

| Author:               | Ronan Synnott, Arm [LinkedIn](https://linkedin.com/in/ronansynnott) |
|-----------------------|----------------------------------------------------------------------|
| Arm IP:               | [Cortex-M](https://support.arm.com/?tab=compute-ip&Product%20Type=Microcontrollers) |
| Tags:                 | Performance and Architecture, Baremetal, Keil MDK                   |

### Who is this for?
This is an introductory topic for software developers who are interested in programming microcontrollers with C/Assembly.

### What will you learn?
Upon completion of this Learning Path, you will be able to:
- Write a mixed C program and assembly language subroutines for the microcontroller.
- Call the subroutines written in assembly in a C function.
- Use Arm register calling conventions when writing subroutines in assembly language.
- Step through the code to understand operation.

### Prerequisites
Before starting, you will need the following:
- Some familiarity with C/Assembly.
- An installation of Keil MDK.

### Summary
You’ll build a small mixed C and assembly program for Cortex-M using Keil MDK. First, you’ll set up a project in either Keil Studio (VS Code) or μVision for the `ARMCM4` target, add CMSIS core and startup components where required, and configure the Cortex-M4 Fixed Virtual Platform as the debug target. Then, you’ll write two assembly subroutines for string copy and capitalization, called from a C `main()` function, while following the Arm Procedure Call Standard. By stepping through the program in the debugger, you’ll observe register use and memory updates and verify that the destination buffer reflects the copied and capitalized string.

### Frequently asked questions

<details>
<summary>Do I need a physical board to run the examples?</summary>
No. The steps use the Cortex-M4 Fixed Virtual Platform provided with MDK, so you can run and debug without hardware.
</details>

<details>
<summary>Which target device should I select when creating the project?</summary>
Select **ARMCM4** as the target device. This applies to both Keil Studio (VS Code) and μVision.
</details>

<details>
<summary>How do I configure debugging to use the Fixed Virtual Platform in μVision?</summary>
Open **Options for Target**, go to the **Debug** tab, and select **Models Cortex-M Debugger**. Use this configuration to run on the Cortex-M4 FVP.
</details>

<details>
<summary>Which components do I add when setting up the μVision project?</summary>
Add **CMSIS > Core and Device > Startup** when prompted for software components. This prepares the project for the ARMCM4 device and startup sequence.
</details>

<details>
<summary>What result should I expect when the C and assembly functions run correctly?</summary>
The destination buffer contains a copy of the source string, and the capitalization routine updates characters as intended. Step through the code to observe register usage and memory changes that match these operations.
</details>
