├── .gitignore ├── LICENSE ├── README.md ├── _images ├── cpm_dm1.png ├── cpm_dm2.png └── cpm_dm3.png ├── cpm_disk_manager.sln ├── cpm_disk_manager ├── App.config ├── Disk.cs ├── DiskImage.cs ├── DiskInfo.cs ├── FileEntry.cs ├── IniFile.cs ├── ListViewColumnSorter.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── ico62999.ico │ ├── icoDetails.ico │ ├── icoLargeIcon.ico │ ├── icoList.ico │ ├── icoSmallIcon.ico │ ├── icoTile.ico │ └── imageres_5325.ico ├── Utils.cs ├── config.ini ├── cpm_disk_manager.csproj ├── frmAbout.cs ├── frmAbout.designer.cs ├── frmAbout.resx ├── frmDiskSelection.Designer.cs ├── frmDiskSelection.cs ├── frmDiskSelection.resx ├── frmEditFile.Designer.cs ├── frmEditFile.cs ├── frmEditFile.resx ├── frmMain.Designer.cs ├── frmMain.cs ├── frmMain.resx ├── packages.config └── tasm │ ├── Tasm_Opcode.cs │ ├── original_tasm1.tab │ └── tasm1.tab ├── data.dsk └── tasm80.tab /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CP/M Disk Manager [![Hackaday.io](https://img.shields.io/badge/Hackaday.io--blue.svg)](https://hackaday.io/project/183266-baffa-2-homebrew-microcomputer) 2 | 3 | Compatible with CP/M on breadboard by Grant Searle (http://searle.x10host.com/cpm/index.html) 4 | and RC2014 by Spencer Owen (https://rc2014.co.uk/) 5 | 6 | This is a disk manager for CP/M disk format using a 64MB/128MB Compact Flash proposed by Grant Searle. 7 | 8 | The emulator software is available at https://github.com/abaffa/z80cpm_emulator and was the landmark for [Baffa-2 Homebrew Microcomputer Project](https://baffa-2.baffasoft.com.br) 9 | 10 | File data.dsk is an example of disk image. 11 | 12 | To read the CFCard/SDCard it's necessary to run as administrator to have disk raw access priviledges. 13 | 14 | PS: This program uses the RawDiskLib.dll from Visual Studio 2017 to access (read/write) raw data from removable disks. As it has that raw disk access feature, some antivirus programs are erroneously reporting it as malware. This is a false positive and should be ignored! Btw the raw disk access only is available and accessible if the program is run with administrative privileges. 15 | 16 | ![cpm_dm1](_images/cpm_dm1.png) 17 | 18 | ![cpm_dm2](_images/cpm_dm2.png) 19 | 20 | ![cpm_dm3](_images/cpm_dm3.png) 21 | 22 | -----BEGIN LICENSE NOTICE----- 23 | 24 | CP/M Disk Manager for Z80 CPM Emulator 25 | 26 | Copyright (C) 2021 Augusto Baffa, (cpm.baffasoft.com.br) 27 | 28 | This program is free software; you can redistribute it and/or 29 | modify it under the terms of the GNU General Public License 30 | as published by the Free Software Foundation; either version 2 31 | of the License, or (at your option) any later version. 32 | 33 | This program is distributed in the hope that it will be useful, 34 | but WITHOUT ANY WARRANTY; without even the implied warranty of 35 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 36 | GNU General Public License for more details. 37 | 38 | You should have received a copy of the GNU General Public License 39 | along with this program; if not, write to the Free Software 40 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 41 | 42 | -----END LICENSE NOTICE----- 43 | -------------------------------------------------------------------------------- /_images/cpm_dm1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/_images/cpm_dm1.png -------------------------------------------------------------------------------- /_images/cpm_dm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/_images/cpm_dm2.png -------------------------------------------------------------------------------- /_images/cpm_dm3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/_images/cpm_dm3.png -------------------------------------------------------------------------------- /cpm_disk_manager.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cpm_disk_manager", "cpm_disk_manager\cpm_disk_manager.csproj", "{2475CA2B-7973-45AA-BD9F-5D79DC37E6C2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2475CA2B-7973-45AA-BD9F-5D79DC37E6C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2475CA2B-7973-45AA-BD9F-5D79DC37E6C2}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2475CA2B-7973-45AA-BD9F-5D79DC37E6C2}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {2475CA2B-7973-45AA-BD9F-5D79DC37E6C2}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {8D1EA7F2-FE7C-45F5-8C67-0BE6DE1C7459} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /cpm_disk_manager/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cpm_disk_manager/Disk.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace cpm_disk_manager 8 | { 9 | public class Disk 10 | { 11 | int default_firstdiskstart = 0x4000; 12 | 13 | public int spt { get; set; } //DEFW spt; Number of 128-byte records per track 14 | 15 | public int bsh { get; set; } //DEFB bsh; Block shift. 3 => 1k, 4 => 2k, 5 => 4k.... 16 | public int blm { get; set; } //DEFB blm; Block mask. 7 => 1k, 0Fh => 2k, 1Fh => 4k... 17 | public int exm { get; set; } //DEFB exm; Extent mask, see later 18 | public int dsm { get; set; } //DEFW dsm; (no.of blocks on the disc)-1 19 | public int first_dsm { get; set; } 20 | public int last_dsm { get; set; } 21 | 22 | public int drw { get; set; } //DEFW drm; (no.of directory entries)-1 23 | 24 | public int al0 { get; set; } //DEFB al0; Directory allocation bitmap, first byte 25 | public int al1 { get; set; } //DEFB al1; Directory allocation bitmap, second byte 26 | public int cks { get; set; } //DEFW cks; Checksum vector size, 0 for a fixed disc 27 | // ; No.directory entries/4, rounded up. 28 | public int off { get; set; } //DEFW off; Offset, number of reserved tracks 29 | 30 | //The directory allocation bitmap is interpreted as: (240 0) 31 | // al0 al1 32 | //b7b6b5b4b3b2b1b0 b7b6b5b4b3b2b1b0 33 | // 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 34 | 35 | // - ie, in this example, the first 4 blocks of the disc contain the directory. 36 | 37 | 38 | Byte[] fileData; 39 | 40 | List FAT = new List(); 41 | Dictionary> file_entries = new Dictionary>(); 42 | 43 | public Disk(DiskImageFormat _diskImageFormat) 44 | { 45 | 46 | if (_diskImageFormat == DiskImageFormat._64MB_Searle) 47 | { 48 | spt = 128; 49 | bsh = 5; 50 | blm = 31; 51 | exm = 1; 52 | dsm = 2047; 53 | drw = 511; 54 | first_dsm = 2043; 55 | last_dsm = dsm; 56 | al0 = 240; //0b11110000; 57 | al1 = 0; //0b00000000; 58 | cks = 0; 59 | off = 0; 60 | 61 | default_firstdiskstart = 0x4000; 62 | } 63 | else if (_diskImageFormat == DiskImageFormat.__ROMWBW) 64 | { 65 | spt = 64; 66 | bsh = 5; 67 | blm = 31; 68 | exm = 1; 69 | dsm = 2048 - 1; 70 | first_dsm = dsm; 71 | last_dsm = dsm; 72 | drw = 512 - 1; 73 | al0 = 0b11110000; 74 | al1 = 0b00000000; 75 | cks = 0x8080; 76 | off = 16; 77 | default_firstdiskstart = 0x20000; 78 | } 79 | else if (_diskImageFormat == DiskImageFormat._128MB_Searle) 80 | { 81 | spt = 128; 82 | bsh = 5; 83 | blm = 31; 84 | exm = 1; 85 | dsm = 2047; 86 | first_dsm = 2043; 87 | last_dsm = dsm; 88 | drw = 511; 89 | al0 = 240; //0b11110000; 90 | al1 = 0; //0b00000000; 91 | cks = 0; 92 | off = 0; 93 | 94 | default_firstdiskstart = 0x4000; 95 | } 96 | } 97 | 98 | public void LoadDisk(Byte[] disk, int start) 99 | { 100 | int size = GetDiskSize(); 101 | 102 | if (start == 0 || start == default_firstdiskstart) 103 | { 104 | dsm = first_dsm; 105 | start = default_firstdiskstart; 106 | size = (dsm + 1) * 0x1000; 107 | off = 1; 108 | } 109 | else if (size + start > disk.Length) 110 | { 111 | size = disk.Length - start; 112 | dsm = (size / 0x1000) - 1; 113 | off = 0; 114 | } 115 | else 116 | { 117 | dsm = last_dsm; 118 | off = 0; 119 | //size = GetDiskSize(); 120 | } 121 | 122 | fileData = new byte[size]; 123 | Buffer.BlockCopy(disk, start, fileData, 0, size); 124 | } 125 | 126 | 127 | 128 | public static short[] get_al(byte[] fileBytes2, int start) 129 | { 130 | short[] _al = new short[8]; 131 | _al[0] = (short)(fileBytes2[start + 0] + (fileBytes2[start + 1] << 8)); 132 | _al[1] = (short)(fileBytes2[start + 2] + (fileBytes2[start + 3] << 8)); 133 | _al[2] = (short)(fileBytes2[start + 4] + (fileBytes2[start + 5] << 8)); 134 | _al[3] = (short)(fileBytes2[start + 6] + (fileBytes2[start + 7] << 8)); 135 | _al[4] = (short)(fileBytes2[start + 8] + (fileBytes2[start + 9] << 8)); 136 | _al[5] = (short)(fileBytes2[start + 10] + (fileBytes2[start + 11] << 8)); 137 | _al[6] = (short)(fileBytes2[start + 12] + (fileBytes2[start + 13] << 8)); 138 | _al[7] = (short)(fileBytes2[start + 14] + (fileBytes2[start + 15] << 8)); 139 | 140 | return _al; 141 | } 142 | 143 | public int get_file_bytes(FileEntry f) 144 | { 145 | int c = 0; 146 | List b = new List(); 147 | 148 | foreach (int ad in f._al) 149 | { 150 | if (c > 0 && ad == 0) 151 | break; 152 | c++; 153 | } 154 | 155 | return (c - 1) * 0x1000 + 0x80 * f._rc; 156 | } 157 | 158 | 159 | public List cmd_ls() 160 | { 161 | 162 | FAT.Clear(); 163 | file_entries.Clear(); 164 | int d = 0; 165 | 166 | while (d < ((drw + 1) * 0x20)) 167 | { 168 | 169 | if (fileData[d] != 0xE5) 170 | { 171 | 172 | FileEntry f = new FileEntry() 173 | { 174 | _entry = d, 175 | _status = fileData[d + 0], 176 | 177 | _name = Utils.getStringFromByteArray(fileData, d + 1, 8), 178 | _ext = Utils.getStringFromByteArray(fileData, d + 9, 3), 179 | _ex = fileData[d + 12], 180 | _s1 = 0x0, 181 | _s2 = fileData[d + 14], 182 | _rc = fileData[d + 15], 183 | _entry_number = 0, 184 | _num_records = 0, 185 | _size = 0, 186 | _start = 0 187 | }; 188 | f._entry_number = ((32 * f._s2) + f._ex) / (exm + 1); 189 | f._num_records = (f._ex & exm) * 128 + f._rc; 190 | 191 | f._al = get_al(fileData, d + 16); 192 | f._size = get_file_bytes(f); 193 | f._start = (f._al[0] * 0x1000); 194 | 195 | string filename = Utils.getStringFromByteArray(fileData, d + 1, 8) + Utils.getStringFromByteArray(fileData, d + 9, 3); 196 | if (!file_entries.ContainsKey(filename)) 197 | { 198 | FAT.Add(f); 199 | file_entries.Add(filename, new List(new FileEntry[] { f })); 200 | } 201 | else 202 | { 203 | file_entries[filename].Add(f); 204 | } 205 | 206 | } 207 | d += 0x20; 208 | } 209 | 210 | return FAT; 211 | } 212 | 213 | 214 | public bool DeleteFile(string filename) 215 | { 216 | if (file_entries.ContainsKey(filename)) 217 | { 218 | foreach (FileEntry fe in file_entries[filename]) 219 | { 220 | fe._status = 0xE5; 221 | } 222 | 223 | return true; 224 | } 225 | return false; 226 | } 227 | 228 | public bool RenameFile(string filename, String name, String ext) 229 | { 230 | if (file_entries.ContainsKey(filename)) 231 | { 232 | String _name = name.Length > 0 ? name.Substring(0, Math.Min(name.Length, 8)) : ""; 233 | String _ext = ext.Length > 0 ? ext.Substring(0, Math.Min(ext.Length, 3)) : ""; 234 | 235 | _name = _name.PadRight(8); 236 | _ext = _ext.PadRight(3); 237 | 238 | foreach (FileEntry fe in file_entries[filename]) 239 | { 240 | fe._name = _name; 241 | fe._ext = _ext; 242 | } 243 | 244 | 245 | List value = file_entries[filename]; 246 | file_entries.Remove(filename); 247 | file_entries.Add(_name + _ext, value); 248 | return true; 249 | } 250 | return false; 251 | } 252 | 253 | public List GetFileEntries(String filename) 254 | { 255 | return file_entries[filename]; 256 | } 257 | 258 | public List GetFileEntry(string filename) 259 | { 260 | if (file_entries.ContainsKey(filename)) 261 | return file_entries[filename]; 262 | return null; 263 | } 264 | 265 | 266 | public void SetUser(string filename, int new_user) 267 | { 268 | 269 | for(int i = 0; i < file_entries[filename].Count; i++) 270 | { 271 | file_entries[filename][i]._status = new_user; 272 | } 273 | } 274 | 275 | public byte[] GetFile(string filename) 276 | { 277 | int c = 0; 278 | List f = new List(); 279 | List blocks = new List(); 280 | int size = 0; 281 | foreach (FileEntry fe in file_entries[filename]) 282 | { 283 | blocks.AddRange(fe._al.Where(p => p > 0)); 284 | size += fe._size; 285 | } 286 | 287 | blocks.Sort(); 288 | 289 | 290 | foreach (short b in blocks) 291 | { 292 | int _start = (b * 0x1000); 293 | for (int j = 0; j < 0x1000; j++) 294 | f.Add(fileData[_start + j]); 295 | 296 | c++; 297 | } 298 | 299 | 300 | int i = Math.Min(f.Count - 1, size - 1); 301 | while (i > 0 && (f[i] == 0x0 || f[i] == 0x1A)) 302 | --i; 303 | // now foo[i] is the last non-zero byte 304 | byte[] bar = new byte[i + 1]; 305 | Array.Copy(f.ToArray(), bar, i + 1); 306 | 307 | return bar; 308 | } 309 | 310 | 311 | public int GetDiskSize() 312 | { 313 | return (dsm + 1) * 0x1000; 314 | } 315 | 316 | public int GetDiskTotalBlocks() 317 | { 318 | return (GetDiskSize() - default_firstdiskstart) / 0x1000; 319 | } 320 | 321 | public List GetFreeBlocks() 322 | { 323 | List ret = new List(); 324 | List used = new List(); 325 | 326 | 327 | int total_blocks = GetDiskTotalBlocks(); 328 | 329 | foreach (List lfe in file_entries.Values) 330 | { 331 | foreach (FileEntry fe in lfe) 332 | { 333 | if (fe._status != 0xE5) 334 | { 335 | foreach (short s in fe._al) 336 | { 337 | if (s > 0) 338 | used.Add(s); 339 | } 340 | } 341 | } 342 | } 343 | 344 | for (short i = 4; i <= (total_blocks + 4); i++) 345 | { 346 | if (!used.Contains(i)) 347 | ret.Add(i); 348 | } 349 | 350 | return ret; 351 | } 352 | 353 | 354 | public List GetFreeDirEntries() 355 | { 356 | List ret = new List(); 357 | List used = new List(); 358 | 359 | 360 | foreach (List lfe in file_entries.Values) 361 | { 362 | foreach (FileEntry fe in lfe) 363 | { 364 | if (fe._status != 0xE5) 365 | { 366 | used.Add((short)(fe._entry / 0x20)); 367 | } 368 | } 369 | } 370 | 371 | for (short i = 0; i <= drw; i++) 372 | { 373 | if (!used.Contains(i)) 374 | ret.Add(i); 375 | } 376 | 377 | return ret; 378 | } 379 | } 380 | } 381 | -------------------------------------------------------------------------------- /cpm_disk_manager/DiskImage.cs: -------------------------------------------------------------------------------- 1 | using RawDiskLib; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows.Forms; 9 | 10 | namespace cpm_disk_manager 11 | { 12 | public enum DiskImageFormat 13 | { 14 | _64MB_Searle, 15 | _128MB_Searle, 16 | __ROMWBW 17 | } 18 | public class DiskImage 19 | { 20 | //const int CF_CARD_LBA_SIZE = 0x800; // temporary small size 21 | 22 | 23 | Byte[] fileData; 24 | 25 | 26 | Disk disk; 27 | List fileEntryList = new List(); 28 | int disk_start = 0; 29 | int disk_number = 0; 30 | int disk_count = 0; 31 | 32 | public Disk Disk { get { return this.disk; } } 33 | 34 | public int DiskNumber { get { return this.disk_number; } } 35 | public int DiskCount { get { return this.disk_count; } } 36 | 37 | public DiskImageFormat DiskImageFormat { get; set; } 38 | 39 | int clusters_4mb = 0x2000; // 4MB Image 40 | int clusters_64mb = 0x20000; // 64MB Image 41 | int clusters_68mb = 0x20900; // 68MB Image //68288512 bytes 42 | int clusters_128mb = 0x40000; // 128MB Image 43 | 44 | 45 | int default_disksize = 0x800000; 46 | int default_firstdisksize = 0x800000; 47 | int default_lastdisksize = 0x800000; 48 | int default_firstdiskstart = 0x4000; 49 | 50 | public DiskImage() 51 | { 52 | DiskImageFormat = DiskImageFormat._64MB_Searle; 53 | } 54 | 55 | public DiskImage(DiskImageFormat _imageSize) 56 | { 57 | DiskImageFormat = _imageSize; 58 | } 59 | 60 | 61 | private int UpdateCurrentDiskStart() 62 | { 63 | 64 | disk_count = (int)Math.Floor((decimal)fileData.Length / default_disksize); 65 | 66 | int current_disksize = default_disksize; 67 | 68 | if (disk_count == 0) 69 | { 70 | disk_start = default_firstdiskstart; 71 | current_disksize = default_firstdisksize; 72 | } 73 | else if (disk_number == disk_count - 1) 74 | { 75 | if(DiskImageFormat == DiskImageFormat.__ROMWBW) 76 | disk_start = default_firstdiskstart + (disk_number * current_disksize); 77 | else 78 | disk_start = (disk_number * current_disksize); 79 | current_disksize = default_lastdisksize; 80 | } 81 | else 82 | { 83 | if (DiskImageFormat == DiskImageFormat.__ROMWBW) 84 | disk_start = default_firstdiskstart + (disk_number * current_disksize); 85 | else 86 | disk_start = (disk_number * current_disksize); 87 | current_disksize = default_disksize; 88 | } 89 | 90 | 91 | 92 | return current_disksize; 93 | } 94 | 95 | 96 | public void SetFormat(DiskImageFormat _diskImageSize) 97 | { 98 | int clusters = clusters_4mb; 99 | disk = new Disk(_diskImageSize); 100 | 101 | DiskImageFormat = _diskImageSize; 102 | 103 | if (DiskImageFormat == DiskImageFormat._64MB_Searle) 104 | { 105 | clusters = clusters_64mb; 106 | default_disksize = 0x800000; 107 | default_firstdiskstart = 0x4000; 108 | default_firstdisksize = default_disksize - default_firstdiskstart; 109 | default_lastdisksize = default_disksize; 110 | } 111 | else if (DiskImageFormat == DiskImageFormat.__ROMWBW) 112 | { 113 | clusters = clusters_68mb; 114 | default_disksize = 0x820000; //0x800000; 115 | default_firstdiskstart = 0x20000; //0x4000; 116 | 117 | default_firstdisksize = default_disksize; 118 | default_lastdisksize = default_disksize; 119 | } 120 | else if (DiskImageFormat == DiskImageFormat._128MB_Searle) 121 | { 122 | clusters = clusters_128mb; 123 | default_disksize = 0x800000; 124 | default_firstdiskstart = 0x4000; 125 | 126 | default_firstdisksize = default_disksize - default_firstdiskstart; 127 | default_lastdisksize = default_disksize; 128 | } 129 | 130 | fileData = new byte[512 * clusters]; 131 | 132 | disk_number = 0; 133 | 134 | UpdateCurrentDiskStart(); 135 | 136 | 137 | createEmptyFileEntries(); 138 | 139 | UpdateDiskList(); 140 | } 141 | 142 | 143 | public void NewImage(DiskImageFormat _diskImageSize) 144 | { 145 | SetFormat(_diskImageSize); 146 | } 147 | 148 | 149 | private void createEmptyFileEntries() 150 | { 151 | for (int disk_number = 0; disk_number < disk_count; disk_number++) 152 | { 153 | UpdateCurrentDiskStart(); 154 | 155 | for (int file_entry = disk_start; file_entry < disk_start + default_firstdiskstart; file_entry += 0x20) 156 | { 157 | fileData[file_entry] = 0xe5; //empty entry 158 | 159 | for (int i = 1; i < 0x0C; i++) 160 | fileData[file_entry + i] = 0x20; //noname file 161 | } 162 | } 163 | } 164 | 165 | public void PreviousDisk() 166 | { 167 | if (disk_number > 0) 168 | disk_number--; 169 | 170 | UpdateDiskList(); 171 | } 172 | 173 | public void NextDisk() 174 | { 175 | if (disk_number < disk_count - 1) 176 | disk_number++; 177 | 178 | UpdateDiskList(); 179 | } 180 | 181 | 182 | public void UpdateDiskList() 183 | { 184 | UpdateCurrentDiskStart(); 185 | disk.LoadDisk(fileData, disk_start); 186 | } 187 | 188 | 189 | public void cmd_rmdir(string filename) 190 | { 191 | this.disk.DeleteFile(filename); 192 | 193 | foreach (FileEntry f in this.disk.GetFileEntries(filename)) 194 | { 195 | Buffer.BlockCopy(f.GetDataEntry(), 0, fileData, disk_start + f._entry, 32); 196 | } 197 | 198 | disk.LoadDisk(fileData, disk_start); 199 | } 200 | 201 | public void cmd_mkbin(string str, byte[] data) 202 | { 203 | 204 | int num_blocks = FileEntry.CalcNumOfBlocks(data.Length); 205 | 206 | int num_entries = (int)Math.Ceiling((decimal)num_blocks / 8); 207 | 208 | 209 | List reserve_entries = disk.GetFreeDirEntries().Take(num_entries).ToList(); 210 | 211 | List reserve_blocks = disk.GetFreeBlocks().Take(num_blocks).ToList(); 212 | 213 | string newname = str; 214 | 215 | if (newname.ToArray().Where(p => p == '.').Count() <= 1 216 | && newname.IndexOf('\0') == -1 217 | && newname.IndexOf('\\') == -1 218 | && newname.IndexOf('/') == -1 219 | && newname.IndexOf(':') == -1 220 | && newname.IndexOf('*') == -1 221 | && newname.IndexOf('?') == -1 222 | && newname.IndexOf('\'') == -1 223 | && newname.IndexOf('\"') == -1 224 | && newname.IndexOf('<') == -1 225 | && newname.IndexOf('>') == -1 226 | && newname.IndexOf('|') == -1 227 | && newname.Trim().IndexOf(' ') == -1) 228 | { 229 | String name = newname.IndexOf('.') > -1 ? newname.Substring(0, newname.IndexOf('.')) : newname; 230 | String ext = newname.IndexOf('.') > -1 ? newname.Substring(newname.IndexOf('.') + 1) : ""; 231 | 232 | name = name.Length > 0 ? name.Substring(0, Math.Min(name.Length, 8)) : ""; 233 | ext = ext.Length > 0 ? ext.Substring(0, Math.Min(ext.Length, 3)) : ""; 234 | 235 | name = name.PadRight(8); 236 | ext = ext.PadRight(3); 237 | 238 | short ex = 0; 239 | int data_start = 0; 240 | 241 | foreach (short s in reserve_entries) 242 | { 243 | List current_blocks = reserve_blocks.Take(8).ToList(); 244 | bool isfull = reserve_blocks.Count > 8 && current_blocks.Count == 8; 245 | int current_block_count = current_blocks.Count(); 246 | 247 | while (current_blocks.Count < 8) 248 | current_blocks.Add(0); 249 | 250 | int pos = 4 - ((current_block_count - 1) % 4); 251 | 252 | if (num_entries > 1 || current_block_count > 4) 253 | ex++; 254 | 255 | FileEntry f = new FileEntry() 256 | { 257 | _entry = (s * 0x20), 258 | _status = 0, 259 | 260 | _name = name, 261 | _ext = ext, 262 | _ex = ex & 0b11111111, 263 | _s1 = 0x0, 264 | _s2 = (ex >> 8) & 0b11111111, 265 | //_rc = isfull? 0x80 : (int)Math.Ceiling(((decimal)data.Length % 0x1000) / 0x80), 266 | _rc = isfull ? 0x80 : (int)Math.Ceiling(((((double)data.Length / 0x8000) - (current_block_count <= 4 ? 0 : 0.5)) * 0x100)), 267 | _entry_number = 0, 268 | _num_records = 0, 269 | _size = 0, 270 | _start = reserve_blocks[0] * 0x1000, 271 | _al = current_blocks.ToArray() 272 | }; 273 | 274 | Buffer.BlockCopy(f.GetDataEntry(), 0, fileData, f._entry + disk_start, 0x20); 275 | 276 | foreach (short al in f._al) 277 | { 278 | if (al > 0) 279 | { 280 | int block_size = (data.Length - data_start) > 0x1000 ? 0x1000 : (data.Length - data_start); 281 | Buffer.BlockCopy(data, data_start, fileData, (al * 0x1000) + disk_start, block_size); 282 | 283 | if (block_size < 0x1000) 284 | { 285 | int size_to_complete = 0x1000 - block_size; 286 | 287 | //Buffer.BlockCopy(Enumerable.Repeat((byte)0x1A, size_to_complete).ToArray(), 0, fileData, (al * 0x1000) + disk_start + block_size, size_to_complete); 288 | Buffer.BlockCopy(Enumerable.Repeat((byte)0x00, size_to_complete).ToArray(), 0, fileData, (al * 0x1000) + disk_start + block_size, size_to_complete); 289 | 290 | } 291 | 292 | data_start += 0x1000; 293 | } 294 | } 295 | 296 | reserve_blocks.RemoveRange(0, Math.Min(8, reserve_blocks.Count)); 297 | } 298 | 299 | } 300 | this.UpdateDiskList(); 301 | } 302 | 303 | 304 | public bool cmd_rename(String filename, String newname) 305 | { 306 | if (newname.ToArray().Where(p => p == '.').Count() <= 1 307 | && newname.IndexOf('\0') == -1 308 | && newname.IndexOf('\\') == -1 309 | && newname.IndexOf('/') == -1 310 | && newname.IndexOf(':') == -1 311 | && newname.IndexOf('*') == -1 312 | && newname.IndexOf('?') == -1 313 | && newname.IndexOf('\'') == -1 314 | && newname.IndexOf('\"') == -1 315 | && newname.IndexOf('<') == -1 316 | && newname.IndexOf('>') == -1 317 | && newname.IndexOf('|') == -1 318 | && newname.IndexOf(',') == -1 319 | && newname.IndexOf(';') == -1 320 | && newname.IndexOf('=') == -1 321 | && newname.IndexOf('[') == -1 322 | && newname.IndexOf(']') == -1 323 | && newname.IndexOf('(') == -1 324 | && newname.IndexOf(')') == -1 325 | && newname.IndexOf('%') == -1 326 | && newname.Trim().IndexOf(' ') == -1) 327 | { 328 | String name = newname.IndexOf('.') > -1 ? newname.Substring(0, newname.IndexOf('.')) : newname; 329 | String ext = newname.IndexOf('.') > -1 ? newname.Substring(newname.IndexOf('.') + 1) : ""; 330 | 331 | name = name.Length > 0 ? name.Substring(0, Math.Min(name.Length, 8)) : ""; 332 | ext = ext.Length > 0 ? ext.Substring(0, Math.Min(ext.Length, 3)) : ""; 333 | 334 | name = name.PadRight(8); 335 | ext = ext.PadRight(3); 336 | 337 | disk.RenameFile(filename, name, ext); 338 | 339 | foreach (FileEntry f in disk.GetFileEntries(name + ext)) 340 | { 341 | Buffer.BlockCopy(f.GetDataEntry(), 0, fileData, disk_start + f._entry, 32); 342 | } 343 | 344 | disk.LoadDisk(fileData, disk_start); 345 | 346 | return true; 347 | } 348 | 349 | return false; 350 | } 351 | 352 | 353 | 354 | public void cmd_chuser(String filename, int newuser) 355 | { 356 | disk.SetUser(filename, newuser); 357 | 358 | foreach (FileEntry f in disk.GetFileEntries(filename)) 359 | { 360 | Buffer.BlockCopy(f.GetDataEntry(), 0, fileData, disk_start + f._entry, 32); 361 | } 362 | 363 | disk.LoadDisk(fileData, disk_start); 364 | 365 | } 366 | 367 | 368 | 369 | public bool ReadImageFile(String fileName, ToolStripProgressBar progressBar = null) 370 | { 371 | try 372 | { 373 | if (File.Exists(fileName)) 374 | { 375 | 376 | FileInfo fi = new FileInfo(fileName); 377 | 378 | DiskImageFormat = 379 | ( 380 | fi.Length >= 100000000 ? DiskImageFormat._128MB_Searle : 381 | (fi.Length >= 68000000 ? DiskImageFormat.__ROMWBW : DiskImageFormat._64MB_Searle) 382 | ); 383 | 384 | SetFormat(DiskImageFormat); 385 | disk = new Disk(DiskImageFormat); 386 | 387 | 388 | //fileData = new byte[fi.Length]; 389 | 390 | if (progressBar != null) 391 | { 392 | progressBar.Minimum = 0; 393 | progressBar.Maximum = (int)fi.Length; 394 | progressBar.Visible = true; 395 | } 396 | 397 | 398 | using (BinaryReader b = new BinaryReader( 399 | File.Open(fileName, FileMode.Open))) 400 | { 401 | // 2. 402 | // Position and length variables. 403 | int pos = 0; 404 | // 2A. 405 | // Use BaseStream. 406 | int length = (int)b.BaseStream.Length; 407 | while (pos < length && pos < fileData.Length) 408 | { 409 | 410 | fileData[pos] = b.ReadByte(); 411 | // 3. 412 | // Read integer. 413 | //int v = b.ReadInt32(); 414 | //Console.WriteLine(v); 415 | 416 | // 4. 417 | // Advance our position variable. 418 | 419 | if (progressBar != null) 420 | { 421 | if (pos % 1000000 == 0) 422 | { 423 | progressBar.Value = pos; 424 | Application.DoEvents(); 425 | } 426 | } 427 | 428 | pos += sizeof(byte); 429 | } 430 | } 431 | 432 | if (progressBar != null) 433 | progressBar.Visible = false; 434 | 435 | UpdateCurrentDiskStart(); 436 | 437 | this.UpdateDiskList(); 438 | return true; 439 | } 440 | } 441 | catch (Exception Ex) 442 | { 443 | MessageBox.Show("An error occurred while reading the image file.\nPlease check the file.", "Reading Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 444 | } 445 | 446 | if (progressBar != null) 447 | progressBar.Visible = false; 448 | 449 | return false; 450 | } 451 | 452 | 453 | public bool SaveImageFile(string fileName, ToolStripProgressBar progressBar = null) 454 | { 455 | try 456 | { 457 | if (progressBar != null) 458 | { 459 | progressBar.Minimum = 0; 460 | progressBar.Maximum = (int)fileData.Length; 461 | progressBar.Visible = true; 462 | } 463 | 464 | 465 | using (BinaryWriter b = new BinaryWriter(File.Open(fileName, FileMode.Create))) 466 | { 467 | for (int pos = 0; pos < fileData.Length; pos++) 468 | { 469 | b.Write(fileData[pos]); 470 | if (progressBar != null) 471 | { 472 | if (pos % 1000000 == 0) 473 | { 474 | progressBar.Value = pos; 475 | Application.DoEvents(); 476 | } 477 | } 478 | } 479 | } 480 | 481 | 482 | if (progressBar != null) 483 | progressBar.Visible = false; 484 | 485 | return true; 486 | 487 | } 488 | catch 489 | { 490 | MessageBox.Show("An error occurred while writing the image file.\nPlease check the file.", "Writing Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 491 | } 492 | 493 | if (progressBar != null) 494 | progressBar.Visible = false; 495 | 496 | return false; 497 | } 498 | 499 | 500 | public void ReadRawDisk(int selectedVol) 501 | { 502 | try 503 | { 504 | int clusters = DiskImageFormat == DiskImageFormat._128MB_Searle ? clusters_128mb : 505 | (DiskImageFormat == DiskImageFormat.__ROMWBW ? clusters_68mb : clusters_64mb); 506 | 507 | 508 | using (RawDisk disk = new RawDisk(DiskNumberType.Volume, selectedVol, FileAccess.ReadWrite)) 509 | { 510 | fileData = new byte[512 * clusters]; 511 | fileData = disk.ReadClusters(0, clusters); 512 | } 513 | 514 | UpdateCurrentDiskStart(); 515 | 516 | this.UpdateDiskList(); 517 | 518 | } 519 | catch 520 | { 521 | MessageBox.Show("An error occurred while reading disk.", "Reading Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 522 | } 523 | } 524 | 525 | public void WriteRawDisk(int selectedVol) 526 | { 527 | try 528 | { 529 | using (RawDisk disk = new RawDisk(DiskNumberType.Volume, selectedVol, FileAccess.ReadWrite)) 530 | { 531 | disk.WriteClusters(fileData, 0); 532 | } 533 | } 534 | catch 535 | { 536 | MessageBox.Show("An error occurred while writing the disk.", "Writing Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 537 | } 538 | } 539 | } 540 | } 541 | -------------------------------------------------------------------------------- /cpm_disk_manager/DiskInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace cpm_disk_manager 8 | { 9 | public class DiskInfo 10 | { 11 | 12 | public int Id { get; set; } 13 | public string Name { get; set; } 14 | 15 | public override string ToString() 16 | { 17 | return Name; 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cpm_disk_manager/FileEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace cpm_disk_manager 8 | { 9 | //https://www.cpm8680.com/cpmtools/cpm.htm 10 | //https://www.seasip.info/Cpm/format22.html 11 | public class FileEntry 12 | { 13 | public int _entry { get; set; } 14 | 15 | ////////////////////////////////////////////////// 16 | // UU F1 F2 F3 F4 F5 F6 F7 F8 T1 T2 T3 EX S1 S2 RC .FILENAMETYP.... 17 | // AL AL AL AL AL AL AL AL AL AL AL AL AL AL AL AL................ 18 | 19 | public int _status { get; set; } // UU = User number. 0-15 (on some systems, 0-31). The user number allows multiple 20 | // files of the same name to coexist on the disc. 21 | // 0 - 15: used for file, status is the user number 22 | // 16 - 31: used for file, status is the user number(P2DOS) or used for password extent (CP / M 3 or higher) 23 | // 32: disc label 24 | // 33: time stamp(P2DOS) 25 | // 0xE5: unused 26 | 27 | public String _name { get; set; } //F0-F7 28 | // F0-E2 are the file name and its extension. They may consist of any printable 7 bit ASCII character but: < > . , ; : = ? * [ ]. 29 | // The file name must not be empty, the extension may be empty. Both are padded with blanks. The highest bit of each character of 30 | // the file name and extension is used as attribute. The attributes have the following meaning: 31 | // F0: requires set wheel byte(Backgrounder II) 32 | // F1: public file (P2DOS, ZSDOS), foreground - only command(Backgrounder II) 33 | // F2: date stamp(ZSDOS), background - only commands(Backgrounder II) 34 | // F7: wheel protect(ZSDOS) 35 | 36 | public String _ext { get; set; } //E0-E2 37 | // En - filetype.The characters used for these are 7-bit ASCII. 38 | // The top bit of E1 (often referred to as E1') is set if the file is 39 | // read-only. 40 | // E2' is set if the file is a system file (this corresponds to "hidden" on 41 | // other systems). 42 | // E0: read - only 43 | // E1: system file 44 | // E2: archived 45 | 46 | public int _ex { get; set; } //or Xl EX = Extent counter, low byte - takes values from 0-31 47 | 48 | public int _s1 { get; set; } //or Bc S1 - reserved, set to 0. 49 | 50 | public int _s2 { get; set; } //or Xh S2 = Extent counter, high byte. 51 | // An extent is the portion of a file controlled by one directory entry. 52 | // If a file takes up more blocks than can be listed in one directory entry, 53 | // it is given multiple entries, distinguished by their EX and S2 bytes.The 54 | // formula is: Entry number = ((32 * S2) + EX) / (exm + 1) where exm is the 55 | // extent mask value from the Disc Parameter Block. 56 | 57 | public int _rc { get; set; } //or Rc RC - Number of records (1 record=128 bytes) used in this extent, low byte. 58 | //The total number of records used in this extent is 59 | // (EX & exm) * 128 + RC 60 | // If RC is 80h, this extent is full and there may be another one on the disc. 61 | // File lengths are only saved to the nearest 128 bytes. 62 | 63 | 64 | //Xl and Xh store the extent number.A file may use more than one directory entry, if it contains more 65 | // blocks than an extent can hold.In this case, more extents are allocated and each of them is numbered 66 | // sequentially with an extent number. If a physical extent stores more than 16k, it is considered to 67 | // contain multiple logical extents, each pointing to 16k data, and the extent number of the last used 68 | // logical extent is stored.Note: Some formats decided to always store only one logical extent in a 69 | // physical extent, thus wasting extent space. CP/M 2.2 allows 512 extents per file, CP/M 3 and higher 70 | // allow up to 2048. Bit 5-7 of Xl are 0, bit 0-4 store the lower bits of the extent number. 71 | // Bit 6 and 7 of Xh are 0, bit 0-5 store the higher bits of the extent number. 72 | 73 | 74 | //Rc and Bc determine the length of the data used by this extent.The physical extent is divided into 75 | // logical extents, each of them being 16k in size (a physical extent must hold at least one logical 76 | // extent, e.g.a blocksize of 1024 byte with two-byte block pointers is not allowed). Rc stores the 77 | // number of 128 byte records of the last used logical extent.Bc stores the number of bytes in the 78 | // last used record. The value 0 means 128 for backward compatibility with CP/M 2.2, which did not 79 | // support Bc.ISX records the number of unused instead of used bytes in Bc. 80 | 81 | public short[] _al { get; set; } 82 | // Al stores block pointers.If the disk capacity minus boot tracks but including the directory area is less than 256 blocks, 83 | // Al is interpreted as 16 byte-values, otherwise as 8 double-byte-values.Since the directory area is not subtracted, 84 | // the directory area starts with block 0 and files can never allocate block 0, which is why this value can be given 85 | // a new meaning: A block pointer of 0 marks a hole in the file.If a hole covers the range of a full extent, the extent 86 | // will not be allo- cated.In particular, the first extent of a file does not neccessarily have extent number 0. A file may 87 | // not share blocks with other files, as its blocks would be freed if the other files were erased without a following disk 88 | // system reset. CP/M returns EOF when it reaches a hole, whereas UNIX returns zero-value bytes, which makes holes invisible. 89 | 90 | 91 | public int _entry_number { get; set; } 92 | 93 | public int _num_records { get; set; } 94 | public int _size { get; set; } 95 | public int _start { get; set; } 96 | 97 | 98 | public byte[] GetDataEntry() 99 | { 100 | byte[] ret = new byte[32]; 101 | string name = _name.PadRight(8); 102 | string ext = _ext.PadRight(3); 103 | 104 | ret[0x00] = (byte)_status; 105 | ret[0x01] = (byte)name[0]; 106 | ret[0x02] = (byte)name[1]; 107 | ret[0x03] = (byte)name[2]; 108 | ret[0x04] = (byte)name[3]; 109 | ret[0x05] = (byte)name[4]; 110 | ret[0x06] = (byte)name[5]; 111 | ret[0x07] = (byte)name[6]; 112 | ret[0x08] = (byte)name[7]; 113 | ret[0x09] = (byte)ext[0]; 114 | ret[0x0A] = (byte)ext[1]; 115 | ret[0x0B] = (byte)ext[2]; 116 | ret[0x0C] = (byte)_ex; 117 | ret[0x0D] = (byte)_s1; 118 | ret[0x0E] = (byte)_s2; 119 | ret[0x0F] = (byte)_rc; 120 | 121 | 122 | ret[0x10] = (byte)(_al[0] & 0b11111111); 123 | ret[0x11] = (byte)((_al[0] >> 8) & 0b11111111); 124 | ret[0x12] = (byte)(_al[1] & 0b11111111); 125 | ret[0x13] = (byte)((_al[1] >> 8) & 0b11111111); 126 | ret[0x14] = (byte)(_al[2] & 0b11111111); 127 | ret[0x15] = (byte)((_al[2] >> 8) & 0b11111111); 128 | ret[0x16] = (byte)(_al[3] & 0b11111111); 129 | ret[0x17] = (byte)((_al[3] >> 8) & 0b11111111); 130 | ret[0x18] = (byte)(_al[4] & 0b11111111); 131 | ret[0x19] = (byte)((_al[4] >> 8) & 0b11111111); 132 | ret[0x1A] = (byte)(_al[5] & 0b11111111); 133 | ret[0x1B] = (byte)((_al[5] >> 8) & 0b11111111); 134 | ret[0x1C] = (byte)(_al[6] & 0b11111111); 135 | ret[0x1D] = (byte)((_al[6] >> 8) & 0b11111111); 136 | ret[0x1E] = (byte)(_al[7] & 0b11111111); 137 | ret[0x1F] = (byte)((_al[7] >> 8) & 0b11111111); 138 | return ret; 139 | } 140 | 141 | 142 | public static int CalcNumOfBlocks(int size) 143 | { 144 | return (int)Math.Ceiling((decimal)size / 0x1000); 145 | } 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /cpm_disk_manager/IniFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace cpm_disk_manager 9 | { 10 | public class IniFile 11 | { 12 | public string path; 13 | // string Path = System.Environment.CurrentDirectory+"\\"+"ConfigFile.ini"; 14 | 15 | [DllImport("kernel32")] 16 | private static extern long WritePrivateProfileString(string section, 17 | string key, string val, string filePath); 18 | [DllImport("kernel32")] 19 | private static extern int GetPrivateProfileString(string section, 20 | string key, string def, StringBuilder retVal, 21 | int size, string filePath); 22 | public IniFile(string Path) 23 | { 24 | path = Path; 25 | } 26 | 27 | public void IniWriteValue(string Section, string Key, string Value) 28 | { 29 | WritePrivateProfileString(Section, Key, Value, this.path); 30 | } 31 | 32 | public string IniReadValue(string Section, string Key) 33 | { 34 | StringBuilder temp = new StringBuilder(255); 35 | int i = GetPrivateProfileString(Section, Key, "", temp, 36 | 255, this.path); 37 | return temp.ToString(); 38 | 39 | } 40 | } 41 | 42 | /* 43 | //In mail Class 44 | public string ReadConfig(string section, string key) 45 | { 46 | string retVal = string.Empty; 47 | string bankname = string.Empty; 48 | string basePath = System.Environment.CurrentDirectory + "\\" + "Settings"; 49 | IniFile ini = new IniFile(basePath + "\\" + "ConfigFile.ini"); 50 | if (!Directory.Exists(basePath)) 51 | { 52 | Directory.CreateDirectory(basePath); 53 | ini.IniWriteValue("DefaultNames", "default1", "2"); 54 | ini.IniWriteValue("DefaultNames", "default2", "1"); 55 | 56 | } 57 | retVal = ini.IniReadValue(section, key); 58 | return retVal; 59 | } 60 | */ 61 | 62 | } 63 | -------------------------------------------------------------------------------- /cpm_disk_manager/ListViewColumnSorter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace cpm_disk_manager 8 | { 9 | using System.Collections; 10 | using System.Windows.Forms; 11 | 12 | /// 13 | /// This class is an implementation of the 'IComparer' interface. 14 | /// 15 | public class ListViewColumnSorter : IComparer 16 | { 17 | /// 18 | /// Specifies the column to be sorted 19 | /// 20 | private int ColumnToSort; 21 | 22 | /// 23 | /// Specifies the order in which to sort (i.e. 'Ascending'). 24 | /// 25 | private SortOrder OrderOfSort; 26 | 27 | /// 28 | /// Case insensitive comparer object 29 | /// 30 | private CaseInsensitiveComparer ObjectCompare; 31 | 32 | /// 33 | /// Class constructor. Initializes various elements 34 | /// 35 | public ListViewColumnSorter() 36 | { 37 | // Initialize the column to '0' 38 | ColumnToSort = 0; 39 | 40 | // Initialize the sort order to 'none' 41 | OrderOfSort = SortOrder.None; 42 | 43 | // Initialize the CaseInsensitiveComparer object 44 | ObjectCompare = new CaseInsensitiveComparer(); 45 | } 46 | 47 | /// 48 | /// This method is inherited from the IComparer interface. It compares the two objects passed using a case insensitive comparison. 49 | /// 50 | /// First object to be compared 51 | /// Second object to be compared 52 | /// The result of the comparison. "0" if equal, negative if 'x' is less than 'y' and positive if 'x' is greater than 'y' 53 | public int Compare(object x, object y) 54 | { 55 | int compareResult; 56 | ListViewItem listviewX, listviewY; 57 | 58 | // Cast the objects to be compared to ListViewItem objects 59 | listviewX = (ListViewItem)x; 60 | listviewY = (ListViewItem)y; 61 | 62 | // Compare the two items 63 | compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text); 64 | 65 | // Calculate correct return value based on object comparison 66 | if (OrderOfSort == SortOrder.Ascending) 67 | { 68 | // Ascending sort is selected, return normal result of compare operation 69 | return compareResult; 70 | } 71 | else if (OrderOfSort == SortOrder.Descending) 72 | { 73 | // Descending sort is selected, return negative result of compare operation 74 | return (-compareResult); 75 | } 76 | else 77 | { 78 | // Return '0' to indicate they are equal 79 | return 0; 80 | } 81 | } 82 | 83 | /// 84 | /// Gets or sets the number of the column to which to apply the sorting operation (Defaults to '0'). 85 | /// 86 | public int SortColumn 87 | { 88 | set 89 | { 90 | ColumnToSort = value; 91 | } 92 | get 93 | { 94 | return ColumnToSort; 95 | } 96 | } 97 | 98 | /// 99 | /// Gets or sets the order of sorting to apply (for example, 'Ascending' or 'Descending'). 100 | /// 101 | public SortOrder Order 102 | { 103 | set 104 | { 105 | OrderOfSort = value; 106 | } 107 | get 108 | { 109 | return OrderOfSort; 110 | } 111 | } 112 | 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /cpm_disk_manager/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace cpm_disk_manager 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new frmMain()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cpm_disk_manager/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CP/M Disk Manager")] 9 | [assembly: AssemblyDescription("CP/M Disk Manager")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Baffasoft")] 12 | [assembly: AssemblyProduct("CP/M Disk Manager")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2475ca2b-7973-45aa-bd9f-5d79dc37e6c2")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.5.0.0")] 36 | [assembly: AssemblyFileVersion("1.5.0.0")] 37 | -------------------------------------------------------------------------------- /cpm_disk_manager/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace cpm_disk_manager.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cpm_disk_manager.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap ico62999 { 67 | get { 68 | object obj = ResourceManager.GetObject("ico62999", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap icoDetails { 77 | get { 78 | object obj = ResourceManager.GetObject("icoDetails", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap icoLargeIcon { 87 | get { 88 | object obj = ResourceManager.GetObject("icoLargeIcon", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap icoList { 97 | get { 98 | object obj = ResourceManager.GetObject("icoList", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap icoSmallIcon { 107 | get { 108 | object obj = ResourceManager.GetObject("icoSmallIcon", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap icoTile { 117 | get { 118 | object obj = ResourceManager.GetObject("icoTile", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Drawing.Bitmap. 125 | /// 126 | internal static System.Drawing.Bitmap imageres_5325 { 127 | get { 128 | object obj = ResourceManager.GetObject("imageres_5325", resourceCulture); 129 | return ((System.Drawing.Bitmap)(obj)); 130 | } 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /cpm_disk_manager/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\icoDetails.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\icoTile.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\icoLargeIcon.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\icoList.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\ico62999.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\icoSmallIcon.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\imageres_5325.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | -------------------------------------------------------------------------------- /cpm_disk_manager/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace cpm_disk_manager.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cpm_disk_manager/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cpm_disk_manager/Resources/ico62999.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/cpm_disk_manager/Resources/ico62999.ico -------------------------------------------------------------------------------- /cpm_disk_manager/Resources/icoDetails.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/cpm_disk_manager/Resources/icoDetails.ico -------------------------------------------------------------------------------- /cpm_disk_manager/Resources/icoLargeIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/cpm_disk_manager/Resources/icoLargeIcon.ico -------------------------------------------------------------------------------- /cpm_disk_manager/Resources/icoList.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/cpm_disk_manager/Resources/icoList.ico -------------------------------------------------------------------------------- /cpm_disk_manager/Resources/icoSmallIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/cpm_disk_manager/Resources/icoSmallIcon.ico -------------------------------------------------------------------------------- /cpm_disk_manager/Resources/icoTile.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/cpm_disk_manager/Resources/icoTile.ico -------------------------------------------------------------------------------- /cpm_disk_manager/Resources/imageres_5325.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/cpm_disk_manager/Resources/imageres_5325.ico -------------------------------------------------------------------------------- /cpm_disk_manager/Utils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace cpm_disk_manager 10 | { 11 | public static class Utils 12 | { 13 | 14 | public static DialogResult ShowInputDialog(ref string input, String Title, Form owner) 15 | { 16 | System.Drawing.Size size = new System.Drawing.Size(200, 70); 17 | Form inputBox = new Form(); 18 | inputBox.StartPosition = FormStartPosition.CenterParent; 19 | 20 | inputBox.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 21 | inputBox.ClientSize = size; 22 | inputBox.Text = Title; 23 | 24 | System.Windows.Forms.TextBox textBox = new TextBox(); 25 | textBox.Size = new System.Drawing.Size(size.Width - 10, 23); 26 | textBox.Location = new System.Drawing.Point(5, 5); 27 | textBox.Text = input; 28 | inputBox.Controls.Add(textBox); 29 | 30 | Button okButton = new Button(); 31 | okButton.DialogResult = System.Windows.Forms.DialogResult.OK; 32 | okButton.Name = "okButton"; 33 | okButton.Size = new System.Drawing.Size(75, 23); 34 | okButton.Text = "&OK"; 35 | okButton.Location = new System.Drawing.Point(size.Width - 80 - 80, 39); 36 | inputBox.Controls.Add(okButton); 37 | 38 | Button cancelButton = new Button(); 39 | cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 40 | cancelButton.Name = "cancelButton"; 41 | cancelButton.Size = new System.Drawing.Size(75, 23); 42 | cancelButton.Text = "&Cancel"; 43 | cancelButton.Location = new System.Drawing.Point(size.Width - 80, 39); 44 | inputBox.Controls.Add(cancelButton); 45 | 46 | inputBox.AcceptButton = okButton; 47 | inputBox.CancelButton = cancelButton; 48 | 49 | DialogResult result = inputBox.ShowDialog(owner); 50 | input = textBox.Text; 51 | return result; 52 | } 53 | 54 | public static void SetSortArrow(ColumnHeader head, SortOrder order) 55 | { 56 | const string ascArrow = " ▲"; 57 | const string descArrow = " ▼"; 58 | 59 | // remove arrow 60 | if (head.Text.EndsWith(ascArrow) || head.Text.EndsWith(descArrow)) 61 | head.Text = head.Text.Substring(0, head.Text.Length - 2); 62 | 63 | // add arrow 64 | switch (order) 65 | { 66 | case SortOrder.Ascending: head.Text += ascArrow; break; 67 | case SortOrder.Descending: head.Text += descArrow; break; 68 | } 69 | } 70 | 71 | ///////////////////////////////////////// 72 | public static String getStringFromByteArray(byte[] fileBytes2, int start, int max) 73 | { 74 | String ret = ""; 75 | for (int i = 0; i < max && fileBytes2[start + i] != 0x00; i++) 76 | ret += Convert.ToChar(fileBytes2[start + i]); 77 | 78 | return ret.Trim('\0'); 79 | } 80 | 81 | 82 | 83 | 84 | public static string stringByteToText(String bytetext) 85 | { 86 | Byte[] filearray = HexStringToByteArray(bytetext); 87 | 88 | string file = ""; 89 | foreach (Byte b in filearray) 90 | { 91 | file += Convert.ToChar(b); 92 | } 93 | 94 | file = file.Replace("\r", ""); 95 | file = file.Replace("\n", "\r\n"); 96 | 97 | return file; 98 | } 99 | 100 | public static string textToStringByte(String _text) 101 | { 102 | string file = ""; 103 | foreach (char a in _text.ToCharArray()) 104 | { 105 | file += Convert.ToByte(a).ToString("X2"); 106 | } 107 | 108 | return file; 109 | } 110 | 111 | public static byte[] HexStringToByteArray(String hex) 112 | { 113 | int NumberChars = hex.Length; 114 | byte[] bytes = new byte[NumberChars / 2]; 115 | try 116 | { 117 | for (int i = 0; i < NumberChars; i += 2) 118 | bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); 119 | } 120 | catch { } 121 | return bytes; 122 | } 123 | 124 | public static string Convert2Str(byte[] data) 125 | { 126 | char[] characters = data.Select(b => (char)b).ToArray(); 127 | return new string(characters); 128 | } 129 | 130 | 131 | public static String ByteArrayToHexString(byte[] data) 132 | { 133 | string file = ""; 134 | int index = 0; 135 | int size = data.Length; 136 | while (index < size) 137 | { 138 | file += data[index].ToString("X2"); 139 | index++; 140 | } 141 | 142 | return file; 143 | } 144 | 145 | public static bool CompareByteArrays(byte[] data1 ,byte[] data2) 146 | { 147 | return data1.SequenceEqual(data1) && data1.LongLength == data2.LongLength; 148 | } 149 | 150 | 151 | 152 | public static Byte[] getByteArray(byte[] fileBytes2, int start, int max) 153 | { 154 | Byte[] ret = new byte[max]; 155 | for (int i = 0; i < max; i++) 156 | ret[i] = fileBytes2[start + i]; 157 | 158 | return ret; 159 | } 160 | 161 | 162 | public static byte[] ReadAllBytes(BinaryReader reader) 163 | { 164 | const int bufferSize = 4096; 165 | using (var ms = new MemoryStream()) 166 | { 167 | byte[] buffer = new byte[bufferSize]; 168 | int count; 169 | while ((count = reader.Read(buffer, 0, buffer.Length)) != 0) 170 | ms.Write(buffer, 0, count); 171 | return ms.ToArray(); 172 | } 173 | 174 | } 175 | 176 | public static Byte ConvertIntHexToByte(int d) 177 | { 178 | return Convert.ToByte(d.ToString(), 16); 179 | 180 | } 181 | 182 | public static string CalculateChecksum(byte[] bytes) 183 | { 184 | int sum = 0; 185 | int byte_count = 0; 186 | foreach (byte c in bytes) 187 | { 188 | sum += (int)c; 189 | byte_count++; 190 | } 191 | 192 | return (byte_count & 0b11111111).ToString("X2") + (sum & 0b11111111).ToString("X2"); 193 | } 194 | } 195 | } 196 | -------------------------------------------------------------------------------- /cpm_disk_manager/config.ini: -------------------------------------------------------------------------------- 1 | [general] 2 | last_open=C:\Backup\Develop\emudev\cpm_emulator\cpm_vc\cpm_emul\cpm_emul\data.dsk 3 | view=1 4 | col_0=232 5 | col_1=63 6 | col_2=76 7 | col_3=80 8 | 9 | [address_start] 10 | disk_buffer=0x19a7 11 | boot_origin=0x8204 12 | kernel_origin=0x00 13 | -------------------------------------------------------------------------------- /cpm_disk_manager/cpm_disk_manager.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2475CA2B-7973-45AA-BD9F-5D79DC37E6C2} 8 | WinExe 9 | cpm_disk_manager 10 | cpm_disk_manager 11 | v4.5 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | Resources\imageres_5325.ico 36 | 37 | 38 | 39 | ..\packages\DeviceIOControlLib.0.1.6\lib\net40\DeviceIOControlLib.dll 40 | 41 | 42 | ..\packages\RawDiskLib.0.2.1\lib\net40\RawDiskLib.dll 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Form 62 | 63 | 64 | frmDiskSelection.cs 65 | 66 | 67 | Form 68 | 69 | 70 | frmMain.cs 71 | 72 | 73 | Form 74 | 75 | 76 | frmAbout.cs 77 | 78 | 79 | Form 80 | 81 | 82 | frmEditFile.cs 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | frmDiskSelection.cs 93 | 94 | 95 | frmMain.cs 96 | 97 | 98 | frmAbout.cs 99 | 100 | 101 | frmEditFile.cs 102 | 103 | 104 | ResXFileCodeGenerator 105 | Designer 106 | Resources.Designer.cs 107 | 108 | 109 | PreserveNewest 110 | 111 | 112 | 113 | SettingsSingleFileGenerator 114 | Settings.Designer.cs 115 | 116 | 117 | True 118 | True 119 | Resources.resx 120 | 121 | 122 | True 123 | Settings.settings 124 | True 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | Always 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /cpm_disk_manager/frmAbout.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace cpm_disk_manager 12 | { 13 | public partial class FrmAbout : Form 14 | { 15 | public FrmAbout() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /cpm_disk_manager/frmAbout.designer.cs: -------------------------------------------------------------------------------- 1 | namespace cpm_disk_manager 2 | { 3 | partial class FrmAbout 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 32 | this.linkLabel2 = new System.Windows.Forms.LinkLabel(); 33 | this.label2 = new System.Windows.Forms.Label(); 34 | this.linkLabel4 = new System.Windows.Forms.LinkLabel(); 35 | this.label4 = new System.Windows.Forms.Label(); 36 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 37 | this.label3 = new System.Windows.Forms.Label(); 38 | this.groupBox1.SuspendLayout(); 39 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 40 | this.SuspendLayout(); 41 | // 42 | // groupBox1 43 | // 44 | this.groupBox1.Controls.Add(this.linkLabel2); 45 | this.groupBox1.Controls.Add(this.label2); 46 | this.groupBox1.Controls.Add(this.linkLabel4); 47 | this.groupBox1.Controls.Add(this.label4); 48 | this.groupBox1.Controls.Add(this.pictureBox1); 49 | this.groupBox1.Controls.Add(this.label3); 50 | this.groupBox1.Location = new System.Drawing.Point(12, 12); 51 | this.groupBox1.Name = "groupBox1"; 52 | this.groupBox1.Size = new System.Drawing.Size(437, 246); 53 | this.groupBox1.TabIndex = 0; 54 | this.groupBox1.TabStop = false; 55 | // 56 | // linkLabel2 57 | // 58 | this.linkLabel2.AutoSize = true; 59 | this.linkLabel2.Location = new System.Drawing.Point(249, 146); 60 | this.linkLabel2.Name = "linkLabel2"; 61 | this.linkLabel2.Size = new System.Drawing.Size(106, 13); 62 | this.linkLabel2.TabIndex = 3; 63 | this.linkLabel2.TabStop = true; 64 | this.linkLabel2.Text = "abaffa@inf.puc-rio.br"; 65 | // 66 | // label2 67 | // 68 | this.label2.AutoSize = true; 69 | this.label2.Location = new System.Drawing.Point(92, 146); 70 | this.label2.Name = "label2"; 71 | this.label2.Size = new System.Drawing.Size(132, 13); 72 | this.label2.TabIndex = 2; 73 | this.label2.Text = "C# Version: Augusto Baffa"; 74 | // 75 | // linkLabel4 76 | // 77 | this.linkLabel4.AutoSize = true; 78 | this.linkLabel4.Location = new System.Drawing.Point(144, 211); 79 | this.linkLabel4.Name = "linkLabel4"; 80 | this.linkLabel4.Size = new System.Drawing.Size(137, 13); 81 | this.linkLabel4.TabIndex = 8; 82 | this.linkLabel4.TabStop = true; 83 | this.linkLabel4.Text = "http://cpm.baffasoft.com.br"; 84 | // 85 | // label4 86 | // 87 | this.label4.AutoSize = true; 88 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 89 | this.label4.Location = new System.Drawing.Point(117, 75); 90 | this.label4.Name = "label4"; 91 | this.label4.Size = new System.Drawing.Size(199, 20); 92 | this.label4.TabIndex = 6; 93 | this.label4.Text = "Version 0.05 - Apr 2022"; 94 | // 95 | // pictureBox1 96 | // 97 | this.pictureBox1.Image = global::cpm_disk_manager.Properties.Resources.imageres_5325; 98 | this.pictureBox1.Location = new System.Drawing.Point(33, 35); 99 | this.pictureBox1.Name = "pictureBox1"; 100 | this.pictureBox1.Size = new System.Drawing.Size(38, 36); 101 | this.pictureBox1.TabIndex = 5; 102 | this.pictureBox1.TabStop = false; 103 | // 104 | // label3 105 | // 106 | this.label3.AutoSize = true; 107 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 108 | this.label3.Location = new System.Drawing.Point(84, 35); 109 | this.label3.Name = "label3"; 110 | this.label3.Size = new System.Drawing.Size(273, 31); 111 | this.label3.TabIndex = 4; 112 | this.label3.Text = "CP/M Disk Manager"; 113 | // 114 | // FrmAbout 115 | // 116 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 117 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 118 | this.ClientSize = new System.Drawing.Size(461, 270); 119 | this.Controls.Add(this.groupBox1); 120 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 121 | this.MaximizeBox = false; 122 | this.MinimizeBox = false; 123 | this.Name = "FrmAbout"; 124 | this.ShowIcon = false; 125 | this.ShowInTaskbar = false; 126 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 127 | this.Text = "About"; 128 | this.groupBox1.ResumeLayout(false); 129 | this.groupBox1.PerformLayout(); 130 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 131 | this.ResumeLayout(false); 132 | 133 | } 134 | 135 | #endregion 136 | 137 | private System.Windows.Forms.GroupBox groupBox1; 138 | private System.Windows.Forms.LinkLabel linkLabel2; 139 | private System.Windows.Forms.Label label2; 140 | private System.Windows.Forms.LinkLabel linkLabel4; 141 | private System.Windows.Forms.Label label4; 142 | private System.Windows.Forms.PictureBox pictureBox1; 143 | private System.Windows.Forms.Label label3; 144 | } 145 | } -------------------------------------------------------------------------------- /cpm_disk_manager/frmAbout.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /cpm_disk_manager/frmDiskSelection.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace cpm_disk_manager 2 | { 3 | partial class frmDiskSelection 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.listBox1 = new System.Windows.Forms.ListBox(); 32 | this.SuspendLayout(); 33 | // 34 | // listBox1 35 | // 36 | this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.listBox1.FormattingEnabled = true; 38 | this.listBox1.Location = new System.Drawing.Point(0, 0); 39 | this.listBox1.Name = "listBox1"; 40 | this.listBox1.Size = new System.Drawing.Size(287, 277); 41 | this.listBox1.TabIndex = 0; 42 | this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); 43 | // 44 | // frmDiskSelection 45 | // 46 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 47 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 48 | this.ClientSize = new System.Drawing.Size(287, 277); 49 | this.Controls.Add(this.listBox1); 50 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 51 | this.Name = "frmDiskSelection"; 52 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 53 | this.Text = "Select Removable Media"; 54 | this.ResumeLayout(false); 55 | 56 | } 57 | 58 | #endregion 59 | 60 | private System.Windows.Forms.ListBox listBox1; 61 | } 62 | } -------------------------------------------------------------------------------- /cpm_disk_manager/frmDiskSelection.cs: -------------------------------------------------------------------------------- 1 | using RawDiskLib; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Runtime.InteropServices; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | using System.Windows.Forms; 12 | 13 | namespace cpm_disk_manager 14 | { 15 | public partial class frmDiskSelection : Form 16 | { 17 | public frmDiskSelection() 18 | { 19 | InitializeComponent(); 20 | list_drives(); 21 | } 22 | 23 | DiskInfo _seldisk = new DiskInfo() { Id = -1, Name = "*** Cancel ***" }; 24 | 25 | public DiskInfo SelDisk 26 | { 27 | get { return _seldisk; } 28 | } 29 | 30 | static readonly string[] SizeSuffixes = 31 | { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }; 32 | static string SizeSuffix(Int64 value, int decimalPlaces = 1) 33 | { 34 | if (decimalPlaces < 0) { throw new ArgumentOutOfRangeException("decimalPlaces"); } 35 | if (value < 0) { return "-" + SizeSuffix(-value, decimalPlaces); } 36 | if (value == 0) { return string.Format("{0:n" + decimalPlaces + "} bytes", 0); } 37 | 38 | // mag is 0 for bytes, 1 for KB, 2, for MB, etc. 39 | int mag = (int)Math.Log(value, 1024); 40 | 41 | // 1L << (mag * 10) == 2 ^ (10 * mag) 42 | // [i.e. the number of bytes in the unit corresponding to mag] 43 | decimal adjustedSize = (decimal)value / (1L << (mag * 10)); 44 | 45 | // make adjustment when the value is large enough that 46 | // it would round up to 1000 or more 47 | if (Math.Round(adjustedSize, decimalPlaces) >= 1000) 48 | { 49 | mag += 1; 50 | adjustedSize /= 1024; 51 | } 52 | 53 | return string.Format("{0:n" + decimalPlaces + "} {1}", 54 | adjustedSize, 55 | SizeSuffixes[mag]); 56 | } 57 | 58 | [DllImport("kernel32.dll")] 59 | private static extern uint QueryDosDevice(string lpDeviceName, StringBuilder lpTargetPath, uint ucchMax); 60 | 61 | 62 | public static char[] GetDriveLetters(string driveName) 63 | { 64 | List results = new List(); 65 | 66 | StringBuilder sb = new StringBuilder(128); 67 | for (char ch = 'A'; ch < 'Z'; ch++) 68 | { 69 | uint result; 70 | do 71 | { 72 | result = QueryDosDevice(ch + ":", sb, (uint)sb.Capacity); 73 | 74 | if (result == 122) 75 | sb.EnsureCapacity(sb.Capacity * 2); 76 | } while (result == 122); 77 | 78 | // Contains target? 79 | string[] drives = sb.ToString().Split('\0'); 80 | 81 | if (drives.Any(s => s.Equals(driveName, StringComparison.InvariantCultureIgnoreCase))) 82 | results.Add(ch); 83 | } 84 | 85 | return results.ToArray(); 86 | } 87 | 88 | 89 | private void list_drives() 90 | { 91 | IEnumerable volumeDrives = RawDiskLib.Utils.GetAllAvailableVolumes(); 92 | IEnumerable harddiskVolumes = RawDiskLib.Utils.GetAllAvailableDrives(DiskNumberType.Volume); 93 | 94 | //Console.WriteLine("You need to enter a volume on which to write and read. Note that this volume will be useless afterwards - do not chose anything by test volumes!"); 95 | //Console.WriteLine("Select volume:"); 96 | //List options = new List(); 97 | 98 | listBox1.Items.Clear(); 99 | 100 | listBox1.Items.Add(new DiskInfo() { Id = -1, Name = "*** Cancel ***" }); 101 | 102 | foreach (int harddiskVolume in harddiskVolumes) 103 | { 104 | try 105 | { 106 | using (RawDisk disk = new RawDisk(DiskNumberType.Volume, harddiskVolume)) 107 | { 108 | if (disk.DiskInfo.MediaType == DeviceIOControlLib.Objects.Disk.MEDIA_TYPE.RemovableMedia) 109 | { 110 | string volume = disk.DosDeviceName.Remove(0, @"\\.\GLOBALROOT".Length); 111 | char[] driveLetters = GetDriveLetters(volume).Where(volumeDrives.Contains).ToArray(); 112 | 113 | listBox1.Items.Add(new DiskInfo() { Id = harddiskVolume, Name = String.Format("[{1}] {0} {2} ", SizeSuffix(disk.SizeBytes), string.Join(", ", driveLetters), volume) }); 114 | 115 | //options.Add(harddiskVolume); 116 | 117 | } 118 | } 119 | } 120 | catch (Exception) 121 | { 122 | // Don't write it 123 | } 124 | } 125 | } 126 | 127 | private void listBox1_SelectedIndexChanged(object sender, EventArgs e) 128 | { 129 | if (((DiskInfo)listBox1.SelectedItem) != null) 130 | { 131 | if (((DiskInfo)listBox1.SelectedItem).Id == -1) 132 | { 133 | Close(); 134 | } 135 | else if (MessageBox.Show("Confirm Drive " + listBox1.SelectedItem.ToString() + "?", "Confirm Drive", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) 136 | { 137 | //WRITE(current_filename); 138 | 139 | _seldisk = ((DiskInfo)listBox1.SelectedItem); 140 | Close(); 141 | } 142 | } 143 | } 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /cpm_disk_manager/frmDiskSelection.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /cpm_disk_manager/frmEditFile.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace cpm_disk_manager 2 | { 3 | partial class frmEditFile 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.menuStrip1 = new System.Windows.Forms.MenuStrip(); 32 | this.editorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 33 | this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 34 | this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 35 | this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox(); 36 | this.exportFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 37 | this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); 38 | this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); 39 | this.statusStrip1 = new System.Windows.Forms.StatusStrip(); 40 | this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); 41 | this.tabControl1 = new System.Windows.Forms.TabControl(); 42 | this.tabPage1 = new System.Windows.Forms.TabPage(); 43 | this.textBox1 = new System.Windows.Forms.TextBox(); 44 | this.tabPage2 = new System.Windows.Forms.TabPage(); 45 | this.textBox2 = new System.Windows.Forms.TextBox(); 46 | this.label1 = new System.Windows.Forms.Label(); 47 | this.sendToClipboardDOWNLOADCOMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 48 | this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); 49 | this.menuStrip1.SuspendLayout(); 50 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); 51 | this.statusStrip1.SuspendLayout(); 52 | this.tabControl1.SuspendLayout(); 53 | this.tabPage1.SuspendLayout(); 54 | this.tabPage2.SuspendLayout(); 55 | this.SuspendLayout(); 56 | // 57 | // menuStrip1 58 | // 59 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 60 | this.editorToolStripMenuItem, 61 | this.undoToolStripMenuItem, 62 | this.toolStripComboBox1, 63 | this.exportFileToolStripMenuItem}); 64 | this.menuStrip1.Location = new System.Drawing.Point(0, 0); 65 | this.menuStrip1.Name = "menuStrip1"; 66 | this.menuStrip1.Size = new System.Drawing.Size(1103, 27); 67 | this.menuStrip1.TabIndex = 1; 68 | this.menuStrip1.Text = "menuStrip1"; 69 | // 70 | // editorToolStripMenuItem 71 | // 72 | this.editorToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 73 | this.sendToClipboardDOWNLOADCOMToolStripMenuItem, 74 | this.toolStripMenuItem1, 75 | this.closeToolStripMenuItem}); 76 | this.editorToolStripMenuItem.Name = "editorToolStripMenuItem"; 77 | this.editorToolStripMenuItem.Size = new System.Drawing.Size(50, 23); 78 | this.editorToolStripMenuItem.Text = "Editor"; 79 | // 80 | // closeToolStripMenuItem 81 | // 82 | this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; 83 | this.closeToolStripMenuItem.Size = new System.Drawing.Size(279, 22); 84 | this.closeToolStripMenuItem.Text = "Close"; 85 | this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); 86 | // 87 | // undoToolStripMenuItem 88 | // 89 | this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; 90 | this.undoToolStripMenuItem.Size = new System.Drawing.Size(48, 23); 91 | this.undoToolStripMenuItem.Text = "Undo"; 92 | this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click); 93 | // 94 | // toolStripComboBox1 95 | // 96 | this.toolStripComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 97 | this.toolStripComboBox1.Items.AddRange(new object[] { 98 | "Binary File", 99 | "Text File"}); 100 | this.toolStripComboBox1.Name = "toolStripComboBox1"; 101 | this.toolStripComboBox1.Size = new System.Drawing.Size(121, 23); 102 | this.toolStripComboBox1.SelectedIndexChanged += new System.EventHandler(this.toolStripComboBox1_SelectedIndexChanged); 103 | // 104 | // exportFileToolStripMenuItem 105 | // 106 | this.exportFileToolStripMenuItem.Name = "exportFileToolStripMenuItem"; 107 | this.exportFileToolStripMenuItem.Size = new System.Drawing.Size(74, 23); 108 | this.exportFileToolStripMenuItem.Text = "Export File"; 109 | this.exportFileToolStripMenuItem.Click += new System.EventHandler(this.exportFileToolStripMenuItem_Click); 110 | // 111 | // numericUpDown1 112 | // 113 | this.numericUpDown1.Hexadecimal = true; 114 | this.numericUpDown1.Location = new System.Drawing.Point(978, 3); 115 | this.numericUpDown1.Maximum = new decimal(new int[] { 116 | 65535, 117 | 0, 118 | 0, 119 | 0}); 120 | this.numericUpDown1.Name = "numericUpDown1"; 121 | this.numericUpDown1.Size = new System.Drawing.Size(123, 20); 122 | this.numericUpDown1.TabIndex = 0; 123 | this.numericUpDown1.Visible = false; 124 | this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged); 125 | // 126 | // statusStrip1 127 | // 128 | this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 129 | this.toolStripStatusLabel1}); 130 | this.statusStrip1.Location = new System.Drawing.Point(0, 428); 131 | this.statusStrip1.Name = "statusStrip1"; 132 | this.statusStrip1.Size = new System.Drawing.Size(1103, 22); 133 | this.statusStrip1.TabIndex = 5; 134 | this.statusStrip1.Text = "statusStrip1"; 135 | // 136 | // toolStripStatusLabel1 137 | // 138 | this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; 139 | this.toolStripStatusLabel1.Size = new System.Drawing.Size(0, 17); 140 | // 141 | // tabControl1 142 | // 143 | this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 144 | | System.Windows.Forms.AnchorStyles.Left) 145 | | System.Windows.Forms.AnchorStyles.Right))); 146 | this.tabControl1.Controls.Add(this.tabPage1); 147 | this.tabControl1.Controls.Add(this.tabPage2); 148 | this.tabControl1.Location = new System.Drawing.Point(0, 40); 149 | this.tabControl1.Name = "tabControl1"; 150 | this.tabControl1.SelectedIndex = 0; 151 | this.tabControl1.Size = new System.Drawing.Size(1103, 385); 152 | this.tabControl1.TabIndex = 6; 153 | this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); 154 | // 155 | // tabPage1 156 | // 157 | this.tabPage1.Controls.Add(this.textBox1); 158 | this.tabPage1.Location = new System.Drawing.Point(4, 22); 159 | this.tabPage1.Name = "tabPage1"; 160 | this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 161 | this.tabPage1.Size = new System.Drawing.Size(1095, 359); 162 | this.tabPage1.TabIndex = 0; 163 | this.tabPage1.Text = "Editor"; 164 | this.tabPage1.UseVisualStyleBackColor = true; 165 | // 166 | // textBox1 167 | // 168 | this.textBox1.AllowDrop = true; 169 | this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 170 | | System.Windows.Forms.AnchorStyles.Left) 171 | | System.Windows.Forms.AnchorStyles.Right))); 172 | this.textBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 173 | this.textBox1.Location = new System.Drawing.Point(0, 0); 174 | this.textBox1.MaxLength = 0; 175 | this.textBox1.Multiline = true; 176 | this.textBox1.Name = "textBox1"; 177 | this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 178 | this.textBox1.Size = new System.Drawing.Size(1093, 357); 179 | this.textBox1.TabIndex = 1; 180 | this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); 181 | this.textBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.textBox1_DragDrop); 182 | this.textBox1.DragEnter += new System.Windows.Forms.DragEventHandler(this.textBox1_DragEnter); 183 | // 184 | // tabPage2 185 | // 186 | this.tabPage2.Controls.Add(this.textBox2); 187 | this.tabPage2.Location = new System.Drawing.Point(4, 22); 188 | this.tabPage2.Name = "tabPage2"; 189 | this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 190 | this.tabPage2.Size = new System.Drawing.Size(1095, 359); 191 | this.tabPage2.TabIndex = 1; 192 | this.tabPage2.Text = "Hex"; 193 | this.tabPage2.UseVisualStyleBackColor = true; 194 | // 195 | // textBox2 196 | // 197 | this.textBox2.AllowDrop = true; 198 | this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 199 | | System.Windows.Forms.AnchorStyles.Left) 200 | | System.Windows.Forms.AnchorStyles.Right))); 201 | this.textBox2.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 202 | this.textBox2.Location = new System.Drawing.Point(0, 0); 203 | this.textBox2.MaxLength = 0; 204 | this.textBox2.Multiline = true; 205 | this.textBox2.Name = "textBox2"; 206 | this.textBox2.ReadOnly = true; 207 | this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 208 | this.textBox2.Size = new System.Drawing.Size(1093, 357); 209 | this.textBox2.TabIndex = 2; 210 | // 211 | // label1 212 | // 213 | this.label1.AutoSize = true; 214 | this.label1.BackColor = System.Drawing.SystemColors.MenuBar; 215 | this.label1.Location = new System.Drawing.Point(896, 6); 216 | this.label1.Name = "label1"; 217 | this.label1.Size = new System.Drawing.Size(73, 13); 218 | this.label1.TabIndex = 7; 219 | this.label1.Text = "Start Address:"; 220 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 221 | this.label1.Visible = false; 222 | // 223 | // sendToClipboardDOWNLOADCOMToolStripMenuItem 224 | // 225 | this.sendToClipboardDOWNLOADCOMToolStripMenuItem.Name = "sendToClipboardDOWNLOADCOMToolStripMenuItem"; 226 | this.sendToClipboardDOWNLOADCOMToolStripMenuItem.Size = new System.Drawing.Size(320, 22); 227 | this.sendToClipboardDOWNLOADCOMToolStripMenuItem.Text = "Send to Clipboard (DOWNLOAD.COM Format)"; 228 | this.sendToClipboardDOWNLOADCOMToolStripMenuItem.Click += new System.EventHandler(this.sendToClipboardDOWNLOADCOMToolStripMenuItem_Click); 229 | // 230 | // toolStripMenuItem1 231 | // 232 | this.toolStripMenuItem1.Name = "toolStripMenuItem1"; 233 | this.toolStripMenuItem1.Size = new System.Drawing.Size(276, 6); 234 | // 235 | // frmEditFile 236 | // 237 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 238 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 239 | this.ClientSize = new System.Drawing.Size(1103, 450); 240 | this.Controls.Add(this.label1); 241 | this.Controls.Add(this.tabControl1); 242 | this.Controls.Add(this.statusStrip1); 243 | this.Controls.Add(this.numericUpDown1); 244 | this.Controls.Add(this.menuStrip1); 245 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 246 | this.KeyPreview = true; 247 | this.MainMenuStrip = this.menuStrip1; 248 | this.MaximizeBox = false; 249 | this.MinimizeBox = false; 250 | this.Name = "frmEditFile"; 251 | this.ShowIcon = false; 252 | this.ShowInTaskbar = false; 253 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 254 | this.Text = "frmEditFile"; 255 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmEditFile_FormClosing); 256 | this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.frmEditFile_KeyUp); 257 | this.menuStrip1.ResumeLayout(false); 258 | this.menuStrip1.PerformLayout(); 259 | ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); 260 | this.statusStrip1.ResumeLayout(false); 261 | this.statusStrip1.PerformLayout(); 262 | this.tabControl1.ResumeLayout(false); 263 | this.tabPage1.ResumeLayout(false); 264 | this.tabPage1.PerformLayout(); 265 | this.tabPage2.ResumeLayout(false); 266 | this.tabPage2.PerformLayout(); 267 | this.ResumeLayout(false); 268 | this.PerformLayout(); 269 | 270 | } 271 | 272 | #endregion 273 | private System.Windows.Forms.MenuStrip menuStrip1; 274 | private System.Windows.Forms.ToolStripComboBox toolStripComboBox1; 275 | private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; 276 | private System.Windows.Forms.ToolStripMenuItem editorToolStripMenuItem; 277 | private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; 278 | private System.Windows.Forms.ToolStripMenuItem exportFileToolStripMenuItem; 279 | private System.Windows.Forms.SaveFileDialog saveFileDialog1; 280 | private System.Windows.Forms.NumericUpDown numericUpDown1; 281 | private System.Windows.Forms.StatusStrip statusStrip1; 282 | private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; 283 | private System.Windows.Forms.TabControl tabControl1; 284 | private System.Windows.Forms.TabPage tabPage1; 285 | private System.Windows.Forms.TextBox textBox1; 286 | private System.Windows.Forms.TabPage tabPage2; 287 | private System.Windows.Forms.TextBox textBox2; 288 | private System.Windows.Forms.Label label1; 289 | private System.Windows.Forms.ToolStripMenuItem sendToClipboardDOWNLOADCOMToolStripMenuItem; 290 | private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; 291 | } 292 | } -------------------------------------------------------------------------------- /cpm_disk_manager/frmEditFile.cs: -------------------------------------------------------------------------------- 1 | using cpm_disk_manager.tasm; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Text.RegularExpressions; 11 | using System.Threading.Tasks; 12 | using System.Windows.Forms; 13 | 14 | namespace cpm_disk_manager 15 | { 16 | public partial class frmEditFile : Form 17 | { 18 | 19 | byte[] original_data = new byte[0]; 20 | byte[] current_data = new byte[0]; 21 | 22 | String filename = ""; 23 | String hexadecimal_data = ""; 24 | String ascii_data = ""; 25 | String checksum = ""; 26 | 27 | int _org = 0; 28 | 29 | bool savekey = false; 30 | 31 | EditorType _filetype = EditorType.Binary; 32 | 33 | 34 | public int Start_Address 35 | { 36 | get { return _org; } 37 | set { _org = value; numericUpDown1.Value = value; } 38 | } 39 | 40 | public enum EditorType 41 | { 42 | Binary, 43 | Text 44 | } 45 | 46 | public EditorType FileType 47 | { 48 | get { return _filetype; } 49 | set 50 | { 51 | _filetype = value; 52 | toolStripComboBox1.SelectedIndex = (int)value; 53 | } 54 | } 55 | 56 | 57 | public frmEditFile() 58 | { 59 | InitializeComponent(); 60 | 61 | FileType = EditorType.Binary; 62 | undoToolStripMenuItem.Enabled = false; 63 | } 64 | 65 | public bool getSaveKeyHit() 66 | { 67 | return savekey; 68 | } 69 | 70 | 71 | public void setTitle(String text) 72 | { 73 | this.Text = text; 74 | 75 | } 76 | 77 | public string getText() 78 | { 79 | if (_filetype == EditorType.Binary) 80 | { 81 | return hexadecimal_data; 82 | } 83 | else if (_filetype == EditorType.Text) 84 | { 85 | return ascii_data; 86 | } 87 | 88 | return ""; 89 | } 90 | 91 | 92 | 93 | private void load_data() 94 | { 95 | ascii_data = System.Text.Encoding.Default.GetString(current_data); 96 | hexadecimal_data = Utils.ByteArrayToHexString(current_data); 97 | 98 | undoToolStripMenuItem.Enabled = !Utils.CompareByteArrays(original_data, current_data); 99 | } 100 | 101 | private void reload_data() 102 | { 103 | current_data = original_data; 104 | ascii_data = System.Text.Encoding.Default.GetString(current_data); 105 | hexadecimal_data = Utils.ByteArrayToHexString(current_data); 106 | } 107 | 108 | //Regex.Replace(textBox1.Text, "[^a-fA-F0-9]+", "", RegexOptions.Compiled) 109 | public void setBinary(byte[] data) 110 | { 111 | resetFile(); 112 | original_data = data; 113 | reload_data(); 114 | set_entry(); 115 | calculate_checksum(); 116 | } 117 | 118 | 119 | public void setFilename(String _filename) 120 | { 121 | filename = _filename; 122 | } 123 | 124 | 125 | public void newFile() 126 | { 127 | filename = ""; 128 | resetFile(); 129 | } 130 | private void resetFile() 131 | { 132 | original_data = new byte[0]; 133 | current_data = new byte[0]; 134 | ascii_data = ""; 135 | hexadecimal_data = ""; 136 | } 137 | 138 | public byte[] getBinary() 139 | { 140 | 141 | update_entry(); 142 | 143 | return current_data; 144 | } 145 | 146 | private void frmEditFile_KeyUp(object sender, KeyEventArgs e) 147 | { 148 | if (e.Control && (e.KeyValue == (int)'s' || e.KeyValue == (int)'S')) 149 | { 150 | savekey = true; 151 | this.Close(); 152 | } 153 | } 154 | 155 | 156 | private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e) 157 | { 158 | 159 | if (toolStripComboBox1.SelectedIndex == 0) 160 | { 161 | FileType = EditorType.Binary; 162 | } 163 | else if (toolStripComboBox1.SelectedIndex == 1) 164 | { 165 | FileType = EditorType.Text; 166 | } 167 | 168 | set_entry(); 169 | } 170 | 171 | private void undoToolStripMenuItem_Click(object sender, EventArgs e) 172 | { 173 | reload_data(); 174 | set_entry(); 175 | undoToolStripMenuItem.Enabled = false; 176 | } 177 | 178 | private void closeToolStripMenuItem_Click(object sender, EventArgs e) 179 | { 180 | this.Close(); 181 | } 182 | 183 | 184 | private string do_disassembly(Byte[] _bytes) 185 | { 186 | 187 | //assembly = Regex.Replace(assembly, "[^a-fA-F0-9]+", "", RegexOptions.Compiled); 188 | //Byte[] _bytes = StringToByteArray(assembly); 189 | 190 | Start_Address = (int)numericUpDown1.Value; 191 | string disassembly = ""; 192 | 193 | 194 | String[] disassembly_bytes = new string[_bytes.Length]; 195 | 196 | int last_line = -1; 197 | string printable_chars = ""; 198 | string hex_ops = ""; 199 | for (int k = 0; k < disassembly_bytes.Length; k++) 200 | { 201 | if (disassembly_bytes[k] == null) 202 | { 203 | char c = (char)_bytes[k]; 204 | bool isPrintable = !Char.IsControl(c) || Char.IsWhiteSpace(c); 205 | if (c == 0x85 || c == '\t' || c == '\r' || c == '\n') c = '.'; 206 | 207 | if (last_line == -1 || (last_line / 0x10 != k / 0x10)) 208 | { 209 | 210 | if (last_line > -1) 211 | { 212 | if (last_line % 0x10 > 0) 213 | { 214 | hex_ops = hex_ops.PadLeft(hex_ops.Length + ((last_line % 0x10) * 3)); 215 | printable_chars = printable_chars.PadLeft(printable_chars.Length + (last_line % 0x10)); 216 | } 217 | disassembly_bytes[last_line] += hex_ops.PadRight(48) + " " + printable_chars.PadRight(16) + "\r\n"; 218 | } 219 | 220 | last_line = k; 221 | disassembly_bytes[last_line] = (_org + k).ToString("X4") + ":"; 222 | hex_ops = ""; 223 | printable_chars = ""; 224 | } 225 | hex_ops += " " + _bytes[k].ToString("X2"); 226 | printable_chars += (isPrintable ? c.ToString() : "."); 227 | 228 | 229 | } 230 | } 231 | 232 | if (printable_chars.Length > 0) 233 | { 234 | if (last_line % 0x10 > 0) 235 | { 236 | hex_ops = hex_ops.PadLeft(hex_ops.Length + ((last_line % 0x10) * 3)); 237 | printable_chars = printable_chars.PadLeft(printable_chars.Length + (last_line % 0x10)); 238 | } 239 | disassembly_bytes[last_line] += hex_ops.PadRight(48) + " " + printable_chars.PadRight(16) + "\r\n"; 240 | } 241 | 242 | disassembly = String.Join("", disassembly_bytes.Where(p => p != "").ToArray()); 243 | 244 | calculate_checksum(); 245 | 246 | return disassembly; 247 | } 248 | 249 | 250 | private void calculate_checksum() 251 | { 252 | 253 | int sum = 0; 254 | int byte_count = 0; 255 | foreach (char c in current_data) 256 | { 257 | sum += (int)c; 258 | byte_count++; 259 | } 260 | 261 | checksum = (byte_count & 0b11111111).ToString("X2") + (sum & 0b11111111).ToString("X2"); 262 | toolStripStatusLabel1.Text = "Checksum: " + checksum; 263 | } 264 | 265 | 266 | private void textBox1_DragEnter(object sender, DragEventArgs e) 267 | { 268 | e.Effect = DragDropEffects.Copy; 269 | } 270 | 271 | 272 | 273 | 274 | 275 | 276 | private void textBox1_DragDrop(object sender, DragEventArgs e) 277 | { 278 | try 279 | { 280 | string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); 281 | foreach (string file in files) 282 | { 283 | if (File.Exists(file)) 284 | { 285 | using (BinaryReader b = new BinaryReader(File.Open(file, FileMode.Open))) 286 | { 287 | 288 | //string filename = Path.GetFileName(file); 289 | 290 | current_data = Utils.ReadAllBytes(b); 291 | 292 | if (original_data.LongLength == 0) 293 | original_data = current_data; 294 | 295 | set_entry(); 296 | calculate_checksum(); 297 | 298 | } 299 | 300 | } 301 | 302 | } 303 | 304 | } 305 | catch 306 | { 307 | MessageBox.Show("An error occurred while reading the file.\nPlease check the file.", "Reading Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 308 | } 309 | 310 | } 311 | 312 | private void exportFileToolStripMenuItem_Click(object sender, EventArgs e) 313 | { 314 | try 315 | { 316 | Byte[] filearray = Utils.HexStringToByteArray(textBox1.Text); 317 | saveFileDialog1.FileName = filename; 318 | saveFileDialog1.Filter = "All Files (*.*)|*.*"; 319 | if (saveFileDialog1.ShowDialog(this) == DialogResult.OK) 320 | { 321 | string filename = saveFileDialog1.FileName; 322 | 323 | File.WriteAllBytes(filename, filearray); 324 | //MessageBox.Show("FileS, "Save Media", MessageBoxButtons.OK, MessageBoxIcon.Error); 325 | 326 | } 327 | 328 | } 329 | catch 330 | { 331 | MessageBox.Show("An error occurred while writing the file.\nPlease check the file.", "Writing Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 332 | } 333 | } 334 | 335 | private void numericUpDown1_ValueChanged(object sender, EventArgs e) 336 | { 337 | Start_Address = (int)numericUpDown1.Value; 338 | textBox2.Text = do_disassembly(current_data); 339 | } 340 | 341 | 342 | private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) 343 | { 344 | label1.Visible = tabControl1.SelectedIndex == 1; 345 | numericUpDown1.Visible = tabControl1.SelectedIndex == 1; 346 | 347 | if (tabControl1.SelectedIndex == 1) 348 | { 349 | update_entry(); 350 | textBox2.Text = do_disassembly(current_data); 351 | } 352 | } 353 | 354 | 355 | 356 | private void set_entry() 357 | { 358 | load_data(); 359 | 360 | if (_filetype == EditorType.Binary) 361 | { 362 | textBox1.Text = hexadecimal_data; 363 | } 364 | else 365 | { 366 | textBox1.Text = ascii_data; 367 | } 368 | } 369 | 370 | private void update_entry() 371 | { 372 | string entry = textBox1.Text; 373 | 374 | if (_filetype == EditorType.Binary) 375 | { 376 | entry = Regex.Replace(entry, "[^a-fA-F0-9]+", "", RegexOptions.Compiled); 377 | current_data = Utils.HexStringToByteArray(entry); 378 | } 379 | else 380 | { 381 | current_data = Encoding.ASCII.GetBytes(entry); 382 | } 383 | 384 | load_data(); 385 | } 386 | 387 | private void frmEditFile_FormClosing(object sender, FormClosingEventArgs e) 388 | { 389 | update_entry(); 390 | } 391 | 392 | private void textBox1_TextChanged(object sender, EventArgs e) 393 | { 394 | /// verificar undo 395 | update_entry(); 396 | load_data(); 397 | } 398 | 399 | private void sendToClipboardDOWNLOADCOMToolStripMenuItem_Click(object sender, EventArgs e) 400 | { 401 | String clipboard = ""; 402 | clipboard += "A:DOWNLOAD " + filename + "\r\n"; 403 | clipboard += "U0\r\n"; 404 | clipboard += ":" + hexadecimal_data; 405 | clipboard += ">" + checksum + "\r\n"; 406 | 407 | Clipboard.SetText(clipboard); 408 | } 409 | } 410 | } 411 | -------------------------------------------------------------------------------- /cpm_disk_manager/frmEditFile.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 132, 17 125 | 126 | 127 | 268, 17 128 | 129 | -------------------------------------------------------------------------------- /cpm_disk_manager/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /cpm_disk_manager/tasm/Tasm_Opcode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace cpm_disk_manager.tasm 9 | { 10 | public class Tasm_Opcode 11 | { 12 | public string opcode { get; set; } 13 | public string desc { get; set; } 14 | public int size { get; set; } 15 | 16 | 17 | public Tasm_Opcode(string opcode, string desc, int size) 18 | { 19 | this.opcode = opcode.Trim(); 20 | this.desc = desc.Trim(); 21 | this.size = size; 22 | 23 | if (this.desc.IndexOf(" \"\"") > -1) 24 | this.desc = this.desc.Replace(" \"\"", "").Trim(); 25 | 26 | } 27 | 28 | 29 | 30 | public static Dictionary load() 31 | { 32 | String line; 33 | Dictionary opcode_list = new Dictionary(); 34 | if (!Directory.Exists(System.Environment.CurrentDirectory + "\\tasm")) 35 | Directory.CreateDirectory(System.Environment.CurrentDirectory + "\\tasm"); 36 | 37 | try 38 | { 39 | StreamReader sr = new StreamReader(System.Environment.CurrentDirectory + "\\tasm\\tasm80.tab"); 40 | //Read the first line of text 41 | line = sr.ReadLine(); 42 | //Continue to read until you reach end of file 43 | while (line != null) 44 | { 45 | 46 | String[] cols = line.Split('\t'); 47 | int icol = 0; 48 | 49 | string opcode = ""; 50 | string desc = ""; 51 | int size = 0; 52 | foreach (string c in cols) 53 | { 54 | if (c.Trim() != "") 55 | { 56 | switch (icol) 57 | { 58 | case 0: 59 | desc = c.Trim(); 60 | break; 61 | case 1: 62 | opcode = c.Trim(); 63 | break; 64 | case 2: 65 | size = int.Parse(c.Trim()); 66 | break; 67 | } 68 | 69 | icol++; 70 | } 71 | } 72 | 73 | if(opcode != "" && !opcode_list.ContainsKey(opcode)) 74 | { 75 | opcode_list.Add(opcode, new Tasm_Opcode(opcode, desc, size)); 76 | } 77 | 78 | line = sr.ReadLine(); 79 | } 80 | 81 | } 82 | catch (Exception e) 83 | { 84 | Console.WriteLine("Exception: " + e.Message); 85 | } 86 | finally 87 | { 88 | Console.WriteLine("Executing finally block."); 89 | } 90 | 91 | return opcode_list; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /cpm_disk_manager/tasm/original_tasm1.tab: -------------------------------------------------------------------------------- 1 | "TASMSOL" 2 | .ALTWILD 3 | 4 | ESC "" FD 1 NOP 1 5 | SETPTB "" 01 1 NOP 1 6 | PAGEMAP "" 02 1 NOP 1 7 | STORE "" 03 1 NOP 1 8 | LOAD "" 04 1 NOP 1 9 | SYSCALL @ 05 2 NOP 1 10 | SYSRET "" 06 1 NOP 1 11 | CALL A 08 1 NOP 1 12 | CALL [A+@] 07FD 4 NOP 1 13 | CALL @ 07 3 NOP 1 14 | RET "" 09 1 NOP 1 15 | JMP A 0B 1 NOP 1 16 | JMP [@+AL] 0AFD 4 NOP 1 17 | JMP [@+BL] 0BFD 4 NOP 1 18 | JMP @ 0A 3 NOP 1 19 | LODSTAT "" 0C 1 NOP 1 20 | STOSTAT "" 0D 1 NOP 1 21 | LODFLGS "" 0E 1 NOP 1 22 | STOFLGS "" 0F 1 NOP 1 23 | NOP "" FE 1 NOP 1 24 | HALT "" FF 1 NOP 1 25 | ENTER @ F8 3 NOP 1 26 | LEAVE "" F9 1 NOP 1 27 | SUPCOPY "" 08FD 2 NOP 1 28 | SUPSTART "" 09FD 2 NOP 1 29 | 30 | LEA D,[SP+@] FAFD 4 NOP 1 31 | LEA D,[BP+@] FA 3 NOP 1 32 | LEA D,[SI+@] FB 3 NOP 1 33 | LEA D,[DI+@] FC 3 NOP 1 34 | LEA D,[@+A*2^+@+B] F9FD 5 COMBINE 1 35 | LEA D,[BP+A*2^+@+B] F9FD 5 COMBINE 1 36 | 37 | MOV A,SI 4E 1 NOP 1 38 | MOV A,DI 50 1 NOP 1 39 | MOV A,BP 4A 1 NOP 1 40 | MOV A,SP 48 1 NOP 1 41 | MOV A,PC 11FD 2 NOP 1 42 | MOV A,B 11 1 NOP 1 43 | MOV A,C 12 1 NOP 1 44 | MOV A,D 13 1 NOP 1 45 | MOV A,G 12FD 2 NOP 1 46 | MOV A,PC 11FD 2 NOP 1 47 | MOV A,[D] 15 1 NOP 1 48 | MOV A,[A+@] B7 3 NOP 1 49 | MOV A,[@+A] B7 3 NOP 1 50 | MOV A,[D+@] 16 3 NOP 1 51 | MOV A,[BP+D] 18 1 NOP 1 52 | MOV A,[BP+@] 17 3 NOP 1 53 | MOV A,[SP+D] 18FD 2 NOP 1 54 | MOV A,[SP+@] 17FD 4 NOP 1 55 | MOV A,[@] 14 3 NOP 1 56 | MOV A,@ 10 3 NOP 1 57 | MOV AL,AH 1A 1 NOP 1 58 | MOV AL,BL 1B 1 NOP 1 59 | MOV AL,BH 1C 1 NOP 1 60 | MOV AL,CL 84 1 NOP 1 61 | MOV AL,CH A8 1 NOP 1 62 | MOV AL,GL 1AFD 2 NOP 1 63 | MOV AL,GH 1BFD 2 NOP 1 64 | MOV AL,[D] 1E 1 NOP 1 65 | MOV AL,[D+@] 1F 3 NOP 1 66 | MOV AL,[BP+@] 20 3 NOP 1 67 | MOV AL,[BP+D] 21 1 NOP 1 68 | MOV AL,[SP+D] 21FD 2 NOP 1 69 | MOV AL,[SP+@] 20FD 4 NOP 1 70 | MOV AL,[@] 1D 3 NOP 1 71 | MOV AL,@ 19 2 NOP 1 72 | MOV AH,AL 23 1 NOP 1 73 | MOV AH,BL 24 1 NOP 1 74 | MOV AH,BH 25 1 NOP 1 75 | MOV AH,GL 23FD 2 NOP 1 76 | MOV AH,GH 24FD 2 NOP 1 77 | MOV AH,@ 22 2 NOP 1 78 | MOV B,A 27 1 NOP 1 79 | MOV B,C 28 1 NOP 1 80 | MOV B,D 2D 1 NOP 1 81 | MOV B,G 27FD 2 NOP 1 82 | MOV B,[D] 2A 1 NOP 1 83 | MOV B,[D+@] 2B 3 NOP 1 84 | MOV B,[BP+@] 2C 3 NOP 1 85 | MOV B,[BP+D] 2D 1 NOP 1 86 | MOV B,[SP+@] 2CFD 4 NOP 1 87 | MOV B,[@] 29 3 NOP 1 88 | MOV B,@ 26 3 NOP 1 89 | MOV BL,AL 2F 1 NOP 1 90 | MOV BL,AH 99 1 NOP 1 91 | MOV BL,BH 30 1 NOP 1 92 | MOV BL,GL 2FFD 2 NOP 1 93 | MOV BL,GH 30FD 2 NOP 1 94 | MOV BH,AL 36 1 NOP 1 95 | MOV BH,AH 9A 1 NOP 1 96 | MOV BH,BL 37 1 NOP 1 97 | MOV BH,GL 36FD 2 NOP 1 98 | MOV BH,GH 37FD 2 NOP 1 99 | MOV BH,@ A7 2 NOP 1 100 | MOV BL,[D] 32 1 NOP 1 101 | MOV BL,[D+@] 33 3 NOP 1 102 | MOV BL,[BP+@] 34 3 NOP 1 103 | MOV BL,[BP+D] 35 1 NOP 1 104 | MOV BL,[SP+@] 34FD 4 NOP 1 105 | MOV BL,[SP+D] 35FD 2 NOP 1 106 | MOV BL,[@] 31 3 NOP 1 107 | MOV BL,@ 2E 2 NOP 1 108 | MOV C,A 39 1 NOP 1 109 | MOV C,B 39FD 2 NOP 1 110 | MOV C,G 38FD 2 NOP 1 111 | MOV C,@ 38 3 NOP 1 112 | MOV CL,AL 83 1 NOP 1 113 | MOV CL,GL 3AFD 2 NOP 1 114 | MOV CL,GH 83FD 2 NOP 1 115 | MOV CL,@ 3A 2 NOP 1 116 | MOV D,A 3C 1 NOP 1 117 | MOV D,B 74 1 NOP 1 118 | MOV D,C 3CFD 2 NOP 1 119 | MOV D,G 3BFD 2 NOP 1 120 | MOV D,@ 3B 3 NOP 1 121 | MOV [D],AL 3E 1 NOP 1 122 | MOV [D],BL 3EFD 2 NOP 1 123 | MOV [D+@],AL 3F 3 NOP 1 124 | MOV [BP+@],AL 40 3 NOP 1 125 | MOV [BP+D],AL 41 1 NOP 1 126 | MOV [@],AL 3D 3 NOP 1 127 | MOV [@],BL 3DFD 4 NOP 1 128 | MOV [D],A 43 1 NOP 1 129 | MOV [D],B 43FD 2 NOP 1 130 | MOV [D+@],A 44 3 NOP 1 131 | MOV [D+@],B 44FD 4 NOP 1 132 | MOV [BP+@],A 45 3 NOP 1 133 | MOV [BP+D],A 46 1 NOP 1 134 | MOV SP,A 47 1 NOP 1 135 | MOV BP,A 49 1 NOP 1 136 | MOV SI,A 4D 1 NOP 1 137 | MOV DI,A 4F 1 NOP 1 138 | MOV [@],A 42 3 NOP 1 139 | MOV [@],B 42FD 4 NOP 1 140 | MOV BYTE[@],@ F2 4 COMBINE 1 141 | MOV WORD[@],@ B8 5 COMBINE 1 142 | 143 | ADD SP,@ 51 3 NOP 1 144 | SUB SP,@ 52 3 NOP 1 145 | ADD A,B 54 1 NOP 1 146 | ADD A,C 55FD 2 NOP 1 147 | ADD A,D 56FD 2 NOP 1 148 | ADD A,@ 53 3 NOP 1 149 | ADD B,A 56 1 NOP 1 150 | ADD B,C 57FD 2 NOP 1 151 | ADD B,D 58FD 2 NOP 1 152 | ADD B,@ 55 3 NOP 1 153 | ADD C,A 59FD 2 NOP 1 154 | ADD C,B 5AFD 2 NOP 1 155 | ADD C,D 5BFD 2 NOP 1 156 | ADD C,@ 57 3 NOP 1 157 | ADD D,A 59 1 NOP 1 158 | ADD D,B 5A 1 NOP 1 159 | ADD D,C 5CFD 2 NOP 1 160 | ADD D,@ 58 3 NOP 1 161 | ADC A,B 5C 1 NOP 1 162 | ADC A,@ 5B 3 NOP 1 163 | ADC B,@ 5D 3 NOP 1 164 | ADC C,@ 5E 3 NOP 1 165 | SUB A,B 60 1 NOP 1 166 | SUB A,@ 5F 3 NOP 1 167 | SUB B,D 61FD 2 NOP 1 168 | SUB B,@ 61 3 NOP 1 169 | SUB C,@ 62 3 NOP 1 170 | SUB D,A 64 1 NOP 1 171 | SUB D,B 65 1 NOP 1 172 | SUB D,@ 63 3 NOP 1 173 | SBB A,B 67 1 NOP 1 174 | SBB A,@ 66 3 NOP 1 175 | SBB B,@ 68 3 NOP 1 176 | SBB C,@ 69 3 NOP 1 177 | ADD AL,BL 6B 1 NOP 1 178 | ADD AL,@ 6A 2 NOP 1 179 | ADD BL,AL 6CFD 2 NOP 1 180 | ADD BL,@ 6C 2 NOP 1 181 | ADD CL,@ 6D 2 NOP 1 182 | ADD CH,@ 6E 2 NOP 1 183 | 184 | SUB AL,BL 70 1 NOP 1 185 | SUB AL,@ 6F 2 NOP 1 186 | SUB CL,@ 71 2 NOP 1 187 | SUB CH,@ 72 2 NOP 1 188 | 189 | INC A 77 1 NOP 1 190 | INC C 78 1 NOP 1 191 | INC D 79 1 NOP 1 192 | INC AL 7A 1 NOP 1 193 | INC AH 75 1 NOP 1 194 | INC CL 7B 1 NOP 1 195 | INC CH 7C 1 NOP 1 196 | DEC A 7D 1 NOP 1 197 | DEC C 7E 1 NOP 1 198 | DEC D 7F 1 NOP 1 199 | DEC AL 80 1 NOP 1 200 | DEC AH 73 1 NOP 1 201 | DEC CL 81 1 NOP 1 202 | DEC CH 82 1 NOP 1 203 | 204 | AND A,B 86 1 NOP 1 205 | AND A,@ 85 3 NOP 1 206 | AND AL,BL 88 1 NOP 1 207 | AND AL,@ 87 2 NOP 1 208 | AND BL,@ 87FD 3 NOP 1 209 | 210 | NAND A,B 86FD 2 NOP 1 211 | NAND A,@ 85FD 4 NOP 1 212 | NAND AL,@ 84FD 3 NOP 1 213 | NAND AL,BL 88FD 2 NOP 1 214 | 215 | OR A,B 8A 1 NOP 1 216 | OR A,@ 89 3 NOP 1 217 | OR AL,BL 8C 1 NOP 1 218 | OR AL,@ 8B 2 NOP 1 219 | OR BL,@ 8BFD 3 NOP 1 220 | NOR A,B 8AFD 2 NOP 1 221 | NOR A,@ 89FD 4 NOP 1 222 | NOR AL,BL 8CFD 2 NOP 1 223 | NOR AL,@ 8DFD 3 NOP 1 224 | 225 | XOR A,B 8E 1 NOP 1 226 | XOR A,@ 8D 3 NOP 1 227 | XOR AL,BL 90 1 NOP 1 228 | XOR AL,@ 8F 2 NOP 1 229 | TEST A,B 92 1 NOP 1 230 | TEST A,@ 91 3 NOP 1 231 | TEST AL,BL 94 1 NOP 1 232 | TEST AL,@ 93 2 NOP 1 233 | TEST BL,@ 93FD 3 NOP 1 234 | TEST CL,@ 94FD 3 NOP 1 235 | 236 | NOT A 95 1 NOP 1 237 | NOT AL 96 1 NOP 1 238 | NOT B 97 1 NOP 1 239 | NOT BL 98 1 NOP 1 240 | MOV BP,SP 9B 1 NOP 1 241 | MOV SP,BP 9C 1 NOP 1 242 | SHL A,CL 9D 1 NOP 1 243 | SHL AL,CL 9E 1 NOP 1 244 | SHL B,CL 9F 1 NOP 1 245 | SHL BL,CL A0 1 NOP 1 246 | SHR A,CL A1 1 NOP 1 247 | SHR AL,CL A2 1 NOP 1 248 | SHR B,CL A3 1 NOP 1 249 | SHR BL,CL A4 1 NOP 1 250 | ASHR A,CL A5 1 NOP 1 251 | ASHR AL,CL A6 1 NOP 1 252 | ASHR A,@ A5FD 3 NOP 1 253 | ASHR AL,@ A6FD 3 NOP 1 254 | 255 | ASHR B,CL 8EFD 2 NOP 1 256 | ASHR BL,CL 8FFD 2 NOP 1 257 | ASHR B,@ 90FD 3 NOP 1 258 | ASHR BL,@ 91FD 3 NOP 1 259 | 260 | 261 | LOOPC @ A9 3 NOP 1 262 | SNEX A AA 1 NOP 1 263 | SNEX B AB 1 NOP 1 264 | MUL A,B AC 1 NOP 1 265 | MUL A,C ACFD 2 NOP 1 266 | MUL AL,BL AD 1 NOP 1 267 | DIV A,B AE 1 NOP 1 268 | CMP A,B B0 1 NOP 1 269 | CMP A,C B1 1 NOP 1 270 | CMP A,D B2 1 NOP 1 271 | CMP A,@ AF 3 NOP 1 272 | CMP AL,BL BA 1 NOP 1 273 | CMP AL,CL BB 1 NOP 1 274 | 275 | CMP BYTE[D],@ BD 2 NOP 1 276 | CMP BYTE[D+@],@ BE 4 NOP 1 277 | CMP BYTE[BP+@],@ BF 4 NOP 1 278 | CMP BYTE[@],@ BC 4 COMBINE 1 279 | 280 | CMP WORD[D],@ B4 3 NOP 1 281 | CMP WORD[D+@],@ B5 5 NOP 1 282 | CMP WORD[BP+@],@ B6 5 NOP 1 283 | CMP WORD[@],@ B3 5 COMBINE 1 284 | 285 | CMP AL,@ B9 2 NOP 1 286 | CMP AH,@ 76 2 NOP 1 287 | CMP B,C C0FD 2 NOP 1 288 | CMP B,@ C0 3 NOP 1 289 | CMP BL,@ C1 2 NOP 1 290 | CMP C,@ C2 3 NOP 1 291 | CMP CL,@ C3 2 NOP 1 292 | CMP CH,@ C4 2 NOP 1 293 | CMP D,@ C5 3 NOP 1 294 | JZ @ C6 3 NOP 1 295 | JE @ C6 3 NOP 1 296 | JNZ @ C7 3 NOP 1 297 | JNE @ C7 3 NOP 1 298 | JC @ C8 3 NOP 1 299 | JLU @ C8 3 NOP 1 300 | JNC @ C9 3 NOP 1 301 | JGEU @ C9 3 NOP 1 302 | JNEG @ CA 3 NOP 1 303 | JPOS @ CB 3 NOP 1 304 | JL @ CC 3 NOP 1 305 | JLE @ CD 3 NOP 1 306 | JG @ CE 3 NOP 1 307 | JGE @ CF 3 NOP 1 308 | JLEU @ D0 3 NOP 1 309 | JGU @ D1 3 NOP 1 310 | 311 | PUSH BYTE@ DBFD 3 NOP 1 312 | PUSH WORD@ D7FD 4 NOP 1 313 | 314 | PUSH BP D2 1 NOP 1 315 | ADD SI,@ D3 3 NOP 1 316 | ADD DI,@ D4 3 NOP 1 317 | SUB SI,@ D5 3 NOP 1 318 | SUB DI,@ D6 3 NOP 1 319 | PUSHA "" 4B 1 NOP 1 320 | PUSH A D7 1 NOP 1 321 | PUSH B D8 1 NOP 1 322 | PUSH C D9 1 NOP 1 323 | PUSH D DA 1 NOP 1 324 | PUSH G D8FD 2 NOP 1 325 | PUSH AL DB 1 NOP 1 326 | PUSH AH DC 1 NOP 1 327 | PUSH BL DD 1 NOP 1 328 | PUSH BH DE 1 NOP 1 329 | PUSH CL DF 1 NOP 1 330 | PUSH CH E0 1 NOP 1 331 | PUSHF "" E1 1 NOP 1 332 | PUSH SI E2 1 NOP 1 333 | PUSH DI E3 1 NOP 1 334 | POPA "" 4C 1 NOP 1 335 | POP A E4 1 NOP 1 336 | POP B E5 1 NOP 1 337 | POP C E6 1 NOP 1 338 | POP D E7 1 NOP 1 339 | POP G F1FD 2 NOP 1 340 | POP AL E8 1 NOP 1 341 | POP AH E9 1 NOP 1 342 | POP BL EA 1 NOP 1 343 | POP BH EB 1 NOP 1 344 | POP CL EC 1 NOP 1 345 | POP CH ED 1 NOP 1 346 | POPF "" EE 1 NOP 1 347 | POP SI EF 1 NOP 1 348 | POP DI F0 1 NOP 1 349 | POP BP F1 1 NOP 1 350 | 351 | CMPSB "" F3 1 NOP 1 352 | REPZ CMPSB "" F3FD 2 NOP 1 353 | REPE CMPSB "" F3FD 2 NOP 1 354 | REPNZ CMPSB "" F6FD 2 NOP 1 355 | REPNE CMPSB "" F6FD 2 NOP 1 356 | SCANSB "" F4 1 NOP 1 357 | MOVSB "" F5 1 NOP 1 358 | LODSB "" F6 1 NOP 1 359 | STOSB "" F7 1 NOP 1 360 | 361 | REP MOVSB F5FD 2 NOP 1 362 | REP STOSB F7FD 2 NOP 1 363 | 364 | MOV G,A 78FD 2 NOP 1 365 | MOV G,B 79FD 2 NOP 1 366 | MOV G,C 7AFD 2 NOP 1 367 | MOV G,D 7BFD 2 NOP 1 368 | MOV G,SI 7CFD 2 NOP 1 369 | MOV G,DI 7DFD 2 NOP 1 370 | 371 | STI "" 0CFD 2 NOP 1 372 | CLI "" 0DFD 2 NOP 1 373 | 374 | INC B 77FD 2 NOP 1 375 | INC SP 51FD 2 NOP 1 376 | DEC B 7DFD 2 NOP 1 377 | DEC SP 52FD 2 NOP 1 378 | 379 | CLA "" 10FD 2 NOP 1 380 | 381 | SWP A AAFD 2 NOP 1 382 | SWP B ABFD 2 NOP 1 383 | 384 | NEG A 95FD 2 NOP 1 385 | NEG AL 96FD 2 NOP 1 386 | NEG B 97FD 2 NOP 1 387 | NEG BL 98FD 2 NOP 1 388 | 389 | OR BL,@ 8BFD 3 NOP 1 390 | TEST BL,@ 93FD 3 NOP 1 391 | TEST CL,@ 94FD 3 NOP 1 392 | 393 | LOOPB @ A9FD 4 NOP 1 394 | 395 | MOV SI,D 4EFD 2 NOP 1 396 | MOV DI,D 50FD 2 NOP 1 397 | MOV SI,@ 4DFD 4 NOP 1 398 | MOV DI,@ 4FFD 4 NOP 1 399 | MOV SP,@ 47FD 4 NOP 1 400 | MOV BP,@ 49FD 4 NOP 1 401 | 402 | SHL A 99FD 2 NOP 1 403 | SHL AL 9AFD 2 NOP 1 404 | SHR A 9BFD 2 NOP 1 405 | SHR AL 9CFD 2 NOP 1 406 | 407 | SHL A,@ 9DFD 3 NOP 1 408 | SHL AL,@ 9EFD 3 NOP 1 409 | SHL B,@ 9FFD 3 NOP 1 410 | SHL BL,@ A0FD 3 NOP 1 411 | SHR A,@ A1FD 3 NOP 1 412 | SHR AL,@ A2FD 3 NOP 1 413 | SHR B,@ A3FD 3 NOP 1 414 | SHR BL,@ A4FD 3 NOP 1 415 | 416 | ROL A,CL DEFD 2 NOP 1 417 | ROL AL,CL DFFD 2 NOP 1 418 | RLC A,CL E0FD 2 NOP 1 419 | RLC AL,CL E1FD 2 NOP 1 420 | ROR A,CL E2FD 2 NOP 1 421 | ROR AL,CL E3FD 2 NOP 1 422 | RRC A,CL E4FD 2 NOP 1 423 | RRC AL,CL E5FD 2 NOP 1 424 | 425 | ROL B,CL E6FD 2 NOP 1 426 | ROL BL,CL E7FD 2 NOP 1 427 | RLC B,CL E8FD 2 NOP 1 428 | RLC BL,CL E9FD 2 NOP 1 429 | ROR B,CL EAFD 2 NOP 1 430 | ROR BL,CL EBFD 2 NOP 1 431 | RRC B,CL ECFD 2 NOP 1 432 | RRC BL,CL EDFD 2 NOP 1 433 | 434 | STC "" 53FD 2 NOP 1 435 | CLC "" 54FD 2 NOP 1 436 | CMC "" 4AFD 2 NOP 1 437 | 438 | LODMSKS "" 0EFD 2 NOP 1 439 | STOMSKS "" 0FFD 2 NOP 1 -------------------------------------------------------------------------------- /cpm_disk_manager/tasm/tasm1.tab: -------------------------------------------------------------------------------- 1 | "TASMSOL" 2 | .ALTWILD 3 | 4 | SETPTB "" 01 1 NOP 1 5 | PAGEMAP "" 02 1 NOP 1 6 | STORE "" 03 1 NOP 1 7 | LOAD "" 04 1 NOP 1 8 | SYSCALL U8 05 2 NOP 1 9 | SYSRET "" 06 1 NOP 1 10 | CALL [A+I16] 07FD 4 NOP 1 11 | CALL U16 07 3 NOP 1 12 | SUPCOPY "" 08FD 2 NOP 1 13 | CALL A 08 1 NOP 1 14 | SUPSTART "" 09FD 2 NOP 1 15 | RET 09 1 NOP 1 16 | JMP [U16+AL] 0AFD 4 NOP 1 17 | JMP U16 0A 3 NOP 1 18 | JMP [U16+BL] 0BFD 4 NOP 1 19 | JMP A 0B 1 NOP 1 20 | STI "" 0CFD 2 NOP 1 21 | LODSTAT "" 0C 1 NOP 1 22 | CLI 0DFD 2 NOP 1 23 | STOSTAT "" 0D 1 NOP 1 24 | LODMSKS "" 0EFD 2 NOP 1 25 | LODFLGS "" 0E 1 NOP 1 26 | STOMSKS "" 0FFD 2 NOP 1 27 | STOFLGS "" 0F 1 NOP 1 28 | 29 | CLA "" 10FD 2 NOP 1 30 | MOV A,I16 10 3 NOP 1 31 | MOV A,PC 11FD 2 NOP 1 32 | MOV A,B 11 1 NOP 1 33 | MOV A,G 12FD 2 NOP 1 34 | MOV A,C 12 1 NOP 1 35 | MOV A,D 13 1 NOP 1 36 | MOV A,[U16] 14 3 NOP 1 37 | MOV A,[D] 15 1 NOP 1 38 | MOV A,[D+I16] 16 3 NOP 1 39 | MOV A,[SP+I16] 17FD 4 NOP 1 40 | MOV A,[BP+I16] 17 3 NOP 1 41 | MOV A,[SP+D] 18FD 2 NOP 1 42 | MOV A,[BP+D] 18 1 NOP 1 43 | MOV AL,I8 19 2 NOP 1 44 | MOV AL,GL 1AFD 2 NOP 1 45 | MOV AL,AH 1A 1 NOP 1 46 | MOV AL,GH 1BFD 2 NOP 1 47 | MOV AL,BL 1B 1 NOP 1 48 | MOV AL,BH 1C 1 NOP 1 49 | MOV AL,[U16] 1D 3 NOP 1 50 | MOV AL,[D] 1E 1 NOP 1 51 | MOV AL,[D+I16] 1F 3 NOP 1 52 | 53 | MOV AL,[SP+I16] 20FD 4 NOP 1 54 | MOV AL,[BP+I16] 20 3 NOP 1 55 | MOV AL,[SP+D] 21FD 2 NOP 1 56 | MOV AL,[BP+D] 21 1 NOP 1 57 | MOV AH,I8 22 2 NOP 1 58 | MOV AH,GL 23FD 2 NOP 1 59 | MOV AH,AL 23 1 NOP 1 60 | MOV AH,GH 24FD 2 NOP 1 61 | MOV AH,BL 24 1 NOP 1 62 | MOV AH,BH 25 1 NOP 1 63 | MOV B,I16 26 3 NOP 1 64 | MOV B,G 27FD 2 NOP 1 65 | MOV B,A 27 1 NOP 1 66 | MOV B,C 28 1 NOP 1 67 | MOV B,[U16] 29 3 NOP 1 68 | MOV B,[D] 2A 1 NOP 1 69 | MOV B,[D+I16] 2B 3 NOP 1 70 | MOV B,[SP+I16] 2CFD 4 NOP 1 71 | MOV B,[BP+I16] 2C 3 NOP 1 72 | MOV B,D 2D 1 NOP 1 73 | MOV BL,I8 2E 2 NOP 1 74 | MOV BL,GL 2FFD 2 NOP 1 75 | MOV BL,AL 2F 1 NOP 1 76 | 77 | MOV BL,GH 30FD 2 NOP 1 78 | MOV BL,AH 30 1 NOP 1 79 | MOV BL,[U16] 31 3 NOP 1 80 | MOV BL,[D] 32 1 NOP 1 81 | MOV BL,[D+I16] 33 3 NOP 1 82 | MOV BL,[SP+I16] 34FD 4 NOP 1 83 | MOV BL,[BP+I16] 34 3 NOP 1 84 | MOV BL,[SP+D] 35FD 2 NOP 1 85 | MOV BL,[BP+D] 35 1 NOP 1 86 | MOV BH,GL 36FD 2 NOP 1 87 | MOV BH,AL 36 1 NOP 1 88 | MOV BH,GH 37FD 2 NOP 1 89 | MOV BH,BL 37 1 NOP 1 90 | MOV C,G 38FD 2 NOP 1 91 | MOV C,U16 38 3 NOP 1 92 | MOV C,B 39FD 2 NOP 1 93 | MOV C,A 39 1 NOP 1 94 | MOV CL,GL 3AFD 2 NOP 1 95 | MOV CL,U8 3A 2 NOP 1 96 | MOV D,G 3BFD 2 NOP 1 97 | MOV D,U16 3B 3 NOP 1 98 | MOV D,C 3CFD 2 NOP 1 99 | MOV D,A 3C 1 NOP 1 100 | MOV [U16],BL 3DFD 4 NOP 1 101 | MOV [U16],AL 3D 3 NOP 1 102 | MOV [D],BL 3EFD 2 NOP 1 103 | MOV [D],AL 3E 1 NOP 1 104 | MOV [D+ I16],BL 3FFD 4 NOP 1 105 | MOV [D+ I16],AL 3F 3 NOP 1 106 | 107 | MOV [SP+I16],AL 40FD 4 NOP 1 108 | MOV [BP+I16],AL 40 3 NOP 1 109 | MOV [SP+D],AL 41FD 2 NOP 1 110 | MOV [BP+D],AL 41 1 NOP 1 111 | MOV [U16],B 42FD 4 NOP 1 112 | MOV [U16],A 42 3 NOP 1 113 | MOV [D],B 43FD 2 NOP 1 114 | MOV [D],A 43 1 NOP 1 115 | MOV [D+I16],B 44FD 4 NOP 1 116 | MOV [D+I16],A 44 3 NOP 1 117 | MOV [SP+I16],A 45FD 4 NOP 1 118 | MOV [BP+I16],A 45 3 NOP 1 119 | MOV [SP+D],A 46FD 2 NOP 1 120 | MOV [BP+D],A 46 1 NOP 1 121 | MOV SP,U16 47FD 4 NOP 1 122 | MOV SP,A 47 1 NOP 1 123 | MOV A,SP 48 1 NOP 1 124 | MOV BP,U16 49FD 4 NOP 1 125 | MOV BP,A 49 1 NOP 1 126 | CMC "" 4AFD 2 NOP 1 127 | MOV A,BP 4A 1 NOP 1 128 | PUSHA "" 4B 1 NOP 1 129 | POPA "" 4C 1 NOP 1 130 | MOV SI,U16 4DFD 4 NOP 1 131 | MOV SI,A 4D 1 NOP 1 132 | MOV SI,D 4EFD 2 NOP 1 133 | MOV A,SI 4E 1 NOP 1 134 | MOV DI,U16 4FFD 4 NOP 1 135 | MOV DI,A 4F 1 NOP 1 136 | 137 | MOV DI,D 50FD 2 NOP 1 138 | MOV A,DI 50 1 NOP 1 139 | INC SP 51FD 2 NOP 1 140 | ADD SP,I16 51 3 NOP 1 141 | DEC SP 52FD 2 NOP 1 142 | SUB SP,I16 52 3 NOP 1 143 | STC "" 53FD 2 NOP 1 144 | ADD A,I16 53 3 NOP 1 145 | CLC "" 54FD 2 NOP 1 146 | ADD A,B 54 1 NOP 1 147 | ADD A,C 55FD 2 NOP 1 148 | ADD B,I16 55 3 NOP 1 149 | ADD A,D 56FD 2 NOP 1 150 | ADD B,A 56 1 NOP 1 151 | ADD B,C 57FD 2 NOP 1 152 | ADD C,I16 57 3 NOP 1 153 | ADD B,D 58FD 2 NOP 1 154 | ADD D,I16 58 3 NOP 1 155 | ADD C,A 59FD 2 NOP 1 156 | ADD D,A 59 1 NOP 1 157 | ADD C,B 5AFD 2 NOP 1 158 | ADD D,B 5A 1 NOP 1 159 | ADD C,D 5BFD 2 NOP 1 160 | ADC A,I16 5B 3 NOP 1 161 | ADD D,C 5CFD 2 NOP 1 162 | ADC A,B 5C 1 NOP 1 163 | SUB A,C 5DFD 2 NOP 1 164 | ADC B,I16 5D 3 NOP 1 165 | SUB A,D 5EFD 2 NOP 1 166 | ADC C,I16 5E 3 NOP 1 167 | SUB B,A 5FFD 2 NOP 1 168 | SUB A,I16 5F 3 NOP 1 169 | 170 | SUB B,C 60FD 2 NOP 1 171 | SUB A,B 60 1 NOP 1 172 | SUB B,D 61FD 2 NOP 1 173 | SUB B,I16 61 3 NOP 1 174 | SUB C,A 62FD 2 NOP 1 175 | SUB C,I16 62 3 NOP 1 176 | SUB C,B 63FD 2 NOP 1 177 | SUB D,I16 63 3 NOP 1 178 | SUB C,D 64FD 2 NOP 1 179 | SUB D,A 64 1 NOP 1 180 | SUB D,C 65FD 2 NOP 1 181 | SUB D,B 65 1 NOP 1 182 | ADD AL,AH 66FD 2 NOP 1 183 | SBB A,I16 66 3 NOP 1 184 | ADD AL,BH 67FD 2 NOP 1 185 | SBB A,B 67 1 NOP 1 186 | ADD AL,CL 68FD 2 NOP 1 187 | SBB B,I16 68 3 NOP 1 188 | ADD AL,CH 69FD 2 NOP 1 189 | SBB C,I16 69 3 NOP 1 190 | ADD AL,DL 6AFD 2 NOP 1 191 | ADD AL,I8 6A 2 NOP 1 192 | ADD AL,DH 6BFD 2 NOP 1 193 | ADD AL,BL 6B 1 NOP 1 194 | ADD BL,AL 6CFD 2 NOP 1 195 | ADD BL,I8 6C 2 NOP 1 196 | ADD BL,AH 6DFD 2 NOP 1 197 | ADD CL,I8 6D 2 NOP 1 198 | ADD CL,AL 6EFD 2 NOP 1 199 | ADD CH,I8 6E 2 NOP 1 200 | ADD CL,AH 6FFD 2 NOP 1 201 | SUB AL,I8 6F 2 NOP 1 202 | 203 | SUB AL,BL 70 1 NOP 1 204 | SUB CL,I8 71 2 NOP 1 205 | SUB CH,I8 72 2 NOP 1 206 | DEC AH 73 1 NOP 1 207 | MOV D,B 74 1 NOP 1 208 | INC AH 75 1 NOP 1 209 | CMP AH,I8 76 2 NOP 1 210 | INC B 77FD 2 NOP 1 211 | INC A 77 1 NOP 1 212 | MOV G,A 78FD 2 NOP 1 213 | INC C 78 1 NOP 1 214 | MOV G,B 79FD 2 NOP 1 215 | INC D 79 1 NOP 1 216 | MOV G,C 7AFD 2 NOP 1 217 | INC AL 7A 1 NOP 1 218 | MOV G,D 7BFD 2 NOP 1 219 | INC CL 7B 1 NOP 1 220 | MOV G,SI 7CFD 2 NOP 1 221 | INC CH 7C 1 NOP 1 222 | DEC B 7DFD 2 NOP 1 223 | DEC A 7D 1 NOP 1 224 | MOV G,DI 7EFD 2 NOP 1 225 | DEC C 7E 1 NOP 1 226 | DEC D 7F 1 NOP 1 227 | 228 | DEC AL 80 1 NOP 1 229 | DEC CL 81 1 NOP 1 230 | DEC CH 82 1 NOP 1 231 | MOV CL,GH 83FD 2 NOP 1 232 | MOV CL,AL 83 1 NOP 1 233 | NAND AL,U8 84FD 3 NOP 1 234 | MOV AL,CL 84 1 NOP 1 235 | NAND A,U16 85FD 4 NOP 1 236 | AND A,U16 85 3 NOP 1 237 | NAND A,B 86FD 2 NOP 1 238 | AND A,B 86 1 NOP 1 239 | AND BL,U8 87FD 3 NOP 1 240 | AND AL,U8 87 2 NOP 1 241 | NAND AL,BL 88FD 2 NOP 1 242 | AND AL,BL 88 1 NOP 1 243 | NOR A,U16 89FD 4 NOP 1 244 | OR A,U16 89 3 NOP 1 245 | NOR A,B 8AFD 2 NOP 1 246 | OR A,B 8A 1 NOP 1 247 | OR BL,U8 8BFD 3 NOP 1 248 | OR AL,U8 8B 2 NOP 1 249 | NOR AL,BL 8CFD 2 NOP 1 250 | OR AL,BL 8C 1 NOP 1 251 | NOR AL,U8 8DFD 3 NOP 1 252 | XOR A,U16 8D 3 NOP 1 253 | ASHR B,CL 8EFD 2 NOP 1 254 | XOR A,B 8E 1 NOP 1 255 | ASHR BL,CL 8FFD 2 NOP 1 256 | XOR AL,U8 8F 2 NOP 1 257 | 258 | ASHR B,U8 90FD 3 NOP 1 259 | XOR AL,BL 90 1 NOP 1 260 | ASHR BL,U8 91FD 3 NOP 1 261 | TEST A,U16 91 3 NOP 1 262 | TEST A,B 92 1 NOP 1 263 | TEST BL,U8 93FD 3 NOP 1 264 | TEST AL,U8 93 2 NOP 1 265 | TEST CL,U8 94FD 3 NOP 1 266 | TEST AL,BL 94 1 NOP 1 267 | NEG A 95FD 2 NOP 1 268 | NOT A 95 1 NOP 1 269 | NEG AL 96FD 2 NOP 1 270 | NOT AL 96 1 NOP 1 271 | NEG B 97FD 2 NOP 1 272 | NOT B 97 1 NOP 1 273 | NEG BL 98FD 2 NOP 1 274 | NOT BL 98 1 NOP 1 275 | SHL A 99FD 2 NOP 1 276 | MOV BL,AH 99 1 NOP 1 277 | SHL AL 9AFD 2 NOP 1 278 | MOV BH,AH 9A 1 NOP 1 279 | SHR A 9BFD 2 NOP 1 280 | MOV BP,SP 9B 1 NOP 1 281 | SHR AL 9CFD 2 NOP 1 282 | MOV SP,BP 9C 1 NOP 1 283 | SHL A,U8 9DFD 3 NOP 1 284 | SHL A,CL 9D 1 NOP 1 285 | SHL AL,U8 9EFD 3 NOP 1 286 | SHL AL,CL 9E 1 NOP 1 287 | SHL B,U8 9FFD 3 NOP 1 288 | SHL B,CL 9F 1 NOP 1 289 | 290 | SHL BL,U8 A0FD 3 NOP 1 291 | SHL BL,CL A0 1 NOP 1 292 | SHR A,U8 A1FD 3 NOP 1 293 | SHR A,CL A1 1 NOP 1 294 | SHR AL,U8 A2FD 3 NOP 1 295 | SHR AL,CL A2 1 NOP 1 296 | SHR B,U8 A3FD 3 NOP 1 297 | SHR B,CL A3 1 NOP 1 298 | SHR BL,U8 A4FD 3 NOP 1 299 | SHR BL,CL A4 1 NOP 1 300 | ASHR A,U8 A5FD 3 NOP 1 301 | ASHR A,CL A5 1 NOP 1 302 | ASHR AL,U8 A6FD 3 NOP 1 303 | ASHR AL,CL A6 1 NOP 1 304 | MOV BH,U8 A7 2 NOP 1 305 | MOV AL,CH A8 1 NOP 1 306 | LOOPB U16 A9FD 4 NOP 1 307 | LOOPC U16 A9 3 NOP 1 308 | SWP A AAFD 2 NOP 1 309 | SNEX A AA 1 NOP 1 310 | SWP B ABFD 2 NOP 1 311 | SNEX B AB 1 NOP 1 312 | MUL A,C ACFD 2 NOP 1 313 | MUL A,B AC 1 NOP 1 314 | MUL AL,BL AD 1 NOP 1 315 | DIV A,B AE 1 NOP 1 316 | CMP A,I16 AF 3 NOP 1 317 | 318 | CMP A,B B0 1 NOP 1 319 | CMP A,C B1 1 NOP 1 320 | CMP A,D B2 1 NOP 1 321 | CMP WORD[U16],U16 B3 5 NOP 1 322 | CMP WORD[D],U16 B4 3 NOP 1 323 | CMP WORD[D+I16],U16 B5 5 NOP 1 324 | CMP WORD[SP+I16],U16 B6FD 6 NOP 1 325 | CMP WORD[BP+I16],U16 B6 5 NOP 1 326 | MOV A,[A+I16] B7 3 NOP 1 327 | MOV WORD[U16],U16 B8 5 NOP 1 328 | CMP AL,I8 B9 2 NOP 1 329 | CMP AL,BL BA 1 NOP 1 330 | CMP AL,CL BB 1 NOP 1 331 | CMP BYTE[U16],U8 BC 4 NOP 1 332 | CMP BYTE[D],U8 BD 2 NOP 1 333 | CMP BYTE[D+I16],U8 BE 4 NOP 1 334 | CMP BYTE[SP+I16],U8 BFFD 5 NOP 1 335 | CMP BYTE[BP+I16],U8 BF 4 NOP 1 336 | 337 | CMP B,C C0FD 2 NOP 1 338 | CMP B,I16 C0 3 NOP 1 339 | CMP BL,I8 C1 2 NOP 1 340 | CMP C,I16 C2 3 NOP 1 341 | ADD BYTE [U16],I8 C3FD 5 NOP 1 342 | CMP CL,I8 C3 2 NOP 1 343 | ADD BYTE [D],I8 C4FD 3 NOP 1 344 | CMP CH,I8 C4 2 NOP 1 345 | ADD BYTE [D+I16],I8 C5FD 5 NOP 1 346 | CMP D,I16 C5 3 NOP 1 347 | ADD BYTE [BP+I16],I8 C6FD 5 NOP 1 348 | JZ U16 C6 3 NOP 1 349 | ADD BYTE [SP+I16],I8 C7FD 5 NOP 1 350 | JNZ U16 C7 3 NOP 1 351 | ADD WORD [U16],I16 C8FD 6 NOP 1 352 | JC u16 C8 3 NOP 1 353 | JLU u16 C8 3 NOP 1 354 | ADD WORD [D],I16 C9FD 4 NOP 1 355 | JNC u16 C9 3 NOP 1 356 | JGEU u16 C9 3 NOP 1 357 | ADD WORD [D+I16],I16 CAFD 6 NOP 1 358 | JNEG U16 CA 3 NOP 1 359 | ADD WORD [BP+I16],I16 CBFD 6 NOP 1 360 | JPOS U16 CB 3 NOP 1 361 | ADD WORD [SP+I16],I16 CCFD 6 NOP 1 362 | JL U16 CC 3 NOP 1 363 | SUB BYTE [U16],I8 CDFD 5 NOP 1 364 | JLE U16 CD 3 NOP 1 365 | SUB BYTE [D],I8 CEFD 3 NOP 1 366 | JG U16 CE 3 NOP 1 367 | SUB BYTE [D+I16],I8 CFFD 5 NOP 1 368 | JGE U16 CF 3 NOP 1 369 | 370 | SUB BYTE [BP+I16],I8 D0FD 5 NOP 1 371 | JLEU U16 D0 3 NOP 1 372 | SUB BYTE [SP+I16],I8 D1FD 5 NOP 1 373 | JGU U16 D1 3 NOP 1 374 | SUB WORD [U16],I16 D2FD 6 NOP 1 375 | PUSH BP D2 1 NOP 1 376 | SUB WORD [D],I16 D3FD 4 NOP 1 377 | ADD SI,I16 D3 3 NOP 1 378 | SUB WORD [D+I16],I16 D4FD 6 NOP 1 379 | ADD DI,I16 D4 3 NOP 1 380 | SUB WORD [BP+I16],I16 D5FD 6 NOP 1 381 | SUB SI,I16 D5 3 NOP 1 382 | SUB WORD [SP+I16],I16 D6FD 6 NOP 1 383 | SUB DI,I16 D6 3 NOP 1 384 | PUSH WORD U16 D7FD 4 NOP 1 385 | PUSH A D7 1 NOP 1 386 | PUSH G D8FD 2 NOP 1 387 | PUSH B D8 1 NOP 1 388 | PUSH C D9 1 NOP 1 389 | PUSH D DA 1 NOP 1 390 | PUSH BYTE U8 DBFD 3 NOP 1 391 | PUSH AL DB 1 NOP 1 392 | PUSH AH DC 1 NOP 1 393 | PUSH BL DD 1 NOP 1 394 | ROL A,CL DEFD 2 NOP 1 395 | PUSH BH DE 1 NOP 1 396 | ROL AL,CL DFFD 2 NOP 1 397 | PUSH CL DF 1 NOP 1 398 | 399 | RLC A,CL E0FD 2 NOP 1 400 | PUSH CH E0 1 NOP 1 401 | RLC AL,CL E1FD 2 NOP 1 402 | PUSHF E1 1 NOP 1 403 | ROR A,CL E2FD 2 NOP 1 404 | PUSH SI E2 1 NOP 1 405 | ROR AL,CL E3FD 2 NOP 1 406 | PUSH DI E3 1 NOP 1 407 | RRC A,CL E4FD 2 NOP 1 408 | POP A E4 1 NOP 1 409 | RRC AL,CL E5FD 2 NOP 1 410 | POP B E5 1 NOP 1 411 | ROL B,CL E6FD 2 NOP 1 412 | POP C E6 1 NOP 1 413 | ROL BL,CL E7FD 2 NOP 1 414 | POP D E7 1 NOP 1 415 | RLC B,CL E8FD 2 NOP 1 416 | POP AL E8 1 NOP 1 417 | RLC BL,CL E9FD 2 NOP 1 418 | POP AH E9 1 NOP 1 419 | ROR B,CL EAFD 2 NOP 1 420 | POP BL EA 1 NOP 1 421 | ROR BL,CL EBFD 2 NOP 1 422 | POP BH EB 1 NOP 1 423 | RRC B,CL ECFD 2 NOP 1 424 | POP CL EC 1 NOP 1 425 | RRC BL,CL EDFD 2 NOP 1 426 | POP CH ED 1 NOP 1 427 | POPF "" EE 1 NOP 1 428 | POP SI EF 1 NOP 1 429 | 430 | POP DI F0 1 NOP 1 431 | POP G F1FD 2 NOP 1 432 | POP BP F1 1 NOP 1 433 | MOV BYTE[U16],U8 F2 4 NOP 1 434 | REPZ cmpsb "" F3FD 2 NOP 1 435 | REPE cmpsb "" F3FD 2 NOP 1 436 | CMPSB "" F3 1 NOP 1 437 | SCANSB "" F4 1 NOP 1 438 | REP MOVSB "" F5FD 2 NOP 1 439 | MOVSB "" F5 1 NOP 1 440 | REPNZ cmpsb "" F6FD 2 NOP 1 441 | REPNZ cmpsb "" F6FD 2 NOP 1 442 | LODSB "" F6 1 NOP 1 443 | REP STOSB "" F7FD 2 NOP 1 444 | STOSB "" F7 1 NOP 1 445 | LEA D,[BP+A*2^U8+B] F8FD 3 NOP 1 446 | ENTER U16 F8 3 NOP 1 447 | LEA D,[U16+A*2^U8+B] F9FD 5 NOP 1 448 | LEAVE "" F9 1 NOP 1 449 | LEA D,[SP+U16] FAFD 4 NOP 1 450 | LEA D,[BP+U16] FA 3 NOP 1 451 | LEA D,[SI+U16] FB 3 NOP 1 452 | LEA D,[DI+U16] FC 3 NOP 1 453 | ESC U8 FD 2 NOP 1 454 | NOP "" FE 1 NOP 1 455 | HALT "" FF 1 NOP 1 456 | -------------------------------------------------------------------------------- /data.dsk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abaffa/cpm_disk_manager/f9bb1e17a43f62f4134308495a4a4826b3c05603/data.dsk -------------------------------------------------------------------------------- /tasm80.tab: -------------------------------------------------------------------------------- 1 | "TASM Z80 Assembler. " 2 | .ALTWILD 3 | 4 | ADC A,(HL) 8E 1 NOP 1 5 | ADC A,(IX*) 8EDD 3 ZIX 1 6 | ADC A,(IY*) 8EFD 3 ZIX 1 7 | ADC A,A 8F 1 NOP 1 8 | ADC A,B 88 1 NOP 1 9 | ADC A,C 89 1 NOP 1 10 | ADC A,D 8A 1 NOP 1 11 | ADC A,E 8B 1 NOP 1 12 | ADC A,H 8C 1 NOP 1 13 | ADC A,L 8D 1 NOP 1 14 | ADC A,* CE 2 NOP 1 15 | ADC HL,BC 4AED 2 NOP 1 16 | ADC HL,DE 5AED 2 NOP 1 17 | ADC HL,HL 6AED 2 NOP 1 18 | ADC HL,SP 7AED 2 NOP 1 19 | 20 | ADD A,(HL) 86 1 NOP 1 21 | ADD A,(IX*) 86DD 3 ZIX 1 22 | ADD A,(IY*) 86FD 3 ZIX 1 23 | ADD A,A 87 1 NOP 1 24 | ADD A,B 80 1 NOP 1 25 | ADD A,C 81 1 NOP 1 26 | ADD A,D 82 1 NOP 1 27 | ADD A,E 83 1 NOP 1 28 | ADD A,H 84 1 NOP 1 29 | ADD A,L 85 1 NOP 1 30 | ADD A,* C6 2 NOP 1 31 | ADD HL,BC 9 1 NOP 1 32 | ADD HL,DE 19 1 NOP 1 33 | ADD HL,HL 29 1 NOP 1 34 | ADD HL,SP 39 1 NOP 1 35 | ADD IX,BC 09DD 2 NOP 1 36 | ADD IX,DE 19DD 2 NOP 1 37 | ADD IX,IX 29DD 2 NOP 1 38 | ADD IX,SP 39DD 2 NOP 1 39 | ADD IY,BC 09FD 2 NOP 1 40 | ADD IY,DE 19FD 2 NOP 1 41 | ADD IY,IY 29FD 2 NOP 1 42 | ADD IY,SP 39FD 2 NOP 1 43 | 44 | AND (HL) A6 1 NOP 1 45 | AND (IX*) A6DD 3 ZIX 1 46 | AND (IY*) A6FD 3 ZIX 1 47 | AND A A7 1 NOP 1 48 | AND B A0 1 NOP 1 49 | AND C A1 1 NOP 1 50 | AND D A2 1 NOP 1 51 | AND E A3 1 NOP 1 52 | AND H A4 1 NOP 1 53 | AND L A5 1 NOP 1 54 | AND * E6 2 NOP 1 55 | 56 | BIT *,(HL) 46CB 2 ZBI T 1 57 | BIT *,(IX*) CBDD 4 ZBI T 1 0 4600 58 | BIT *,(IY*) CBFD 4 ZBI T 1 0 4600 59 | BIT *,A 47CB 2 ZBI T 1 60 | BIT *,B 40CB 2 ZBI T 1 61 | BIT *,C 41CB 2 ZBI T 1 62 | BIT *,D 42CB 2 ZBI T 1 63 | BIT *,E 43CB 2 ZBI T 1 64 | BIT *,H 44CB 2 ZBI T 1 65 | BIT *,L 45CB 2 ZBI T 1 66 | 67 | CALL C,* DC 3 NOP 1 68 | CALL M,* FC 3 NOP 1 69 | CALL NC,* D4 3 NOP 1 70 | CALL NZ,* C4 3 NOP 1 71 | CALL P,* F4 3 NOP 1 72 | CALL PE,* EC 3 NOP 1 73 | CALL PO,* E4 3 NOP 1 74 | CALL Z,* CC 3 NOP 1 75 | CALL * CD 3 NOP 1 76 | 77 | CCF "" 3F 1 NOP 1 78 | 79 | CP (HL) BE 1 NOP 1 80 | CP (IX*) BEDD 3 ZIX 1 81 | CP (IY*) BEFD 3 ZIX 1 82 | CP A BF 1 NOP 1 83 | CP B B8 1 NOP 1 84 | CP C B9 1 NOP 1 85 | CP D BA 1 NOP 1 86 | CP E BB 1 NOP 1 87 | CP H BC 1 NOP 1 88 | CP L BD 1 NOP 1 89 | CP * FE 2 NOP 1 90 | CPD "" A9ED 2 NOP 1 91 | CPDR "" B9ED 2 NOP 1 92 | CPIR "" B1ED 2 NOP 1 93 | CPI "" A1ED 2 NOP 1 94 | CPL "" 2F 1 NOP 1 95 | 96 | DAA "" 27 1 NOP 1 97 | 98 | DEC (HL) 35 1 NOP 1 99 | DEC (IX*) 35DD 3 ZIX 1 100 | DEC (IY*) 35FD 3 ZIX 1 101 | DEC A 3D 1 NOP 1 102 | DEC B 5 1 NOP 1 103 | DEC BC 0B 1 NOP 1 104 | DEC C 0D 1 NOP 1 105 | DEC D 15 1 NOP 1 106 | DEC DE 1B 1 NOP 1 107 | DEC E 1D 1 NOP 1 108 | DEC H 25 1 NOP 1 109 | DEC HL 2B 1 NOP 1 110 | DEC IX 2BDD 2 NOP 1 111 | DEC IY 2BFD 2 NOP 1 112 | DEC L 2D 1 NOP 1 113 | DEC SP 3B 1 NOP 1 114 | DI "" F3 1 NOP 1 115 | DJNZ * 10 2 R1 1 116 | 117 | EI "" FB 1 NOP 1 118 | EX (SP),HL E3 1 NOP 1 119 | EX (SP),IX E3DD 2 NOP 1 120 | EX (SP),IY E3FD 2 NOP 1 121 | EX AF,AF' 8 1 NOP 1 122 | EX DE,HL EB 1 NOP 1 123 | EXX "" D9 1 NOP 1 124 | HALT "" 76 1 NOP 1 125 | 126 | IM 0 46ED 2 NOP 1 127 | IM 1 56ED 2 NOP 1 128 | IM 2 5EED 2 NOP 1 129 | 130 | IN A,(C) 78ED 2 NOP 1 131 | IN B,(C) 40ED 2 NOP 1 132 | IN C,(C) 48ED 2 NOP 1 133 | IN D,(C) 50ED 2 NOP 1 134 | IN E,(C) 58ED 2 NOP 1 135 | IN H,(C) 60ED 2 NOP 1 136 | IN L,(C) 68ED 2 NOP 1 137 | 138 | IN A,(*) DB 2 NOP 1 139 | 140 | IN0 A,(*) 38ED 3 NOP 2 141 | IN0 B,(*) 00ED 3 NOP 2 142 | IN0 C,(*) 08ED 3 NOP 2 143 | IN0 D,(*) 10ED 3 NOP 2 144 | IN0 E,(*) 18ED 3 NOP 2 145 | IN0 H,(*) 20ED 3 NOP 2 146 | IN0 L,(*) 28ED 3 NOP 2 147 | 148 | INC (HL) 34 1 NOP 1 149 | INC (IX*) 34DD 3 ZIX 1 150 | INC (IY*) 34FD 3 ZIX 1 151 | INC A 3C 1 NOP 1 152 | INC B 4 1 NOP 1 153 | INC BC 3 1 NOP 1 154 | INC C 0C 1 NOP 1 155 | INC D 14 1 NOP 1 156 | INC DE 13 1 NOP 1 157 | INC E 1C 1 NOP 1 158 | INC H 24 1 NOP 1 159 | INC HL 23 1 NOP 1 160 | INC IX 23DD 2 NOP 1 161 | INC IY 23FD 2 NOP 1 162 | INC L 2C 1 NOP 1 163 | INC SP 33 1 NOP 1 164 | 165 | 166 | IND "" AAED 2 NOP 1 167 | INDR "" BAED 2 NOP 1 168 | INI "" A2ED 2 NOP 1 169 | INIR "" B2ED 2 NOP 1 170 | 171 | JP (HL) E9 1 NOP 1 172 | JP (IX) E9DD 2 NOP 1 173 | JP (IY) E9FD 2 NOP 1 174 | JP C,* DA 3 NOP 1 175 | JP M,* FA 3 NOP 1 176 | JP NC,* D2 3 NOP 1 177 | JP NZ,* C2 3 NOP 1 178 | JP P,* F2 3 NOP 1 179 | JP PE,* EA 3 NOP 1 180 | JP PO,* E2 3 NOP 1 181 | JP Z,* CA 3 NOP 1 182 | JP * C3 3 NOP 1 183 | 184 | JR C,* 38 2 R1 1 185 | JR NC,* 30 2 R1 1 186 | JR NZ,* 20 2 R1 1 187 | JR Z,* 28 2 R1 1 188 | JR * 18 2 R1 1 189 | 190 | LD (BC),A 2 1 NOP 1 191 | LD (DE),A 12 1 NOP 1 192 | LD (HL),A 77 1 NOP 1 193 | LD (HL),B 70 1 NOP 1 194 | LD (HL),C 71 1 NOP 1 195 | LD (HL),D 72 1 NOP 1 196 | LD (HL),E 73 1 NOP 1 197 | LD (HL),H 74 1 NOP 1 198 | LD (HL),L 75 1 NOP 1 199 | LD (HL),* 36 2 NOP 1 200 | LD (IX*),A 77DD 3 ZIX 1 201 | LD (IX*),B 70DD 3 ZIX 1 202 | LD (IX*),C 71DD 3 ZIX 1 203 | LD (IX*),D 72DD 3 ZIX 1 204 | LD (IX*),E 73DD 3 ZIX 1 205 | LD (IX*),H 74DD 3 ZIX 1 206 | LD (IX*),L 75DD 3 ZIX 1 207 | LD (IX*),* 36DD 4 ZIX 1 208 | LD (IY*),A 77FD 3 ZIX 1 209 | LD (IY*),B 70FD 3 ZIX 1 210 | LD (IY*),C 71FD 3 ZIX 1 211 | LD (IY*),D 72FD 3 ZIX 1 212 | LD (IY*),E 73FD 3 ZIX 1 213 | LD (IY*),H 74FD 3 ZIX 1 214 | LD (IY*),L 75FD 3 ZIX 1 215 | LD (IY*),* 36FD 4 ZIX 1 216 | LD (*),A 32 3 NOP 1 217 | LD (*),BC 43ED 4 NOP 1 218 | LD (*),DE 53ED 4 NOP 1 219 | LD (*),HL 22 3 NOP 1 220 | LD (*),IX 22DD 4 NOP 1 221 | LD (*),IY 22FD 4 NOP 1 222 | LD (*),SP 73ED 4 NOP 1 223 | LD A,(BC) 0A 1 NOP 1 224 | LD A,(DE) 1A 1 NOP 1 225 | LD A,(HL) 7E 1 NOP 1 226 | LD A,(IX*) 7EDD 3 ZIX 1 227 | LD A,(IY*) 7EFD 3 ZIX 1 228 | LD A,A 7F 1 NOP 1 229 | LD A,B 78 1 NOP 1 230 | LD A,C 79 1 NOP 1 231 | LD A,D 7A 1 NOP 1 232 | LD A,E 7B 1 NOP 1 233 | LD A,H 7C 1 NOP 1 234 | LD A,I 57ED 2 NOP 1 235 | LD A,L 7D 1 NOP 1 236 | LD A,R 5FED 2 NOP 1 237 | LD A,(*) 3A 3 NOP 1 238 | LD A,* 3E 2 NOP 1 239 | LD B,(HL) 46 1 NOP 1 240 | LD B,(IX*) 46DD 3 ZIX 1 241 | LD B,(IY*) 46FD 3 ZIX 1 242 | LD B,A 47 1 NOP 1 243 | LD B,B 40 1 NOP 1 244 | LD B,C 41 1 NOP 1 245 | LD B,D 42 1 NOP 1 246 | LD B,E 43 1 NOP 1 247 | LD B,H 44 1 NOP 1 248 | LD B,L 45 1 NOP 1 249 | LD B,* 6 2 NOP 1 250 | LD BC,(*) 4BED 4 NOP 1 251 | LD BC,* 1 3 NOP 1 252 | LD C,(HL) 4E 1 NOP 1 253 | LD C,(IX*) 4EDD 3 ZIX 1 254 | LD C,(IY*) 4EFD 3 ZIX 1 255 | LD C,A 4F 1 NOP 1 256 | LD C,B 48 1 NOP 1 257 | LD C,C 49 1 NOP 1 258 | LD C,D 4A 1 NOP 1 259 | LD C,E 4B 1 NOP 1 260 | LD C,H 4C 1 NOP 1 261 | LD C,L 4D 1 NOP 1 262 | LD C,* 0E 2 NOP 1 263 | LD D,(HL) 56 1 NOP 1 264 | LD D,(IX*) 56DD 3 ZIX 1 265 | LD D,(IY*) 56FD 3 ZIX 1 266 | LD D,A 57 1 NOP 1 267 | LD D,B 50 1 NOP 1 268 | LD D,C 51 1 NOP 1 269 | LD D,D 52 1 NOP 1 270 | LD D,E 53 1 NOP 1 271 | LD D,H 54 1 NOP 1 272 | LD D,L 55 1 NOP 1 273 | LD D,* 16 2 NOP 1 274 | LD DE,(*) 5BED 4 NOP 1 275 | LD DE,* 11 3 NOP 1 276 | LD E,(HL) 5E 1 NOP 1 277 | LD E,(IX*) 5EDD 3 ZIX 1 278 | LD E,(IY*) 5EFD 3 ZIX 1 279 | LD E,A 5F 1 NOP 1 280 | LD E,B 58 1 NOP 1 281 | LD E,C 59 1 NOP 1 282 | LD E,D 5A 1 NOP 1 283 | LD E,E 5B 1 NOP 1 284 | LD E,H 5C 1 NOP 1 285 | LD E,L 5D 1 NOP 1 286 | LD E,* 1E 2 NOP 1 287 | LD H,(HL) 66 1 NOP 1 288 | LD H,(IX*) 66DD 3 ZIX 1 289 | LD H,(IY*) 66FD 3 ZIX 1 290 | LD H,A 67 1 NOP 1 291 | LD H,B 60 1 NOP 1 292 | LD H,C 61 1 NOP 1 293 | LD H,D 62 1 NOP 1 294 | LD H,E 63 1 NOP 1 295 | LD H,H 64 1 NOP 1 296 | LD H,L 65 1 NOP 1 297 | LD H,* 26 2 NOP 1 298 | LD HL,(*) 2A 3 NOP 1 299 | LD HL,* 21 3 NOP 1 300 | LD I,A 47ED 2 NOP 1 301 | LD IX,(*) 2ADD 4 NOP 1 302 | LD IX,* 21DD 4 NOP 1 303 | LD IY,(*) 2AFD 4 NOP 1 304 | LD IY,* 21FD 4 NOP 1 305 | LD L,(HL) 6E 1 NOP 1 306 | LD L,(IX*) 6EDD 3 ZIX 1 307 | LD L,(IY*) 6EFD 3 ZIX 1 308 | LD L,A 6F 1 NOP 1 309 | LD L,B 68 1 NOP 1 310 | LD L,C 69 1 NOP 1 311 | LD L,D 6A 1 NOP 1 312 | LD L,E 6B 1 NOP 1 313 | LD L,H 6C 1 NOP 1 314 | LD L,L 6D 1 NOP 1 315 | LD L,* 2E 2 NOP 1 316 | LD R,A 4FED 2 NOP 1 317 | LD SP,(*) 7BED 4 NOP 1 318 | LD SP,HL F9 1 NOP 1 319 | LD SP,IX F9DD 2 NOP 1 320 | LD SP,IY F9FD 2 NOP 1 321 | LD SP,* 31 3 NOP 1 322 | LDD "" A8ED 2 NOP 1 323 | LDDR "" B8ED 2 NOP 1 324 | LDI "" A0ED 2 NOP 1 325 | LDIR "" B0ED 2 NOP 1 326 | NEG "" 44ED 2 NOP 1 327 | NOP "" 0 1 NOP 1 328 | 329 | MLT BC 4CED 2 NOP 2 330 | MLT DE 5CED 2 NOP 2 331 | MLT HL 6CED 2 NOP 2 332 | MLT SP 7CED 2 NOP 2 333 | 334 | OR (HL) B6 1 NOP 1 335 | OR (IX*) B6DD 3 ZIX 1 336 | OR (IY*) B6FD 3 ZIX 1 337 | OR A B7 1 NOP 1 338 | OR B B0 1 NOP 1 339 | OR C B1 1 NOP 1 340 | OR D B2 1 NOP 1 341 | OR E B3 1 NOP 1 342 | OR H B4 1 NOP 1 343 | OR L B5 1 NOP 1 344 | OR * F6 2 NOP 1 345 | 346 | OTDM "" 8BED 2 NOP 2 347 | OTDMR "" 9BED 2 NOP 2 348 | OTDR "" BBED 2 NOP 1 349 | OTIM "" 83ED 2 NOP 2 350 | OTIMR "" 93ED 2 NOP 2 351 | OTIR "" B3ED 2 NOP 1 352 | 353 | OUT (C),A 79ED 2 NOP 1 354 | OUT (C),B 41ED 2 NOP 1 355 | OUT (C),C 49ED 2 NOP 1 356 | OUT (C),D 51ED 2 NOP 1 357 | OUT (C),E 59ED 2 NOP 1 358 | OUT (C),H 61ED 2 NOP 1 359 | OUT (C),L 69ED 2 NOP 1 360 | OUT (*),A D3 2 NOP 1 361 | 362 | OUT0 (*),A 39ED 3 NOP 2 363 | OUT0 (*),B 01ED 3 NOP 2 364 | OUT0 (*),C 09ED 3 NOP 2 365 | OUT0 (*),D 11ED 3 NOP 2 366 | OUT0 (*),E 19ED 3 NOP 2 367 | OUT0 (*),H 21ED 3 NOP 2 368 | OUT0 (*),L 29ED 3 NOP 2 369 | 370 | OUTD "" ABED 2 NOP 1 371 | OUTI "" A3ED 2 NOP 1 372 | 373 | POP AF F1 1 NOP 1 374 | POP BC C1 1 NOP 1 375 | POP DE D1 1 NOP 1 376 | POP HL E1 1 NOP 1 377 | POP IX E1DD 2 NOP 1 378 | POP IY E1FD 2 NOP 1 379 | 380 | PUSH AF F5 1 NOP 1 381 | PUSH BC C5 1 NOP 1 382 | PUSH DE D5 1 NOP 1 383 | PUSH HL E5 1 NOP 1 384 | PUSH IX E5DD 2 NOP 1 385 | PUSH IY E5FD 2 NOP 1 386 | 387 | RES *,(HL) 86CB 2 ZBI T 1 388 | RES *,(IX*) CBDD 4 ZBI T 1 0 8600 389 | RES *,(IY*) CBFD 4 ZBI T 1 0 8600 390 | RES *,A 87CB 2 ZBI T 1 391 | RES *,B 80CB 2 ZBI T 1 392 | RES *,C 81CB 2 ZBI T 1 393 | RES *,D 82CB 2 ZBI T 1 394 | RES *,E 83CB 2 ZBI T 1 395 | RES *,H 84CB 2 ZBI T 1 396 | RES *,L 85CB 2 ZBI T 1 397 | 398 | RET "" C9 1 NOP 1 399 | RET C D8 1 NOP 1 400 | RET M F8 1 NOP 1 401 | RET NC D0 1 NOP 1 402 | RET NZ C0 1 NOP 1 403 | RET P F0 1 NOP 1 404 | RET PE E8 1 NOP 1 405 | RET PO E0 1 NOP 1 406 | RET Z C8 1 NOP 1 407 | RETI "" 4DED 2 NOP 1 408 | RETN "" 45ED 2 NOP 1 409 | 410 | RL (HL) 16CB 2 NOP 1 411 | RL (IX*) CBDD 4 ZIX 1 0 1600 412 | RL (IY*) CBFD 4 ZIX 1 0 1600 413 | RL A 17CB 2 NOP 1 414 | RL B 10CB 2 NOP 1 415 | RL C 11CB 2 NOP 1 416 | RL D 12CB 2 NOP 1 417 | RL E 13CB 2 NOP 1 418 | RL H 14CB 2 NOP 1 419 | RL L 15CB 2 NOP 1 420 | RLA "" 17 1 NOP 1 421 | 422 | RLC (HL) 06CB 2 NOP 1 423 | RLC (IX*) CBDD 4 ZIX 1 0 0600 424 | RLC (IY*) CBFD 4 ZIX 1 0 0600 425 | RLC A 07CB 2 NOP 1 426 | RLC B 00CB 2 NOP 1 427 | RLC C 01CB 2 NOP 1 428 | RLC D 02CB 2 NOP 1 429 | RLC E 03CB 2 NOP 1 430 | RLC H 04CB 2 NOP 1 431 | RLC L 05CB 2 NOP 1 432 | RLCA "" 7 1 NOP 1 433 | RLD "" 6FED 2 NOP 1 434 | 435 | RR (HL) 1ECB 2 NOP 1 436 | RR (IX*) CBDD 4 ZIX 1 0 1E00 437 | RR (IY*) CBFD 4 ZIX 1 0 1E00 438 | RR A 1FCB 2 NOP 1 439 | RR B 18CB 2 NOP 1 440 | RR C 19CB 2 NOP 1 441 | RR D 1ACB 2 NOP 1 442 | RR E 1BCB 2 NOP 1 443 | RR H 1CCB 2 NOP 1 444 | RR L 1DCB 2 NOP 1 445 | RRA "" 1F 1 NOP 1 446 | RRC (HL) 0ECB 2 NOP 1 447 | RRC (IX*) CBDD 4 ZIX 1 0 0E00 448 | RRC (IY*) CBFD 4 ZIX 1 0 0E00 449 | RRC A 0FCB 2 NOP 1 450 | RRC B 08CB 2 NOP 1 451 | RRC C 09CB 2 NOP 1 452 | RRC D 0ACB 2 NOP 1 453 | RRC E 0BCB 2 NOP 1 454 | RRC H 0CCB 2 NOP 1 455 | RRC L 0DCB 2 NOP 1 456 | RRCA "" 0F 1 NOP 1 457 | RRD "" 67ED 2 NOP 1 458 | 459 | RST 00H C7 1 NOP 1 460 | RST 08H CF 1 NOP 1 461 | RST 10H D7 1 NOP 1 462 | RST 18H DF 1 NOP 1 463 | RST 20H E7 1 NOP 1 464 | RST 28H EF 1 NOP 1 465 | RST 30H F7 1 NOP 1 466 | RST 38H FF 1 NOP 1 467 | 468 | SBC A,(HL) 9E 1 NOP 1 469 | SBC A,(IX*) 9EDD 3 ZIX 1 470 | SBC A,(IY*) 9EFD 3 ZIX 1 471 | SBC A,A 9F 1 NOP 1 472 | SBC A,B 98 1 NOP 1 473 | SBC A,C 99 1 NOP 1 474 | SBC A,D 9A 1 NOP 1 475 | SBC A,E 9B 1 NOP 1 476 | SBC A,H 9C 1 NOP 1 477 | SBC A,L 9D 1 NOP 1 478 | SBC HL,BC 42ED 2 NOP 1 479 | SBC HL,DE 52ED 2 NOP 1 480 | SBC HL,HL 62ED 2 NOP 1 481 | SBC HL,SP 72ED 2 NOP 1 482 | SBC A,* DE 2 NOP 1 483 | SCF "" 37 1 NOP 1 484 | 485 | SET *,(HL) C6CB 2 ZBI T 1 486 | SET *,(IX*) CBDD 4 ZBI T 1 0 C600 487 | SET *,(IY*) CBFD 4 ZBI T 1 0 C600 488 | SET *,A C7CB 2 ZBI T 1 489 | SET *,B C0CB 2 ZBI T 1 490 | SET *,C C1CB 2 ZBI T 1 491 | SET *,D C2CB 2 ZBI T 1 492 | SET *,E C3CB 2 ZBI T 1 493 | SET *,H C4CB 2 ZBI T 1 494 | SET *,L C5CB 2 ZBI T 1 495 | 496 | SLA (HL) 26CB 2 NOP 1 497 | SLA (IX*) CBDD 4 ZIX 1 0 2600 498 | SLA (IY*) CBFD 4 ZIX 1 0 2600 499 | SLA A 27CB 2 NOP 1 500 | SLA B 20CB 2 NOP 1 501 | SLA C 21CB 2 NOP 1 502 | SLA D 22CB 2 NOP 1 503 | SLA E 23CB 2 NOP 1 504 | SLA H 24CB 2 NOP 1 505 | SLA L 25CB 2 NOP 1 506 | 507 | SLP "" 76ED 2 NOP 2 508 | 509 | SRA (HL) 2ECB 2 NOP 1 510 | SRA (IX*) CBDD 4 ZIX 1 0 2E00 511 | SRA (IY*) CBFD 4 ZIX 1 0 2E00 512 | SRA A 2FCB 2 NOP 1 513 | SRA B 28CB 2 NOP 1 514 | SRA C 29CB 2 NOP 1 515 | SRA D 2ACB 2 NOP 1 516 | SRA E 2BCB 2 NOP 1 517 | SRA H 2CCB 2 NOP 1 518 | SRA L 2DCB 2 NOP 1 519 | 520 | SRL (HL) 3ECB 2 NOP 1 521 | SRL (IX*) CBDD 4 ZIX 1 0 3E00 522 | SRL (IY*) CBFD 4 ZIX 1 0 3E00 523 | SRL A 3FCB 2 NOP 1 524 | SRL B 38CB 2 NOP 1 525 | SRL C 39CB 2 NOP 1 526 | SRL D 3ACB 2 NOP 1 527 | SRL E 3BCB 2 NOP 1 528 | SRL H 3CCB 2 NOP 1 529 | SRL L 3DCB 2 NOP 1 530 | 531 | SUB (HL) 96 1 NOP 1 532 | SUB (IX*) 96DD 3 ZIX 1 533 | SUB (IY*) 96FD 3 ZIX 1 534 | SUB A 97 1 NOP 1 535 | SUB B 90 1 NOP 1 536 | SUB C 91 1 NOP 1 537 | SUB D 92 1 NOP 1 538 | SUB E 93 1 NOP 1 539 | SUB H 94 1 NOP 1 540 | SUB L 95 1 NOP 1 541 | SUB * D6 2 NOP 1 542 | 543 | TST A 3CED 2 NOP 2 544 | TST B 04ED 2 NOP 2 545 | TST C 0CED 2 NOP 2 546 | TST D 14ED 2 NOP 2 547 | TST E 1CED 2 NOP 2 548 | TST H 24ED 2 NOP 2 549 | TST L 2CED 2 NOP 2 550 | TST (HL) 34ED 2 NOP 2 551 | TST * 64ED 3 NOP 2 552 | 553 | TSTIO * 74ED 3 NOP 2 554 | 555 | XOR (HL) AE 1 NOP 1 556 | XOR (IX*) AEDD 3 ZIX 1 557 | XOR (IY*) AEFD 3 ZIX 1 558 | XOR A AF 1 NOP 1 559 | XOR B A8 1 NOP 1 560 | XOR C A9 1 NOP 1 561 | XOR D AA 1 NOP 1 562 | XOR E AB 1 NOP 1 563 | XOR H AC 1 NOP 1 564 | XOR L AD 1 NOP 1 565 | XOR * EE 2 NOP 1 566 | --------------------------------------------------------------------------------