4 ms·
I think people are missing the forest for the trees here. He's trying to bootstrap a programming environment from the basic tools provided with a default MS-DOS
by classichasclass 8y ago
I think people are missing the forest for the trees here. He's trying to bootstrap a programming environment from the basic tools provided with a default MS-DOS install ( https://github.com/mniip/BOOTSTRA https://github.com/mniip/BOOTSTRA ) and build everything from the "cleanest" possible state.
That is mad as badgers. The batch file assembler is merely what will get him more years in the asylum. ;)
- userbinator 8y agoI think a lot more people have tried something similar when they first read about DEBUG (and the source code listings in PC magazines of the time would use it for assembling short programs)... including me. At the start, the most powerful tool is undoubtedly DEBUG.EXE with its ability to assemble and create executable files. It has just one handicap though: there are no labels. One has to manually adjust jump and variable locations. My solution, instead of writing an assembler with batch files, was to use DEBUG itself to write the label-understanding assembler. I think I still have it somewhere, in incomplete form --- never got around to finishing the whole thing, because real life got in the way. ;-) Looking at the number of "bootstrap pilgrimage" projects that have become public, it's great to see many others trying the same thing; there was this one recently too: https://news.ycombinator.com/item?id=17851311 https://news.ycombinator.com/item?id=17851311
- cardiffspaceman 8y agoAs others have said, "Start with a floppy and a magnetized needle..."
- Narishma 8y agoWhy DEBUG.EXE and not the BASICs that came with MS-DOS? Wouldn't that be much easier?
- Someone 8y agoThose required the presence of a version of Basic in ROM (I guess to keep the size of the executable down, not primarily as a license-checking scheme), so they didn’t run on all hardware. (Source: https://en.wikipedia.org/wiki/IBM_BASIC#IBM_Disk_BASIC https://en.wikipedia.org/wiki/IBM_BASIC#IBM_Disk_BASIC, https://en.wikipedia.org/wiki/IBM_BASIC#IBM_Advanced_BASIC https://en.wikipedia.org/wiki/IBM_BASIC#IBM_Advanced_BASIC)
- mniip 8y agoI had initially considered doing it that way but deemed it too tedious. I really can't stand calculating and correcting offsets all the time.
- Someone 8y agoI think I would get a Forth up and running ASAP, and write the assembler, if one still is needed, in that Forth. looking at https://github.com/nornagon/jonesforth/blob/master/jonesforth.S https://github.com/nornagon/jonesforth/blob/master/jonesfort... for a simple example, that needs assembler labels and macros, but I think a few batch files can give you rough approximations of those (example of rough approximation: assume every function is 64 bytes long, and every jump needs a 2-byte offset. That makes address calculations a bit easier. Wasteful, but that can be fixed later, once you have a better assembler written in your Forth.
- userbinator 8y agoI wrote my initial version on lined paper, using labels, and didn't calculate the offsets until I was ready to enter it in. The planning/design was also done on paper, away from a computer. The state of mind required to do that is something I can safely say is foreign to the majority of developers today, who will write code they're not completely sure of and test/debug/modify later; but when each "cycle" of debugging may take many minutes instead of seconds, one learns to think very very carefully about what the code is doing. Code that works perfectly on the first run is not unusual when you have this mindset.
- tempodox 8y agoUsing that cursed parody of an interpreter to write an assembler definitely merits extra hero points. :)
- curlypaul924 8y agoIf that's the goal, then why write it in batch instead of BASIC?