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: ┃ O T

⟦9212393e1⟧ TextFile

    Length: 17227 (0x434b)
    Types: TextFile
    Names: »OS2000_IO_ASM«

Derivation

└─⟦afbc8121e⟧ Bits:30000532 8mm tape, Rational 1000, MC68020_OS2000 7_2_2
    └─ ⟦77aa8350c⟧ »DATA« 
        └─⟦f794ecd1d⟧ 
            └─⟦24d1ddd49⟧ 
                └─⟦this⟧ 

TextFile

;    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 "OS2000_IO"

;
;    Implements the body of the Ada package Os2000_Io which
;    provides the services needed for Os_Dependent_Io.       
;    
        .include "^standard_assembler_include_file"
        .include "^common.runtime_definitions"
        .include "^common.os2000_definitions"

        comp_unit runtime_compunit

        .sect   predefined_code,relocatable,code,readonly,alignment:=2
;    
        .ext.l   __Process_Descriptor_Pointer

        .gbl.l  __OS9_I$Create
        .gbl.l  __OS9_I$Open
        .gbl.l  __OS9_I$Close
        .gbl.l  __OS9_I$Delete
        .gbl.l  __OS9_I$Read
        .gbl.l  __OS9_I$Readln
        .gbl.l  __OS9_I$Write
        .gbl.l  __OS9_I$Seek
        .gbl.l  __OS9_I$GetStt_Pos
        .gbl.l  __OS9_I$GetStt_EOF
        .gbl.l  __OS9_I$GetStt_Size
        .gbl.l  __OS9_I$GetStt_Opt
        .gbl.l  __OS9_I$GetStt_DevNm
        .gbl.l  __OS9_I$SetStt_Opt
        .gbl.l  __OS9_I$SetStt_Size
    
        .gbl.l  __Get_Unique_Task_Key
        .gbl.l  _ART_F$Time
        .gbl.l  __Get_Time_Of_Day
;
;   procedure Create (Name       :     System.Address;
;                     Mode       :     Natural;
;                     Attributes :     Natural;
;                     New_Path   : out Path_Number;
;                     Result     : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$create:                                 
        .local

        $name'offset            equ 4
        $mode'offset            equ 8
        $attrs'offset           equ 12
        $new_path'offset        equ 16
        $result'offset          equ 20

        movea.l ($name'offset,sp),a0           ; pathname pointer
        move.l  ($mode'offset,sp),d0           ; file access mode
        move.l  ($attrs'offset,sp),d1          ; file attributes
        clr.l   ($new_path'offset,sp)
        clr.l   ($result'offset,sp)

        trap    #os9_call
        .dc.w   i$create                        ; make create call

        bcc.b   $exit

$error: move.w  d1,($result'offset+2,sp)
        moveq.l #0,d0

$exit:  move.w  d0,($new_path'offset+2,sp)      ; store path number 
        rts
;
;   procedure Open (Name     :     System.Address;
;                   Mode     :     Natural;
;                   New_Path : out Path_Number;
;                   Result   : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__OS9_I$Open:
        .local
        
        $name'offset            equ 4
        $mode'offset            equ 8
        $new_path'offset        equ 12
        $result'offset          equ 16

        movea.l ($name'offset,sp),a0            ; pathname pointer
        move.l  ($mode'offset,sp),d0            ; file access mode
        clr.l   ($new_path'offset,SP)           ; New_Path := null
        clr.l   ($result'offset,sp)             ; result := successful

        trap    #os9_call
        .dc.w   i$open                          ; make open call

        bcc.b   $exit
        
$error: move.w  d1,($result'offset+2,sp)        ; store statue
        moveq.l #0,d0                           ; new_path := 0

$exit:  move.w  d0,($new_path'offset+2,sp)      ; store path number 
        rts
;
;   procedure Close (Path : Path_Number; Result : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$close:                                  
        .local
        
        $path'offset    equ 4
        $result'offset  equ 8

        move.l  ($path'offset,sp),d0            ; path number
        clr.l   ($result'offset,sp)             ; result := successful

        trap    #os9_call
        .dc.w   i$close                         ; make close call

        bcc.b   $exit

$error: move.w  d1,($result'offset+2,sp)

$exit:  rts
;
;   procedure Delete (Name : System.Address; Result : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$delete:                                 
        .local
        
        $name'offset    equ 4
        $result'offset  equ 8

        clr.l   ($result'offset,sp)             ; result := successful
        moveq.l #3,d0                           ; use data directory 
        movea.l ($name'offset,sp),a0            ; pathname pointer

        trap    #os9_call
        .dc.w   i$delete

        bcc.b   $exit

$error: move.w  d1,($result'offset+2,sp)

$exit:  rts
;
;   procedure Read (Path       :     Path_Number;
;                   Count      :     Natural;
;                   Buffer     :     System.Address;
;                   Bytes_Read : out Natural;
;                   Result     : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$read:
        .local

        $path'offset            equ 4
        $count'offset           equ 8
        $buffer'offset          equ 12
        $bytes_read'offset      equ 16
        $result'offset          equ 20

        move.l  ($path'offset,sp),d0            ; path number
        move.l  ($count'offset,sp),d1           ; max byte count
        movea.l ($buffer'offset,sp),a0          ; buffer address
        clr.l   ($result'offset,sp)             ; result := successful

        trap    #os9_call
        .dc.w   i$read                          ; make read call

        bcc.b   $exit

        move.w  d1,($result'offset+2,sp)
        moveq.l #0,d1

$exit:  move.l  d1,($bytes_read'offset,sp)             ; store bytes_read
        rts
;
;    procedure Readln (Path       :     Path_Number;
;                      Count      :     Natural;
;                      Buffer     :     System.Address;
;                      Bytes_Read : out Natural;
;                      Result     : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$readln:
        .local

        $path'offset            equ 4
        $count'offset           equ 8
        $buffer'offset          equ 12
        $bytes_read'offset      equ 16
        $result'offset          equ 20

        move.l  ($path'offset,sp),d0            ; path number
        move.l  ($count'offset,sp),d1           ; max byte count
        movea.l ($buffer'offset,sp),a0          ; buffer address
        clr.l   ($result'offset,sp)             ; result := successful

        trap     #os9_call
        .dc.w    i$readln

        bcc.b    $exit

$error: move.w  d1,($result'offset+2,sp)
        moveq.l #0,d1

$exit:  move.l   d1,($bytes_read'offset,sp)     ; store bytes_read
        rts
;
;   procedure Write (Path : Path_Number;
;                    Count : Natural;
;                    Buffer : System.Address;
;                    Bytes_Written : out Natural;
;                    Result : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__OS9_I$Write:
        .local
        
        $path'offset            equ 4
        $count'offset           equ 8
        $buffer'offset          equ 12
        $bytes_written'offset   equ 16
        $result'offset          equ 20

        move.l  ($path'offset,sp),d0            ; path number
        move.l  ($count'offset,sp),d1           ; byte count
        movea.l ($buffer'offset,sp),a0          ; buffer address
        clr.l   ($result'offset,sp)             ; result := successful

        trap    #os9_call
        .dc.w   i$write

        bcc.b   $exit

$error: move.w  d1,($result'offset+2,sp)        ; result := error code
        moveq.l #0,d1

$exit:  move.l  d1,($bytes_written'offset,sp)   ; store Bytes_Written
        rts
;
;   procedure Seek (Path     :     Path_Number;
;                   Position :     Natural;
;                   Result   : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$seek:
        .local

        $path'offset            equ 4
        $position'offset        equ 8
        $result'offset          equ 12

        move.l  ($path'offset,sp),d0            ; path number
        move.l  ($position'offset,sp),d1        ; new position
        clr.l   ($result'offset,sp)             ; result := successful
        trap    #os9_call
        .dc.w   i$seek                          ; make seek call                      

        bcc.b   $exit
$error: move.w  d1,($result'offset+2,sp)
$exit:  rts
;
;   procedure Current_Position (Path     :     Path_Number;
;                               Position : out File_Position;
;                               Result   : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$getstt_pos:
        .local
        
        $path'offset            equ 4+4
        $position'offset        equ 8+4
        $result'offset          equ 12+4

        move.l  d2,-(sp)
        statement 0,0,1
        move.l  ($path'offset,sp),d0            ; path number
        clr.l   ($result'offset,sp)             ; result := successful
        move.l  #ss_pos,d1                      ; Pos function code

        trap    #os9_call
        .dc.w   i$getstt

        bcc.b   $exit

$error: move.w  d1,($result'offset+2,sp)        ; result := error code
        moveq.l #0,d2

$exit:  move.l  d2,($position'offset,sp)        ; Position := Current_Position

        move.l  (sp)+,d2
        statement 0,0,0
        rts
;
;   procedure End_Of_File (Path   :     Path_Number;
;                          At_End : out Boolean;
;                          Result : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$getstt_eof:
        .local
        
        $path'offset    equ 4
        $at_end'offset  equ 8
        $result'offset  equ 12

        move.l  ($path'offset,sp),d0            ; path number
        clr.l   ($result'offset,sp)             ; result := successful
        move.l  #ss_eof,d1                      ; EOF function code

        trap    #OS9_Call
        .dc.w   I$GetStt                        ; make status call                      

        bcs.b   $error

        clr.l   ($at_end'offset,sp)             ; not End_Of_File
        rts

$error: moveq.l #1,d0                           ; d0 := true
        move.l  d0,($at_end'offset,sp)          ; set End_Of_File
        move.w  d1,($result'offset+2,sp)        ; result := error code
        rts
;
;   procedure File_Size (Path   :     Path_Number;
;                        Size   : out Natural;
;                        Result : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$getstt_size:
        .local
        
        $path'offset    equ 4+4
        $size'offset    equ 8+4
        $result'offset  equ 12+4

        move.l   d2,-(sp)
        statement 0,0,1
        move.l  ($path'offset,sp),d0            ; path number
        clr.l   ($result'offset,sp)             ; result := successful
        move.l  #SS_Size,d1                     ; Size function code

        trap    #OS9_Call
        .dc.w   I$GetStt                        ; make status call                      

        bcc.b   $exit

$error: move.w  d1,($result'offset+2,sp)        ; result := error code
        moveq.l #0,d2

$exit:  move.l  d2,($size'offset,sp)            ; size   := current file size

        move.l  (sp)+,d2
        statement 0,0,0
        rts


;
;
;   procedure Set_File_Size (Path    :     Path_Number;
;                            To_Size :     Natural;
;                            Result  : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$setstt_size:
        .local
        
        $path'offset    equ 4+4
        $to_size'offset equ 8+4
        $result'offset  equ 12+4

        move.l   d2,-(sp)
        statement 0,0,1
        move.l  ($path'offset,sp),d0            ; path number
        clr.l   ($result'offset,sp)             ; result := successful
        move.l  #ss_size,d1                     ; Size function code
        move.l  ($to_size'offset,sp),d2         ; get new size

        trap    #os9_call
        .dc.w   i$setstt                        ; make status call                      

        bcc.b   $exit

$error: move.w  d1,($result'offset+2,sp)        ; result := error code

$exit:  move.l  (sp)+,d2
        statement 0,0,0
        rts
;
;    procedure Get_Options (Path          :     Path_Number;
;                           Option_Buffer :     System.Address;
;                           Result        : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$setstt_opt:
        .local
        
        $path'offset    equ 4
        $option'offset  equ 8
        $result'offset  equ 12

        move.l  ($path'offset,sp),d0            ; path number
        movea.l ($option'offset,sp),a0          ; buffer address
        clr.l   ($result'offset,sp)
        move.l  #ss_opt,d1                      ; Read_Option function code

        trap    #os9_call
        .dc.w   i$setstt

        bcc.b   $exit
        
        move.w  d1,($result'offset+2,sp)

$exit:  rts
;
;    procedure Set_Options (Path          :     Path_Number;
;                           Option_Buffer :     System.Address;
;                           Result        : out Stratus);
;
        subprogram sp_rt,sp.internal,linkage.simple
__OS9_I$GetStt_Opt:
        .local
        
        $path'offset    equ 4
        $option'offset  equ 8
        $result'offset  equ 12

        move.l  ($path'offset,sp),d0            ; path number
        movea.l ($option'offset,sp),a0          ; buffer address
        clr.l   ($result'offset,sp)             ; status := successful
        move.l  #ss_opt,d1                      ; Read_Option function code

        trap    #os9_call
        .dc.w   i$getstt

        bcc.b   $exit

        move.w  d1,($result'offset+2,sp)        ; result := error code

$exit:  rts
;
;    procedure Get_Device_Name (Path        :     Path_Number;
;                               Name_Buffer :     System.Address;
;                               Result      : out Status);
;
        subprogram sp_rt,sp.internal,linkage.simple
__os9_i$getstt_devnm:
        .local

        $path'offset    equ 4
        $name'offset    equ 8
        $result'offset  equ 12

        move.l  ($path'offset,sp),d0            ; path number
        movea.l ($name'offset,sp),a0            ; buffer address
        clr.l   ($result'offset,sp)             ; result := successful
        move.l  #ss_devnm,d1                    ; Device Name function code
        trap    #os9_call
        .dc.w   i$getstt

        bcc.b   $done
        
        move.w  d1,($result'offset+2,sp)        ; return status

$done:  rts
;
;   procedure Get_Time (Day    : out Integer;
;                       Second : out Integer;
;                       Tick   : out Integer;
;                       Status : out Integer);
;                       
        subprogram sp_rt,sp.internal,linkage.simple
_art_f$time:
__get_time_of_day:
        .local

        $day'offset     equ 12
        $sec'offset     equ 16
        $tick'offset    equ 20
        $status'offset  equ 24

        Julian$With$Ticks    equ 3

        movem.l d2-d3,-(sp)             ; save the nonvolatile
        statement      0,0,2

        move.l  #julian$with$ticks,d0   ; set the format code
        trap    #os9_call               ; trap to get time
        .dc.w   f$time

        bcc.b    $store

$error: move.l  d1,($status'offset,sp)
        bra.s   $return

$store: move.l  d1,($day'offset,sp)     ; store Julian day
        move.l  d0,($sec'offset,sp)     ; store seconds since midnight 
        swap.w  d3                      ; get current tick into D0 high word
        clr.w   d3                      ; clear D0 low word
        swap.w  d3                      ; restore current tick into D0 low word
        move.l  d3,($tick'offset,sp)    ; store current tick
        clr.l   ($status'offset,sp)     ; successful status
   
$return:movem.l (sp)+,d2-d3
        statement    0,0,0
        rts
;
;   procedure Get_Unique_Task_Key (Value1 : out Integer;
;                                  Value2 : out Integer;
;                                  Value3 : out Integer);
;
        subprogram sp_rt,sp.internal,linkage.simple
__get_unique_task_key:
        .local
        
        $v1'offset      equ 4
        $v2'offset      equ 8
        $v3'offset      equ 12

        movea.l (__process_descriptor_pointer,a5),a0
        movea.l (a0),a0
        move.l  (art$tsk_id,a0),($v1'offset,sp)
        move.l  (p$datbeg,a0),($v2'offset,sp)
        move.l  (p$timbeg,a0),($v3'offset,sp)
        rts

        end_subprograms

       .end