Category: Assembly Language
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 Line Number Code Comments 1 RDREC LDX ZERO 2…
System Software – SIC/XE Program to divide BETA by GAMMA and set ALHPA to floating quotient
Problem Statement Write a sequence of instructions for SIC/XE to divide BETA by GAMMA, setting ALPHA to the value of the quotient, rounded to the nearest integer. Use register-to-register instructions to make the calculation as efficient as possible. Solution Line Number(ac) Code Description 1 LDF BETA 2 DIVF GAMMA 3 FIX 4 STA ALPHA 5 ALPHA RESW 1 6 BETA…
System Software – SIC/XE program to copy a character string to another string
Write a SIC/XE program a program to copy a character string to another char string
System Software – Given the target address generated for the following machine instruction
System Software – Given the target address generated for the following machine instruction
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…