home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / books / 68k_book / arp_doc / arp_func.txt next >
Text File  |  1985-11-20  |  2KB  |  66 lines

  1.  Robert C. Arp, Jr.
  2.  278-1 San Tomas Aquino Rd
  3.  Campbell, Ca 95008
  4.  (408)370-9039
  5.  
  6.  June 30, 1989
  7.  
  8.  Program: ARP_FUNC.PRG Version 1.001
  9.  
  10.      This is a LSR program that establishes user defined trap.  It may be
  11.  be executed from the desktop, but you may prefer to copy it to the AUTO
  12.  folder of the boot partition of your hard disk or boot floppy disk so that
  13.  it will execute automatically during boot.
  14.  
  15.      The program installs trap #4 as a multi-function trap.  For example,
  16.  the first two functions provide string printing functions for printers
  17.  and files that is similar to the GEMDOS print line function.
  18.  
  19.      Function #  Function Performed
  20.  
  21.          0       Prints a null terminated string to the parallel port.
  22.          1       Prints a null terminated string to a file.
  23.  
  24.                  Other functions will be added in later versions.
  25.  
  26.       The custom trap expects the first value placed on the stack to have
  27.  been a pointer to the null terminated string to be written; the second
  28.  value to have been a word length external device number for function 0,
  29.  or a file handle for function 1; and the third value to be the word length
  30.  function number.
  31.  
  32.       The contents of all registers used by the custom trap are preserved.
  33.  
  34.       Invocation Format:
  35.  
  36.   pea     string_add         ; Location where null terminated string is stored.
  37.   move.w  #dev_num, -(sp)    ; Device to which the string is to be written.
  38.   move.w  #function, -(sp)   ; ARP_FUNC function invoked.
  39.   trap    #4                 ; ARP_FUNC call.
  40.   addq    #8, sp             ; Reposition stack pointer.
  41.  
  42.   where the dev_num is specified as follows:
  43.  
  44.   If function = 0, then device number
  45.  
  46.         0 = PRN  = Parallel port.
  47.  
  48.   If function = 1, then device number = file handle.
  49.  
  50.       The assembly source for this program is being uploaded as ARPFUNCS.ARC.
  51.  You can download that file if you are interested in the listing.
  52.  
  53.       The program used to test ARP_FUNC.PRG is being uploaded as AFUNCTST.ARC
  54.  and its assembly source is being uploaded as AFUNTSTS.ARC
  55.  
  56.       The program was designed on a MEGA2 that has been upgraded to four
  57.  megabytes of memory.  Also, the developer TOS 1.4 proms are in the machine.
  58.  I mention this in case there are problems.
  59.  
  60.  Please don't hesitate to contact me if you want to declare any problems
  61.  with my material.
  62.  
  63.                                     Sincerely,
  64.                                     Bob Arp
  65.   
  66.