Wednesday, August 10, 2011

System Software Assignment

I have find out solution of our system software assignment..
Hope it will be right. Pls help me to solve the question if i'm wrong.
pls write it down on comment portion.Thanks!!!! 


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


Assembly Code:

LDS #3
LDT #300
LDX #0
ADDLOOP LDA ALPHA, X
MUL #4
ADD BETA, X
STA GAMMA, X
ADDR S, X
COMPR X, T
JLT ADDLOOP
:
:
ALPHA RESW 100
BETA RESW 100
GAMMA RESW 100




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


Assembly Code:

LDS #3
LDT #300
LDX #0
CLOOP LDA ALPHA, X
COMP MAX
JLT NOCH
STA MAX
NOCH ADDR S, X
COMPR X, T
JLT CLOOP
:
:
ALPHA RESW 100
MAX WORD -32768





16. Write a subroutine for SIC that will read a record into a buffer, as in Fig.1.7(a). 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.


Assembly Code:

JSUB RDREC
:
:
RDREC LDX ZERO
RLOOP TD INDEV
JEQ RLOOP
RD INDEV
COMP NULL
JEQ EXIT
STCH BUFFER, X
TIX K100
JLT RLOOP
EXIT STX LENGTH
RSUB
:
:
ZERO WORD 0
NULL WORD 0
K100 WORD 1
INDEV BYTE X ‘F1’
LENGTH RESW 1
BUFFER RESB 100





Here i have uploaded C.G Sir Notes.Download it from below..
System_software notes    download