Tag: SIC
System Software – SIC Program to swap the values of ALPHA and BETA
Problem Statement Write a sequence of instructions for SIC to swap the values of ALPHA and BETA. Solution Line Number(ac) Code Description 1 LDA ALPHA Load the value of ALPHA in Accumulator 2 STA GAMMA Store the value of Accumulator to GAMMA 3 LDA BETA Load the value of BETA to Accumulator 4 STA ALPHA Store the value of Accumulator to ALPHA 5 LDA GAMMA…
System Software – SIC Program to set ALPHA equal to Product of Beta and Gamma
Problem Statement Write a sequence of instructions for SIC to set ALPHA equal to the product of BETA and GAMMA. Assume that ALPHA, BETA, and GAMMA are defined as in Fig. 1.3(a). Solution Line Number(ac) Code Description 1 LDA BETA Load the value of BETA in Accumulator 2 MUL GAMMA Multiply the value of GAMMA with accumulator and the result will be stored in Accumulator…
System Software – SIC/XE Program to set ALPHA=GAMMA*BETA-9 using Register Operation
Problem Statement Write a sequence of instructions for SIC/XE to set ALPHA=GAMMA*BETA-9 using register operation. Solution Line Number(ac) Code Description 1 LDA GAMMA 2 MUL BETA 3 SUB 9 4 STA ALPHA
System Software – SIC/XE Program to set ALPHA equal to 4 * BETA – 9.
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…
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 sequence of instructions for SIC to set all 100 elements of the array to 0. Solution Line Number(ac) Code Description 1 LDA ZERO 2 STA INDEX 3 LOOP LDX INDEX 4 LDA ZERO 5 STA ALPHA, X 6 LDA INDEX 7…
System Software – SIC/XE Program to Write a subroutine to read a record into a buffer
Problem Statement Write a subroutine for SIC/XE that will read a record into a buffer. The record may be any length from 1 to 100 bytes. The end of record is marked with a “null” character (ASCII code 00). The subroutine should place the length of the record read into a variable named LENGTH. Use immediate addressing and register-to-register instructions to make the process as…