0

Before a certain operation is to be performed on the data by ALU, Will the operands have to be loaded into the register from memory to perform? If yes, then why address field in the instruction may refer to the memory address of the operand?

  • This is too vague; different architectures work in different ways. Some architectures can do arithmetic with memory operands (x86 `add eax, [rdi]`), though the instruction might actually do a load into an internal register first. Others have no such instructions, and would need a separate load instruction to get the data into a register. – Nate Eldredge Jul 17 '21 at 15:45
  • No, memory source operands for ALU instructions don't need an architectural register, only a temporary buffer of some sort, possibly just the load-result muxed straight to the ALU in a simple CPU. In logic-gate terminology, a buffer like that can be called a "register" or "latch register", but is not the same thing. – Peter Cordes Jul 17 '21 at 17:21
  • See [Is processor can do memory and arithmetic operation at the same time?](https://stackoverflow.com/q/51102525) re: how memory-destination instructions work in x86, for example. – Peter Cordes Apr 16 '22 at 07:48

0 Answers0