Академический Документы
Профессиональный Документы
Культура Документы
Q 1. What is the difference between a macro and a subroutine? Explain with example.
A. Difference between macro and subroutine
Macro Subroutine
Macro is called by simply using its name. A subroutine is called by the BSR or JSR instructions.
Simpler to write and use. Subroutines are more complex, stacks are used.
Example:
Example:
sqr macro
&hello;
move X,d0
sub hello {
muls d0,d0
print “Hello World .! \n”;
move d0,X
}
mend
Q 2. How is pure interpreter different from impure interpreter? Explain with examples for each.
A. In a pure interpreter, the source program is retained in the source form all through its
interpretation. This arrangement incurs substantial analysis overheads while interpreting a statement.
An impure interpreter performs some preliminary processing of the source program to reduce the analysis
overheads during interpretation. The preprocessor converts the program to an intermediate
representation (IR), which is used during interpretation. This speeds up interpretation as the code
component of the IR i.e. the IC, can be analyzed more efficiently than the source form of the program .
Q 3. What do understand by the terms – translation time address, linked address, load time address,
translated origin, and load origin?
A. Translation time address: Translation time address is used at the translation time. This address is
assigned by translator
Suraj Dev Singh Roll No: 17STAMCA027
Linked address: Linked address are the addresses which are assigned to the linker .
Load time address: These are the address assigned by the loader.
Translated origin: These are the addresses which are assumed by the translator.
Load origin: These are the address of the origin assigned by the loader while loading the program for
execution.
Editor: It can be any text editor which can be used for writing codes by the programmer.
Compiler: Compiler is a software which converts a program written in high level language (Source
Language) to low level language (Object/Target/Machine Language).
Assembler: For every platform (Hardware + OS) there is an assembler. They are not universal since for
each platform one assembler is needed. The output of assembler is called object file. Its translates
assembly language to machine code.
Linker: It converts the relocatable code into absolute code and tries to run the program resulting in a
running program or an error message.
Loader: Linker loads a variety of object files into a single file to make it executable. Then loader loads it in
memory and executes it.
Debugger: There are programs called debuggers that help software developers find and eliminate bugs
while they are writing programs. A debugger tells the programmer what types of errors it finds and often
marks the exact lines of code where the bugs are found. Debuggers also allow programmers to run a
program step by step so that they can determine exactly when and why a program crashes.
References
Q1:
1. http://users.encs.concordia.ca/~aagarwal/coen311/notes/macro.pdf
Q2:
1. https://study-for-exam.blogspot.com/2013/05/explain-following-i-elimination-of.html
Q3:
1. http://www.wbuthelp.com/chapter_file/2681.pdf
Q4:
1. https://www.careerride.com/os-loader-and-linker.aspx
Q5:
1. http://www.keil.com/support/man/docs/a166/a166_st_extrn.htm
2. http://www.lahey.com/docs/lfpro78help/F95ARENTRYStmt.htm
Q6:
1. https://www.geeksforgeeks.org/introduction-compiler-design/
2. https://techterms.com/definition/debugger