0% found this document useful (0 votes)
19 views3 pages

Experiment No. 10 MP

The document outlines an assembly programming experiment focused on creating reusable procedures to simplify code. It describes the hardware and software configurations used, as well as the theory behind procedures, including their syntax and types (near and far). Additionally, it explains the directives and instructions related to procedures, such as PROC, ENDP, CALL, and RET.

Uploaded by

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

Experiment No. 10 MP

The document outlines an assembly programming experiment focused on creating reusable procedures to simplify code. It describes the hardware and software configurations used, as well as the theory behind procedures, including their syntax and types (near and far). Additionally, it explains the directives and instructions related to procedures, such as PROC, ENDP, CALL, and RET.

Uploaded by

yogita.gawdeds
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment No.

:06

Aim: Assembly program using procedure.

Objective: To understand how to provide us an ease in our code by making the set
of instructions reusable

Hardware configuration:Device Name :- computer-ThinkCentre


Hardware Model :- Lenovo ThinkCentre neo 50t Gen 3
Memory :- 8.0 Gib
Processor :- 12th Gen Intel® CoreTM i5-12400 × 12
Disk Capacity :- 256.1 GB

Software configuration : 8086 Emulator, Version : 4.08

Theory: Procedure is a part of code that can be called from your program in order to
make some specific task.
A procedure is group of instructions that usually performs one task. It is a reusable
section of a software program which is stored in memory once but can be used as
often as necessary.

he Syntax for a procedure is as follows:


Procedure_name PROC [near / far]
Instruction 1
Instruction 2
- - - - - - - - - - -
- - - - - - - - - - -
Instruction n
Procedure_name ENDP

A procedure can be of two types. 1) Near Procedure 2) Far Procedure

Near Procedure: A procedure is known as NEAR procedure if is written(defined) in the


same code segment which is calling that procedure. Only Instruction Pointer(IP
register) contents will be changed in NEAR procedure.
FAR procedure : A procedure is known as FAR procedure if it is written (defined) in the
different code segment than the calling segment. In this case both Instruction
Pointer(IP) and the Code Segment(CS) register content will be changed.

Directives used for procedure : PROC directive: The PROC directive is used to identify
the start of a procedure. The PROC directive follows a name given to the
procedure.After that the term FAR and NEAR is used to specify the type of the
procedure.
ENDP Directive: This directive is used along with the name of the procedure to
indicate the end of a procedure to the assembler. The PROC and ENDP directive are
used to bracket a procedure.

CALL instruction and RET instruction : CALL instruction : The CALL instruction is used
to transfer execution to a procedure.It performs two operation.When it executes,first
it stores the address of instruction after the CALL instruction on the stack.Second it
changes the content of IP register in case of Near call and changes the content of IP
register and cs register in case of FAR call.
There are two types of calls.
1)Near Call or Intra segment call.
2) Far call or Inter Segment call

Conclusion: write in your own words in 3 to 4 sentences using instructions.

You might also like