- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For an assembly routine that is to be called from a CVF Fortran routine, what what are the rules regarding restoring registers?
The documentation says that any register that is used must be restored to the value it had on entry to the routine. However, in two of the examples in the SAMPLESMIXLANGMASM folder, several registers are used but only the EBX register is saved and restored.
Are there any other registers which, if used, must be restored?
The documentation says that any register that is used must be restored to the value it had on entry to the routine. However, in two of the examples in the SAMPLESMIXLANGMASM folder, several registers are used but only the EBX register is saved and restored.
Are there any other registers which, if used, must be restored?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The usual calling conventions for Win32 state that EAX, ECX, and EDX may be destroyed by the callee. Also, EFLAGS may be modified by the callee, however the direction flag DF in EFLAGS must be preserved (or reset to "UP" before exit from the function). On function exit, EAX contains a function result of integral or pointer type, if any.
CVF follows the above rules, as does IFL, MSVC etc. Interestingly enough the Win32 conventions seem to match the System V ABI.
CVF follows the above rules, as does IFL, MSVC etc. Interestingly enough the Win32 conventions seem to match the System V ABI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the information!
Is "System V ABI" a Unix calling convention standard, or what?
Is "System V ABI" a Unix calling convention standard, or what?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The "System V ABI" is a fairly large document that devotes a rather small section to calling conventions used by Unix systems on various platforms. Specifically it covers these in the psABI (processor specific ABI) documents, wheras processor independent stuff is found in the GABI (general ABI) document. The current psABI for 32-bit x86 platforms can be found here, among other places:
stage.caldera.com/developer/devspecs/abi386-4.pdf
There are also downloadable psABI document on the web for PPC, MIPS, SPARC, and x86-64. I figure it might not be politically correct to list pointers to these in this Intel forum, but there is always Google :-)
stage.caldera.com/developer/devspecs/abi386-4.pdf
There are also downloadable psABI document on the web for PPC, MIPS, SPARC, and x86-64. I figure it might not be politically correct to list pointers to these in this Intel forum, but there is always Google :-)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page