Micro #07
04 августа 1998
  TR-DOS  

Tape and Disk - Adapting programs to the system TR-DOS (Part 2).

<b>Tape and Disk</b> - Adapting programs to the system TR-DOS (Part 2).
  ************************************

  ADAPTATION PROGRAMMES OF SYSTEM TR-DOS.

          - PART 2. -

  ************************************


                 CHAPTER 1

       --------------------------
         HOW TO FIGHT WITH BASIC.


   Loaders programs with which you can meet, fall into three
Category: Loaders in BASIC (load
made by the operator LOAD), spouts
in native and mixed feeders.

   Easier and more enjoyable, of course, have
deal with the loaders in BASIC. They can be
divided into open and closed.

   Open spouts - is when, after
Download the first file of the program (ie
actual bootloader) you press Break,
then Enter, and a pleasant blue background
appears:


  10 INK 1: PAPER 5: BORDER 5: CLEAR 25199


  20 LOAD "" SCREEN $: LOAD "" CODE


  30 RANDOMIZE USR 32768

or something like that.

   I hope that does not infringe your self-esteem,
if you still show how to adapt to
drive such a program:


  10 INK 1: PAPER 5: BORDER 5: CLEAR 25199


  20 RANDOMIZE USR 15619: REM: LOAD "name1"
CODE 16384


  25 RANDOMIZE USR 15619: REM: LOAD "name2"
CODE


  30 RANDOMIZE USR 32768

- Where name1 and name2 - the names that you
change a file, followed by the loader.
Sometimes these names can be left unchanged,
but more often they have to change. Firstly,
filenames in the cassette versions may contain symbols or 
symbol combinations to be perceived system TR-DOS correctly. 
For example, meeting operator LOAD "B: SCREEN", TR-DOS will 
load the file "SCREEN" to drive "B", and is not a file named 
"B: SCREEN", as I would like. Secondly, unlike the cassette on 
which a file named "SCREEN" can be any amount of disk space

file with this name should only be
one. Therefore, usually the program files are called names that 
are derived from the name itself program (for example, "rambo 
$", "rambo cd" etc.). In addition, it is considered good

tone in the name of the master file (bootloader)
use capital letters and names
others - lowercase.

   Change the file names to the desired one can
before transferring to disk, using an ordinary tape copiers (TF 
COPY, COPY DE LUXE, COPY COPY, etc.), and then will only 
transfer the files to disc special copiers <tape drive>>. The 
most convenient way used copiers Programmable

Copier v.2.0 (PCopier), PCopier Plus, or
AMCopier. When you work with the listed
Copy Room, first of all, you can change
names of the files after copying to
drive, and secondly, there is confidence that
Files and disks will not be corrupted (using the same copyist 
Dereschuka such no certainty).


   But here you are, very carefully
viewing all your drives, make sure that
<> they do not.
Do not despair, all is not lost. Download the program in an 
ordinary copier and carefully review everything that he tells 
about her faylah.Zapishite length and address download each 
file and boldly press reset button. Now, having such valuable 
information, you can proceed. 

   Suppose, for example, copier reported the following:


  file "SCREEN" - the load address 49152,
length 6912;

  file "code" - the load address 25200, the length of
40335.


   Using these data, we can, based on
reduced version of the bootloader to write
Special copyist:


  10 INK 1: PAPER 5: BORDER 5: CLEAR 25199


  20 LOAD "" SCREEN $


  21 RANDOMIZE USR 15619:

     REM: SAVE "shaky sc" CODE 16384,6912


  30 LOAD "" CODE


  31 RANDOMIZE USR 15619:

     REM: SAVE "shaky mn" CODE 25200,40335


  40 STOP

- That is, after each statement loading
file from a tape recording is necessary to put the operator on 
the disc, indicating the address and length of the file. If the 
tape loader not mentioned load address, then use the address, 
who kindly informed copyist. But be careful, do not always 
address in the loader specified explicitly: in the above 
Example copyist have address of the first File 49152, but the 
download is performed by the operator LOAD "" SCREEN $, which 
is equivalent to LOAD "" CODE 16384,6912. Therefore, the file 
must be written to address 16384, not 49152.


   At the same time, as a rule, your torment shall
end. The only "serious"
problem in remaking this loader may be that in the derivation 
of his Listing background color and tone match, and you

have to change one color operator
INK and PAPER. But even this can be avoided to load the file 
loader operator MERGE, but not LOAD. In this case, the program

will not start, and the message
0 OK, 0:1. The only thing we should not forget
that this should be done on a clean machine, ie, after pressing 
the reset button. 

   I hope that in matters of public loaders, has come full 
clarity, even in who did not understand.



            -----------------

   You're lucky if viewing listing
Loader, you will see something like
previous example, ie a normal BASIC program, but in practice 
much more often there is something like:



  0 REM Look here, little bozo, why don't

    you go fuck yourself?


  0 DRAW USR VAL "24500", deBillGilbert'89


  0 REM FLASH DRAW??? Aw COPY M

or even more terrible. Such fear can be named is a to r s t s m 
loader. Try to teach you <<open>> it.


   BASIC program to protect the viewing
and editing in several ways.
Consider the most popular ones.

   You probably have already encountered such
focus, as the zero line, which can neither remove nor cause to 
edit. Cope with such protection in two ways. The first is 
pernumeratsii rows using one of the many service programs 
(ZXED, for example). After that usually results in quite good 
listing (there are no zero line, etc.).


   The second way is more elegant, but effective
only if the zero line
placed first in the program. To
implementation need to be aware of
storage format of rows BASIC program
Memory ZX Spectrum:


 Room length operators translate
 row row row BASIC
(2 bytes) (2 bytes)



   You've probably realized that the change
line number of easy, writing the operator POKE required number 
in the first two byte of the program. But where to write? Here

this issue we now turn.

   Determine the start of BASIC programs will help the system 
variable PROG. It is located at 23635 and occupies two bytes. 
Thus, to find out address of the first byte by executing the 
operator 


  PRINT PEEK 23635 + 256 * PEEK 23636


   If your Speccy is not connected to any peripherals, then 
after this statement appears on the screen the number 23755.

If you have connected and initialized Beta-Disk, you will get 
the number 23867, because TR-DOS allocates 112 cells for their

needs.

   Thus, the address where the number is saved
starting line BASIC programs found: suppose, for example, it is 
equal to 23755. Now you can change the first line number: 


  POKE 23755, N - 256 * INT (N/256):

  POKE 23756, INT (N/256)

- Where N - the number required. This is an ideal
how to override the number stroki.Mozhete the way to experiment 
by setting the number of rows over 9999: received very 
interesting results. As shown practices need to change the 
numbers more than 255 is rare. Therefore, usually

enough to execute only one statement:


  POKE 23756, N

- Where N - number of rows to 255. This
operator changes only the low byte
line number (once again want to remind you that
the last two examples are based on the
that the BASIC program begins with
address 23755).

   Above it was said that such a method
against the zero line is effective only when the null string at 
the beginning of the program. In fact, nothing prevents change 
the number of second and subsequent lines. For this useful 
information about length of the string contained in the 
following two for the line number byte. Adding length

lines to address it early, we address
next line.


          ---------------------

   No less common technique protection BASIC programs is the 
addition of line BASIC program various control codes: INK, 
PAPER, AT, TAB and other but more on this and many other in the 
next issue "MICRO". 


          ______________________


   In "MICRO 8" planned napechachat
end of chapter 1, as well as Chapter 2, "How
fight "BREAK'om.


  07.08.98 Gloom Demons & Computer Eye.


                 Special for "MICRO 7.






Other articles:

News - an overview of new toys: Fisher, Dizzy 5, Mirror, Dizzy 2.

Letter from FidoNet - a letter from Vyacheslav Mednonogova of CV and hackers.

Iron - small improvements ZSC modem.

Tape and Disk - Adapting programs to the system TR-DOS (Part 2).

Prohodilka - a step by step walkthrough Mirror.

AD & D - a description of the system of AD & D (Part 3).

Pokes - Poke's from the Internet part 2.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Artique - Tips for beginners and experienced artists: how to use extravagant methods to achieve outstanding success in ascii and ansi art.
Archive - about the harmful posledviyah transfer games to other platforms at the Spectrum. What to do with beaten disks.

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