TR-DOS
Level 1: 15635
Alone Coder
TR-DOS functions called from BASIC
Not everyone can use it
system capabilities. The developers pre-
We looked at a number of special functions for working with
disk drive, access to which can cause
proceed exclusively from programs in ma-
bus codes. This is the so-called "work with
disk at a high level>, unlike
file level and low, i.e. direct
instructions to the controller.
All the above functions are performed
one program, the transition to which is carried out
appears at 15635. In fact, in
memory cell with the specified content address
there is NOP/JR, but there is evidence that the transition to
address 15636 does not work on all types
Speccy. The parameter for this program is
The C register of the processor is registered, in which it must
women contain the team number according to the following
the following list:
#5 - reading sectors.
Read from the current drive in a row B
sectors of 256 bytes each and remember them by ad-
resu HL. The initial track(s) must be
stay in D, the initial sector on this road
horn - in E. Typically this function is used
available in all-in-one program loaders. B
in this case you should do LD DE,(23796),
that is, remember the sector number following
last read/written data block
nyh, i.e. in this case, the sector is exactly behind
BASIC part.
How to make a monoblock bootloader?pi-
First write this basic program:
10 REM 16 pieces spaces
20 CLEAR 24575:RANDOMIZE USR 23872
Then from address 23872 (if calls to TR-
There has been no DOS since the last reset,
then with 23760) in any way you like
enter the code program:
LD DE,(23796)
LD BC,#NN05;where NN=code part length,
LD HL,ADDR; and this is the download address.
CALL 15635
JP START; code part start address.
It obviously takes up the entire REM. This is the most
a simple case - when there is only one code block and
starts without unpacking. In more complex
cases add spaces after REM and
put in whatever you want.
Let's write our BASIC program to disk:
RANDOMIZE USR 15619:REM:SAVE"IGRA"LINE 10
We'll write the code block right behind it, then
To do this, download Disk Doctor and fix the length
Well, a BASIC file in sectors from 01 to total
the length of BASIC and codes, in the first character
code file, write code 00, and at the 8th second -
reduce the torus byte by the number of code files
number #E4. The bootloader is ready, and it even copies
ruetsya.Of course, it would be better to have a loader like
0 INK USR .
#6 - recording sectors.
Write B sectors in a row using the same
rules. It should be noted that these procedures
ry stop at Break and issue a message
Disk error, etc. with screen cleaning.
If you want to warn this, write it down
previously at 23746 instead of RET
call commanderror handler.
#7 - catalog display.
Equivalent to the CAT command, except
It means that output is produced to any stream.
The thread number is specified in A (standard - 2).
It is advisable to write down the drive number (23798)
also at addresses (23800) and (23801). Absolutely
useless command.
#0 - recovery command.
The drive head returns to zero -
wuyu path.
#1 - changing the drive and testing.
Register A must contain the disk number
yes:0="A",1="B",2="C",3="D". Testing -
determining the number of tracks (40 or 80)
and the speed of movement of the magnetic head -
is not performed if the drive has already been removed
tested.
It should be noted that before use
By using these commands you need to open the blue area
theme variables TR-DOS. By itself it
after the reset it does not open, which is why they hang
all assemblers known to me. You can go in and
exit DOS immediately, you can also call
procedure 15649.
Another unpleasant feature of these procedures is
bad thing is that when reading/writing sec-
tors in a row, they make an extra one every time
disk revolution when moving to the next fi-
otic track. This shortcoming can be corrected
there are numerous TURBO-LOADERs, using
direct appeal to control
disk drive leru KR1818VG93.
Program 15635 has other functions,
but they have little relevance to our topic. I’ll touch on
finally just one:
#13 - copying a descriptor.Copies 16 bytes from the HL address to
23773 (descriptor area in system pe-
belt TR-DOS). With this command you can pro-
view TR-DOS codes from outside the program
depending on the system version, not including
drive.
Share your thoughts about the article