DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ C T

⟦2b15185f8⟧ TextFile

    Length: 4454 (0x1166)
    Types: TextFile
    Names: »CALLBACK_ASM«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

.set R0,0                                                                       
.set SP,1                                                                       
.set R2,2                                                                       
.set R3,3                                                                       
.set R4,4                                                                       
.set R5,5                                                                       
.set R11,11                                                                     
.set R12,12                                                                     
.set R19,19                                                                     
.set R20,20                                                                     
.set R29,29                                                                     
#  On entry,                                                                    
#     R3 -> Ada 'subprogram value (not C callable)                              
#     R4 -> output parameter area                                               
#                                                                               
#   On return, R3 -> "C" function descriptor that can be called                 
#       from C, and will call the Ada program described by the                  
#       input parameter;                                                        
 .csect  .ada_to_c{pr},3                                                        
 .globl  .ada_to_c{pr}                                                          
#                                                                               
#   Create the C callable function descriptor from the Ada subprogram           
#     value.                                                                    
#                                                                               
     l    R5,T001(R2)      # get entry point of assembly bridge                 
     st   R2,4(R4)         # save toc into output parm                          
     st   R5,0(R4)         # set into output param                              
     st   R3,8(R4)         # save Ada subprogram value                          
     cal  R3,0(R4)         # R3 := R4                                           
     br                                                                         
                                                                                
 .csect   .ada_to_c_bridge{pr},3                                                
 .globl   .ada_to_c_bridge{pr}                                                  
 #                                                                              
 #    R11 -> ada subprogram_value                                               
 #                                                                              
 mflr     R12                                                                   
        cal      SP,-128(SP)                                                    
 ai       R0,R11,0       # preserve R11                                         
 mfcr     R11                                                                   
 stm      R11,36(SP)      # save important stuff, so we can call Ada            
 ai       R11,R0,0        # restore R11                                         
 l        R12,0(R11)      # R12 = ada entry point                               
 mtlr     R12                                                                   
 l        R29,8(R11)      # load static link                                    
 cal      R20,0(0)        # stack top is infinite....                          
 brl                                                                            
 ai       R3,R19,0        # move function return to C register                  
 lm       R11,36(SP)      # restore important stuff                             
 mtcr     R11                                                                   
 mtlr     R12                                                                   
        cal      SP,128(SP)                                                     
 br                                                                             
      .toc                                                                      
T001:   .tc  T001{tc},.ada_to_c_bridge{pr}