Newsgroups: comp.sys.sinclair
From: briang@bgserv.demon.co.uk (Brian Gaff)
Path: ulke.hiMolde.no!trane.uninett.no!sunic!sunic.sunet.se!news.luth.se!eru.mt.luth.se!bloom-beacon.mit.edu!news.kei.com!news.mathworks.com!news.ultranet.com!news.sprintlink.net!pipex!peernews.demon.co.uk!bgserv.demon.co.uk!briang
Subject: Blast from Past?
Organization: bgserv
Reply-To: briang@bgserv.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.29
Lines: 77
X-Posting-Host: bgserv.demon.co.uk
Date: Fri, 17 Mar 1995 15:32:49 +0000
Message-ID: <795454369snz@bgserv.demon.co.uk>
Sender: usenet@demon.co.uk

I was just ferreting around in my archives and came up with all
my old PCW articles. Creepy huh... Creep with me here...

        18/02/90      PCW Spectrum Column by Brian Gaff
                                                                        
                                                                        
                                                                        
        Those of you with Microdrives will probably know by now that    
        Ablex, who make them, have stopped production. It seems that the
        problem is that the supply of the special width Chrome tape has 
        all but dried up. Most of the cheaper ones you will see on offer
        in the ads section of the magazines, are old Psion ones that    
        originally held QL programs. These are OK for use on the        
        Spectrum of course, but they need to have some tape stuck over  
        the write protect tab.                                          
                                                                        
        Have you ever wondered how to protect a SCREEN$ so that loading 
        further CODE from tape will not corrupt it with filenames? No?  
        Well thats hard luck, as I am going to tell you anyway!         
                                                                        
        The system variable CHANS at 23631/2 holds information on the   
        addresses that the Spectrum needs to jump to for transferring   
        data between various devices. In this context, the screen is an 
        output device, and by fiddling with the values stored in the    
        channels area, it is perfectly possible to disable printing to  
        the screen. Have a look at this proglet.                        
                                                                        
                                                                        
           10 BORDER 0: PAPER 0: INK 0:CLS                              
           20 LOAD ""SCREEN$: GO SUB 1020                               
           30 LOAD""CODE: LOAD""CODE                                    
           40 GO SUB 1050 : REM now call code                           
                                                                        
        This is a typical loader. To suppress the printing of filenames 
        it calls the subroutines in the listing below. First            
        in lines 1000 to 1040, the value at CHANS+5/6 is PEEKed and     
        stored in variables p1 and p2. New values are POKEd into these  
        locations in line 1030. The address is a point in ROM that      
        contains a RET instruction. This means that when the Speccy     
        tries to print the filename, it jumps to the new address we put 
        in, instead of the real print routine. The RET then sends       
        control back as if the printing had been done. Then, when all   
        the loading has finished, the subroutine at line 1050 is called 
        to place the original values back in again.                     
                                                                        
         1000 DEF FN c(x)= (PEEK 23631+256*PEEK                         
              23632)+x: REM a location in chans                         
         1020 LET p1= PEEK FN c(5):LET p2= PEEK                         
              FN c(6): REM get old values                               
         1030 POKE FN c(5),82:POKE FN c(6),0:                           
              REM POKE new values in                                    
         1040 RETURN                                                    
         1050 POKE FN c(5), p1:POKE FNc(6), p2:                         
              REM POKE old values back.                                 
         1060 RETURN                                                    
                                                                        
        The reason for the complexity is that in the earlier Spectrums  
        which could be fitted with interface 1, the address of CHANS    
        moved about. On a +3 which has a fixed position for CHANS, a    
        couple of pokes can be used to disable printing. This can be    
        useful to suppress the list of files during a COPY, for         
        instance.                                                       
                                                                        
        So to disable printing do POKE 23739, 78: POKE 23740, 10.       
                                                                        
        To enable it, ether do a CLS or POKE 23739, 244: POKE 23740, 9. 
                                                                        
        I think thats quite enough brain strain for this week!          


        Erm oh well...

Brian
-- 
briang@bgserv.demon.co.uk  - Email for Speccy membranes
Brian Gaff is B G Services - UK support for 'Z80'
                             The Spectrum Emulator
