October 12th, 2013, 09:47 PM
Question about memory locations
Sorry if this is a really simple question, but I am having a hard time finding an answer that makes sense to me. I am having a hard time figuring out how to ask my question. It seems to me that if a programmer is going to write software for a type of hardware (like a cpu) then they would need to know how to make that hardware do what they want it to do. I'm thinking this is accomplished through an addressing scheme?(such as: add value in location x to location y and set it in location z) - So, if a programmer wanted to access or modify an absolute address in his code how would he do that?
November 11th, 2013, 12:32 PM
Sorry to ask this, can you explain the question properly so that i can try to answer the question.
February 1st, 2014, 09:50 PM
On all but a few ancient computers (CDC 3000 series for example), modifying the address portion of an instruction isn't normally done.
Originally Posted by dmac0505
For a computer with a single address per instruction, the sequence would be, load accumulator with the value in memory location x, add the value in memory location y to the accumulator, store the accumulator value into memory location z. On computers with multiple registers, any of the registers could be used to perform the math operations.
Another sequence of instructions would be needed to perform the same addition operation on three other locations in memory.
Many machines allow addresses and/or offsets to be obtained from registers. Then the values in those registers are changed in order to change the address and/or offsets to be updated, perhaps incremented while in a loop to sum an array of numbers in memory.
You should find a book on assembly language for a processor that you would be interested in.
February 2nd, 2014, 02:19 AM
To my knowledge we can't change the absolute address value, if you want to add an array by incrementing the registers as you said in the example we can do that in ARM 7TDMI instruction set this gives us the authority to traverse over the group of registers and do arithemetic calculations over it.