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 6232 times

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 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...