dsktool 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/bin/dsktool.rb +157 -0
  2. data/doc/classes/AppleSoftFile.html +215 -0
  3. data/doc/classes/AppleSoftFile.src/M000005.html +18 -0
  4. data/doc/classes/AppleSoftFile.src/M000006.html +18 -0
  5. data/doc/classes/AppleSoftFile.src/M000008.html +18 -0
  6. data/doc/classes/AppleSoftFile.src/M000009.html +18 -0
  7. data/doc/classes/AppleSoftFile.src/M000010.html +18 -0
  8. data/doc/classes/AppleSoftFile.src/M000011.html +18 -0
  9. data/doc/classes/AppleSoftFile.src/M000012.html +18 -0
  10. data/doc/classes/BinaryFile.html +179 -0
  11. data/doc/classes/BinaryFile.src/M000015.html +18 -0
  12. data/doc/classes/BinaryFile.src/M000020.html +18 -0
  13. data/doc/classes/BinaryFile.src/M000021.html +18 -0
  14. data/doc/classes/BinaryFile.src/M000022.html +19 -0
  15. data/doc/classes/BinaryFile.src/M000023.html +18 -0
  16. data/doc/classes/BinaryFile.src/M000024.html +18 -0
  17. data/doc/classes/BinaryFile.src/M000025.html +19 -0
  18. data/doc/classes/D65.html +180 -0
  19. data/doc/classes/D65.src/M000002.html +18 -0
  20. data/doc/classes/D65.src/M000003.html +18 -0
  21. data/doc/classes/D65.src/M000004.html +64 -0
  22. data/doc/classes/D65.src/M000005.html +18 -0
  23. data/doc/classes/D65.src/M000006.html +18 -0
  24. data/doc/classes/D65.src/M000007.html +18 -0
  25. data/doc/classes/D65.src/M000008.html +18 -0
  26. data/doc/classes/D65.src/M000009.html +64 -0
  27. data/doc/classes/DOSDisk.html +272 -0
  28. data/doc/classes/DOSDisk.src/M000007.html +20 -0
  29. data/doc/classes/DOSDisk.src/M000008.html +77 -0
  30. data/doc/classes/DOSDisk.src/M000010.html +20 -0
  31. data/doc/classes/DOSDisk.src/M000011.html +20 -0
  32. data/doc/classes/DOSDisk.src/M000012.html +19 -0
  33. data/doc/classes/DOSDisk.src/M000013.html +20 -0
  34. data/doc/classes/DOSDisk.src/M000014.html +19 -0
  35. data/doc/classes/DOSDisk.src/M000015.html +76 -0
  36. data/doc/classes/DOSFile.html +221 -0
  37. data/doc/classes/DOSFile.src/M000016.html +22 -0
  38. data/doc/classes/DOSFile.src/M000017.html +17 -0
  39. data/doc/classes/DOSFile.src/M000018.html +18 -0
  40. data/doc/classes/DOSFile.src/M000021.html +22 -0
  41. data/doc/classes/DOSFile.src/M000022.html +22 -0
  42. data/doc/classes/DOSFile.src/M000023.html +22 -0
  43. data/doc/classes/DOSFile.src/M000024.html +17 -0
  44. data/doc/classes/DOSFile.src/M000025.html +18 -0
  45. data/doc/classes/DOSFile.src/M000026.html +22 -0
  46. data/doc/classes/DOSFile.src/M000027.html +17 -0
  47. data/doc/classes/DOSFile.src/M000028.html +18 -0
  48. data/doc/classes/DSK.html +285 -0
  49. data/doc/classes/DSK.src/M000009.html +22 -0
  50. data/doc/classes/DSK.src/M000010.html +27 -0
  51. data/doc/classes/DSK.src/M000011.html +19 -0
  52. data/doc/classes/DSK.src/M000012.html +18 -0
  53. data/doc/classes/DSK.src/M000013.html +22 -0
  54. data/doc/classes/DSK.src/M000014.html +22 -0
  55. data/doc/classes/DSK.src/M000015.html +22 -0
  56. data/doc/classes/DSK.src/M000016.html +22 -0
  57. data/doc/classes/DSK.src/M000017.html +22 -0
  58. data/doc/classes/DSK.src/M000018.html +27 -0
  59. data/doc/classes/DSK.src/M000019.html +19 -0
  60. data/doc/classes/DSK.src/M000020.html +18 -0
  61. data/doc/classes/DSK.src/M000021.html +40 -0
  62. data/doc/classes/DSK.src/M000022.html +23 -0
  63. data/doc/classes/IntegerBasicFile.html +276 -0
  64. data/doc/classes/IntegerBasicFile.src/M000001.html +18 -0
  65. data/doc/classes/IntegerBasicFile.src/M000004.html +18 -0
  66. data/doc/classes/IntegerBasicFile.src/M000005.html +18 -0
  67. data/doc/classes/IntegerBasicFile.src/M000006.html +18 -0
  68. data/doc/classes/TestDOSDisks.html +174 -0
  69. data/doc/classes/TestDOSDisks.src/M000001.html +19 -0
  70. data/doc/classes/TestDOSDisks.src/M000002.html +19 -0
  71. data/doc/classes/TestDOSDisks.src/M000003.html +43 -0
  72. data/doc/classes/TestDisassembly.html +144 -0
  73. data/doc/classes/TestDisassembly.src/M000005.html +19 -0
  74. data/doc/classes/TestDisassembly.src/M000006.html +19 -0
  75. data/doc/classes/TestDisassembly.src/M000007.html +19 -0
  76. data/doc/classes/TextFile.html +179 -0
  77. data/doc/classes/TextFile.src/M000019.html +18 -0
  78. data/doc/classes/TextFile.src/M000020.html +20 -0
  79. data/doc/classes/TextFile.src/M000024.html +18 -0
  80. data/doc/classes/TextFile.src/M000025.html +18 -0
  81. data/doc/classes/TextFile.src/M000026.html +18 -0
  82. data/doc/classes/TextFile.src/M000027.html +20 -0
  83. data/doc/classes/TextFile.src/M000029.html +18 -0
  84. data/doc/classes/TextFile.src/M000030.html +18 -0
  85. data/doc/classes/TextFile.src/M000031.html +20 -0
  86. data/doc/created.rid +1 -0
  87. data/doc/dot/f_0.dot +14 -0
  88. data/doc/dot/f_0.png +0 -0
  89. data/doc/dot/f_1.dot +23 -0
  90. data/doc/dot/f_1.png +0 -0
  91. data/doc/dot/f_2.dot +32 -0
  92. data/doc/dot/f_2.png +0 -0
  93. data/doc/dot/f_3.dot +75 -0
  94. data/doc/dot/f_3.png +0 -0
  95. data/doc/dot/f_4.dot +23 -0
  96. data/doc/dot/f_4.png +0 -0
  97. data/doc/dot/f_5.dot +32 -0
  98. data/doc/dot/f_5.png +0 -0
  99. data/doc/dot/f_6.dot +32 -0
  100. data/doc/dot/f_6.png +0 -0
  101. data/doc/dot/f_7.dot +14 -0
  102. data/doc/dot/f_7.png +0 -0
  103. data/doc/files/bin/dsktool_rb.html +171 -0
  104. data/doc/files/lib/D65_rb.html +114 -0
  105. data/doc/files/lib/DOSDisk_rb.html +115 -0
  106. data/doc/files/lib/DOSFile_rb.html +118 -0
  107. data/doc/files/lib/DSK_rb.html +114 -0
  108. data/doc/files/test/tc_disassembly_rb.html +117 -0
  109. data/doc/files/test/tc_dos_disks_rb.html +116 -0
  110. data/doc/files/test/test_dos_disks_rb.html +109 -0
  111. data/doc/files/test/ts_test_all_rb.html +114 -0
  112. data/doc/fr_class_index.html +36 -0
  113. data/doc/fr_file_index.html +34 -0
  114. data/doc/fr_method_index.html +57 -0
  115. data/doc/index.html +24 -0
  116. data/lib/D65.rb +178 -0
  117. data/lib/DOSDisk.rb +186 -0
  118. data/lib/DOSFile.rb +356 -0
  119. data/lib/DSK.rb +121 -0
  120. data/lib/a2_symbols.yaml +199 -0
  121. data/test/dos33_with_adt.dsk +0 -0
  122. data/test/tc_disassembly.rb +16 -0
  123. data/test/tc_dos_disks.rb +49 -0
  124. data/test/ts_test_all.rb +5 -0
  125. metadata +184 -0
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (D65)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/D65.rb, line 91</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">_annotations</span>={})
15
+ <span class="ruby-ivar">@annotations</span>=<span class="ruby-identifier">_annotations</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>annotations (D65)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/D65.rb, line 98</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">annotations</span>
15
+ <span class="ruby-ivar">@annotations</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>disassemble (D65)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/D65.rb, line 103</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disassemble</span>(<span class="ruby-identifier">buffer</span>,<span class="ruby-identifier">start_address</span>=<span class="ruby-value">0</span>)
15
+
16
+ <span class="ruby-identifier">index</span>=<span class="ruby-value">0</span>
17
+ <span class="ruby-identifier">s</span>=<span class="ruby-value str">&quot;&quot;</span>
18
+ <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">index</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">length</span>
19
+ <span class="ruby-identifier">byte</span>=<span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">index</span>]
20
+ <span class="ruby-identifier">current_address</span>=<span class="ruby-identifier">start_address</span><span class="ruby-operator">+</span><span class="ruby-identifier">index</span>
21
+ <span class="ruby-identifier">opcode_name</span>=<span class="ruby-constant">OPCODES</span>[<span class="ruby-identifier">byte</span>][<span class="ruby-value">0</span>]
22
+ <span class="ruby-identifier">operand_type</span>=<span class="ruby-constant">OPCODES</span>[<span class="ruby-identifier">byte</span>][<span class="ruby-value">1</span>]
23
+ <span class="ruby-identifier">next_byte</span>=(<span class="ruby-identifier">index</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span><span class="ruby-operator">?</span><span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>]<span class="ruby-operator">:</span><span class="ruby-value">0</span>)
24
+ <span class="ruby-identifier">next_word</span>=(<span class="ruby-identifier">index</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">2</span><span class="ruby-operator">?</span><span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>]<span class="ruby-operator">+</span><span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">+</span><span class="ruby-value">2</span>]<span class="ruby-operator">*</span><span class="ruby-value">256</span><span class="ruby-operator">:</span><span class="ruby-value">0</span>)
25
+ <span class="ruby-identifier">operand_format</span>,<span class="ruby-identifier">operand_address</span>= <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">operand_type</span>
26
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:imp</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">''</span>,<span class="ruby-value str">''</span>]
27
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:acc</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;A&quot;</span>,<span class="ruby-value str">''</span>]
28
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:imm</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;\#$%02X&quot;</span>,<span class="ruby-identifier">next_byte</span>]
29
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:abs</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%04X&quot;</span>,<span class="ruby-identifier">next_word</span>]
30
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:abx</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%04X,X&quot;</span>,<span class="ruby-identifier">next_word</span>]
31
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:aby</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%04X,Y&quot;</span>,<span class="ruby-identifier">next_word</span>]
32
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:zpg</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%02X&quot;</span>,<span class="ruby-identifier">next_byte</span>]
33
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:zpx</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%02X,X&quot;</span>,<span class="ruby-identifier">next_byte</span>]
34
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:zpy</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%02X,Y&quot;</span>,<span class="ruby-identifier">next_byte</span>]
35
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:ind</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;($%04X)&quot;</span>,<span class="ruby-identifier">next_word</span>]
36
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:inx</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;($%04X),X&quot;</span>,<span class="ruby-identifier">next_word</span>]
37
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:iny</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;($%04X),Y&quot;</span>,<span class="ruby-identifier">next_word</span>]
38
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:inz</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;($%02X),Y&quot;</span>,<span class="ruby-identifier">next_byte</span>]
39
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:rel</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%04X&quot;</span>,(<span class="ruby-identifier">current_address</span><span class="ruby-operator">+</span><span class="ruby-identifier">next_byte</span>.<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;c&quot;</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-value">2</span>)<span class="ruby-operator">%</span><span class="ruby-value">0x10000</span>]
40
+ <span class="ruby-keyword kw">else</span>
41
+ <span class="ruby-identifier">abort</span>(<span class="ruby-node">&quot;unknown symbol #{operand_type}&quot;</span>)
42
+ <span class="ruby-keyword kw">end</span>
43
+ <span class="ruby-identifier">operand</span> = <span class="ruby-identifier">sprintf</span>(<span class="ruby-identifier">operand_format</span>,<span class="ruby-identifier">operand_address</span>)
44
+ <span class="ruby-identifier">opcode_size</span>=<span class="ruby-constant">OPCODE_SIZE</span>[<span class="ruby-identifier">operand_type</span>]
45
+ <span class="ruby-identifier">instruction_bytes</span>=<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">opcode_size</span>
46
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%02X &quot;</span>,<span class="ruby-identifier">byte</span>)
47
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%02X %02X &quot;</span>,<span class="ruby-identifier">byte</span>,<span class="ruby-identifier">next_byte</span>)
48
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%02X %02X %02X&quot;</span>,<span class="ruby-identifier">byte</span>,<span class="ruby-identifier">next_byte</span>,<span class="ruby-identifier">next_word</span><span class="ruby-operator">&gt;&gt;</span><span class="ruby-value">8</span>)
49
+ <span class="ruby-keyword kw">end</span>
50
+
51
+
52
+ <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span><span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%04X: %s %s %s ; &quot;</span>,<span class="ruby-identifier">current_address</span>,<span class="ruby-identifier">instruction_bytes</span>,<span class="ruby-identifier">opcode_name</span>,<span class="ruby-identifier">operand</span>.<span class="ruby-identifier">ljust</span>(<span class="ruby-value">10</span>))
53
+ <span class="ruby-identifier">annotation</span>=<span class="ruby-identifier">annotations</span>[<span class="ruby-identifier">operand_address</span>]
54
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">annotation</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">operand_type!</span>=<span class="ruby-identifier">:imm</span>)) <span class="ruby-keyword kw">then</span>
55
+ <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span><span class="ruby-value str">&quot; &quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">annotation</span>.<span class="ruby-identifier">to_s</span>
56
+ <span class="ruby-keyword kw">end</span>
57
+ <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;\n&quot;</span>
58
+ <span class="ruby-identifier">index</span><span class="ruby-operator">+=</span><span class="ruby-identifier">opcode_size</span>
59
+ <span class="ruby-keyword kw">end</span>
60
+
61
+ <span class="ruby-identifier">s</span>
62
+ <span class="ruby-keyword kw">end</span></pre>
63
+ </body>
64
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (D65)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/D65.rb, line 92</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">_annotations</span>={})
15
+ <span class="ruby-ivar">@annotations</span>=<span class="ruby-identifier">_annotations</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>annotations (D65)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/D65.rb, line 99</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">D65</span>.<span class="ruby-identifier">annotations</span>
15
+ <span class="ruby-ivar">@@annotations</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>annotations (D65)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/D65.rb, line 99</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">D65</span>.<span class="ruby-identifier">annotations</span>
15
+ <span class="ruby-ivar">@@annotations</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>annotations (D65)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/D65.rb, line 99</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">D65</span>.<span class="ruby-identifier">annotations</span>
15
+ <span class="ruby-ivar">@@annotations</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>disassemble (D65)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/D65.rb, line 104</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">D65</span>.<span class="ruby-identifier">disassemble</span>(<span class="ruby-identifier">buffer</span>,<span class="ruby-identifier">start_address</span>=<span class="ruby-value">0</span>)
15
+
16
+ <span class="ruby-identifier">index</span>=<span class="ruby-value">0</span>
17
+ <span class="ruby-identifier">s</span>=<span class="ruby-value str">&quot;&quot;</span>
18
+ <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">index</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">length</span>
19
+ <span class="ruby-identifier">byte</span>=<span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">index</span>]
20
+ <span class="ruby-identifier">current_address</span>=<span class="ruby-identifier">start_address</span><span class="ruby-operator">+</span><span class="ruby-identifier">index</span>
21
+ <span class="ruby-identifier">opcode_name</span>=<span class="ruby-constant">OPCODES</span>[<span class="ruby-identifier">byte</span>][<span class="ruby-value">0</span>]
22
+ <span class="ruby-identifier">operand_type</span>=<span class="ruby-constant">OPCODES</span>[<span class="ruby-identifier">byte</span>][<span class="ruby-value">1</span>]
23
+ <span class="ruby-identifier">next_byte</span>=(<span class="ruby-identifier">index</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span><span class="ruby-operator">?</span><span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>]<span class="ruby-operator">:</span><span class="ruby-value">0</span>)
24
+ <span class="ruby-identifier">next_word</span>=(<span class="ruby-identifier">index</span><span class="ruby-operator">&lt;</span><span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">2</span><span class="ruby-operator">?</span><span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>]<span class="ruby-operator">+</span><span class="ruby-identifier">buffer</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">+</span><span class="ruby-value">2</span>]<span class="ruby-operator">*</span><span class="ruby-value">256</span><span class="ruby-operator">:</span><span class="ruby-value">0</span>)
25
+ <span class="ruby-identifier">operand_format</span>,<span class="ruby-identifier">operand_address</span>= <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">operand_type</span>
26
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:imp</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">''</span>,<span class="ruby-value str">''</span>]
27
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:acc</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;A&quot;</span>,<span class="ruby-value str">''</span>]
28
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:imm</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;\#$%02X&quot;</span>,<span class="ruby-identifier">next_byte</span>]
29
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:abs</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%04X&quot;</span>,<span class="ruby-identifier">next_word</span>]
30
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:abx</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%04X,X&quot;</span>,<span class="ruby-identifier">next_word</span>]
31
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:aby</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%04X,Y&quot;</span>,<span class="ruby-identifier">next_word</span>]
32
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:zpg</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%02X&quot;</span>,<span class="ruby-identifier">next_byte</span>]
33
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:zpx</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%02X,X&quot;</span>,<span class="ruby-identifier">next_byte</span>]
34
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:zpy</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%02X,Y&quot;</span>,<span class="ruby-identifier">next_byte</span>]
35
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:ind</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;($%04X)&quot;</span>,<span class="ruby-identifier">next_word</span>]
36
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:inx</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;($%04X),X&quot;</span>,<span class="ruby-identifier">next_word</span>]
37
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:iny</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;($%04X),Y&quot;</span>,<span class="ruby-identifier">next_word</span>]
38
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:inz</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;($%02X),Y&quot;</span>,<span class="ruby-identifier">next_byte</span>]
39
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:rel</span> <span class="ruby-keyword kw">then</span> [<span class="ruby-value str">&quot;$%04X&quot;</span>,(<span class="ruby-identifier">current_address</span><span class="ruby-operator">+</span><span class="ruby-identifier">next_byte</span>.<span class="ruby-identifier">chr</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;c&quot;</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-value">2</span>)<span class="ruby-operator">%</span><span class="ruby-value">0x10000</span>]
40
+ <span class="ruby-keyword kw">else</span>
41
+ <span class="ruby-identifier">abort</span>(<span class="ruby-node">&quot;unknown symbol #{operand_type}&quot;</span>)
42
+ <span class="ruby-keyword kw">end</span>
43
+ <span class="ruby-identifier">operand</span> = <span class="ruby-identifier">sprintf</span>(<span class="ruby-identifier">operand_format</span>,<span class="ruby-identifier">operand_address</span>)
44
+ <span class="ruby-identifier">opcode_size</span>=<span class="ruby-constant">OPCODE_SIZE</span>[<span class="ruby-identifier">operand_type</span>]
45
+ <span class="ruby-identifier">instruction_bytes</span>=<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">opcode_size</span>
46
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%02X &quot;</span>,<span class="ruby-identifier">byte</span>)
47
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%02X %02X &quot;</span>,<span class="ruby-identifier">byte</span>,<span class="ruby-identifier">next_byte</span>)
48
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%02X %02X %02X&quot;</span>,<span class="ruby-identifier">byte</span>,<span class="ruby-identifier">next_byte</span>,<span class="ruby-identifier">next_word</span><span class="ruby-operator">&gt;&gt;</span><span class="ruby-value">8</span>)
49
+ <span class="ruby-keyword kw">end</span>
50
+
51
+
52
+ <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span><span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%04X: %s %s %s ; &quot;</span>,<span class="ruby-identifier">current_address</span>,<span class="ruby-identifier">instruction_bytes</span>,<span class="ruby-identifier">opcode_name</span>,<span class="ruby-identifier">operand</span>.<span class="ruby-identifier">ljust</span>(<span class="ruby-value">10</span>))
53
+ <span class="ruby-identifier">annotation</span>=<span class="ruby-identifier">annotations</span>[<span class="ruby-identifier">operand_address</span>]
54
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">annotation</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">operand_type!</span>=<span class="ruby-identifier">:imm</span>)) <span class="ruby-keyword kw">then</span>
55
+ <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span><span class="ruby-value str">&quot; &quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">annotation</span>.<span class="ruby-identifier">to_s</span>
56
+ <span class="ruby-keyword kw">end</span>
57
+ <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;\n&quot;</span>
58
+ <span class="ruby-identifier">index</span><span class="ruby-operator">+=</span><span class="ruby-identifier">opcode_size</span>
59
+ <span class="ruby-keyword kw">end</span>
60
+
61
+ <span class="ruby-identifier">s</span>
62
+ <span class="ruby-keyword kw">end</span></pre>
63
+ </body>
64
+ </html>
@@ -0,0 +1,272 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: DOSDisk</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">DOSDisk</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/DOSDisk_rb.html">
59
+ lib/DOSDisk.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="DSK.html">
69
+ DSK
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+ <div id="diagram">
83
+ <map id="map" name="map">
84
+ <area shape="RECT" coords="13,101,88,149" href="DOSDisk.html" alt="DOSDisk">
85
+ <area shape="RECT" coords="15,5,87,53" href="DSK.html" alt="DSK">
86
+ </map>
87
+ <img src="../dot/f_2.png" usemap="#map" border=0 alt="TopLevel">
88
+ </div>
89
+
90
+ <div id="description">
91
+ <pre>
92
+ Disk image with a standard Apple DOS 3.3 VTOC at track $11, sector $00
93
+ </pre>
94
+ <p>
95
+ VTOC : Volume Table of Contents (from Beneath Apple DOS pp 4-2 &amp; 4-3)
96
+ </p>
97
+ <pre>
98
+ 00 not used
99
+ 01 track number of first catalog sector
100
+ 02 sector number of first catalog sector
101
+ 03 release number of DOS used to INIT this disk
102
+ 04-05 not used
103
+ 06 Diskette volume number (1-254)
104
+ 07-26 not used
105
+ 27 maximum number of track/sector pairs which will fit in one file track/sector
106
+ list sector (122 for 256 byte sectors)
107
+ 28-2F not used
108
+ 30 last track where sectors were allocated
109
+ 31 direction of track allocation (+1 or -1)
110
+ 32-33 not used
111
+ 34 number of tracks per diskette (normally 35)
112
+ 35 number of sectors per track (13 or 16)
113
+ 36-37 number of bytes per sector (LO/HI format)
114
+ 38-3B bit map of free sectors in track 0
115
+ 3C-3F bit map of free sectors in track 1
116
+ 40-43 bit map of free sectors in track 2
117
+ ...
118
+ BC-BF bit map of free sectors in track 33
119
+ CO-C3 bit map of free sectors in track 34
120
+ C4-FF bit maps for additional tracks if there are more than 35 tracks per diskette
121
+ </pre>
122
+ <p>
123
+ CATALOG (from Beneath Apple DOS p 4-6)
124
+ </p>
125
+ <pre>
126
+ 00 Not Used
127
+ 01 track number of next catalog sector
128
+ 02 sector number of next catalog sector
129
+ 03-0A not used
130
+ 0B-2D First file descriptive entry
131
+ 2E-50 Second file descriptive entry
132
+ 51-73 Third file descriptive entry
133
+ 74-96 Fourth file descriptive entry
134
+ 97-B9 Fifth file descriptive entry
135
+ BA-DC Sixth file descriptive entry
136
+ DD-FF Seventh file descriptive entry
137
+ </pre>
138
+ <p>
139
+ FILE DESCRIPTIVE ENTRY (from Beneath Apple DOS p 4-6)
140
+ </p>
141
+ <pre>
142
+ 00 Track of first track/sector list sector, if this is a deleted file this contains FF
143
+ and the original track number is copied to the last byte of the file name (BYTE 20)
144
+ If this byte contains a 00, the entry is assumed to never have been used and is
145
+ available for use. (This means track 0 can never be used for data even if the DOS image
146
+ is 'wiped' from the disk)
147
+
148
+ 01 Sector of first track/sector list sector
149
+ 02 File type and flags:
150
+ 80+file type - file is locked
151
+ 00+file type - file is not locked
152
+
153
+ 00 - TEXT file
154
+ 01 - INTEGER BASIC file
155
+ 02 - APPLESOFT BASIC file
156
+ 04 - BINARY file
157
+ 08 - S type file
158
+ 10 - RELOCATABLE object module file
159
+ 20 - a type file
160
+ 40 - b type file
161
+
162
+ 03-20 File Name (30 characters)
163
+ 21-22 Length of file in sectors (LO/HI format)
164
+ </pre>
165
+ <p>
166
+ TRACK/SECTOR LIST FORMAT (from Beneath Apple DOS p 4-6)
167
+ </p>
168
+ <pre>
169
+ 00 Not used
170
+ 01 Track number of next T/S list of one is needed or zero if no more t/s list
171
+ 02 Sector number of next T/S list (if one is present)
172
+ 03-04 Not used
173
+ 05-06 Sector offset in file of the first sector described by this list
174
+ 07-oB Not used
175
+ 0C-0D Track and sector of first data sector or zeros
176
+ 0E-0F Track and sector of second data sector or zeros
177
+ 10-FF Up to 120 more track and sector pairs
178
+ </pre>
179
+
180
+ </div>
181
+
182
+
183
+ </div>
184
+
185
+ <div id="method-list">
186
+ <h3 class="section-bar">Methods</h3>
187
+
188
+ <div class="name-list">
189
+ <a href="#M000013">dump_catalog</a>&nbsp;&nbsp;
190
+ <a href="#M000014">new</a>&nbsp;&nbsp;
191
+ <a href="#M000015">read_vtoc</a>&nbsp;&nbsp;
192
+ </div>
193
+ </div>
194
+
195
+ </div>
196
+
197
+
198
+ <!-- if includes -->
199
+
200
+ <div id="section">
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <!-- if method_list -->
210
+ <div id="methods">
211
+ <h3 class="section-bar">Public Class methods</h3>
212
+
213
+ <div id="method-M000014" class="method-detail">
214
+ <a name="M000014"></a>
215
+
216
+ <div class="method-heading">
217
+ <a href="DOSDisk.src/M000014.html" target="Code" class="method-signature"
218
+ onclick="popupCode('DOSDisk.src/M000014.html');return false;">
219
+ <span class="method-name">new</span><span class="method-args">(file_bytes)</span>
220
+ </a>
221
+ </div>
222
+
223
+ <div class="method-description">
224
+ </div>
225
+ </div>
226
+
227
+ <h3 class="section-bar">Public Instance methods</h3>
228
+
229
+ <div id="method-M000013" class="method-detail">
230
+ <a name="M000013"></a>
231
+
232
+ <div class="method-heading">
233
+ <a href="DOSDisk.src/M000013.html" target="Code" class="method-signature"
234
+ onclick="popupCode('DOSDisk.src/M000013.html');return false;">
235
+ <span class="method-name">dump_catalog</span><span class="method-args">()</span>
236
+ </a>
237
+ </div>
238
+
239
+ <div class="method-description">
240
+ </div>
241
+ </div>
242
+
243
+ <div id="method-M000015" class="method-detail">
244
+ <a name="M000015"></a>
245
+
246
+ <div class="method-heading">
247
+ <a href="DOSDisk.src/M000015.html" target="Code" class="method-signature"
248
+ onclick="popupCode('DOSDisk.src/M000015.html');return false;">
249
+ <span class="method-name">read_vtoc</span><span class="method-args">()</span>
250
+ </a>
251
+ </div>
252
+
253
+ <div class="method-description">
254
+ <p>
255
+ reads the VTOC, and populate the &quot;files&quot; array with files
256
+ </p>
257
+ </div>
258
+ </div>
259
+
260
+
261
+ </div>
262
+
263
+
264
+ </div>
265
+
266
+
267
+ <div id="validator-badges">
268
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
269
+ </div>
270
+
271
+ </body>
272
+ </html>