VOGONS

Common searches


First post, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

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:
Books:
- 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.

Software
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.

So...

What next?
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.

BTW
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.)

Reply 1 of 10, by Jo22

User metadata
Rank l33t++
Rank
l33t++

probably CP/M's fault.

Oh, that reminds me of DOS' ancient CALL 5 interface for CP/M compatibility.. Really fascinating stuff! 😎

http://hitchhikersgui.de/A20_line
Re: Win3mu Soon OpenSource

http://www.os2museum.com/wp/who-needs-the-add … paround-anyway/
http://www.os2museum.com/wp/a-word-on-the-call-5-spell/

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 10, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

I have a feeling A20 is one of those things that IBM wishes it would have handled differently. (Or, did wish.. when they still had an interest in PCs.)

Oh no, we can access 16MB of memory now, and all your programs that assume life ends at 1MB are broken. Boo hoo, write a patch, ya Melvin... ;-D I got 99 problems and A20 ain't one.

Reply 3 of 10, by TheMobRules

User metadata
Rank Oldbie
Rank
Oldbie

My go-to book for MASM programming back in college was The Art of Assembly Language. But beware, there are different editions of the book: one for 32-bit Windows, another one for 32-bit Linux and the most common one which you will probably find on Amazon, that focuses on HLA (High Level Assembly). None of these are very useful for DOS programming, the one you want is known as DOS 16-bit edition: this is the one I used, and you can probably get it online as a PDF.

Maybe there are better books out there but I remember this one being both a very good introduction to x86 assembly and a solid MASM reference.

EDIT: for C programming on DOS, instead of a specific book I would recommend the classic Kernighan/Ritchie + reference docs of whatever compiler you are using

Reply 4 of 10, by pan069

User metadata
Rank Oldbie
Rank
Oldbie

For DOS programming, books can be a great resource. there's a lot of information on the web but when it comes to DOS, nothing beats good 'ol books.

On that note; I see you already have a few books, good start. If you don't mind, I'd like to suggest another one for you, a book that will explain pretty much everything you need to know when it comes to DOS/x86 programming:

PC Intern: The Encyclopedia of System Programming

https://www.amazon.com/PC-Intern-Encyclopedia … s/dp/1557553041

Personally. when I do DOS development I just work on my Linux desktop with a modern code editor (Sublime or VSCode), I use OpenWatcom on Linux so I build my binaries (.com or .exe) from the Linux command line and then run the program directly in DOSBox. Then, to test if it works on actual hardware, I copy it over to a real machine.

Those old machines, either DOS or Windows, just aren't productivity beasts. 😀

Last edited by pan069 on 2019-11-24, 06:54. Edited 1 time in total.

Reply 5 of 10, by Jo22

User metadata
Rank l33t++
Rank
l33t++
SirNickity wrote:

I have a feeling A20 is one of those things that IBM wishes it would have handled differently. (Or, did wish.. when they still had an interest in PCs.)

Oh no, we can access 16MB of memory now, and all your programs that assume life ends at 1MB are broken. Boo hoo, write a patch, ya Melvin... ;-D I got 99 problems and A20 ain't one.

Yeah, maybe. 😉
In practice, though, DOS and its programs do not have as much trouble with A20 as the press constantly claims them to have.
If you read the links I mentioned before, you'll realize address-wrapparound is a non-issue for the CALL 5 stuff, for example. 😀
It works either way. General speaking, DOS itself can run with or without an A20 just fine.
It's the memory managers (Himem etc) that are having issues mainly. Luckily, they can be replaced by third-party ones.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 6 of 10, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

if you have a c compiler, you dont need to "know dos" since the clibs abstract everything away. if your doing asm, sure, dos books like the norton pink shirt are great.. otherwise meh.

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 7 of 10, by BeginnerGuy

User metadata
Rank Oldbie
Rank
Oldbie
pan069 wrote:
For DOS programming, books can be a great resource. there's a lot of information on the web but when it comes to DOS, nothing be […]
Show full quote

For DOS programming, books can be a great resource. there's a lot of information on the web but when it comes to DOS, nothing beats good 'ol books.

On that note; I see you already have a few books, good start. If you don't mind, I'd like to suggest another one for you, a book that will explain pretty much everything you need to know when it comes to DOS/x86 programming:

PC Intern: The Encyclopedia of System Programming

https://www.amazon.com/PC-Intern-Encyclopedia … s/dp/1557553041

Personally. when I do DOS development I just work on my Linux desktop with a modern code editor (Sublime or VSCode), I use OpenWatcom on Linux so I build my binaries (.com or .exe) from the Linux command line and then run the program directly in DOSBox. Then, to test if it works on actual hardware, I copy it over to a real machine.

Those old machines, either DOS or Windows, just aren't productivity beats. 😀

I'm actually missing the cd room for tischer's encyclopedia of pc programming.. its always a gamble whether or ot they'll really have the disk when you buy thrift books. If anybody has a copy of that please share (or pm about it if this is potential copyright bait)

Edit: it appears somebody added it to archive.org in recent years, will download when im at a pc to check for sure!

Sup. I like computers. Are you a computer?

Reply 8 of 10, by brostenen

User metadata
Rank l33t++
Rank
l33t++

This book might be usefull...

Don't eat stuff off a 15 year old never cleaned cpu cooler.
Those cakes make you sick....

My blog: http://to9xct.blogspot.dk
My YouTube: https://www.youtube.com/user/brostenen

001100 010010 011110 100001 101101 110011

Reply 9 of 10, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie
pan069 wrote:

For DOS programming, books can be a great resource. there's a lot of information on the web but when it comes to DOS, nothing beats good 'ol books.

Absolutely. The Internet has all the info you ever wanted, but sometimes finding what you need can be like looking for a dropped SMD chip resistor in deep pile carpet.

So I decided to give the Norton book a shot, and picked up the PC Intern book as well since it covers Win95, which will be useful later on. I have a feeling I'll probably grab the Advanced MS-DOS Programming book eventually, but it seems to have the most overlap with what I've already got.

No surprise, but I did not find The Art of Assembly 16-bit Edition, just the ubiquitous HLA one. I recognized the cover of that one, as it turns out I have looked at the HLA edition before, and was turned off by the decision to put training wheels on ASM. I do understand the intent -- and it's laudable that they want to provide some of the creature comforts of high level languages, and avoid bombarding a new assembly programmer with the tedium of a low-level language, but uh... that IS kinda the point. If you're using ASM, you're there for a reason and willing to forego the amenities. Otherwise why not just write in C? Anyway, I'll keep my eyes peeled for an older edition, or an electronic copy.

Thanks all -- great suggestions. 😎

Reply 10 of 10, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

Some books are better than others... some of my stacks below. of interest I'd list;

applied cryptography
data compression book
peter norton guide to ibm pc
the indispensable pc hardware book
programmer's guide to the ega and vga (2nd or 3rd ed)
dos + windows protected mode
dissecting dos (mildly interesting)
mastering algorithms in c

iXOGG74l.jpg

gXOVPyEl.jpg

NUrbSril.jpg

FLp0Derl.jpg

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--