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 ...
Updated 05-09-2009 at 06:08 AM by Jordan
(Part 3)Hi, everyone, it's me again with the latest installment of Programs Under the Hood. Today we're going to get to know the inner workings of the processor, and start learning a little assembly language. INTRODUCING THE GENERIC INTEL CPU Since the 8086 in 1974, the Intel processors have retained a lot of the same characteristics. Pretty much the only thing that has changed that we need to worry about, aside from speed, is the size of the instruction set. The newer the processor, ...
Updated 05-09-2009 at 06:01 AM by Jordan
(Part 2) I said in my last blog that I'm going to assume you know assembly language in my further exploits. I changed my mind. I'll walk all of you through this in a way that'll be as painless as possible for the experienced and the n00bs. Before we begin writing this disassembler, I should outline a few things I plan on doing. [*]I'm going to use debug.exe for nearly everything. It's very crappy, yes, but it's primitive enough so you can see how everything works at its most basic ...
Updated 05-09-2009 at 06:00 AM by Jordan