5. Using the C Language

When we learned how to do bare metal programming in the last chapter, we created a bare metal application using assembly language. Once that step is complete, we want to move to the C language programming environment as soon as possible. With C, we are able to work more efficiently and can capitalize on better portability of our code. In this chapter, we explore how to switch from working with assembly language programs to the C language environment. The C language environment is prepared by a piece of assembly code called C startup code. After discovering how this code works, we consider how to call a C function from assembly language versus how to call an assembly function from the C language.

C Startup in a Bare Metal ...

Get Embedded Programming with Android: Bringing Up an Android System from Scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.