Coders - an option for organizing work with the Disk Drive.

ZX Time #10
 Coders
───────────── ───────────────────────────
                                        
 OPTION OF WORK ORGANIZATION      
 WITH DISK DRIVE              
                                        
 (C) Alexander Sizenko (Alex_S)     
                                        
    Judging by the latest releases, for example,
Slider`a, transferring programs from tape to TR-
DOS has not yet lost its relevance.
Therefore, the material below is probably
No, it will be useful.                     
                                        
    Some game programs have
functions for uploading/downloading current coc-
recording a game situation on a tape recorder.
If this program does not damage the system,
area, then problems with “disconnafi-
gation" does not arise in principle. More difficult
if the program does the opposite
zom, for example: placing your body there.
I would like to suggest to readers, perhaps,
one of the simplest ways to organize
options of such games working with a disk drive,
worked by the author literally using the method
"scientific poking" and in no way
claiming its originality.LD HL, #5С00 ; take it and wash it
LD DE,#5С01 ;to hell with the system-
LD BC,#013A ;region
LD (HL),L ;BASIC and TRDOS
LDIR                              
                                        
      LD IY,#5C3A ;restore
                        ;standard   
 ;IY value   
      LD A,#FF                          
      LD (IY),A ;throw #FF here
                        ;(just like that
                        ;before)           
      LD (#SCC8),A ;if not
                        ;do, will
                        ;troubles  
 ;when accessed
                        ;to the second half-
                        ;disk fault     
                                        
      LD (#5D0C),A ;and here (why  
 ;I don’t know)      
                                        
      LD A,#С9 ;without RET command
                        ;nothing to work
                        ;will not be      
                                        
      LD (#SCC2),A                      
      EX AF,AF` ; in A` we will
                        ;send 5 or 6
                        ;for LOAD/SAVE
LD C,A ;and place in C
                                        
      LD HL,#6000 ;let's say #6000
                        ;block address -
                        ;of Tabernacles-
                        ;nia           
COUNT LD DE,#0000 ;B (COUNT+1) non-
                        ;necessarily brought-
                        ;after loading
                        ;zki (and possible
                        ;no unpacking)
                        ;programs know-
 ;word reading by
                        ;address #5CF4
                        ;(sec counter-;tor, track), i.e.
                        ;load/save-
                        ;we will hire in
                        ;end of the body about-
                        ;grams, resp.
                        ;tally the length
                        ;candy bar Bay-
                        ;cuk - programs
                        ;increase by ve-
                        ;register identity
                        ;B (see below)  
                                        
      LD B,1 ;for example, for-
                        ;write no more than-
                        ;it's 256 bytes
 CALL #3D13 ;with some
                        ;we enter with trepidation
                        ;in TR-DOS      
                                        
     I note that all this only works
with drive A if you want it
worked on drive B or even on C and D,
then a little modification is needed
setting system variables:         
                                        
      LD A,#FF                          
      ............                      
      LD (#SCC9),A ;for "B" of this
                        ;enough         
      LD(#5CCA),A                      
      LD (#5CCB),A ;for C and D      
      ............                      
DRIVE LD A,0 ;to cell      
 ;DRIVE+1 after
                        ;downloads      
 ;programs      
     LD (#5D16),A ;required     
 ;make a copy
                        ;cells #5D16
                        ;(number 60+number
                        ;drive)   
                                        
    Referring to this subsection for LOAD will be
like this:                                  
                                        
                                        
     ........                           
     LD A,5 ;or LD A,6 for
                        ;SAVE          
     EX AF,AF`                          
     CALL DOS                           
     ........                           
                                        
    Let me remind you that procedure #3D13work
melts only with the first interrupt mode.
If necessary, turn off the second mode
at the time of application.  Well, naturally
if in the BASIC system area
the body of the program is located, save and
restore its value.            
                                        
 * * * 

Share your thoughts about the article