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.

Putting assembly language into C code

Putting assembly language into C code

- [Instructor] The marriage of C and Assembly Language can start with a linking of a compiled C object file, with an assembled Assembly Language object code file. These object code files are then linked together to form a single program. The reason this marriage works is that object code is a common lingo in programming, providing that the right hooks exist in each file, linking works. The hooks include making function names public or global, and properly calling the function in the related languages. This C source code file doesn't need the standard I/O header file, because output is supplied in an assembly module. The assembly function must be prototyped shown here at line five. The message function has no return value and takes no arguments. This function, which is Assembly Language code is called in the for loop in the code's main body. The assembly module contains a single function, message. It's declared globally at…

Contents