Problem Statement
Write a sequence of instructions for SIC/XE to set ALPHA equal to 4 * BETA – 9. Assume that ALPHA and BETA are defined as in Fig 1.3(b). Use immediate addressing for the constants.
Solution
Line Number(ac) | Code | Description |
1 | LDA BETA | Load the value of BETA in Accumulator |
2 | LDS #4 | Load the value 4 to Register S |
3 | MULR S,A | Multiply the value of Accumulator with Register S and store the result back to Accumulator |
4 | SUB #9 | Subtract the value 9 from the contents of accumulator |
5 | STA ALPHA | Store the value of accumulator to ALPHA |
6 | ALPHA RESW 1 | Reserve 1 word for ALPHA |
Leave a Reply