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 #73 background imageLoading...
Page #73 background image
Chapter
1
I
System Calls
Randomwrite
Random Write Function Call
22H
Performs a random write
of
a
record. The current block (offset
0CH) and current record (offset 20H) fields in the FCB are set
to
agree with the relative record field (offset 21H). The record ad-
dressed by these fields is then written from the Disk Transfer
Address. If the record size is smaller than a sector (512 bytes),
the records are buffered until
a
full sector is ready to write.
Entry Conditions:
AH
=
22H
DS:DX
=
pointer to the opened
FCB
of
the file to write
Exit Conditions:
If AL
=
00H, the write was completed successfully.
If AL
=
01H, the disk is full.
If AL
=
02H, there was not enough room at the Disk Transfer
Macro
Definition:
Address
to
write
1
record; the write was canceled.
wr
I
t
e-ran macro fcb
mov
dx,offsetfcb
mov
ah,22H
int
21
H
endm
Example:
The following program prompts for
a
letter, converts the letter
to
its alphabetic sequence
(A
=
1,
B
=
2, etc.), and then reads and
displays the corresponding record from a file named ALPHA-
BET.DAT on the disk in Drive B. After displaying the record, it
prompts the user to enter
a
changed record.
If
the user types
a
new record, it is written
to
the file; if the user presses
[ENTER],
the record is not replaced. The file contains 26 records; each re-
cord
is
28 bytes long.
71

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