It consists of variety of programs that supports the operation of the computer. This software makes it possible for the user to focus on the other problems to be solved with out needing to know how the machine works internally. Eg: operatirig system, assembler, loader.
Comiler is a set of program which converts the whole high level language program to machine language program.
Interpreter is a set of programs which converts high level language program to machine language program line by line
Loader is a set of programs that loads the machine language translated by the translator into the main memory and makes it ready for execution.
Opcode^ | 1 D1 | 2 | D2 |
0 | 7 8 15 16 19 20 | 31 | 32 35 36 47 |
It is 6 byte instruction used to move L+1 bytes of data from storage location 1 to storage location2.
Storage Location 1 = D1 + [B1]
Storage Location2 = D2 + [B2]
Eg: MOV 60, 400(3), 500(4)
Base relative addressing | PC relative addressing |
Target address is calculated using formula address = Displacement + [B] B-base register |
Target address is calculated using formula address = Displacement + [PC] PC -program counter |
Displacement lies between 0 to 4095 | Displacement lies between -2048 to 2047 |
In this addressing mode the operand value is given directly. There is no need to refer memory. The immediate addressing is indicated by prefix '#'. Eg: ADD #6
In this instruction, one operand is in accumulator and the second operand is an immediate value . The value 5 is directly added with the accumulator content and the result is stored in accumulator.
In the case of immediate addressing the operand field gives the memory location. The word from the given address is fetched and it gives the address of the operand. Eg: ADD R5,[600].
Here, the second operand is given in indirect addressing mode. First the word in memory location 600 is fetched and which will give the address of the operand.
CISC - Power PC, Cray T3E
RISC - VAX,Pentium Pro architecture
A - Accumulator
It is used for arithmetic operation. i.e. in the case of arithmetic operations one operand is in the accumulator and other operand may be an immediate value, reg ister operand or memory content. The operation given in the instruction is performed and the result is stored in the accumulator register.
L - Linkage register
It is used to store the return address in the case of jump to subroutine (JSUB) instructions.
Format 1 (1 byte), format 2 (2 bytes), format 3 (3 bytes) and format 4 (4 bytes) are the different instructions used in SIC/XE architecture.
Format 2 :
8 4 4
OPCODE R1 R2
In the first instruction, immediate addresing is used. Here the value 3 is directly loaded into the accumulator register.
In the second instruction, the memory reference is used. Here the address (address assigned for the symbol THREE), is loaded into the accumulator register.
The numeric format is used to represent numeric values with one digit per byte. In the numeric format, if the sign appears in the last byte, it is known as the trailing numeric. If the sign appears in a the separate byte preceding the first digit, then it is called as leading separate numeric.
Register direct, register deferred, auto increment and decrement, program counter relative, base relative, index register mode and indirect addressing are the various addressing modes in the VAX architecture.
Here the target address is calculated using the formula
T.A = (register) + displacement
LDA ALPHA
ADD ONE
STA BETA
ALPHA RESW 1
BETA RESW 1
ONE RESW 1
LDA ALPHA
ADD #1
STA BETA
ALPHA RESW 1
BETA RESW 1
The Test Device (TD) instruction tests the addressed device is ready to send or receive a byte of data. The condition code is set to indicate the result of this test. Setting of '<' means the device is ready to send or receive, and '=' means the device is not ready.
These are the statements that are not translated into machine instructions, but they provide the instructions to assembler itself.
Example: START,END,BYTE,WORD,RESW and RESB
It is a reference to a label that is defined later in a program.
Consider the statement -
10 1000STL RETADR
80 1036 RETADR RESW 1
The first instruction contains a forward reference RETADR. If we attempt to translate the program line by line, we will be unable to process the statement in line 10, because we do not know the address that will be assigned to RETADR. The address is assigned later (in line 80) in the program.