System Software – SIC Program to swap the values of ALPHA and BETA

Problem Statement

Write a sequence of instructions for SIC to swap the values of ALPHA and BETA.

Solution

Line Number(ac)CodeDescription
1LDA ALPHALoad the value of ALPHA in Accumulator
2STA GAMMAStore the value of Accumulator to GAMMA
3LDA BETALoad the value of BETA to Accumulator
4STA ALPHAStore the value of Accumulator to ALPHA
5LDA GAMMALoad the value of GAMMA to Accumulator
6STA BETAStore the value of Accumulator to BETA
7ALPHA RESW 1Reserve 1 word for ALPHA
8BETA RESW 1Reserve 1 word for BETA
9GAMMA RESW 1Reserve 1 word for GAMMA
%d