Problem Statement
Write a sequence of instructions for SIC to swap the values of ALPHA and BETA.
Solution
Line Number(ac) | Code | Description |
1 | LDA ALPHA | Load the value of ALPHA in Accumulator |
2 | STA GAMMA | Store the value of Accumulator to GAMMA |
3 | LDA BETA | Load the value of BETA to Accumulator |
4 | STA ALPHA | Store the value of Accumulator to ALPHA |
5 | LDA GAMMA | Load the value of GAMMA to Accumulator |
6 | STA BETA | Store the value of Accumulator to BETA |
7 | ALPHA RESW 1 | Reserve 1 word for ALPHA |
8 | BETA RESW 1 | Reserve 1 word for BETA |
9 | GAMMA RESW 1 | Reserve 1 word for GAMMA |
Leave a Reply