protection. We need a special drive routine to check for the bytes
      that we added to the end of the data block. Below is an assembler
      listing of such a routine. What you do with the bytes is up to you:
      you could use them as a key to decrypt some data necessary to the
      operation of your protected program or send the drive into an
      endless loop so that the program could proceed no further. We'll
      simply place the bytes in drive memory where they can be tested by
      your routine.
      
         TGREAD.ASM
         
           This program is for educational and personal use only
           No commercial use of this program is permitted.
           All rights reserved  (C) 1989 X.J.P.B.
         
         ***********************************************************;
           JOB: Read 5 tail-gap bytes from a given track and sector.
           The following code must be written to
           drive memory $0500 and can be executed
           from BASIC with the following statement:
         
           OPEN 15,8,15,"UC:"+CHR$(track)+CHR$(sector):CLOSE 15
         
           The tail-gap bytes can then be read from $0300 - $0304 in
           drive memory.

         ***********************************************************;
         
         .org  $0500 ;code executes in drive here

         ;this routine sets up READTG for execution
         
        setup
          sei         ;disable interrupts
          lda  #$4c   ;set up for job queue EXEC command
          sta  $0300  ; (JMP READTG)
          lda  #readtg
          sta  $0302
          lda  $203   ;get track for tail-gap read
          sta  $06    ;will be read into $0300
          lda  $204   ;get sector for tail-gap read
                      ;from command buffer.
          sta  $07
          lda  #$E0   ;store EXEC cmd to job queue
          sta  $00
          cli         ;enable interrupts
          wjloop
          lda  $00    ;wait for job to finish
          bmi wjloop
          rts         ;exit
         
         ;This is the actual read routine.
         
            K.J. REVEALED TRILOGY    PAGE [147]    (C)1990 K.J.P.B.

<<previous page - next page>>