Final answer:
The code to compute C=A+B in different instruction set architectures requires varying numbers of instructions and total code sizes.
Step-by-step explanation:
Computing C=A+B in Different Instruction Set Architectures
For the code to compute C=A+B, let's analyze each instruction set architecture shown in Figure A.2:
Stack Architecture
- Push A
- Push B
- Add
- Pop C
Total code size: 4 instructions
Accumulator Architecture
- Load A
- Add B
- Store C
Total code size: 3 instructions
Register-Memory Architecture
- Load R1, A
- Load R1, B
- Add R3, R1, B
- Store R3, C
Total code size: 4 instructions
Register (Load-Store) Architecture
- Load R1, A
- Add R1, B
- Store R1, C
Total code size: 3 instructions