Staccato
Staccato

Reputation: 23

How can I load C application with Assembly?

It's the same idea as Operating system boot loader. I have a C source code and Assembly source code. I want the assembly code to pass control to the C application. I am working on Linux and using GCC + NASM for compiling. Do I need to compile them in a special way? What's the assembly code used to load the c application and start it ?

Upvotes: 2

Views: 208

Answers (1)

joni
joni

Reputation: 5482

Let gcc and nasm produce object files which you can link together. You have to use the right symbol names, too. In the NASM manual, you can find a nice explanation including examples. As it is not explained how to compile the examples using gcc and a linker, you can find these things explained here.

Upvotes: 2

Related Questions