Welcome back to Part 8 of Programs Under the Hood. Today we're going to disassemble a BIOS interrupt to get a real-world example of what programs are structured like, and we'll see if we can convert some of it to C/C++ code. (I apologize for the large line breaks. For some reason, they just appeared.)
POPPING THE HOOD-DISASSEMBLING A BIOS ROUTINE
A few issues back I mentioned that the BIOS provides a lot of basic functionality in assembly-language
Welcome to Part 7 of Programs Under the Hood. Today we're going to learn a bit more about how programs make decisions on the assembly language level. I promise after this we'll get back to the disassembler project.
FLOW CONTROL STRUCTURES
Everyone who knows C/C++ is familiar with the goto keyword, the bane of many a programmer's existence. Using goto makes code harder to read and terrible to debug because you have to jump around
I realize that I’ve been throwing a lot at you all at once. I now promise to go slower, easier, and put in more diagrams. Today we’re going to learn about the stack, stack frames and functions.USING A STACKJust about every program needs a stack, or a section of memory that is used sort of like temporary storage. It’s not[/i] like allocating memory, because the stack is already part of the program. The function of the stack is to:
Hold arguments passed to a function,
Hello, and welcome back to Programs Under the Hood. Today we're going to start planning out our disassembler's memory, talk a bit about memory segmentation, and then start working on the actual program. For those of you who have no idea what I’m talking about, please see Programs Under the Hood…Introduction[/i] to start from the beginning.All right... let’s get going on this disassembler project. I can only compile COM programs on my computer (don’t worry about why), so I’ll need to outline a few
(Part 4)Hello, and welcome to the latest part of my series, Programs Under the Hood[/i]. Today we’re going to relearn a bit of what I poorly taught last time, get more familiar with debug.exe[/i], and finally write our first program in assembly language. I know I threw a lot at you last time, so if you don’t mind, I’ll do a quick rehashing of the important points.
The generic Intel CPU has several sets of registers, or super-fast little sections of memory that have