System Software – SIC Program to set ALPHA equal to integer portion of BETA/GAMMA

Problem Statement

Write a sequence of instructions for SIC to set ALPHA equal to the integer portion of BETA / GAMMA. Assume that ALPHA and BETA are defined as in Fig. 1.3(a).

Solution

Line Number(ac)CodeDescription
1LDA BETALoad the value of BETA to accumulator
2DIV GAMMADivide the value of accumulator by GAMMA
3STA ALPHAStore the value of accumulator to ALPHA
4ALPHA RESW 1Reserve 1 word for ALPHA
5BETA RESW 1Reserve 1 word for BETA
6GAMMA RESW 1Reserve 1 word for GAMMA