Write a SIC/XE program a program to copy a character string to another char string
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 […]
System Software – SIC/XE Program to write a subroutine for SIC that will read a record into a buffer
Problem Statement Write a subroutine for SIC 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. Solution […]
System Software – SIC/XE Program to write a subroutine for SIC that writes record on to device 05
Problem Statement Suppose that RECORD contains a 100-byte record. Write a subroutine for SIC that will write this record on to device 05. Solution Line Number Code Comment 1 JSUB WRREC 2 WRREC LDX ZERO 3 WLOOP TD OUTPUT 4 JEQ WLOOP 5 LDCH RECORD, X 6 WD OUTPUT […]
System Software – SIC/XE Program to find the maximum element in the array and store result in MAX
Problem Statement 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. Solution Line Number Code Comment LDS #3 LDT #300 LDX #0 CLOOP LDA ALPHA, X […]
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 Number Code Comments 1 LDS #3 2 LDT #300 3 LDX #0 4 ADDLOOP LDA […]
System Software – SIC/XE Program to arrange an array of 100 words in ascending order
Problem Statement Suppose that ALPHA is an array of 100 words. Write a sequence of instruction for SIC/XE to arrange the 100 words in ascending order and store result in an array BETA of 100 elements. Solution Line Number Code Comments 1 SORT START 0 2 OUTER LDX INDEX 3 LDS ARR1,X […]
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 Number Code Comments 1 LDS #3 2 LDT #300 […]
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 clear 20 byte string to empty
Problem Statement Write a sequence of instructions for SIC/XE to clear a 20-byte string to all blanks. Solution Line Number(ac) Code Description 1 LDX ZERO 2 LOOP LDCH BLANK 3 STCH STR1,X 4 TIX TWENTY 5 JLT LOOP 6 STR1 RESW 20 7 BLANK BYTE C ‘ ‘ […]