Welcome Press #01
31 декабря 1995

Programmer's Reference - the entry point to the TR-DOS.

<b>Programmer's Reference</b> - the entry point to the TR-DOS.
    It is no secret that many who are reading right now
This journal is drive. Nor will
secret that many already constrain the scope "BASIC"
to work in the TR-DOS. Of course, many
a book by Larchenko and Rodionova "ZX SPECTRUM
'TR-DOS ". This article is intended for those
who had no opportunity to get acquainted with this
remarkable book.

    So, before you consider the entry point
TR-DOS, let's analyze something (not in the physical
sense). It is no secret that the ROM occupies the region
memory starting at 0 and ending address of 16384,
further extends the RAM. Well, where is the TR-DOS? All
The fact that the development of TR-DOS
developers of this system tends to
maximum compatibility with other types of
machines do not have TR-DOS, so I had to
come up with an ingenious way, called shadow
memory.

    For the most curious to say that to see
TR-DOS can be! To do this, log into the system and
type SAVE "TR-DOS" CODE 0,16384.

    Disassemble this fail, you will be able to further
understand and understand in this system.

    In normal operation, Z80 (central
microprocessor) TR-DOS memory is absent, but
if you call the entry point to 15,616 or 15,619, then
TR-DOS takes place normally occupied by the ROM and
takes control. When you return, if
return address more 16384, management again
transferred to the ROM "BASIC".

    Well, okay, let's start the story about the points.

    The first two points are all familiar with - it's 15,616 and
15619. Talk about them specifically I will not.

    The next point of 15649 is a preparatory step before going 
to other points. 

    Its purpose - is to install the system TR-DOS
and its initialization.

    Point of 15,635 is the most important point
inputs, it allows you to apply directly to the
command interpreter TR-DOS. Handling,
number of commands given in the register C.


    Consider the command Interpreter:


    # 00 - This command allows you to set the block
magnetic heads for floppy disk and the zero track
reset the "heart" of the microcontroller CD 1818VG93.
This command is best applied in early
Work with the point of 15,635.


    # 01 - is a team set on the drive.
Serves to record the drive parameters
(Number of tracks and speed of movement
magnetic heads) in sistemmnye variables
TR-DOS. This command can not execute if
Manually submit all the characteristics at
23752 (track number) and 23,802 (the rate
displacement). Number of drives in the battery.


    Example:


        LD A, # 00

        LD C, # 01; tune in to drive A

        CALL 15635


    # 02 - it's positioning. Serves to
moving block of magnetic heads on a given
track. Sector number in the accumulator.


    Example:


        LD A, # 05

        LD C, # 02; Moving magnetic

        CALL 15635 heads to the fifth track.


    # 03 - a team of installation facilities sector
battery.


    Example:


        LD A, # 03

        LD C, # 03; Choosing the third sector

        CALL 15635


    # 04 - installation of a custom address
buffer. See # 05 and # 06.


    Example:


        LD HL, Address buffer

        LD C, # 2004

        CALL 15635


    # 05 - reading of sectors. Team
read into memory from disk sector, starting with
sector specified in the register E, which is located at
path specified in the register D, the memory from
address specified in register HL.


    Example:


        LD BC, # 0805

        LD DE, # 0000 Reading directory

        LD HL, 50000; disk into memory, starting

        CALL 15635; from address 50000


    # 06 - Record of sectors. Team
records information from the memory area specified
in register HL, on the track specified in the register D,
in the sector specified in the register E. The number of 
integers sectors is given in the register B.



    Example:


    LD BC, # 0106

    LD DE, # 08; entry in the service sector

                   ; Information from memory

    LD HL, 50000; starting at address 50000

    CALL 15635


    # 07 - output directory disk. In battery
put the thread number to be displayed
catalog (# 2-screen; # 3-printer). Number of drives
given the addresses 23798, 23800, 23801.


    Example:


    LD A, # 0

    LD (23798), A

    LD (23800), A; Select drive A.

    LD (23801), A

    LD A, # 2, Choose output to screen.

    LD C, # 7

    CALL 15635; Print katologa on the screen.


    # 08 - read directory entry. Number

    element is given in the battery. This command
allows you to read the directory entry in the descriptor
file, located at a 23,773 to 23,788.


    We examine separately the file descriptor:


    In the address to 23773 to 23780 to be addressed
file. The address 23781 file type
(C-CODE; B-BASIK; D-DATA, etc.). 23782-23783 at
type -starting address, with the type of -length
BASIC program. 23784-23785 length of the file.
23786-size in sectors. 23,787-number of the first
Sector file. 23788 is the number of the first track of the file.


    Example:


    LD A, # 02

    LD C, # 08; Read the information about the third

    CALL 15635; file into a descriptor.


    # 09 - write a file descriptor. With
this command, the file descriptor is written in
directory entry specified in the battery.


    Example:


    LD A, # 02

    LD C, # 09; Record file descriptor in place

    CALL 15635; third directory entry.


    # 0A - searching for information about the file. This 
command used to search the directory of information about

Fail. Background information is given in
descriptor. The number of bytes (template) to
in the search are set at 23,814.
There are usually recorded the number 9.


    # 0B - function to create the file. Name and file type
descriptor, the address in HL, the length of DE.


    # 0C - create BASIC file. This command
similar to the previous, only the type of recorded
the program must necessarily be . Input
parameter descriptor.


    # 0E - read command / verification. Input
options should be placed in the handle. By
at 23,801, the type of operation # 00-Reading;
# FF-checking. For the "no-BASIC" file address in the HL
the length of DE, the battery number is not equal to 0 or
3.


    # 0F; # 10, # 11, # 16 - lack of action.


    # 12 - delete the file. This command searches
directory entry that matches the descriptor and
removes it.


    # 13 - This command copies from the memory address in
HL, 16 bytes into a file descriptor.


    # 14 - This command works the other way than
Prev. Descriptor is copied into memory,
addressable register HL.


    # 15 - Test Track. Track number of
Register D, part number, see # 17 or # 02.
The address counter 23766 bad sectors.


    # 17 - Select the underside of the disc.


    Example:


    LD C, # 1917

    CALL 15635


    # 18 - Set up the disk. This command
reads from disk service sector and manufacturing
setting some variables TR-DOS. Necessary
the disc is changed.

    For those who do not have the button "MAGIC". This
program for the button is located at
102. You can get to it through the point at
15664, where the team RET.


    Example:


    LD HL, return address

    PUSH HL

    LD HL, # 102

    PUSH HL

    JP 15664


    And finally I want to bring a destination
some registers.

    HL - this register is mainly used as
address register.

    DE - This register is used in commands
where in addition to the primary address, need one more
address.


    Example:


    LD HL, primary address

    LD DE, auxiliary address

    LD BC, the number of bytes sent

    LDIR


    BC - counting register. Mostly used
as a cycle counter, and just as a counter.


    A - universal storage case. In
the earliest computer models, there was only one
the register. The main application is found at
comparison operations and as an 8-bit counter.
Well, maybe that's all. If you find any omissions,
please do not scold severely. Tried as I could.



                                VI Mayorov, 1996



                     *





Other articles:

Turbo Assembler 3.0 - a full description.

FAQ.

Contest - a competition to "boot" of the year.

News - News from the firm WELCOME.

News - an overview of the computer press.

Ads - offer to lords programmers.

Editorial.

Guide - entry.

Guide - Game Academy (Academy).

Guide - Game Last Battle (The Last Stand)

Guide - Game Lords of Midnights (Lords of Midnight)

Guide - Game Stiflip & Company (Stifflip and company).

Guide - Game Where Time Stood Still (Where time stood still).

Spekutrum inside - logic elements.

Programmer's Reference - in search of eternal life.

Programmer's Reference - the entry point to the TR-DOS.

Directory - entry.

Big Brother - CD-ROM

photoscope - pictures of readers.

Humor - the fate of the resident, or a spider's web over the country.



Similar articles:

В этот день...   21 November