SIC/XE Program to find the maximum element in the array and store result in MAX
This System Software program provides a sequence of instructions in SIC/XE Program to find the maximum element in the array and store result in MAX.
Assume that ALPHA is an array of 100 words. Write a sequence of instructions for SIC/XE to find the maximum element in the array and store results in MAX.
Source Code
Line Number | Code | Comment |
---|---|---|
1 | LDS #3 | |
2 | LDT #300 | |
3 | LDX #0 | |
4 | CLOOP LDA ALPHA, X | |
5 | COMP MAX | |
6 | JLT NOCH | |
7 | STA MAX | |
8 | NOCH ADDR S, X | |
9 | COMPR X, T | |
10 | JLT CLOOP | |
11 | ALPHA RESW 100 | |
12 | MAX WORD -32768 |