|
|
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: A T
Length: 7044 (0x1b84)
Types: TextFile
Names: »ADAROOT_TSK_ASM«
└─⟦afbc8121e⟧ Bits:30000532 8mm tape, Rational 1000, MC68020_OS2000 7_2_2
└─⟦77aa8350c⟧ »DATA«
└─⟦f794ecd1d⟧
└─⟦24d1ddd49⟧
└─⟦this⟧
; The use of this system is subject to the software license terms and
; conditions agreed upon between Rational and the Customer.
;
; Copyright 1988 by Rational.
;
; RESTRICTED RIGHTS LEGEND
;
; Use, duplication, or disclosure by the Government is subject to
; restrictions as set forth in subdivision (b)(3)(ii) of the Rights in
; Technical Data and Computer Software clause at 52.227-7013.
;
;
; Rational
; 3320 Scott Boulevard
; Santa Clara, California 95054-3197
;
; PROPRIETARY AND CONFIDENTIAL INFORMATION OF RATIONAL;
; USE OR COPYING WITHOUT EXPRESS WRITTEN AUTHORIZATION
; IS STRICTLY PROHIBITED. THIS MATERIAL IS PROTECTED AS
; AN UNPUBLISHED WORK UNDER THE U.S. COPYRIGHT ACT OF
; 1976. CREATED 1988. ALL RIGHTS RESERVED.
;
;
.module "ADAROOT_TASKING"
.include "^standard_assembler_include_file"
.include "^Common.Runtime_Definitions"
.include "^Common.Os2000_Definitions"
comp_unit Runtime_Compunit
.sect ada_runtime_code,code,relocatable,alignment:=2
;
; Defines the runtime entry points for Start, Middle, and Finish
; of tasking programs.
;
.gbl.l __Start_Tasking
.ext.l _.Start_Tasking
.gbl.l __Finish_Tasking
.ext.l _.Finish_Tasking
.gbl.l __debug.tsk_root_creation
.gbl.l __debug.tsk_root_termination
.gbl.l __debug.task_creation
.gbl.l __debug.task_termination
.gbl.l __Process_Exit
.ext.l __task_end
.ext.l __debug.raise
.ext.l __defined_heap_size
.ext.l __Main_Priority
.ext.l __Data_Area_Size
.ext.l __Main_Code_Start_Var
.ext.l __Main_Code_Start_Copy
.ext.l __Heap_Size_Var
.ext.l __Main_Priority_Var
.ext.l __Data_Size_Var
.ext.l __Root_Create_Return
.ext.l __Task_Create_Return
.ext.l __Root_Finish_Return
.ext.l __Task_Finish_Return
.ext.w __Finish_Entry_Offset
.ext.l __Propagate_Exception_Branch
.ext.l __TDlyStm_Indirect
.ext.l __Runtime_Entry_Pointer
.ext.l __Put_Error_Msg_And_Exit
.ext.l __Runtime_Compatibility_Value
.ext.l __Ada_Init_Values_Begin
.ext.l __Ada_Init_Values_End
.ext.l __Ada_Init_Data_Begin
;
; Initial entry point from the program after fork; the
; return address to the program is passed in A0. All other
; registers except D4, D7, A2, and A4 contain information
; about the fork which is used in subsequent code.
;
subprogram sp_rt,sp.internal,linkage.none
__Start_Tasking:
move.l d0,d4 ; save process id in d4
;
; Setup global data pointer
;
movea.l a5,a2 ; save parameter pointer in temp
suba.l d6,a1 ; get base address for globals
movea.l a1,a5 ; setup global base register
;
; Move data from ADA_INIT_VALUES section to ADA_INIT_DATA section.
;
movem.l d7/a2/a4,-(a7) ; Save working regs
lea.l (__Ada_Init_Values_Begin,pc),a2 ; Get source of move
lea.l (__Ada_Init_Values_End,pc),a4 ; Compute length of move
move.l a4,d7
sub.l a2,d7
beq.s $no_copy ; -> Nothing to move
lea.l (__Ada_Init_Data_Begin,a5),a4 ; Get destination of move
addq.l #3,d7 ; Round up to 4 byte multiple
lsr.l #2,d7 ; Convert to count of 4 byte objects
move.l d7,d4 ; Make copy of count
swap d4 ; LSW of d4 is MSW of d7
bra.s $enter_loop ; -> Begin loop
; Assertion: source and dest sections were 32 bit aligned, so a
; 32-bit-at-a-time copy is correct.
$copy: move.l (a2)+,(a4)+ ; Move a byte
$enter_loop:
dbra d7,$copy ; -> Loop on copy
dbra d4,$copy ; -> Loop on large copy
$no_copy:
movem.l (a7)+,d7/a2/a4 ; Restore working regs
;
; Store address for return to user code and
; shared runtime offset for Finish
;
move.l a0,(__main_code_start_var,a5) ; save code start
move.l a0,(__main_code_start_copy,a5) ; save code start for debugger
;
; Store values associated with current code segment
;
lea (__debug.raise,PC),a0 ; compute address for raise brk
move.l a0,(__Propagate_Exception_Branch,a5) ; store for branch from rt
lea ($root_create_return,pc),a0 ; compute address for create
move.l a0,(__Root_Create_Return,a5) ; store for branch from rt
lea (__debug.task_creation,pc),a0 ; compute address for create
move.l a0,(__Task_Create_Return,a5) ; store for branch from rt
lea (__debug.task_termination,PC),a0; compute address for term
move.l a0,(__Task_Finish_Return,a5) ; store for branch from rt
move.l #__main_priority,(__main_priority_var,a5)
move.l (__defined_heap_size,pc),(__heap_size_var,a5)
move.l #__data_area_size,(__data_size_var,a5)
move.b #compatibility_version,(__runtime_compatibility_value,a5)
;
; setup pointer to runtime entry point table
;
move.l sp,d7 ; get current stack pointer
andi.l #(-a32_size),d7 ; mask for high order bits
movea.l ((cct_start + pi_cpt),d7),a0 ; get CPT address
move.l (cpt_ada_runtime_ptr,a0),d7 ; get runtime table pointer
beq.b $no_runtimes ; if Z, then no runtime
move.l d7,(__runtime_entry_pointer,a5) ; store table pointer
bsr.l _.start_tasking
__debug.tsk_root_creation:
$root_create_return:
jmp ([__main_code_start_var,a5]) ; jump to program start
;
; Runtime table pointer was zero
;
$no_runtimes:
move.w #no$runtime$ferror,d1 ; load error code
bra.w __put_error_msg_and_exit ; give message and die
;
; Finish calls from user program
;
subprogram sp_rt,sp.internal,linkage.simple
__Finish_Tasking:
bsr.l _.finish_tasking
__debug.tsk_root_termination:
moveq #No$Error,d1
trap #OS9_Call
.dc.w F$Exit
;
; Branch from shared runtime after initialization of task.
; Pointer to current TCB is in A4.
;
__debug.task_creation:
lea ([tcb.code_start,a4]),a0 ; get address of elab object
jsr ([a0]) ; execute user code
bsr.l __task_end
__process_exit:
__debug.task_termination:
moveq.l #no$error,d1
trap #os9_call
.dc.w f$exit
end_subprograms
.end