home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / kaypro / pw-swap.inf < prev    next >
Text File  |  1985-01-19  |  2KB  |  62 lines

  1.     The following SBASIC program will allow you to create different
  2. sized PW.SWP files.  After compiling, put it and a copy of an old
  3. PW.SWP file together on a disk in drive a.  Put a disk without a PW.SWP
  4. (and enough room to hold the new one) in drive B.
  5.  
  6. var num,I,J = integer
  7. var abyte,fsize = char
  8. files S(1),S(1)
  9. create "B:PW.SWP"
  10. open #1; "A:PW.SWP"
  11. open #0; "B:PW.SWP"
  12. print "File size (64 is normal)";
  13. input num
  14. let fsize = chr(num)
  15. for I = 0H to 7BH
  16.    read #1; abyte
  17.    write #0; abyte
  18. next I
  19. read #1; abyte
  20. write #0; fsize
  21. for I = 7DH to 3FFH
  22.    read #1; abyte
  23.    write #0; abyte
  24. next I
  25. let abyte = chr(0)
  26. for I = 1 to fsize
  27.    for J = 0H to 3FFH
  28.       write #0; abyte
  29.    next J
  30.    print I;"K";chr(0DH);
  31. next I
  32. close #0
  33. close #1
  34. print "Done."
  35. end
  36.  
  37.    The idea behind the program is simple: It allows you to replace byte
  38. number 7C (Hex) of the file (the size parameter) with a new value, copying
  39. all else of the first K directly, then building the file to that size.
  40.  
  41.     The above grew out of personal necessity for a larger swap file.  It
  42. is based on careful study of SWP files for both PW and MINCE.  The
  43. program can easily be modified to change the other personal preference
  44. params of a SWP file -- just change the FOR loops to allow editing a
  45. different byte.  The other params are:
  46.  
  47. cursor start line: 75H
  48. fill column: 76H
  49. tab spacing: 77H
  50. indent column: 78H
  51. CPU clock rate: 79H
  52. Delay count: 7AH (low order byte) 7BH (high order byte)
  53. File size (as in above program): 7CH
  54.  
  55.     Hope this helps all of those who've been trying to get PWCONFIG.
  56. Note that the above program doesn't check values -- read the PW manual
  57. to find out what's acceptable.  (The one thing it doesn't mention is
  58. that PW likes SWP files to be in multiples of 8K)
  59.  
  60.                                      Chip Weems
  61.                                      COINS Dept., UMass/Amherst
  62.