System Software – SIC/XE Program to multiply two arrays

Problem Statement

Assume that ALPHA and BETA are the two arrays of 100 words. Another array of GAMMA elements are obtained by multiplying the corresponding ALPHA element by 4 and adding the corresponding BETA elements.

Solution

Line NumberCodeComments
1LDS #3 
2LDT #300 
3LDX #0 
4ADDLOOP LDA ALPHA, X 
5MUL #4 
6ADD BETA, X 
7STA GAMMA, X 
8ADDR S, X 
9COMPR X, T 
10JLT ADDLOOP 
11ALPHA RESW 100 
12BETA RESW 100 
13GAMMA RESW 100