






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







CS 1203 SYSTEM SOFTWARE III Sem CSE QUESTION BANK - UNIT-II ASSEMBLERS
Why an Assembly Language is needed? Programming in machine code, by supplying the computer with the numbers of the operations it must perform, can be quite a burden, because for every operation the corresponding number must be looked up or remembered. Looking up all numbers takes a lot of time, and mis-remembering a number may introduce computer bugs. So Assembly Languages are evolved which contains mnemonic instructions corresponding to the Machine codes using which the program can be written easily. Therefore a set of mnemonics was devised. Each number was represented by an alphabetic code. So instead of entering the number corresponding to addition to add two numbers one can enter "add". Although mnemonics differ between different CPU designs some are common, for instance: "sub" (subtract), "div" (divide), "add" (add) and "mul" (multiply).
What is an Assembler? An assembler is a program that accepts an assembly language program as input and produces its machine language equivalent along with information for the loader (An Assembler translates a program written in an assembly language to it machine language equivalent)
Explain the terms a)Label,b)Opcode,c)Operand,and d)Comment ( What is the format in which the assembly language program is written?).
E.g. STL -> 14 (line 10)
Functions of Two Pass Assembler
10) Write an Algorithm for pass 1 of SIC Assembler.
11) Write an algorithm for pass 2 of SIC assembler.
What are the Data Structures used in an Assembler? Data Structures: Operation Code Table (OPTAB) Symbol Table (SYMTAB) Location Counter(LOCCTR)
Explain the features of a Symbol Table.
15)..h..i Larger memory allows us to load many programs. 15)..h..ii The object code is relative to zero because the load address is variable. 15)..h..iii Program must be relocated when it is loaded in memory. 15)..i (^) Register set mapping. 15)..i..i A separate register table can store the numeric values of the registers. 15)..i..ii The numeric values of the registers can be preloaded with the symbol table. 15)..j Relative (PC and base) addressing mode. 15)..j..i Operand value is subtracted from PC or base register value. 15)..j..ii PC relative addressing provides a displacement from – to +2047. 15)..j..iii Base relative addressing provides a displacement from 0 to
Sample Program for a One-Pass Assembler
Load-and-Go Assembler
two undefined symbol in the defining expression
2 MAXLEN EQU BUFEND-BUFFER
After scanning line 160
5 BUFEND EQU *
appended to the list
depending list
depending list
undefined symbol
undefined symbol
defining expression
SYMTAB
SYMTAB
OPTAB
Object Code in Memory and SYMTAB
Object Code in Memory and SYMTAB