![]() In hexadecimal, CR is 0Dh, and LF is 0Ah. A newline is in fact two characters: a carriage return (CR is ASCII 13) and a line feed (LF is ASCII 10). However, I want a prettier output, with a newline character before and after our string. With DB I can neatly provide the string using ASCII values, like this: db "hello, world!!" I’ll use the pseudo-instruction “DB” to define our string. That’s because I want the final program to occupy exactly 32 bytes we’ll see the reason for this later on. For this little program I only need the characters for “hello, world!!”. Equivalently, I could type “a 0100” or “a 100” to achieve the same result. By default, instructions will be placed starting from CS:0100, so I’ll use that address. The command for that is “a”, which might be optionally followed by a memory address. I want to assemble, i.e., I want to type assembly language instructions. After we execute DEBUG.COM we’ll meet a prompt with a “-” symbol. I don’t have any use for this, but it comes as a “relaxing” post after several weeks focused on the release of “DragonScales 3: Eternal Prophecy of Darkness” on Steam and the localization of “DragonScales 5: The Frozen Tomb”. Specifically what I want is to build a minimal “hello, world!” program using DEBUG.COM. You could create little programs, or inspect programs and peek memory areas. However, DEBUG looked pretty cool back then: it could assemble, disassemble and dump hexadecimal output. ![]() Heck, DEBUG isn’t even available on the Windows 10 machine I’m typing this on. So I’ll revisit this here, mostly as a self-imposed disciplinary measure, an exercise on programming, specifically, an exercise on programming futility. I wrote a post about this “hello, world” with DEBUG.COM elsewhere, and yesterday I found the time to reread it: I verified, first with awe, then with horror, and finally, with relief, that I had almost completely forgotten how to code in assembly. I remember trying to code, as expected, the traditional “hello, world!”, using a strange tool included in DOS, DEBUG.COM. ![]() First painful steps were taken and first crashes happily followed. The famous RBIL (Ralf Brown’s Interrupt List) was, back then, my favorite “reference”. I remember the masochist approach to learning the opcodes and the hardware architecture. More than two decades ago I used to code in x86 (Intel) assembly, almost daily. Or an exercise on retro, old-school coding. Coding “Hello world” with DEBUG will be a blunt exercise on programming futility. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |