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

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

Problem Statement

Write a sequence of instructions for SIC/XE to set ALPHA equal to 4 * BETA – 9. Assume that ALPHA and BETA are defined as in Fig 1.3(b). Use immediate addressing for the constants.

Solution

Line Number(ac) Code Description
1 LDA BETA Load the value of BETA in Accumulator
2 LDS #4 Load the value 4 to Register S
3 MULR S,A Multiply the value of Accumulator with Register S and store the result back to Accumulator
4 SUB #9 Subtract the value 9 from the contents of accumulator
5 STA ALPHA Store the value of accumulator to ALPHA
6 ALPHA RESW 1 Reserve 1 word for ALPHA

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 clear 20 byte string using Immediate addressing mode.

Problem Statement Write a sequence of instructions for SIC/XE to clear a 20-byte string to all blan...

System Software - SIC/XE Program to clear 20 byte string to empty

Problem Statement Write a sequence of instructions for SIC/XE to clear a 20-byte string to all blan...