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.

Viewing C as assembly

Viewing C as assembly

- [Instructor] Here you see the familiar chestnut, the war horse of all C language tutorials, the "Hello, world!" program. And here you see my Assembly language version of the same code, "Hello, World", which sends this string here at line three to standard output. Obviously, it has more lines of code than the C example. It has two function calls, but the two programs accomplish the same task. I'll run the first program coded in C and the second program coded in Assembly. A listing of the files shows that the C's program size is 9K or thereabouts. The Assembly code's program is just a little bit over 1K. Most of this storage is empty. Still, the Assembly code is smaller, but is it faster or tighter than what the C compiler created? Here's a listing of the Assembly language "Hello, World" program as translated by the assembler. The far left column is an address or offset. The next column are bytes such as the bytes…

Contents