EasyManuals Logo

Tandy 1000 Programmer's Reference Guide

Default Icon
251 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #83 background imageLoading...
Page #83 background image
Chawter
1
I
System Calls
Example:
The following program copies
a
file using the Random
Block Read and Random Block Write function calls. It
speeds the copy by specifying
a
record count equal
to
the
file size and
a
record length
of
1.
With
a
buffer
of
32K
bytes the file is copied quickly, requiring
1
disk access
each
to
read and write. (Compare this example with the
sample program for Function
27H,
that specifies a record
count
of
1
and
a
record length equal to file
size.)
current-record
f ile-size
equ
32
;offset
-
Current Rec field
equ
16
;offset
-
File
Size
field
fcb db
37
dup
(7)
f
i
lename db
17
dup(7)
prompt1 db "File
to
copy:
$"
;5ee
Function
E9H
for
prompt
2
db "Name of copy:
$"
;explanation of
$
crlf db
1
3,l
0
,"$"
num-recs dw
7
buffer db
32767
dup(7)
func-28H: set-dta buffer
;5ee
Function
1AH
display prompt
1
;see
Function E9H
get-string 15,filename
;5ee
Function ERH
display crlf
;see
Function E9H
parse filename[21,fcb
;see
Function 29H
open fcb
;see
Function
EFH
mov fcb[current-record1,E
;set Current Record
;field
set-relative-record fcb
;see
Function 24H
mov ax, word ptr fcb [file-size1
mov num-recs,ax ;5ave
it
for
ran-block-read fcb,num-rec5,l
;THIS
FUNCTION
display prompt2
;see
Function E9H
get-string 15,filename
;see
Function %RH
display
crlf
:see
Function 89H
parse filenameI21,fcb
;see
Function
29h
create fcb
;see
Function 16H
mov
fcb[current-
;5et
Current
set-relative-record fcb
;5ee
Function 24H
mov ax, file-length ;get
size
of
ran-block-write fcb,num-recs,l
;5ee
Function 28H
close fcb
:5ee
Function
18H
;get file
size
;ran-block-write
record1
,E
;Record field
;or
ig
ina
I
____
81

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals