Mod 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

System Software Application Software 3. Device Management:• Keeps tracks of all devices.

racks of all devices. Macro Processor:macro processing facility, which Characteristics of a Compiler:• Machine Dependent: Key Differences between Compiler and Assembler
1. System software is the type of software which is the Program responsible for this task is known as the I/O permits the programmer to define an abbreviation for Each compiler has its own machine language. 1. The compiler generates assembly code and some
interface between application software and the system. controller.• Decides which process gets the device a part of his program and to use the abbreviation in Compilers are machine dependent – means that you compilers can also directly generate executable code
1. Application software is the type of software which when and for how much time.• Allocates the device in his program. Macro instructions (Macros) are single- cannot use a compiler in CRAY, to translate a whereas, the assembler generates reloadable machine
runs as per user request– runs on the platform the efficient way.• De-allocates devices. line abbreviations for a group of instructions. The program that could be understood by the IBM-360. code. 2. The compiler takes as input the preprocessed
provided by the system software 2. It is intended to 4. File Management:• Keeps track of information, macro processor treats the identical parts of the • Language Dependent:A PASCAL compiler cannot be code generated by preprocessor. On the other hands,
support the operation and make use of the computer location, uses, status etc. The collective facilities are program defined by the abbreviation as a macro used to translate a program written in C language. the assembler takes assembly code as input. 3. The
system 2. It is concerned mainly with the solution of often known as file system.• Decides who gets the definition and saves the definition. The macro compilation takes place in two phases that are analysis
the problem and makes use of the computer as a resources.• Creating and deleting files• Creating and processor substitutes the definition for all occurrences phase and synthesis phase.In analysis phase, the input
software tool. 3. Are developed in low level language deleting directories to organize files• Supporting of the abbreviation (macrocall)in the program.Macros goes through lexical analyzer, syntax analyzer,
which is more compatible with the system hardware in primitives for manipulating files and directories• differ from subroutines in one fundamental respect. semantic analyzer whereas; the synthesis analysis
order to interact with. 3. Developed in high level Mapping files onto secondary storage• Backing up files Use of a macro name in the mnemonic field of an takes place via intermediate code generator, code
languages 4. Installed on the computer when the on stable(non-volatile) storage media assembly statement leads to its expansion, whereas use optimizer, code generator. On the other hands,
operating system is installed 4. Used by user to 1. Security − By means of password and similar other of a subroutine name in a call instruction leads to its assembler passes the input through two phases. The
perform a specific task 5. Less or no user interaction techniques, it prevents unauthorized access to execution. first phase detects the identifiers and allots addresses
5. More user interaction 6. Depends on machine programs and data. 2. Control over system Language Translators:1. Assembler:mnemonic to them in the second phase the assembly code is
architecture 6. Independent on machine architecture performance − Recording delays between request for a (symbol) for each machine instructions, which they translated to binary code. 4. The assembly code
7. Eg: Compiler, assembler, etc. 7. Eg: web browser, service and response from the system. 3. Job would subsequently translate into machine language. generated by the compiler is a mnemonic version of
Photoshop, ms-office accounting − Keeping track of time and resources Such a mnemonic machine language is now called an machine code. However, the reloadable machine code
Functions of Operating System used by various jobs and users. 4. Error detecting aids assembly language. Programs known as Assemblers generated by assembler is a binary reloadable code.
1. Memory Management:• Keeps tracks of primary − Production of dumps, traces, error messages, and were written to automate the translation of assembly 3. Interpreter:The interpreter consists of three main
memory, i.e., what part of it are in use by whom, what other debugging and error detecting aids. 5. language into machine language. The input to an components: ▪ Symbol Table: The symbol table holds
parts are not in use?• In multiprogramming, the OS Coordination between other software’s and users − assembler program is called source program. The the information concerning entities in the source
decides which process will get memory when and Coordination and assignment of compilers, output is a machine language translation called object program. ▪ Data Store: The data store contains values
how much.• Allocates the memory when a process interpreters, assemblers and other software to the program. of the data items declared in the program being
requests it to do so.• De-allocates the memory when a various users of the computer systems. 6. Secondary 2. Compiler:A compiler is a computer program which interpreted.▪ Data Manipulation Routine: This set
process no longer needs it or has been terminated. storage management – is a task performed by an helps you transform source code written in a high-level contains a routine for every legal data manipulation
2. Process Management:• Keeps tracks of processor operating system in conjunction with the use of disks, language into low-level machine language. It translates action in the source language.
and status of process. The program responsible for tapes, and other secondary storage for a user’s the code written in one programming language to Types of Compilers:• Incremental compiler• Cross Types of Interpreter:▪ Pure Interpreter
thistask is known as traffic controller. • Allocates/ programs and data. some other language without changing the meaning of Compiler• Load & Go Compiler• Threaded Code Pure Interpreters do not change the source code and
Schedules the processor (CPU) to a process. • De- Text Editors:Line Editors,Stream Editors,Screen the code. The compiler also makes the end code compiler• Stage Compiler• Just-in-time Compiler retains the source form throughout the interpretation
allocates processor when a process is no longer Editors,Word Processor,Structure Editors efficient which is optimized for execution time and • Parallelizing Compiler process. This requires more overhead and the process
required. memory space. According to passes, Compilers can be: becomes a bit complex.
• Single pass compiler• Multi-pass compiler

firstly source code is translated to target program then to the executable module in main memory. There are the other hands, loader allocates space to an
executed. While in Interpreter It’s a one-step process three kinds of loading approaches: executable module in main memory. 4. The linker can
in which Source code is compiled and executed at the • Absolute loading • Relocatable loading • Dynamic be classified as linkage editor and dynamic linker
same time. 8. The compiler is used in programming run-time loading whereas loader can be classified as absolute loader,
languages like C, C++, C#, Scala, etc. On the other Absolute loading: This approach loads the executable relocatable loader and dynamic run-time loader.
▪ Impure Interpreter Interpreter is employed in languages like PHP, Ruby, file of a program into a same main memory location Debugger (in A debugger is a software program used
The source code is subjected to initial preprocessing Python, etc. each time. But it has some disadvantages like a to test and find bugs(errors) in other programs. The
before the code is eventually interpreted. The actual Linker:The Assembler generates the object code of a programmer must be aware of the assignment strategy tool is known as debugging tool. Two modes of
analysis overhead is now reduced and the process source program and hands it over to the linker. The for loading the modules to main memory. In case, the operation of debugging tools are:▪ Full Simulation
speeds up and efficient interpretation. linker takes this object code and generates the program is to be modified involving some insertion ▪ Partial Simulation
executable code for the program, and hand it over and deletion in the program, then all the addresses of There are two types of debuggers:▪ CorDBG
to the Loader.The high-level language, programs have the program have to be altered. Relocatable loading: (command-line debugger)▪ DbgCLR (graphic
some built-in libraries and header files.The linker In this approach, the compiler or assembler does not debugger)
Key Difference between Compiler and Interpreter links these function to the built-in libraries. In case produce actual main memory address. It produces the SIC Machine Architecture
1. The compiler takes a program as a whole and the built-in libraries are not found it informs to the relative addresses.Dynamic Run-Time loading: In this Memory:
translates it, but interpreter translates a program compiler, and the compiler then generates the error. approach, the absolute address for a program is Memory consists of 8-bit bytes. Any 3 consecutive
statement by statement. 2. Intermediate code or target Sometimes the large programs are divided into the generated when an instruction of an executable bytes form a word (24 bits).All addresses on SIC is
code is generated in case of a compiler. As against subprograms which are called modules. Now when module is actually executed. It is very flexible, the byte addresses. Words are addressed by the location of
interpreter doesn’t create intermediate code. 3. A these modules are compiled and assembled, the object loadable module/executable module can be loaded into their lowest numbered byte. There are a total of 2^15
compiler is comparatively faster than Interpreter as modules of the source program are generated. The any region of main memory. The executing program (32768) bytes in the computer memory.
the compiler take the whole program at one go linker has the responsibility of combining/linking all can be interrupted in between and can be swapped out
whereas interpreters compile each line of code after the object modules to generate a single executable file to the disk and back to main memory this time at a
the other. 4. The compiler requires more memory than of the source program. Two types of linkers: different main memory address.
interpreter because of the generation of object code. • Linkage Editor: It is a linker that generates the Key Differences between Linker and Loader
5. Compiler presents all errors concurrently, and it’s reloadable, executable module. • Dynamic Linker: It 1. The linker generates the executable file of a
difficult to detect the errors in contrast interpreter defers/postpones the linkage of some external modules program whereas, the loader loads the executable file
display errors of each statement one by one, and it’s until the load module/executable module is generated. obtained from the linker into main memory for Registers:
easier to detect errors. 6. In compiler when an error Here, linking is done during load time or run time. execution. 2. The linker intakes the object module of a There are 5 registers and all of them have special uses.
occurs in the program, it stops its translation and after Loader:The program that has to be executed currently program generated by the assembler. However, the Each register is 24- bits in length.
removing error whole program is translated again. On must reside in the main memory of the computer. It is loader intakes the executable module generated by the
the contrary, when an error takes place in the the responsibility of the loader, a program in an linker. 3. The linker combines all object module of a
interpreter, it prevents its translation and after operating system, to load the executable file/module of program to generate executable modules it also links
removing the error, translation resumes. 7. In a a program, generated by the linker, to the main the library function in the object module to built-in
compiler, the process requires two steps in which memory for execution. It allocates the memory space libraries of the high-level programming language. On
Data Formats: • Instructions for integer arithmetic operations Assembler Directives SIC/XE Machine Architecture
Integers are stored as 24-bit binary numbers. Negative – ADD, SUB, MUL, DIV Assembler directives are known as Pseudo instruction. Memory:
numbers are stored as 2’s complement representation. – All arithmetic operations involve register A and a They tell the assembler to establish start address for Memory consists of 8-bit bytes. Any 3 consecutive
Characters are stored using their 8-bit ASCII codes. word in memory with result being left in the register your program, to reserve space for variables, to bytes form a word (24 bits).All addresses on SIC/XE is
There is no floating-point hardware on the standard • Instruction COMP include additional source files. START, END, BYTE, byte addresses. Words are addressed by the location of
version of SIC. – Compares the value in register A with a word in WORD, RESW, RESB are some of the assembler their lowest numbered byte. The maximum memory
Instruction Format: memory directives. available on a SIC/XE system is 1 Megabyte (2^20
All machine instructions on standard version of SIC – This sets a condition code, CC to indicate the result START bytes). This increase leads to a change in instruction
are 24-bit format. The following is the representation (<,=,>) Specify name and starting address for the program. formats and addressing modes.
of instruction format. The flag bit x is used to indicate • Conditional Jump Instructions eg: START 100 Registers:
indexed addressing mode. – JLT, JEQ, JGT Statement indicates that the first word of the object There are 9 registers and all of them have special uses.
– Can test the setting of CC and jump accordingly. program generated by the assembler should be placed Each register is 24- bits in length, except floating point
Addressing Modes: • Instructions for Subroutine linkages with the address 100. accumulator (F) which is 48- bit length.
There are two addressing modes available, indicated – JSUB – jumps to the subroutine, placing the return END Data Formats:
by the setting of the x bit in the instruction. In direct address in register L Indicate the end of the source program means no Integers are stored as 24-bit binary numbers. Negative
addressing mode the flag bit x=0. Here the target – RSUB – returns by jumping to the address more assembly statements remain to be processed. numbers are stored as 2’s complement representation.
address is specified by the actual address in the contained in the register L And (optionally) specify the first executable Characters are stored using their 8-bit ASCII codes.
instruction itself. In indexed addressing mode the flag • Input/ Output Instructions instruction in the program. There is no floating-point hardware on the standard
bit x=1. Here the target address is computed by – Input and output are performed by transferring 1 BYTE version of SIC. Additionally, there is a 48-bit floating-
adding the actual address specified in the instruction byte at a time to or from the rightmost 8-bits of Generate character or hexadecimal constant, point data type
and the contents of the Index Register. The table register A – Each device is assigned a unique 8-bit occupying as many bytes as needed to represent the
following describes how the target address is code. – TD (Test Device): this instruction tests whether constant eg: CHARZ BYTE C’Z’
calculated from the address given in instruction. the addressed device is ready to send or receive a byte WORD
• s – indicates sign of floating – point number
Parentheses are used to indicate the contents of a of data. Condition code is set to indicate the result of Generate one-word integer constant
– If s= 0, then it is a positive number
register or a memory location. For example, (X) this test. eg: FIVE WORD 5
– If s= 1, then it is a negative number
represents the contents of register X. ----If < means the device is ready to send or receive RESB
• A value of zero is represented by setting all bits
data Reserve the indicated number of bytes for a data area
(including sign, exponent and fraction) as 0
----- If = means the device is not ready eg: C1 RESB 1
• Fraction(f) is the value between 0 and 1
– A program needing to transfer data must wait until RESW
• Exponent (e) part is an unsigned binary number
the device is ready, then execute RD and WD. Reserve the indicated number of words for a data area
Instruction Set: between 0 and 2047 →(2^11=2048)
– RD (Read Data) eg: ALPHA RESW 1
• Instructions for load and store registers • Absolute value f* 2^(e-1024)
– WD(Write Data)
– LDA, STA, LDX, STX, LDL, STL
– This sequence must be repeated for each byte of data
to be read or written.

Instruction Format: If b = 0, p = 0 TA = disp • Indexing cannot be used with immediate or indirect Instruction Set:
In SIC, there is only 1 format (24-bit). But in SIC/XE, • Displacement field (disp): It is an 8-bit or 16-bit addressing modes ▪ Instructions for load and store registers
as the memory size is large, this instruction format is immediate value given in the instruction • Special Characters used: o LDA, STA, LDX, STX, LDL, STL
not enough to address the whole memory There are • n → indirect • In Format 3 instruction: --# means immediate addressing o LDB, STB
two possible options: • i → immediate ---For base relative addressing, the displacement field ---@ means indirect addressing ▪ Instructions for integer arithmetic operations
1. Use some form of relative addressing • x → indexed (disp) is interpreted as 12-bit unsigned integer. Examples of different addressing modes in SIC/XE o ADD, SUB, MUL, DIV
2. Extend the address field to 20 bits • b → base relative ---For program counter relative addressing, the ( LDA instruction): o All arithmetic operations involve register A and a
There are 4 formats of instructions available in • p → program counter relative displacement field(disp) is interpreted as 12-bit signed word in memory with result being left in the register
SIC/XE • e → indicate the format (either 3 or 4) interger, with negative values in 2’s complement ▪ Instructions for Floating point arithmetic operations
SIC/XE provides some instructions that do not • e bit : representation o ADDF, SUBF, MULF, DIVF
reference memory at all (as in format 1 &2) -- If e=0, then instruction is of format 3. • Both the relative addressing can also be combined ▪ Instructions that take operands from registers
--If e=1, then instruction is of format 4. indexed addressing by using the x bit flag field o RMO (Register Move)
• b and p bit: before that first understood what is • x bit : indexed addressing ▪ Instruction for register – to - register arithmetic
relative addressing ---If x =1, TA can be calculated by adding the content operations
--• Relative Addressing of the X register also with the already calculated the o ADDR, SUBR, MULR, DIVR
--• Means we are specifying some address of the TA for the relative addressing ▪ Special instruction
operand relating to some registers (normally using • In Format 4 instruction the bits b and p are normally o SVC (Supervisor call) Executing this instruction
• In format 1, 8bits for opcode only eg: RSUB base register or program counter) set to 0 → then the target address is taken from the generates an interrupt that can be used for
• In format 2, 8 bits for opcode and 2 registers each --• If specifying the address in relative to base register address field of the instruction. This is known as communication with the operating system
having 4bits eg: COMPR A,S (B) , then it is called base relative addressing Direct Addressing o LPS (Load Processor Status)→ This instruction
• In format 3, 6 bits for opcode, 6bits of flags specifies --• If specifying the address in relative to program • i and n bits: specify how target address is used. stores the CPU status and register contents existing at
the addressing modes, and 12 bit displacement. Eg: counter(PC), then it is called program counter relative any time of the interrupt. It transfers control to the
LDA #3 addressing instruction that follows the one that was being
• In format 4, 6 bits for opcode, 6 bits of flags specifies executed when the interrupt occurred.
the addressing modes and 20 bits of address. Eg: ▪ Instruction COMP, COMPR
JSUB READ o Compares the value in register A with a word in
Addressing Modes: memory and also between registers
(Specifies where the operand of the particular o This sets a condition code, CC to indicate the result
instruction available) (<,=,>)
In SIC, only 2 addressing modes: direct addressing ▪ Conditional Jump Instructions
with or without indexing o JLT, JEQ, JGT
( ie., 1. Direct addressing 2. Indexed addressing) o Test the setting of CC and jump accordingly
Consider the flag bits discussed in instruction format
▪ Instructions for Subroutine linkages
o JSUB – jumps to the subroutine, placing the return
address in register L
o RSUB – returns by jumping to the address
contained in the register L
▪ Input/ Output Instructions
o Input and output are performed by transferring 1
byte at a time to or from the rightmost 8-bits of
register A
o Each device is assigned a unique 8-bit code.
▪ TD (Test Device): this instruction tests whether the
addressed device is ready to send or receive a byte of
data. Condition code is set to indicate the result of this
test.
-- If < means the device is ready to send or receive data
--If = means the device is not ready
▪ A program needing to transfer data must wait until
the device is ready.
▪ RD (Read Data)
▪ WD(Write Data)
▪ This sequence must be repeated for each byte of data
to be read or written
--SIC/XE supports I/O channels that can be used to
perform input and output operation (data transfer)
while the CPU is executing other instructions
---Channel program controls sequence of operation
performed by a channel
---This allows overlapping of computing and I/O –
results in more efficient system
operation
▪ SIO Start an I/O channel number
▪ TIO Test an I/O channel number
▪ HIO Halt an I/O channel number

You might also like