Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
it describes how to compile plain binaries with gcc...i have followed the examples in there and compiled them the way im told in there and the problem is: i dont get the same compiled results as described in the pdf! i have disassembled the compiled output and i get different output..it seems there have been too many changes to the gcc compiler since this was written...can anyone tell me where else i can find information on how to make binary files with c???
i also gave it a try by simply jumping to the compiled binaries from my assembly code, which didnt work can u help me?
I attend that university (York UK). RTS is realtime systems, and is all done in ADA95, for embedded systems. I wouldn't be surprised if the docs there are out of date. The document also isn't written by anyone at York uni, so I'm not sure of it's quality. What exactly is the difference between your results and theirs?
JamesM wrote:I attend that university (York UK). RTS is realtime systems, and is all done in ADA95, for embedded systems. I wouldn't be surprised if the docs there are out of date. The document also isn't written by anyone at York uni, so I'm not sure of it's quality. What exactly is the difference between your results and theirs?
there are a couple extra instructions in my output plus, im not sure, when i compile a file with several functions where main() calls one of the other functions and i specify main() as the entry functions, i get the impression that main() is not really the code that is place right at the top of the output, not so sure though..looks all a bit weird to me..ill post it when i come home from work...
What are all these extra instructions all about? Am I really supposed to be able to execute this in a no-strings-attached environment, i.e., without any operating system? Also, is there no way to specify in the compiler options that main() neednt really be compiled as a function, since I'm not technically calling it but only jmp'ing there...
Thanks for any help
All of that extra code seems to be there in order to align the stack to a 16 byte boundary. That code will run just fine without an operating system, it doesn't call any other functions, it doesn't do any privileged operations it just aligns the stack. If you don't want main to return put a for( ;; ) before the end bracket and it can't possibly return.