home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / DEVPAC31.LZH / EXTRAS / NOTRACE.S < prev   
Text File  |  1992-08-14  |  1KB  |  47 lines

  1.  
  2. *    A TSR (terminate-and-stay-resident) demo program that also has
  3. *    the useful feature of pointing the default trace exception vector
  4. *    to an RTE, as described in the MonST Chapter.
  5. *
  6. *    This demo shows how to write a Terminate and Stay resident
  7. *    program. It does *not* try to be super-smart whereby the code
  8. *    is copied to the basepage to save memory, to preserve clarity.
  9.  
  10. * 14.8.92 updated to reflect Devpac 3 include files
  11.  
  12.     include gemdos.i
  13.     include    bios.i    
  14.     
  15. start    bra.s    real_start
  16.  
  17. TSR_start
  18. *-------    here starts the code to be TSRed
  19.     bclr    #7,(sp)            works on 68000/10/20/30!
  20.     rte
  21. *-------    here ends the code to be TSRed
  22.     even
  23. keep_length    equ    *-start
  24.  
  25. real_start
  26. * print a message via GEMDOS - this should be before the vector patching
  27. * in case Ctrl-C is pressed during the printing
  28.     pea    hellotx(pc)
  29.     move.w    #c_conws,-(sp)        print string
  30.     trap    #1
  31.     addq.l    #6,sp
  32. *-------    any initialisation for the TSR goes here
  33.     move.l    #TSR_start,-(sp)
  34.     move.w    #9,-(sp)        Trace vector number
  35.     move.w    #setexc,-(sp)        setexc
  36.     trap    #13
  37.     addq.l    #8,sp            lose old one
  38.  
  39. *-------    end initialisation
  40.  
  41.     clr.w    -(sp)
  42.     move.l    #$100+keep_length,-(sp)        $100 for basepage
  43.     move.w    #p_termres,-(sp)
  44.     trap    #1        that's the end
  45.  
  46. hellotx    dc.b    'NOTRACE installed ',189,' HiSoft 1988',13,10,0
  47.