home *** CD-ROM | disk | FTP | other *** search
/ Light / Light_Vol.1_June_1992_Datasphere_Publications_Disk_1_of_2_Side_B.d64 / de1 (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  8KB  |  161 lines

  1. 1 a=a+1:ifa=1thenpoke53265,11:load"de.code",8,1
  2. 2 poke53280,5:poke53281,11:print"[147] [193] disk directory may look something"
  3. 3 print" like the one below but what does it"
  4. 4 print" all mean?":print" [208]ress any key to continue":dw$="[155]"
  5. 5 dimh$(15):fori=0to15:readh$(i):h$(i)=h$(i)+"[145][145]":next:ky=49235:l=49152
  6. 6 print"[155] 0 "chr$(34)"[212][197][211][212][160][196][201][210][197][195][212][207][210][217]  "chr$(34)" [196][197] 2[193]":fori=1to11
  7. 7 reada,b$,c$:printatab(6)chr$(34)b$chr$(34)tab(25)c$:next
  8. 8 print" 472 [194][204][207][195][203][211] [198][210][197][197].":poke53265,27:sysky
  9. 9 fori=1to7:print:next:print"                          "
  10. 10 sysl,0,163,0:sysl,163,181,1:sysl,181,684,0
  11. 11 print"[155] [212]his is the disk header, mainly":print" for the user's convenience..."
  12. 12 sysky:sysl,163,181,0:print" ...and this is the identification code"
  13. 13 print"                                    ":sysl,182,187,1:sysky
  14. 14 sysl,0,160,11:sysl,181,187,0:sysl,465,468,1
  15. 15 print"",,,"[157][212]hese tell":print,,,"[157]the drive":print,,,"[157](and the
  16. 16 [153],,,"cmduser) what":[153],,,"cmdtype the":[153],,,"cmdfile is":[158]ky
  17. 17 [158]l,465,468,0:[129]i[178]0[164]5:[158]l,389[170]i[172]40,399[170]i[172]40,11
  18. 18 [130]:[158]l,320,323,1:[153]"(NULL)hese are the number
  19. 19 print"of sectors occupied":print"by each file on":print"the disk.        "
  20. 20 sysky:sysl,320,323,0:print"  [144]"chr$(34)"[215][208] [212][197][216][212]"chr$(34)"         "
  21. 21 print"  "chr$(34)"[194][207][210][196][197][210] [211][208][210][201][212][197]"chr$(34)"  "
  22. 22 print"  "chr$(34)"[203][211] [195][207][213][210][211][197][211]"chr$(34)"     "
  23. 23 print"  "chr$(34)"[196][201][206][199][207] [196][193][210][197][211]"chr$(34)
  24. 24 sysl,268,269,1:print"",,,"[155][211]ignifies[157][157][157][157][157][157][157][157][157]that file";
  25. 25 print"[157][157][157][157][157][157][157][157][157]cannot be[157][157][157][157][157][157][157][157][157]scratched":sysky
  26. 26 sysl,265,269,0:fori=1to4:sysl,190+i*40,199+i*40,11:next
  27. 27 sysl,361,362,1:sysl,384,389,1
  28. 28 print"",,,"[157][155][200]ere, the[157][157][157][157][157][157][157][157][157]file has[157][157][157][157][157][157][157][157]not been";
  29. 29 print"[157][157][157][157][157][157][157][157]closed (or[157][157][157][157][157][157][157][157][157][157]saved)[157][157][157][157][157][157]correctly":sysky:sysl,361,389,0
  30. 30 fori=0to5:sysl,349+i*40,360+i*40,11:next:sysl,640,660,1
  31. 31 printdw$"[145] [193]s it says. [212]here are 472
  32. 32 [153]" blocks (or sectors) still":[153]" available for use on the":[153]" disk."
  33. 33 [158]ky:[158]l,640,660,0:[153]"onononon (NULL)et's take a closer look at the first"
  34. 34 [153]" eight files on the disk. right$nformation
  35. 35 print" about each will be stored on [212][210][193][195][203] 18,"
  36. 36 print" [211][197][195][212][207][210] 1.":fori=0to7:sysl,200+i*40,229+i*40,1:next:sysky:print"[147][212]:18, [211]:1"
  37. 37 print"[155]";:fori=0to7:reada$:fork=0to1:forj=1to16:b$=mid$(a$,j*2-1+k*32,2)
  38. 38 poke199,abs(abs(i/2=int(i/2))-abs(j/2=int(j/2)))
  39. 39 printb$;:next:print:print" ";:nextk,i
  40. 40 print"[155][206]ot very easy to identify what the"
  41. 41 print" data shows, but there are 256 bytes
  42. 42 [153]" and each set of 32 represents one
  43. 43 print" entry in the directory.":fort=1to2500:next:restore:fori=1to16:reada$
  44. 44 next:fori=0to7:ifithensysl,40+i*80,120+i*80,0
  45. 45 reada,b$,c$:print""tab(14)a"[157] "tab(18)chr$(34)b$chr$(34);
  46. 46 printleft$("               ",15-len(b$))tab(35)" "left$(c$+"  ",4)
  47. 47 sysl,120+i*80,200+i*80,1:sysl,200+i*80,761,0
  48. 48 fort=1to500:nextt,i:sysl,680,760,0:sysl,120,200,1:c$="[208][210][199]"
  49. 49 a=79:b$="[197][216][208][197][210][201][205][197][206][212] [195][193][205][208]":print""tab(14)atab(19)b$chr$(34)" "c$
  50. 50 printdw$" [206]ow let's zoom in even closer and take
  51. 51 [153]" a look at  just one of  the entries in
  52. 52 print" detail.      [208]ress any key to continue                            "
  53. 53 sysky:print"[147][155][212][210][193][195][203] 18, [211][197][195][212][207][210] 1  ([194]ytes 0-31)":fori=1to17:reada$:next
  54. 54 print"";:fori=0to3:forj=0to7:reada:printh$(a);:reada:printh$(a)" ";:next
  55. 55 print:print:print:next
  56. 56 print"";:fori=1to4:printchr$(148)chr$(141)chr$(148)chr$(141)chr$(141);
  57. 57 next:print" [210]emember, each entry in the directory":print" consists of 32 bytes";
  58. 58 print" of data. [193]ll of":print" the above is in hexadecimal notation."
  59. 59 print" [208]ress any key to continue.":poke198,0:wait198,1:poke198,0
  60. 60 sys49152,760,959,11
  61. 61 print"[144] 79   "chr$(34)"[197][216][208][197][210][201][205][197][206][212] [195][193][205][208]"chr$(34)"  [208][210][199]   [155][206]o.1-2"
  62. 62 sysl,120,720,0:fori=3to6:sysl,i*40,10+i*40,1:next
  63. 63 printdw$" [212]he most important part of any sector
  64. 64 [153]" on the disk. right$t tells the drive which
  65. 65 print" track and sector should be read next.
  66. 66 [153]" right$f the track pointer is a $00 then the
  67. 67 print" end of the file has been reached.":sysky
  68. 68 fori=3to6:sysl,i*40,10+i*40,0:sysl,11+i*40,15+i*40,1
  69. 69 next:sysl,720,960,11
  70. 70 print"[145][145][145][145][145] [212]he file type. [193]n $81 represents a"
  71. 71 print" sequential file, $82 program file, $83"
  72. 72 print" user file, $84 relative file. [212]o":print" protect a file from";
  73. 73 print" accidental erasure":print" simply add $40 to it..."
  74. 74 print""tab(26)"[208][210][199][155]2  "
  75. 75 sysky:sysl,720,960,11:print""tab(11)h$(12)h$(2)
  76. 77 print""tab(29)"<"dw$" [217]ou will notice that a less than (<)
  77. 78 [153]" sign should appear next to the file
  78. 79 print" type in the directory. [[201]f a file has
  79. 80 [153]" been scratched, the file type byte
  80. 81 print" will be a $00]":sysky:sysl,720,960,11
  81. 82 fori=3to6:sysl,11+i*40,15+i*40,0:sysl,16+i*40,25+i*40,1
  82. 83 next:print""tab(26)"[144][208][210][199]<[155]3-4
  83. 84 [153]dw$" peekytes three and four are the track and
  84. 85 print" sector numbers of the start of the
  85. 86 [153]" file. (NULL)ou can then read this sector to
  86. 87 print" examine the file in detail.":sysky
  87. 88 sysl,720,960,11:fori=3to6:sysl,16+i*40,25+i*40,0
  88. 89 sysl,26+i*40,40+i*40,1:next:sysl,280,465,1:fori=12to13:sysl,i*40,25+i*40,1:next
  89. 90 print""chr$(34)"[197][216][208][197][210][201][205][197][206][212] [195][193][205][208]"chr$(34)tab(35)"[155]5-20
  90. 91 [153]dw$" (NULL)hese represent the atn(NULL)lenright$right$ values for
  91. 92 print" each character in the file name. [212]he
  92. 93 [153]" $atn0 byte is added by the computer
  93. 94 print" to pad out the name to 16 characters.
  94. 95 [153]" lenhanging these changes the file's name
  95. 96 sysky:print" ";:fori=1to8:reada,b:printh$(a)h$(b)" ";:next
  96. 97 print"";:fori=1to4:reada,b:printh$(a)h$(b)" ";:next
  97. 98 print""chr$(34)"[197][216][208]'[205][197][206][212][160][195][193][205][208]"chr$(34)"  ":sysl,720,960,11
  98. 99 printdw$" [210]emember... the $[193]0 bytes are added
  99. 100 [153]" automatically by the computer and do
  100. 101 print" not show up when the directory is":print" listed.":sysky
  101. 102 print"[144]"chr$(34)"[197][216][208]'[205][197][206][212][160][195][193][205][208]"chr$(34)"[155]21-29
  102. 103 [158]l,120,560,0:[158]l,720,960,11:[129]i[178]11[164]13:[158]l,25[170]i[172]40,40[170]i[172]40,1
  103. 104 [158]l,160[170]i[172]40,190[170]i[172]40,1:[130]
  104. 105 [153]dw$" (NULL)hese bytes are not used by the drive"
  105. 106 [153]" but need not be wasted. (NULL)ou may want a
  106. 107 print" program to only list files saved by "
  107. 108 print" that program. [193]lter these bytes during
  108. 109 [153]" the save, check them during the load.":[158]ky:[158]l,720,960,11:[129]i[178]11[164]13
  109. 110 [158]l,160[170]i[172]40,190[170]i[172]40,0:[158]l,25[170]i[172]40,40[170]i[172]40,0:[130]
  110. 111 [153]"79"[163]35)"list30-31":[129]i[178]11[164]13:[158]l,190[170]i[172]40,200[170]i[172]40,1:[130]
  111. 112 [153]dw$" (NULL)he total number of blocks(or sectors)
  112. 113 print" used by the file is indicated by bytes
  113. 114 [153]" 30 and 31. right$t is the usual low byte/
  114. 115 print" high byte format. $4[198]=79, 0x256+79= 79":sysky
  115. 116 print""tab(32)"        ":sysl,0,720,0:sysl,720,960,11
  116. 117 fori=3to6:sysl,16+i*40,25+i*40,1:next
  117. 118 printdw$" [211]o, let's read track 17 ($11),
  118. 119 [153]" sector 0 into the buffer.
  119. 120 print" [212]his is the start location of the file"
  120. 121 print" on the disk.":sysky
  121. 122 print"[147][155] [212][210][195][203] 17, [211][197][195][212] 0  ([198]irst 32 bytes only)[144]"
  122. 123 print"";:fori=0to3:forj=0to7:reada:printh$(a);:reada:printh$(a)" ";:next:print:print:print:next
  123. 124 print"";:fori=1to4:printchr$(148)chr$(141)chr$(148)chr$(141)chr$(141);:next
  124. 125 print"[155] [210]emember, the first two bytes of any"
  125. 126 print" sector on the disk are pointers to the"
  126. 127 print" next sector to be read.":fori=3to6:sysl,i*40,10+i*40,1
  127. 128 next:sysky:sysl,720,960,11:fori=3to6:sysl,i*40,10+i*40,0:sysl,10+i*40,21+i*40,1
  128. 129 next:print"[145][145][145] [212]hese two bytes represent the address
  129. 130 [153]" to which the program will be loaded.
  130. 131 print" [193]gain these are in the usual low byte/
  131. 132 [153]" high byte format.  8x256+1= 2049, the
  132. 133 print" start location of [194][193][211][201][195] programs.":sysky
  133. 134 sysl,120,720,1:fori=3to6:sysl,i*40,21+i*40,0:next
  134. 135 print"[145][145][145][145][145] [212]his is simply the program code and it
  135. 136 [153]" continues byte after byte until the   "
  136. 137 [153]" end of the file is reached. (NULL)o, from  "
  137. 138 [153]" the directory you can obtain a whole  "
  138. 139 [153]" myriad of information about each file.":[158]ky:[153]"loadreturn"[199](34);
  139. 140 [153]"directories explained"[199](34):[153]"by jason finchstop":[151]198,0:[162]
  140. 141 [131]"* cmdcmdgetgetcmdcmdsincos"," rndcmdcmdloggetcmdcmd get","new cmdcmd*coscmdcmdlogwaitrnd","new cmdcmd*coscmdcmdnewcos"
  141. 142 [131]" rndcmdcmdsinwaitgetcmdcmdnewwaitget","newrndcmdcmdlogwait cmdcmdnewcos","*rndcmdcmdlogwait cmdcmdsincos","newrndcmdcmd*coscmdcmdgetwait "
  142. 143 [131]"* cmdcmdsincoscmdcmdsincos","* cmdcmdsingetcmdcmdnewcos","* cmdcmdlogwaitgetcmdcmdgetget","new cmdcmdlogwaitcoscmdcmdlogwaitcos"
  143. 144 [131]"*rndcmdcmdget cmdcmdsinrnd","new cmdcmdgetgetcmdcmdlogwaitcos","newrndcmdcmdlogwait cmdcmdlogwaitrnd","newrndcmdcmdlogwait cmdcmdget "
  144. 145 [131]79,"val(NULL)(NULL)val(NULL)right$(NULL)val(NULL)(NULL) lenatn(NULL)(NULL)","(NULL)(NULL)chr$",24,"right$(NULL)(NULL)val(NULL)(NULL)(NULL)(NULL)(NULL)","(NULL)(NULL)chr$<",12,"(NULL)(NULL) (NULL)val(NULL)(NULL)","(NULL)val(NULL)"
  145. 146 [131]3,"peek(NULL)(NULL)str$val(NULL)close(NULL)(NULL)(NULL)right$(NULL)val","(NULL)(NULL)chr$",,"(NULL)(NULL) len(NULL)(NULL)(NULL)(NULL)val(NULL)","cmd*(NULL)(NULL)chr$",5,"str$right$(NULL)chr$(NULL) str$atn(NULL)val(NULL)","(NULL)(NULL)chr$"
  146. 147 [131]2,"(NULL)len(NULL)(NULL)(NULL)(NULL)close(NULL)val(NULL)(NULL)","(NULL)val(NULL)",30,"(NULL)(NULL)atn(NULL)val(NULL)close(NULL)(NULL)(NULL)atn(NULL)val","(NULL)(NULL)chr$",1,"(NULL)(NULL).chr$atn(NULL) peekright$(NULL)(NULL)","(NULL)val(NULL)"
  147. 148 [131]9,"(NULL)(NULL)(NULL)asc","(NULL)(NULL)chr$",27,"(NULL)right$(NULL)(NULL)val(NULL)right$len","(NULL)(NULL)chr$"
  148. 149 [131]"12048211004558504552494str$454val542048454str$50atn00000000000000000004asc00"
  149. 150 [131]"0000len21301494val544552525550atn0atn0atn0atn0atn0atn0atn0atn00000000000000000001800"
  150. 151 [131]"000081190157502054455854atn0atn0atn0atn0atn0atn0atn0atn0atn00000000000000000000len00"
  151. 152 [131]"000082190str$424asc5244455220535052495445atn0atn0atn00000000000000000000300"
  152. 153 [131]"0000021atn014peek5320434asc5552534553atn0atn0atn0atn0atn0atn00000000000000000000000"
  153. 154 [131]"000082020144494val474asc204441524553atn0atn0atn0atn0atn00000000000000000000500"
  154. 155 [131]"00008102055343524asc4len4len2054455854atn0atn0atn0atn0atn00000000000000000000200"
  155. 156 [131]"0000822103504len414val455420524asc54415445atn0atn0atn00000000000000000001val00"
  156. 157 [131]1,2,,4,8,2,1,1,,,4,5,5,8,5,,4,5,5,2,4,9,4,13,4,5,4,14,5,4,2,,4,8
  157. 158 [131]4,5,4,13,5,,10,,,,,,,,,,,,,,,,,,,,4,15,,
  158. 159 [131]2,7,4,13,4,5,4,14,5,4,2,,4,8,4,5,4,13,5,,10,,10,
  159. 160 [131]1,1,0,10,0,1,0,8,3,2,0,8,0,10,0,0,4,1,11,2,4,1,10,10,3,1,3,10,8,11,4,1
  160. 161 [131]11,2,3,1,10,7,9,7,3,5,3,3,3,2,3,6,3,5,2,12,3,1,3,1,3,10,8,9,3,2,3,0
  161.