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

Published on June 26, 2016 by abundantcode

Filed under Assembly Language

Last modified June 26, 2016

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 2753 times

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
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


x

You might be Interested in these Posts

System Software - SIC program to set 100 elements of array to Zero

Problem Statement Suppose that ALPHA is an array of 100 words, as defined in Fig. 1.5(a). Write a s...

System Software - SIC/XE Program to set ALPHA equal to 4 * BETA - 9.

Problem Statement Write a sequence of instructions for SIC/XE to set ALPHA equal to 4 * BETA - 9. A...

System Software - SIC Program to set ALPHA equal to Product of Beta and Gamma

Problem Statement Write a sequence of instructions for SIC to set ALPHA equal to the product of BET...