Reputation: 431
I want to know how to write a text editor in assembler. But modern operating systems require C libraries, particularly for their windowing systems. I found this page, which has helped me a lot.
But I wonder if there are details I should know. I know enough assembler to write programs that will use windows in Linux using GTK+, but I want to be able to understand what I have to send to a function for it to be a valid input, so that it will be easier to make use of all C libraries. For interfacing between C and x86 assembler, I know what can be learned from this page, and little else.
Upvotes: 5
Views: 3055
Reputation: 101289
The OS may define the calling standard (it pretty well must define the standard for invoking system calls), in which case you need only find where that is documents and read it closely.
Upvotes: 2
Reputation: 994529
One of the most instructive ways to learn how to call C from assembler is to:
gcc -S
)This approach makes it easy to experiment by starting with something that is already known to work. You can change the C source and see how the generated code changes, and you can start with the generated code and modify it yourself.
Upvotes: 10
Reputation: 4199
The links you have in your question show all these steps.
Upvotes: 1