Title: | Languages |
Notice: | Speaking In Tongues |
Moderator: | TLE::TOKLAS::FELDMAN |
Created: | Sat Jan 25 1986 |
Last Modified: | Wed May 21 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 394 |
Total number of notes: | 2683 |
We are developing software to work well with a variety of language RTLs and for various reasons need to use global registers. We have found that BASIC apparently uses R9, R10, and R11 as call linkage global registers (i.e. those registers contain global information at the time the RTL is called). Are there any other languages that do this?
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
288.1 | You *Must* Not Care | TLE::BRETT | Thu Oct 25 1990 20:46 | 18 | |
"Need to use global registers". The way the VMS calling std works, any routine is allowed to use ALL the registers, and is required to restore ALL EXCEPT R0,R1 as part of the return sequence unless there is an explicit agreement with the calling routine that a different set of registers may be modified after the return. Lots of the RTL's have an agreement between them and the compiler generated code to use registers to pass parameters in - which is what the BASIC RTL is really doing. Lots of RTL's also modify registers other than R0 and R1 on return - again known by the compilers. If you are really developing s/w to work well with a variety of languages, then you should keep to the VMS calling standard, in which case you won't have to ask questions like this one. /Bevin | |||||
288.2 | TALLIS::KIRK | Matt Kirk | Fri Oct 26 1990 14:07 | 9 | |
We'd love to stick completely to the VMS calling standard but have a problem with retaining certain types of state information (can't be stored in memory). It doesn't matter much because the code is part of an emulator that will go away when the hardware becomes available. So it will never make it to customers, and we think the solution we found (using AP) will us hold until then. M | |||||
288.3 | TLE::BRETT | Fri Oct 26 1990 17:43 | 3 | ||
lots of VAX code uses the AP as "just another scratch register" /Bevin | |||||
288.4 | TALLIS::KIRK | Matt Kirk | Mon Nov 05 1990 14:27 | 2 | |
AP normally gets restored though. And it doesn't screw up the debugger like FP and SP. |