Problem Statement
Write a sequence of instructions for SIC to set ALPHA equal to the product of BETA and GAMMA. Assume that ALPHA, BETA, and GAMMA are defined as in Fig. 1.3(a).
Solution
Line Number(ac) | Code | Description |
1 | LDA BETA | Load the value of BETA in Accumulator |
2 | MUL GAMMA | Multiply the value of GAMMA with accumulator and the result will be stored in Accumulator |
3 | STA ALPHA | Store the result of Accumulator to ALPHA |
4 | ALPHA RESW 1 | Reserve 1 word for ALPHA |
5 | BETA RESW 1 | Reserve 1 word for BETA |
6 | GAMMA RESW 1 | Reserve 1 word for GAMM |
Instruction set for SIC to set alpha=beta*9 +gama