{"id":18619860,"url":"https://github.com/nq4t/getcd","last_synced_at":"2025-05-07T08:02:08.628Z","repository":{"id":261170072,"uuid":"883479033","full_name":"nq4t/GETCD","owner":"nq4t","description":"Replacement for FINDCD.EXE batch utility that uses filename argument and written in ASM","archived":false,"fork":false,"pushed_at":"2024-11-05T16:52:28.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T08:02:08.156Z","etag":null,"topics":["assembly","cd-rom","ms-dos","utility","x86-assembly","x86-nasm"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit-0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nq4t.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-05T03:11:25.000Z","updated_at":"2024-11-06T02:50:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"da415c08-ccc4-4215-b330-323d1cb53479","html_url":"https://github.com/nq4t/GETCD","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"d0aee903112d306997f337c0be09dc64f02c8888"},"previous_names":["nq4t/getcd"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nq4t%2FGETCD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nq4t%2FGETCD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nq4t%2FGETCD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nq4t%2FGETCD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nq4t","download_url":"https://codeload.github.com/nq4t/GETCD/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839276,"owners_count":21812084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembly","cd-rom","ms-dos","utility","x86-assembly","x86-nasm"],"created_at":"2024-11-07T04:03:36.073Z","updated_at":"2025-05-07T08:02:08.618Z","avatar_url":"https://github.com/nq4t.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GETCD: MS-DOS .BAT Utility For Locating CD-ROM Drive\r\n\r\n`GETCD.COM` is \"batch utility\" for MS-DOS to assist in locating a\r\nCD-ROM drive based on file search. It is similar to `FINDCD.EXE` \r\nwith the following exceptions\r\n- it takes an argument to specify a file\r\n- automatically creates/manages the CDROM= variable\r\n\r\nIt is written in NASM assembler; and is mostly the thing I wrote\r\nwhile ~~attempting to learn~~ learning assembler.\r\n\r\n## Usage\r\n\r\n`GETCD.COM` does not display much in the way of user output. The\r\nlargest chunk can be seen by calling the basic help:\r\n\r\n`getcd /?`\r\n\r\nIf you were to \"place a CD\" in a \"CD drive\" with the file what.txt\r\non it and ran this:\r\n\r\n`getcd what.txt`\r\n\r\nIt looks like nothing happened. However, if you call `set` from the\r\ncommand prompt to see the current variables; you should see `CDROM=D:`\r\n(or whatever the actual drive letter is) now exists. \r\n\r\n`getcd` on it's own will default to a wildcard (*) search. This has\r\nthe effect of returning the first CD drive that has a disc in it, or\r\ndoesn't return some kind of error.\r\n\r\nWildcards are allowed in the search string; as well as just directory\r\nnames. The first drive that doesn't fail search is returned. \r\n\r\n`NO ENV FREE` is the only displayed error message if you don't have \r\nenough environment space free. Most failures should result in nothing\r\nbeing changed. This plays well with being a batch utility:\r\n\r\n```\r\n@echo off\r\nset CDROM=0:\r\ngetcd what.txt\r\nif %CDROM%=0: goto nocd\r\n(do stuff)\r\ngoto exit\r\nnocd:\r\n(stuff for no cd)\r\nexit:\r\n```\r\n\r\nAdditionally, you can look for errorlevel 255, which is returned if\r\nthere are no CDROM drives.\r\n\r\n### Adapting scripts for FINDCD.EXE\r\n\r\nYou'll just need to modify `FINDCD` to `GETCD [file]`\r\n\r\n### My scripts want a \\ in the variable\r\n\r\n`GETCD` is kind of picky in that it will make the CDROM variable\r\na drive letter, a colon, and no backslash. I may change this by\r\nassuming an extra character is a backslash an not delete it.\r\n\r\nBut, for now; just do this in your .bat\r\n\r\n```\r\nset CDROM=%CDROM%\\\r\n```\r\n\r\n\r\n\r\n## What does this do?\r\n\r\n- It lets you specify a file to search CD-ROM drives for and puts\r\nthat drive letter in to the CDROM= environment variable. Then \r\nfancy .BAT scripts can go `call %CDROM%\\install.bat` and\r\nrun the .bat off the CD.\r\n\r\n## How does it differ from other utilities?\r\n\r\n- The only utility I've actually found has been FINDCD.EXE. The\r\nalternative is apparently for loops. I've seen mentions of other\r\nutlities on sites devoted to .bat scripting; but never found an\r\nexe.\r\nThe differences from FINDCD are passing a filename as an argument\r\nand the automatic management of the variable. FINDCD used a hard\r\ncoded file in the binary as well as requiring you to preset the\r\nvariable. \r\nI decided to just toss all that aside and assume the user might\r\nnot do it right; or in the case of FINDCD; the variable length \r\npre-set is longer than necessary. I have no clue what FINDCD is \r\ndoing with the variable.\r\n\r\n## Building\r\n\r\n`nasm -o getcd.com getcd.asm`\r\n\r\nThe build system was FreeDOS with WatcomC, DJGPP, IA16, and a few other things on it. \r\n\r\nIt was tested on MS-DOS 6.22 under an 86Box emulated 486/DX4 100.\r\n\r\n## Random Things Passed As FAQ:\r\n\r\n**Why a .COM and not a .EXE?**\r\n\r\n   - We didn't need any of the fancy options a .exe gave us. Our binary is not over 65kB in size and doesn't have to be relocated to run. That is primarily what .exe would give me; the ability to relocate my code once loaded. I could have assembled this to an object file then linked it to an .EXE, but I still wouldn't be using any \"EXE features\"\r\n\r\n**What are the minimum requirements?**\r\n\r\n   - DOS 3.3 and a CD-ROM drive. The program doesn't use much ram and\r\n    while will technically run on an 8088, the lack of CD-ROM drivers\r\n    are a bigger issue.\r\n\r\n**Will this work on FreeDOS?**\r\n\r\n   - Yes, it's been known to. I have not tested the memory manipulating\r\n    version; but early versions worked.\r\n\r\n**What about n-DOS?**\r\n\r\n   - No comment. It *should*, but it will depend if your CD-ROM extensions\r\n    respond to the interrupts I use. \r\n\r\n**Why did you do this?**\r\n\r\n   - I'd wanted to see if I could write x86 ASM for quite some time. I \r\n    hadn't learned ASM beyond knowing how CPU's work at a low level\r\n    and what ASM was. I had an incorrect assumption that I didn't know \r\n    the levels of math required to make it work that I'd held for years.\r\n    Anyway; I'd also incorrectly assumed after diving in that the magic\r\n    of low-level would give me a secret way to look at drives without\r\n    triggering errors. It did; but changing the interrupt vector isn't\r\n    ASM specific..it was, like most things; a concept I'd heard about\r\n    but really didn't undertand back in my teens when I first tried.\r\n    I almost gave up and went to C when I was just trying to get the\r\n    byte in the env block realizing that's why people have libaries.\r\n    And, no; what little I read about the subject involved inline ASM.\r\n    My most optimized version was 98 bytes. Yes, 98. It had no file\r\n    argument or memory management. You had to make the environment; \r\n    variable, it put the letter at the byte after =, and that was it.\r\n    Then I decided to add features for the sake of stability and users;\r\n    plus what good is a clone if you don't improve it.\r\n    So despite serving no real purpose and being a huge time-sink for\r\n    something only I'll probably use; I'm at least better in ASM than\r\n    when I started. Huge bar given I started at almost zero.\r\n\r\n## License\r\n\r\nMIT No Attribution\r\n\r\nCopyright 2024 Jay Moore\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of this\r\nsoftware and associated documentation files (the \"Software\"), to deal in the Software\r\nwithout restriction, including without limitation the rights to use, copy, modify,\r\nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\r\nINCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\r\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\r\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnq4t%2Fgetcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnq4t%2Fgetcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnq4t%2Fgetcd/lists"}