Summary
Operations using different architectures
C = A + B
Stack | Accumulator | Register-register | Memory-memory |
---|---|---|---|
push A push B add pop C | load A add B store C | load r1, A load r2, B add r3, r1, r2 store C, r3 | add C, A, B |
Concept
Storage architecture
- where are the operands stored so that we can perform operations on them?
- where is the result stored afterwards?
- how to specify the operands
Common storage architectures
- Stack architecture
- operands are implicitly at the top of the stack
- Accumulator architecture
- one operand is implicitly in the accumulater(special register)
- General-purpose register architecture
- explicit operands
- Register-memory architecture
- operands in memory and registers
- Register-register
- operands in registers only
- Memory-memory
- operands in memory only