System Software – SIC/XE Program to divide BETA by GAMMA and set quotient and remainder

Published on June 26, 2016 by Senthil Kumar

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: 5 (1 votes)

This article have been viewed 12356 times

Problem Statement

Write a sequence of instructions for SIC/XE to divide BETA by GAMMA, setting ALPHA to the integer portion of the quotient and DELTA to the remainder. Use register-to-register instructions to make the calculation as efficient as possible.

Solution

Line Number(ac) Code Description
1 LDA BETA Load the value of BETA to accumulator
2 LDS GAMMA Load the value of GAMMA to register S
3 DIVR S, A Divide the value of accumulator with the Register S
4 STA ALPHA Store the accumulator value to ALPHA
5 MULR S, A Multiply the value of accumulator with Register S and store the result in accumulator.
6 LDS BETA Load the value of BETA to Register S
7 SUBR A, S Subtract the value of Register S from Accumulator  and store the result in Register A
8 STS DELTA Store the value of register S to DELTA
9 ALPHA RESW 1 Reserve 1 word for ALPHA
10 BETA RESW 1 Reserve 1 word for BETA
11 GAMMA RESW 1 Reserve 1 word for GAMMA
12 DELTA RESW 1 Reserve 1 word for DELTA

Leave a Comment


x

You might be Interested in these Posts

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

Keywords in XAML Language Namespace

Below are some of the keywords defined in the Xaml Language Namespace Keywords in XAML Language Nam...

How to Get the File Version of the Assembly in .NET (C#)?

The developers can use the methods and properties available in the FileVersionInfo class to retrieve...