[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::languages

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

288.0. "Global register usage in RTLs" by TALLIS::KIRK (Matt Kirk) Thu Oct 25 1990 15:28

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.RTitleUserPersonal
Name
DateLines
288.1You *Must* Not CareTLE::BRETTThu Oct 25 1990 20:4618
    "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.2TALLIS::KIRKMatt KirkFri Oct 26 1990 14:079
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.3TLE::BRETTFri Oct 26 1990 17:433
    lots of VAX code uses the AP as "just another scratch register"
    
    /Bevin
288.4TALLIS::KIRKMatt KirkMon Nov 05 1990 14:272
AP normally gets restored though.  And it doesn't screw up the debugger
like FP and SP.