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

Gaurav Wande1

The document discusses subroutine instructions, bit manipulation instructions, and assembly language programming. Subroutines allow code to be called in multiple places and modular development. Bit manipulation allows efficient storage and operations on bits of data. Assembly language translates high-level code into machine instructions and acts as a bridge between software and hardware.

Uploaded by

ncer.fe.b2023
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)
6 views4 pages

Gaurav Wande1

The document discusses subroutine instructions, bit manipulation instructions, and assembly language programming. Subroutines allow code to be called in multiple places and modular development. Bit manipulation allows efficient storage and operations on bits of data. Assembly language translates high-level code into machine instructions and acts as a bridge between software and hardware.

Uploaded by

ncer.fe.b2023
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
You are on page 1/ 4

Topic Name:-

SUBROUTINE INSTRUCTION, BIT MANIPULATION


INSTRUCTION & ASSEMBLY LANGUAGE
PROGRAMMING
Name :- GAURAV PRAMOD WANDE
Class :- SE-CSE

Roll No:- B-74


SUBROUTINE INSTRUCTION:-
A set of instructions that are used repeatedly in a program can be referred to as a
Subroutine. Only one copy of this Instruction is stored in the memory. When a Subroutine is
required it can be called many times during the Execution of a particular program.

A subroutine is a subprogram or code that can be executed anywhere in a program. It


performs specific tasks such as save the file, display of time, etc. Explanation: A subroutine
can be called many times during the execution of the program.

There are two types of Subroutine:-

⚫ procedures.

⚫ functions.

The Advantages of Subroutine instruction:-

⚫ Allows the subroutine to be called in more than one place within the program.

⚫ The subroutine can be tested independently.

⚫ Allows modular development of the program.

⚫ Allows a team of programmers to work independently on different components of a program.

⚫ Reduces the duplication of code within a program.

The Disadvantages of subroutines:-

The main disadvantages of using the Assembler subroutines are that they require the programmer
to call the Assembler subroutines using user-exits, and they only provide the primary arithmetic
operations: add, subtract, multiply, divide, compare and precision.

BIT MANIPULATION INSTRUCTION:-


⚫ Bit manipulation is the act of algorithmically manipulating bits or other pieces of data shorter
than a word. Computer programming tasks that require bit manipulation include low-level
device control, error detection and correction algorithms, data compression, encryption
algorithms, and optimization.

⚫ Bit manipulation instructions sets (BMI sets)

are extensions to the x86 instruction set architecture for microprocessors from Intel and AMD. The
purpose of these instruction sets is to improve the speed of bit manipulation. All the instructions in
these sets are non- SIMD and operate only on general-purpose registers.
ADVANTAGES OF BIT MANIPULATION INSTRUCTIONS:-

⚫ A big advantage of bit manipulation is that it can help to iterate over all the subsets of an N-
element set. As we all know there are 2 N possible subsets of any given set with N elements. What
if we represent each element in a subset with a bit.

⚫ Memory efficiency: Bit manipulation enables memory efficiency by allowing several values to be
stored in a single byte or word.

⚫ Disadvantages of Bit Manipulation instruction:-

⚫ Reduced code readability: Bit manipulation can sometimes make code more readable, but it can
also make it more challenging to read and comprehend, especially for developers who are
unfamiliar with the use of bitwise operators.

⚫ Example of Bit Manipulation instruction:-

⚫ AND BL, 0FH

⚫ OR AL, BL

ASSEMBELY LANGUAGE PROGRAMMING:-


An assembly language is a type of low level programming language that is intended to communicate
directly with a computer’s hardware. Unlike machine language, which consists of binary and
hexadecimal characters, assembly languages are designed to be readable by humans.

Low-level programming languages such as assembly language are a necessary bridge between the
underlying hardware of a computer and the higher-level programming languages—such as Python or
JavaScript—in which modern software programs are written.

KEY TAKEAWAYS OF ASSEMBLY LANGUAGE:-

-An assembly language is a type of programming language that translates high-level languages into
machine language.

-It is a necessary bridge between software programs and their underlying hardware platforms.

-Assembly language relies on language syntax, labels, operators, and directives to convert code into
usable machine instruction.

-Assembly language may pass through single-pass or multi-pass assemblers, each with specific uses
and benefits.

-Today, assemble languages are rarely written directly, although they are still used in some niche
applications such as when performance requirements are particularly high.

You might also like