DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦e0ed54096⟧ TextFile

    Length: 5567 (0x15bf)
    Types: TextFile
    Notes: R1k Text-file segment

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦6a5ebecf5⟧ 
            └─⟦this⟧ 

TextFile

|---For use with TeleGen2 on 68K Unix
|
|------------------------------------------------------------------------------
|-- Copyright 1990 - 1991 by Rational, Santa Clara, California.
|--
|--                  All Rights Reserved.
|--
|-- Permission to use, copy, modify, and distribute this software and its
|-- documentation for any purpose and without fee is hereby granted,
|-- provided that the above copyright notice(s) appear in all copies and that
|-- both that copyright notice(s) and this permission notice appear in
|-- supporting documentation, and that the name of Rational not be used in
|-- advertising or publicity pertaining to distribution of the software
|-- without specific, written prior permission.
|--
|-- Rational disclaims all warranties with regard to this software, including
|-- all implied warranties of merchantability and fitness, in no event shall
|-- Rational be liable for any special, indirect or consequential damages or
|-- any damages whatsoever resulting from loss of use, data or profits, whether
|-- in an action of contract, negligence or other tortious action, arising out
|-- of or in connection with the use or performance of this software.
|------------------------------------------------------------------------------
|
| Used to invoke a procedure variable (procedure or function) that has any
| kind of IN, OUT, or IN OUT parameters.  This is the most general form and
| it will work properly with any procedure or function.

        .data
        .text
        .proc

|---Usage:
|       Xlbmt_Invoke_Function ( Function'Address,
|                               Function_A4,
|                               First_Argument'Address )

        .globl  _Xlbmt_Invoke_Function
_Xlbmt_Invoke_Function:

|---Standard Ada prologue

        link    a6,#-4
        movl    a4,a6@(-4)              | Save a4

|---Get our caller's A6.  Then we can get his saved SP.  His SP minus our
|   A6 gives us 8+4*<number of arguments>.  We expect 3 arguments but
|   certain return types cause us to end up with 4 arguments.

        movl    a6@,a1                  | Get caller's A6
        movl    a1@(-4),a0              | Get caller's saved SP
        subl    a6,a0                   | Get difference
        cmpl    #20,a0                  | Do we have 3?   (8+4*3=20)
        jne     L40                     | No, we have an extra argument.

|---Sometimes the argument list is not on a 32 bit boundary.  Adjust our
|   argument address to be on a 32 bit boundary.

        addl    #2,a6@(8)               | Add 2 to the address
        andl    #-4,a6@(8)              | Modulo-4; 32 bit boundary

|---Get address of the first argument in a0, then get address of 1st location
|   past the last argument in a1.

        movl    a6@(8),a0               | Get address of 1st argument
        movl    a6@,a1                  | Get caller's A6 register.
        addql   #8,a1                   | Get addr of last word in Nth argument

|---Sometimes the end of the list is not on a 32 bit boundary.  Adjust our
|   starting address to have the same offset; we know we are pasing words.

        movl    a1,d0                   | Get our ending address
        andl    #3,d0                   | Keep the bottom 2 bits
        addl    d0,a0                   | Add that offset to the starting addr

|---Push our arguments onto the stack again so that we can call the subprogram
|   and he can access them.  Loop until a0==a1.

        cmpl    a0,a1
        jge     L37
L36:
        movl    a0@-,sp@-
        cmpl    a0,a1
        jlt     L36
L37:

|---Set A4 for our subroutine and then call him.  A routine with all IN
|   parameters will pop them all off himself.  Check the SP when he gets back.

        movl    a6@(12),a4
        movl    a6@(16),a0
        jsr     a0@

|---Standard Ada epilogue

        movl    a6@(-4),a4              | Restore a4
        unlk    a6
        rts

|---Come here when we have 4 arguments instead of 3.

L40:

|---Sometimes the argument list is not on a 32 bit boundary.  Adjust our
|   argument address to be on a 32 bit boundary.

        addl    #2,a6@(12)               | Add 2 to the address
        andl    #-4,a6@(12)              | Modulo-4; 32 bit boundary

|---Get address of the first argument in a0, then get address of 1st location
|   past the last argument in a1.

        movl    a6@(12),a0              | Get address of 1st argument
        movl    a6@,a1                  | Get caller's A6 register.
        addl    #8,a1                   | Get addr of last word in Nth argument

|---Sometimes the end of the list is not on a 32 bit boundary.  Adjust our
|   starting address to have the same offset; we know we are pasing words.

        movl    a1,d0                   | Get our ending address
        andl    #3,d0                   | Keep the bottom 2 bits
        addl    d0,a0                   | Add that offset to the starting addr
        movl    a0,a6@(8)               | Save so we don't have to recompute

|---Push our arguments onto the stack again so that we can call the subprogram
|   and he can access them.  Loop until a0==a1.

        cmpl    a0,a1
        jge     L47
L46:
        movl    a0@-,sp@-
        cmpl    a0,a1
        jlt     L46
L47:

|---Set A4 for our function and then call him.  We have all IN parameters
|   so we don't have to copy anything out.

        movl    a6@(16),a4
        movl    a6@(20),a0
        jsr     a0@

|---Standard Ada epilogue

        movl    a6@(-4),a4              | Restore a4
        unlk    a6
        rts

        .data