very small os. I would like to make as much as i can in asm, like fuctions, then use c/c++ to run them and make a command line and GUI.
Three answers:
DogmaBites
2009-02-10 08:41:45 UTC
Yes you can. You can write functions in either C, C++ or assembly and call from one to the other at will. However, you have to be knowledgeable about calling conventions. C and C++ can have different calling conventions and you have to respect that when you write your assembler function.
In you project, you can have a mix of .c, .cpp and .asm files and your make system should know how to build each. Your linker can link the object files. Again the hardest is assembly where you have to write the assembler such that the linker can find your functions.
But it is definitely possible. In fact common. If you look at the linux kernel code you can find some assembler, especially in the arch directory.
2009-02-10 08:16:02 UTC
Your question regarding "Make a command line and GUI" is unclear, but yes, you can use what's called "inline assembly" to call asm instructions inside your C/C++ code.
?
2017-01-13 04:30:48 UTC
I discovered while i became approximately 13 or 14. I discovered cyber web Programming by examining HTML for Dummies. in the experience that your interested in computing gadget Programming i examine a e book on VB .internet and discovered alot on a thank you to try this additionally. So my advice, regardless of you prefer to learn there are large books available!!
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.