pointers and processors
IT & Infrastructure
2
Posts
2
Posters
0
Views
1
Watching
-
hi, I was wondering if the pointers in programming languages come about only because of the HL registry pair in Intel 8085.If such a register didnot exist, would we be using pointers today? Cheers
Pointers are made possible by indirect addressing in processors and predate the 8085. So, the instructions:
SET x, 1
SET y, 2
ADDI x, ywill set "x" to (x + *y), which happens to be 1 plus the value sitting in memory location 2. This will set "x" to 3 (1 + 2):
SET x, 1
SET y, 2
ADD x, yIn the 1970's, there were 3 addressing modes: direct, indirect and indexed. No doubt, newer technology may have given rise to other schemes. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com