Hi. I'm pretty much an absolute beginner in programming. I've ordered a book for absolute beginners. But, before it arrives I wonder about how a programmer references a memory location in C.
Here is where I'm at: In the olden days, because the address register was only 16 bits, the maiximum addressable memory
was 64KB. Then came in Segmentation & Offset which allowed up to 1MB of addressable memory with a 16 bit register.
BEFORE SEGMENT & OFFSET
If a programmer needed to reference a specific memory address, or a range of addresses, I presume that they used hexadecimal notation. That is, say, something like FFFD in code (or FFFDh). Unless a decimal number was acceptable.
AFTER SEGMENT & OFFSET
If a programmer needed to reference a specific memory address, or a range of addresses, I presume they used Segment & Offfset notation. That is, say, something like 0000:FFFD or F000:FFFD in code. Unless a decimal number was acceptable.
I wonder also, could a programmer put the result of adding the segement and offset, such as FFFFD (after segement .* 16) to reference a memory address?
I'm really a beginner because I don't even know if programmers still rely on Segment & Offset today. I suppose so, if the appropriate MCU register is 16 bits. Unless something has superseded Segment & Offset. I suppose this must be the case, for how could a MCU address say a 8MB SD card.
Thanks for any assistance rendered. Richard
Here is where I'm at: In the olden days, because the address register was only 16 bits, the maiximum addressable memory
was 64KB. Then came in Segmentation & Offset which allowed up to 1MB of addressable memory with a 16 bit register.
BEFORE SEGMENT & OFFSET
If a programmer needed to reference a specific memory address, or a range of addresses, I presume that they used hexadecimal notation. That is, say, something like FFFD in code (or FFFDh). Unless a decimal number was acceptable.
AFTER SEGMENT & OFFSET
If a programmer needed to reference a specific memory address, or a range of addresses, I presume they used Segment & Offfset notation. That is, say, something like 0000:FFFD or F000:FFFD in code. Unless a decimal number was acceptable.
I wonder also, could a programmer put the result of adding the segement and offset, such as FFFFD (after segement .* 16) to reference a memory address?
I'm really a beginner because I don't even know if programmers still rely on Segment & Offset today. I suppose so, if the appropriate MCU register is 16 bits. Unless something has superseded Segment & Offset. I suppose this must be the case, for how could a MCU address say a 8MB SD card.
Thanks for any assistance rendered. Richard
Last edited: