|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Mon Jan 15, 2018 3:48 pm Post subject: Re: |
|
|
LitusSaxonicum wrote: | If I am right (and I concede that it is about 20 years since I last worked with Assembler, so I could be wrong), then all a FUNCTION returns is the address to its result on the stack. |
The compiler writer is free to implement function calls that way, but that is not how FTN95 handles functions that return simple scalar type results (such as integer, real and double precision). For example, for functions of type INTEGER, the return value is held in AX, EAX or RAX. For functions of type real, the return value is in ST0 or XMM0. No address is needed or used, as with more general expressions.
Things were different when we had 8-bit or 16-bit computers, and a register was insufficiently large to hold Fortran integers (other than INTEGER*2 and INTEGER*1).
If such a character type function is referenced in an expression or an I/O list, the compiler may have to create a temporary variable on the stack to hold the result and pass the address or value of the temporary variable to the I/O routines. |
|
Back to top |
|
|
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Mon Mar 12, 2018 2:18 pm Post subject: A related question... |
|
|
When using DRAW_CHARACTERS@, with a proportional font, is there a way to determine the size in pixels of the box that contains the text, such that right/centre justification can be calculated for hardcopy...
K |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Mar 12, 2018 2:47 pm Post subject: |
|
|
Try GET_TEXT_SIZE@. |
|
Back to top |
|
|
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Mon Mar 12, 2018 3:26 pm Post subject: |
|
|
Perfect, tks!
i was obviously searching for the wrong key words in the help file!
K |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|