0% found this document useful (0 votes)
69 views1 page

Module 1 Execises

Uploaded by

akhilappus0101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views1 page

Module 1 Execises

Uploaded by

akhilappus0101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment 1

1. Write a sequence of instructions for SIC to ALPHA equal to the product of BETA and
GAMMA.

2. Write a sequence of instructions for SIC/XE to set ALPHA equal to 4 * BETA – 9. Use
immediate addressing for the constants.

3. Write SIC instructions to swap the values of ALPHA and BETA.

4. Write a sequence of instructions for SIC/XE to divide BETA by GAMMA, setting ALPHA to
the integer portion of the quotient and DELTA to the remainder. Use register-to-register
instructionsto make the calculation as efficient as possible.

5. Write a sequence of instructions for SIC/XE to clear a 20-byte string to all blanks. Use
immediateaddressing and register-to-register instructions to make the process as
efficient as possible.

6. Suppose 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.

7. Suppose 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.

8. Suppose that ALPHA is an array of 100 words. Write a sequence of instructions for
SIC/XE to findthe maximum element in the array and store results in MAX.

9. Suppose that RECORD contains a 100-byte record. Write a subroutine for SIC that will
write this record on to device 05.

10. 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 efficient as possible.

You might also like