Professional Documents
Culture Documents
7. Define PSW.
It contains the value of the location counter, protection information and interrupts
status which is 64bits in length.
SECTION - B
II. Answer any five questions. Each question carries five marks
Example: The byte address starting from 1016 it occupies four locations
4 bytes =32bits
Example:-021 is represented as
2bytes
The last 1byte (4+4 bits) is reserved for sign and data.
In between the BCD of each numbers a 4 bit zone code/padding bit/internibble
bit is introduced which contains 0/1.
The hex digits C,A,F,E indicates a +ve numbers
While D & B indicates a –ve numbers
4byts(32bits)
1bit 7bits 24bits
1 1000010 0111 0110 1010 0000 0000 0000
S Exponent Fraction
1bit-sign bit(-ve)
7bits represent exponent-in this example 5 is the exponent the range of the 7bit
is 127.so add 127+5=132 then 132 is convert to binary(2) by division method
24bits represents fraction-in this example 0.625 is the fractional part then
convert 0.625 to binary by repeated multiplication by 2
6. Long form floating point numbers
It is same as short form floating point numbers but in Long form floating point
numbers consists of 64bits (8 bytes) are allocated for the floating point number
which contains the exponential and fractional part
In character data each character code is stored in 8 bits (1byte) and its length varies
from 1 to 256 bytes.
Pass 2: databases
1. copy of the source program input to pass-1
2. LC:it is used to store each instruction location
3. MOT:it is used to store all directives or mnemonics and its length, binary opcode
and instruction format
4. POT: it is used to store all directives and its action corresponding index
5. ST(symbol table)-it is used to prepare by pass 1 it consists of each label and its
value
6. BT(base table)-it is used to store which registers are currently specified as base
register by USING pseudo opcode and it specifies the contents of these registers
7. INST-this is a work space used to store each instruction as its various parts. Ex:
binary opcodes, register fields, length fields etc
8. Print line: it is also work space used to produces a printed listing
9. Punch card: it is also work space used for converting the assembled instructions in
the format needed by the loader.
Symbol:
operators, keywords and separators [(,;,:]
Indicators: values are YES or NO Yes=> operators, separators No=> Keywords
Precedence: Used in later phase
3 Literal table: It describes all literals constants used in the source program.
It consists of 6 fields:
Literal Base Scale Precision Other address
information
4 Identifier table:
It describes all identifiers used in the source program. It consists of three fields
1. Name
2. Data attribute
3. Address
Name Data attribute Address
SECTION - C
III. Answer any three questions. Each question carries fifteen marks
21. (a) Explain General Machine Structure of IBM 360/370 with a neat
daigram.
The CPU consists of
1. An instruction interpreter
2. A location counter
3. An instruction register
4. Various working registers and
5. General purpose registers
Instruction interpreter
It is a group of electrical circuits that performs the purpose of the instructions
fetched from the memory.
It is like a decoder that decodes the type of the instruction.
Location counters (LC)
It is also known as program counter or instruction counter which holds the location
of the current instructions being executed
Instruction registers (IR)
It contains a copy of the current instruction that is executed.
Working registers (WR)
WR are memory devices that serves as „SCRATCH PAD‟S‟ (a plurality of multibit
storage locations) for instruction interpreter. WR are general purpose registers.
General purpose register GPR‟S are used by the programmer as storage locations
and for special functions.
Memory address registers (MAR)
It contains the address of memory location that is to be read from or stored into.
Memory buffer register (MBR)
It contains a copy of the designated memory location specified by the MAR, after
read or write.
Memory controller
It is hardware that transfers data between the MBR and the core memory location
the address of which in the MAR
I/O channels
It may be through of as separate computers which interpret special instructions for
inputting and outputting information from the memory.
(b) Explain instruction formats of IBM 360/370 with syntax and example.
The different instruction formats are
RR format
RX format
RS format
SI format
SS format
RR instruction:
RR instruction denotes register to register operation.i.e, both the operands are
register.
The length of RR instruction is 2 bytes (16 bits)
The general format of RR
RX instruction:
RX instruction denotes a register and indexed storage operation
The length of RX instruction is 4 bytes (32 bits)
The general format of RX instruction is
Indexed storage operand refers to the data stored in core memory. The address of
the storage operand is calculated as follows
Address=value of an offset or displacement + contents of a base register + contents
of an index register
=C(B2)+C(X2)+D2
Example: ADD 3,16(0,5)
The load instruction loads register 1 and 3 with the contents of location 1016
SS instruction
SS instruction denotes a storage to storage operation
The length of SS instruction is 6 bytes(48 bits)
The general format is
Example 1: MVC 32 (79, 5), 300(5)
Symbol table
It is a variable table
Same table is used in both pass1 and pass2
The size of the table is 14 bytes per entry
The length field indicates the length in bytes of the instruction to which symbol is
attached
Absolute means the value of the symbol doesn‟t change if the program is moved in
core
Literal table
It is also a variable table
It contains literal and its values
It is same as symbol table but instead of storing symbols we were store literals in a
table
The size of the table is 14 bytes per entry
Base table
It is a variable table
It is used to specify the base register
It is used only in pass2
The size of this table is 4 bytes per entry
Design of an absolute loader: We can design an absolute loader we must and should
having two types cards
1. Text cards.
2. Transfer cards.
1 Text cards:
This type of card is used to store instructions and data. The capacity of this card is
80bytes.
It must convey the machine instructions that assembler has created along with
assigned core location.
2 Transfer cards:These cards must convey the entry point of the program, which is
where the loader is to transfer the control when all instructions are loaded.
2 Stack: The stack is a collection of uniform symbol i.e., currently being worked on
the stack is organized in LIFO technique
3 Reduction table: The syntax rules of the source language are contained in the
reduction table The general form of the reduction or rules is:- Label: old top stack/
action routine/ new top stack/ next reduction
Algorithm:
Step1: Reduction or tested consequently for match between old top of stack field
and the actual top of stack until match is found
Step2: When match is found the action routine specified in the action fields are
executed in ordered from left to right
Step3: when controlled return to the syntax analyzer, it modifies the top of stack to
agree with the new top of tack.
Step4: step1 is repeated starting with the reduction specified in the next reduction
field
SECTION - D
IV. Answer any one questions. Each question carries ten marks
26. (a) Explain the terms macro definition , macro call ,macro expansion
with syntax and example .
Macro Definition:
Macro definition attaches a name to a sequence of instruction
Structure of macro-definition
MACRO starting of macro definition
[ ] give a macro_name
……………
……………. sequence of instruction
…………….
MEND ending of macro definition
The macro definition starts with MACRO pseudo op code. It indicates beginning of
the macro definition. The Macro-definition terminated with the MEND pseudo op
code.
Ex:
MACRO
Add
A 1, data
A 2, data
A 3, data
MEND
MACRO Calls or Invocation:
Once the macro has been defined, the use of the macro name in the place of
sequence
Definition: Sequence of instruction are simply substituted at the point of call or
macro name is referred as macro call
Ex: In the above mentioned example sequence will be repeated thrice, then we
need to replace sequence by macro name like:
MACRO
Add
A 1, data
A 2, data
A 3, data
MEND
…….
Add
……
Add
……
Data DC f „5‟
Macro Expansions:
Whenever the program needs the instruction in the place of macro name then we
need macro expansion.
Definition: The macro-processor replace each macro calls with the defined set of
instructions. This process of replacement is called macro expansion.
Source Expanded source
MACRO
Add
A 1, data
A 2, data does not appear
A 3, data
MEND
……..
Add A 1, data
…… A 2, data
…… A 3, data
Add A 1, data
…… A 2, data
….…… A 3, data
Data DC f „5‟
27. (a) Explain different types of cards used in Direct Linking Loader .
There are 4 types of cards available in the direct linking loader. They are
1. ESD-External symbol dictionary
2. TXT-card
3. RLD-Relocation and linking dictionary
4. END-card
1 ESD card:
It contains information about all symbols that are defined in the program but
reference some where
It contains:
Reference number
Symbol name
Type Id
Relative location
Length
There are again ESD cards classified into 3 types of mnemonics. They are:
1. SD [Segment Definition]: It refers to the segment definition [01]
2. LD It refers to the local definition [ENTRY] [02]
3. ER: it refers to the external reference they are used in the [EXTRN] pseudo op
code [03]
2 TXT Card:
It contains the actual information are text which are already translated.
3 RLD Card:
This card contains information about location in the program whose contexts
depends on the address at which the program is placed. In this we are used „+‟ and
„–„sign, when we are using the „+‟ sign then no need of relocation, when we are
using „-„sign relocation is necessary.
The format of RLD contains:
1. Reference number
2. Symbol
3. Flag
4. Length
5. Relative location
4 END Card:
It indicates end of the object program.
The size of the above 4 cards is 80 bytes
Advantages:
They are simple and easier to implement
Disadvantages:
This loader can perform and take only one object program at a time
A portion of memory is wasted because of the memory occupied by the assembler
for each object program due to that assembler necessary to retranslate the user
program every time
It is very difficult to handle multiple segments or subprograms