//  Routines which enable TRIPOS files to be read or written from a
//  Z80 system.
//
//  GET "RINGHDR"



LET openfile( service, file )  =  VALOF
$(
//  Construct the OPEN block to be sent to the target machine, and then
//  attempt to open the byte stream.

    LET openblock  =  VEC max.ssp.size
    LET offset     =  (bb.ssp.args + 3) * bytesperringword
    LET length     =  file % 0

    FOR  i = 0  TO  length  DO  openblock % (offset + i)  :=  file % i

    openblock!bb.ssp.length  :=  bb.ssp.args + 3 + length/bytesperringword - 1

    RESULTIS  bspopen( service, openblock )
$)


