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

Unlock this course with a free trial

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

Solution: Constructing a dialog

Solution: Constructing a dialog

- [Instructor] Here's the C module, the main module for my solution to the challenge, all the functions are prototyped upfront including the assembly functions at lines three, five, and seven. The main function, well, it's pretty boring. It calls each function one after the other as go the lines in the dialog, starting at line 22 are the three output functions for C, it's part of the dialog. This is really easy, but the point is to integrate the languages not to demonstrate what each language can do. In the assembly code, the three strings and their lengths are declared in the data section. The text section contains the three functions, each of which is global, and each of which has similar commands. Reference the string, reference its length, send it to standard output with a system write call, call the system and return. This is repeated for each of the dialog functions. The C language file is compiled at the…

Contents