|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T X
Length: 3923 (0xf53)
Types: TextFile
Names: »XLBMT_STRING_FUNCTION_68K_UNIX_S«
└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
└─⟦0c20f784e⟧ »DATA«
└─⟦1abbe589f⟧
└─⟦059497ac5⟧
└─⟦this⟧
|---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_String_Function ( Function'Address,
| Function_A4,
| First_Argument'Address )
.globl _Xlbmt_Invoke_String_Function
_Xlbmt_Invoke_String_Function:
|---Standard Ada prologue
link a6,#-12
movl sp,a6@(-4)
movl a4,a6@(-12) | Save caller's a4
|---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@(28) | Add 2 to the address
andl #-4,a6@(28) | 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@(28),a0 | Get address of 1st argument
movl a6@,a1 | Get caller's A6 register
addl #28,a1 | Get addr of last word in Nth arg
|---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 | Any arguments to copy?
jge L137 | Jump if not
L136:
movl a0@-,sp@- | Loop copying arguments
cmpl a0,a1
jlt L136
L137:
lea sp@(-12), sp | Strings require 5 more words
movl a6@(12), sp@- | two of them were arguments to us.
movl a6@(8), sp@-
|---Set A4 for our subroutine and then call him.
movl a6@(32),a4
movl a6@(36),a0
jsr a0@
|---Now we must "return" the string value that was returned to us.
movl sp@(16), a6@(24) | Those 5 extra words need to be
movl sp@(12), a6@(20) | copied back to our own arguments.
movl sp@(8), a6@(16)
movl sp@(4), a6@(12)
|---Standard Ada epilogue
L139:
movl a6@(-12),a4
unlk a6
rts
.data