home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_10_1986_Transactor_Publishing.d64 / relocate (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  1KB  |  27 lines

  1. 100 rem save"0:relocate",8
  2. 105 rem ** rte/85 - allows quick change of prg load address **
  3. 110 :
  4. 115 z$=chr$(0)
  5. 120 print "drive type:"
  6. 125 input "1)1541/2031, 2)4040, 3)8050/8250";d: if d<1 or d>3 then 125
  7. 130 if d=1 then dl=144: dh=2:  di=4: dt=18: bl=0: bh=3:  rem 1541/2031
  8. 135 if d=2 then dl=150: dh=67: di=4: dt=18: bl=0: bh=17: rem 2040/4040
  9. 140 if d=3 then dl=96:  dh=67: di=8: dt=39: bl=0: bh=17: rem 8050/8250
  10. 145 :
  11. 150 input "drive #, filename ";dr,f$: f$=str$(dr)+":"+f$
  12. 155 input "new start address (decimal) ";sa: sh%=sa/256: sl=sa-256*sh%
  13. 160 open 15,8,15: open 8,8,8,(f$): get#8,a$: if st then close8: stop
  14. 165 print#15,"m-r"chr$(dl)chr$(dh): get#15,s$: rem sector
  15. 170 print#15,"m-r"chr$(dl+di)chr$(dh): get#15,i$: rem index
  16. 175 s=asc(s$+z$): i=asc(i$+z$)+1
  17. 180 close 8: open 8,8,8,"#0"
  18. 185 print#15,"u1:"8;dr;dt;s: rem read in directory track/sector
  19. 190 print#15,"m-r"chr$(bl+i)chr$(bh)chr$(2): rem get 1st data block ptr
  20. 195 get#15,t$,s$: t=asc(t$+z$): s=asc(s$+z$)
  21. 200 print#15,"u1:"8;dr;t;s: rem get first data block
  22. 205 print#15,"m-w"chr$(bl+2)chr$(bh)chr$(2)chr$(sl)chr$(sh%)
  23. 210 print#15,"u2:"8;dr;t;s: rem write block back
  24. 215 close 8: close 15
  25. 220 print "** address changed **"
  26. 225 end
  27.