First post, by SirNickity
First, just so you know what I know and what I'm looking for, here's:
My programming experience:
I started with BASIC on a TRS-80, then VB 3.0 in Win 3.x up until .NET. I later picked up perl and C in Linux, then embedded C on AVR, and tried my hand at AVR ASM and have dabbled in ARM as well. I'm no savant, but I keep my indices within array bounds, if ya know whadda mean.
OK... so, I'm just fascinated by hardware, enjoy the puzzle of coding, and have a warm fondness for DOS, Win 3.x, Win 9x, XP, and BeOS. But, the only PC programming I'm familiar with at this point is gcc / libc CLI apps under Linux. I want to start writing DOS programs and drivers, and then move on to Win16, then get back into Win32 after years away since abandoning VB. For now, I'm starting at 0. Or, perhaps 3.3.
To prepare for this, I've bought a lot of:
- Pretty much the entire System Architecture hardware series: ISA, 486, Pentium, PCI, PnP, etc.
- The Sound Blaster book
- Graphics Programming in C (motivating educational practical project: writing VGA test patterns to calibrate my OSSC's sampling settings at various resolutions for my fleet of retro boxen)
- System BIOS for IBM PC/XT/AT Computers & Compatibles
- Microsoft MS-DOS Programmer's Reference
- Programming Windows 3.1
- And -- if I can find it -- I have a book on x86 ASM as well. But I think it may be more of an opcode reference.
I bought MS Visual Studio C++ 4.0 (which comes with 1.52) and 6.0. MS C 7.0 and MSASM 6.1, Watcom C 7.0, and a couple Intel compilers found their way in my disk box as well.
Most of the above focus on very specific things. References of software interrupts, DOS API, particular hardware, the x86 architecture.. but I need an introduction, a place to start.
There are a couple MASM books on Amazon, but 5.x/6.x is a pretty deep cut these days so not all the books have any reviews, and none of them have more than a few. I'm not sure if there's kind of a beloved "go-to" reference or if I should just take my chances with one and hope for the best. Maybe the Peter Norton book? Seems to have done OK by the two or three people that have read it since the turn of the millennium.
Then, I need something that glues all this together. DOS is a different kind of beast. I (think I) get segment:offset addressing, but I have no idea what a "memory model" is, nor when or why I should choose small or large. I'm not really sure how memory allocation works -- AFAIK, you're given kind of a blank check, rather than having to allocate from the OS, but I could be way wrong. This might all be covered in a good MASM book, but it would apply to C as well, so if there's a really great generic DOS C book, that might be a good place to dip toes into the rather strange environment that DOS is.
I did manage to write my first DOS .com file by looking up an 8086 instruction code reference, looking up how to convert them from mnemonics to opcodes, creating a file in a hex editor, and running it in DOSBox. I successfully greeted the world "Hello", and then got kind of crazy and figured I would report what version of DOS this is. That required an int-to-string routine, which I wrote on paper... but converting all the various MOV instructions to opcodes by hand got really tiresome (it is NOT straight-forward), so I installed MASM, and then proceeded to get way in over my head with assembly code boilerplate, the exact syntax it wants for variants with reg-to-reg, mem-to-reg, etc.
I have watched a couple YouTube intros, but ... sigh... I mean, I appreciate the effort, but not everyone is meant to be a teacher, and it's obvious a lot of them don't quite understand it themselves. (Like one, that said you just need to end your program in 0d 0a 24, because that's how you end DOS programs. That lit up my BS detector, and since "$" is not a great Google search term, it took a while to figure out that it's actually just a string terminator because.... reasons... probably CP/M's fault.)