From the course: Advanced C Programming: Integrating C and Assembly Language

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Building assembly code

Building assembly code

- [Instructor] Like C or any other programming language, creating an assembly programs involves three steps. First, write the source code. Use your favorite editor for this task. Second, assemble. This step is analogous to the compiling of C code. The result is the same. An object code file. Third, link. This step is the same in C, the object code file is linked to form a program but with assembly, no libraries are linked in. What you write in assembly is the entire program, everything. Here in the Vim text editor, I have assembly code written and it's available in the exercise files. This code outputs a text message. It's the traditional Hello, World program though with a different message output. The message itself is stored in the data section at line four. The message output routine starts at line 21, assigning the string's address to register rsi. Comments in the code explain the detail, which you can…

Contents