0% found this document useful (0 votes)
23 views4 pages

Less 7 Introduction of Assembler

Uploaded by

areebaahraf090
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

Less 7 Introduction of Assembler

Uploaded by

areebaahraf090
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Introduction of Assembler

Assembler is a program for converting instructions written in low-level assembly code into
relocatable machine code and generating along information for the loader. It is necessary to
convert user-written programs into machinery code. This is called a translation of a high-level
language to a low-level that is machinery language. This type of translation is performed with
the help of system software. An Assembler can be defined as a program that translates an
assembly language program into a machine language program. Self-assembler is a program that
runs on a computer and produces the machine codes for the same computer or same machine.
It is also known as a resident assembler. A cross-assembler is an assembler that runs on a
computer and produces machine codes for other computers.

Types of Assembler

The assembler generates instructions by evaluating the mnemonics (symbols) in the operation
field and finding the value of symbols and literals to produce machine code. On the basis of this
functionality, assembler has two types:

 Single-Pass Assembler: If an assembler does all this work in one scan then it is called a
single-pass assembler.
 Multiple-Pass Assembler: If it does it in multiple scans then called a multiple-pass
assembler.

Working of Assembler

Assembler divides tasks into two passes:

Pass-1

 Define symbols and literals and remember them in the symbol table and literal table
respectively.
 Keep track of the location counter.
 Process pseudo-operations.
 Defines a program that assigns the memory addresses to the variables and translates
the source code into machine code.

Pass-2

 Generate object code by converting symbolic op-code into respective numeric op-code.
 Generate data for literals and look for values of symbols.
 Defines a program that reads the source code two times.
 It reads the source code and translates the code into object code.

What is Debuggers?
A debugger is a tool that allows you to examine the state of a running program. Debugging is
the process of locating and then removing bugs or errors in a program. An interactive
debugging system gives programmers tools to help them test and debug their programs.
Debugging is the methodical process of locating and eliminating bugs or defects in a computer
program.

Types of Debuggers:

Static debugger: A static debugger does not rely on any specific software. The debugging can be
completed by the user.

Dynamic debugger: A dynamic debugger can be either software or hardware. There are several
types of dynamic debuggers, including the following:

 Breakpoint Debugger: Adding conditional and unconditional breakpoints to the


program at various points
 Kernel Debugger: To debug the operating system, a debugger with kernel debugging
capabilities is provided.
 Debugger with the same process: The debugger and debuggee processes are identical,
and they both share the main memory. This type of debugger is simple and
straightforward to implement. This debugger executes more quickly.

Need for Debugging:

When errors in a program code are identical, it is necessary to first identify the precise program
statements responsible for the errors and then fix them. Debugging is the process of identifying
and correcting errors in program code.

Features of Breakpoint Debuggers:

 The Breakpoint debugger supports unit testing.


 The flow of program execution is controlled by a breakpoint debugger.
 The programmer may use some unconditional statement in the program, so it supports
this type of program.
 It is possible to trace the flow of execution logic at different levels and data
modifications.
 Checkpoint provides a snapshot of program output.
 The program can add a watchpoint in the source code.
 The process of execution in a debugger helps back to the previous state of execution.

Process of Debugging:

The following are the various steps involved in debugging:

 Recognize the Error: Identifying an error in a wrong may lead to time waste. It is
obvious that the production errors reported by users are difficult to interpret, and the
information we receive is sometimes misleading. As a result, identifying the actual error
is required.
 Locate the Error: Once the error has been correctly identified, you will need to
thoroughly review the code several times to locate the position of the error. This step, in
general, focuses on locating the error rather than perceiving it.
 Evaluate the Error: The third step is error analysis, which is a bottom-up approach that
begins with locating the error and then analyses the code. This step facilitates
understanding of the errors. Essentially, error analysis has two major goals: reevaluating
errors to find existing bugs and postulating the uncertainty of incoming collateral
damage in a fix.
 Verify the Analysis: After analyzing the primary bugs, look for any additional errors that
may appear on the application. The fourth step is used to write automated tests for
such areas by incorporating the test framework.
 Cover Lateral Damage: The fifth phase involves collecting all of the unit tests for the
code that needs to be modified. When you run these unit tests, they must succeed.
 Fix & Validate: The final stage is fix and validation, which focuses on fixing bugs before
running all of the test scripts to see if they pass.

Advantages of Debugging

 Identifying and fixing errors: The primary advantage of debugging is that it helps
identify and fix errors in software code. By locating and correcting bugs, developers can
ensure that their code performs as intended and meets the required standards.
 Enhancing code quality: Debugging also helps improve the overall quality of the code.
By detecting and fixing errors, developers can eliminate issues that could cause
performance problems or security vulnerabilities.
 Saving time and resources: Debugging can save time and resources by reducing the
need for trial-and-error testing. By pinpointing the source of the problem, developers
can more quickly and accurately address the issue.
 Gaining insights into software behavior: Debugging can provide valuable insights into
how software behaves under different conditions. Developers can use this information
to refine their code, optimize performance, and enhance the user experience.

Disadvantages of Debugging

 Time-consuming: Debugging can be a time-consuming process, especially if the issue is


complex or difficult to reproduce. This can slow down the development process and
delay the release of software.
 Costly: Debugging can be a costly process, as it requires skilled developers and
specialized tools. This can add to the overall cost of software development and
maintenance.
 Difficulty in reproducing bugs: Sometimes, it can be difficult to reproduce bugs,
especially if they occur under specific conditions or with specific data inputs. This can
make debugging more challenging and time-consuming.
 Over-reliance on debugging: If developers rely too heavily on debugging, they may miss
opportunities to design more efficient, reliable, and secure code. Debugging should be
used in combination with other software development practices, such as testing and
code reviews, to ensure the highest quality code.

You might also like