开发者

How can I load C application with Assembly?

开发者 https://www.devze.com 2023-01-28 20:42 出处:网络
I开发者_开发技巧t\'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 Linu

I开发者_开发技巧t'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 ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号