System Software – SIC/XE Program to set 100 elements of the array to 0 using immediate addressing mode

Problem Statement

Assume that ALPHA is an array of 100 words. Write a sequence of instructions for SIC/XE to set all 100 elements of the array to 0. Use immediate addressing and register-to-register instructions to make the process as efficient as possible.

Solution

Line NumberCodeComments
1LDS #3 
2LDT #300 
3LDX #0 
4LOOP LDA #0 
5STA ALPHA, X 
6ADDR S, X 
7COMPR X, T 
8JLT LOOP 
9ALPHA RESW 100