4.9k views
0 votes
Why would it not be a good idea to use numeric addresses when writing instructions that access variables?

User Typhon
by
6.5k points

1 Answer

3 votes
Variable names are convenient for the programmer. The variable name is actually a pointer to the address that the value is stored. People are better with words than numbers. If programmers had to use addresses instead of names, they'd be insane in short order.

Another problem is relocatable code. In modern OS's the code is loaded into different memory locations, so any address has to be an offset into the current section of memory, absolute addresses won't work.
User Vivek Jha
by
6.7k points