Hi folks, I just want to be certain on a few things before I continue developing my software (using NASM). I know it seems a bit strange to finally understand addressing AFTER I've already developed a bootstrap loader, but that's the way it's happened!!! :$
I'm currently working in 16-bit Real Mode, and I'm developing a library of macros/functions to help me before I make the transition into C/C++ (by then I'll also be in 32-bit Protected Mode). I think I understand the following (when I'm working in Real Mode);
- Real-Mode uses the Segment:Offset model, where the segments and offsets are 16-bit values; these are combined to give an absolute address of '(segment * 16) + offset'.
ORGinstruction specifies the offset of the first addressable location in the code.
- All labels within the code actually correspond to 16-bit offsets (and not full absolute addresses, as I first thought).
- When we do something like
MOV SI, myString, we're loading the offset referenced by 'myString' into SI.
Now, I just need to get one more thing cleaned up. When I use indirect addressing, is DS being used as the data segment? For example, does
MOV AL, [myVar] actually correspond to
MOV AL, [DS:myVar] ?