home *** CD-ROM | disk | FTP | other *** search
- page 58,132
-
- ; gsetfcb.asm
- ; contains: getfname(),getblk(),setblk(),getlrs(),setlrs(),getlfs(),
- ; contains: getcrec(),setcrec(),getfattr(),setfattr(),getrrec(),
- ; contains: setrrec()
- ;
-
- include model.h
- include prologue.h
- include equ.h
-
- name gsetfcb
- pseg gsetfcb
-
- ;==>-- char *getfname(table)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ;
- ;; DESCRIPTION:
- ; This function returns a pointer to the drive number byte
- ; in the FCB. This is a 12 byte area, the first byte is the drive
- ; number, followed by 8 bytes of filename, followed by three bytes
- ; of file extension. NOTE: THIS IS NOT A NULL TERMINATED STRING!
- ;
- ;; RETURNS:
- ; pointer to drive number byte in FCB
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:03:17.68
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;; MODIFICATIONS
- ;
- ;;;
- cproc getfname,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_ ;ds:bx points to DISKTABLE
- else
- mov bx,parm1_ ;ds:bx points to DISKTABLE
- endif
- add bx,fcb
- if _LDATA
- ifdef AXBX32
- mov ax,ds ;return value in AX:BX
- else
- mov dx,ds ;return value in DX:AX
- mov ax,bx
- endif
- else
- mov ax,bx
- endif
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- unsigned getblk(table)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ;
- ;; DESCRIPTION:
- ; Return the value of the current block number relative to the
- ; beginning of the file, starting with zero (set to zero by the
- ; open function call.
- ;
- ;; RETURNS:
- ; Value of the current block number field in the FCB
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc getblk,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- else
- mov bx,parm1_
- endif
- mov ax,[bx+blocknum]
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- unsigned setblk(table,newblock)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ; (unsigned) newblock - new block number
- ;
- ;; DESCRIPTION:
- ; Modify the value of the current block number relative to the
- ; beginning of the file, starting with zero (set to zero by the
- ; open function call.
- ;
- ;; RETURNS:
- ; Previous value of the current block number field in the FCB
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc setblk,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- mov ax,parm3_
- else
- mov bx,parm1_
- mov ax,parm2_
- endif
- xchg ax,[bx+blocknum]
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- unsigned getlrs(table)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ;
- ;; DESCRIPTION:
- ; Return the value of the logical record size in bytes field of
- ; the FCB. This field is set to 0x80 by the dos open function
- ; call.
- ;
- ;; RETURNS:
- ; Value of the logical record size field in the FCB
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc getlrs,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- else
- mov bx,parm1_
- endif
- mov ax,[bx+lrs]
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- unsigned setlrs(table,newlrs)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ; (unsigned) newlrs - new logical record size
- ;
- ;; DESCRIPTION:
- ; Modify the value of the logical record size in bytes field of
- ; the FCB. This field is set to 0x80 by the dos open function
- ; call.
- ;
- ;; RETURNS:
- ; Previous value of the logical record size field field in the FCB
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc setlrs,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- mov ax,parm3_
- else
- mov bx,parm1_
- mov ax,parm2_
- endif
- xchg ax,[bx+lrs]
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- long getlfs(table)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ;
- ;; DESCRIPTION:
- ; Return the value of the file size in bytes field of the FCB.
- ;
- ;; RETURNS:
- ; Value of the file size in bytes field in the FCB
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc getlfs,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- else
- mov bx,parm1_
- endif
- ifdef AXBX32
- mov ax,word ptr[bx+lfs+2] ;ax=high order word
- mov bx,word ptr[bx+lfs] ;bx=low order word
- else
- mov ax,word ptr[bx+lfs] ;ax=low order word
- mov dx,word ptr[bx+lfs+2] ;dx=high order word
- endif
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- unsigned getcrec(table)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ;
- ;; DESCRIPTION:
- ; Return the value of the current relative record number (0-127) of
- ; the FCB.
- ;
- ;; RETURNS:
- ; Value of the current relative record number in the FCB
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc getcrec,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- else
- mov bx,parm1_
- endif
- mov al,[bx+fcbcr]
- xor ah,ah
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- unsigned setcrec(table,newcrec)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ; (unsigned) newcrec - new current relative record
- ; number.
- ;
- ;; DESCRIPTION:
- ; Modify the value of the current relative record number (0-127) of
- ; the FCB.
- ;
- ;; RETURNS:
- ; Previous value of the current relative record number field field
- ; in the FCB
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc setcrec,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- mov ax,parm3_
- else
- mov bx,parm1_
- mov ax,parm2_
- endif
- xchg al,[bx+fcbcr]
- xor ah,ah
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- unsigned getfattr(table)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ;
- ;; DESCRIPTION:
- ; Return the value of the attribyte byte field of the
- ; EXTENDED-FCB.
- ;
- ;; RETURNS:
- ; Value of the attribyte byte field in the EXTENDED-FCB.
- ;
- ;; AUTHOR:
- ; David Nienhiser 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc getfattr,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- else
- mov bx,parm1_
- endif
- mov al,[bx+fattr]
- xor ah,ah
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- unsigned setfattr(table,newattr)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ; (unsigned) newattr - new attribute to be set in
- ; the EXTENDED-FCB
- ;
- ;; DESCRIPTION:
- ; Modify the value of the current relative record number (0-127) of
- ; the FCB.
- ;
- ;; RETURNS:
- ; Previous value of the attribyte byte field in the EXTENDED-FCB.
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1989 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc setfattr,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- mov ax,parm3_
- else
- mov bx,parm1_
- mov ax,parm2_
- endif
- xchg al,[bx+fattr]
- xor ah,ah
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- long getrrec(table)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ;
- ;; DESCRIPTION:
- ; Return the value of the relative record number relative to the
- ; beginning of the file, starting with zero. You must set this
- ; field before doing random read/write operations.
- ;
- ;; RETURNS:
- ; Value of the relative record number field in the FCB.
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc getrrec,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- else
- mov bx,parm1_
- endif
- ifdef AXBX32
- mov ax,[bx+_fcbr2] ;AX=High order 16 bits
- mov bx,[bx+fcbrec] ;BX=Low order 16 bits
- else
- mov dx,[bx+_fcbr2] ;DX=High order 16 bits
- mov ax,[bx+fcbrec] ;AX=Low order 16 bits
- endif
- if _LDATA
- pop ds
- endif
- cproce
-
- ;==>-- long setrrec(table,newrrec)
- ;
- ;; ARGUMENTS:
- ; (struct DISKTABLE *) table - points to disktable
- ; (long) newrrec - new value for relative
- ; record number field.
- ;
- ;; DESCRIPTION:
- ; Modify the value of the relative record number relative to the
- ; beginning of the file, starting with zero. You must set this
- ; field before doing random read/write operations.
- ;
- ;; RETURNS:
- ; Previous value of the relative record number field in the FCB.
- ;
- ;; AUTHOR:
- ; "" 02-APR-1987 14:15:51.26
- ; Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- ;;;
- cproc setrrec,,,,,<NOSI,NODI>
- if _LDATA
- push ds
- lds bx,parm1_
- else
- mov bx,parm1_
- endif
- push [bx+_fcbr2] ;save upper 16 bits
- push [bx+fcbrec] ;save lower 16 bits
- if _LDATA
- mov ax,parm3_
- mov [bx+fcbrec],ax
- mov ax,parm4_
- mov [bx+_fcbr2],ax
- else
- mov ax,parm2_
- mov [bx+fcbrec],ax
- mov ax,parm3_
- mov [bx+_fcbr2],ax
- endif
- ifdef AXBX32
- pop bx
- pop ax
- else
- pop ax
- pop dx
- endif
- if _LDATA
- pop ds
- endif
- cproce
- endps
- end
-