SlideShare a Scribd company logo
1 of 14
Submitted by
K.LALITHAMBIGA
Msc[cs&it]
 Introduction
 Procedure Definitions
 Procedure Declaration
 Call and Return
 Uses of procedure
 Saving and Restoring Register
 Procedure Communication
 Recursive Procedure
 The procedure is an important part of any
computer system's architecture.
 A procedure is a group of instructions that
performs one task.
 This saves memory space and makes it easier to
develop software.
 It is a reusable section of the software that is stored
in memory once, but used as often as necessary.
 Procedure is a set of code that can be branched and
returned.
 The branch to a procedure is referred to as the call and
corresponding branch back is known as the return.
 Procedure provides the primary means of breaking
code in a program into modules.
 The disadvantage is small amount of time to link to the
procedure and return from it.
 name - is the procedure name should be in the top and
the bottom. It is used to check correct closing of
procedures.
 The RET instruction is used to return to the operating
system and the same instruction is used to return from
procedure.
 PROC and ENDP are compiler directives. So, they are
not assembled into any real machine code. The
Compiler just remembers the address of procedure.
name PROC
; The procedure code
; goes here
RET
name ENDP
Syntax Example
SEGX SEGMENT
:
SUBT PROC FAR
:
RET
SUBT ENDP
:
CALL FAR PTR SUBT
:
SEGX ENDS
 The CALL instruction links to the procedure and the
RET instruction returns from the procedure.
 The Stack stores the return address whenever a
procedure is called during the execution of a
programme.
 The CALL instruction pushes the address of the
instruction following it on the Stack.
 The RET instruction removes an address from the
Stack so the programme returns to the instruction
following the CALL.
:
:
CALL PROC_A
:
:
CALL PROC_A
:
:
:
:
PROC_A
:
:
RET
:
:
:
:
PROC_B
:
:
RET
:
:
:
:
CALLPROC_A
:
:
:
:
PROC_A
:
:
CALL PROC_B
:
:
RET
(a) Multiple calls
(b) Nested calls
 Both the calling program and procedure share the
same set of register.
 Save the registers when entering a procedure and
to restore them before returning to the calling
program.
(DX) (DX)
(CX) (CX)
(BX) (BX)
(AX) (AX)
Return
address
Return
address
TOS
TOS
0208
0200SP
SP
(a)After storing register (b)After restoring register
SUBT PROC NEAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
:
:
POP DX
POP CX
POP BX
POP AX
RET
SUBT ENDP
 The Procedure communication has two types.
They are,
 One it is always operate on the same set of data.
 Another it is may process a different set of data each
time.
 If a procedure is of the former type and is in the same
source module as the calling program.
 Then the procedure can refer to the variable directly as
indicated in the program
DATA SEGMENT
ARY DW 100 DUP(?)
COUNT DW ?
SUM DW ?
DATA ENDS
CODE SEGMENT
:
:
CALL NEAR PTR PROADD
:
:
PROADD PROC NEAR
PUSH AX
PUSH CX
PUSH SI
LEA SI,ARY
MOV CX,COUNT
XOR AX,AX
NEXT: ADD AX,[SI]
ADD SI,2
LOOP NEXT
MOV SUM,AX
POP SI
POP CX
POP AX
PROADD ENDP
:
:
CODE ENDS
Example: Procedure that refer directly to the
variables on which it operates
 Recursive algorithm may be implemented by having
procedure call by itself.
 Each successive call does not destroy the parameters and
results generated by the previous call and to make sure the
procedure does not modify itself.
 A trivial example of recursive procedure is one of the
evaluating factorials.
BEGIN FACT(N,RESULT)
SAVE register on stack
IF N=0 THEN
RESULT 1
ELSE
PUSH RESULT
PUSH N-1 onto stack
CALL FACT(N-1,RESULT)
RESULT N*RESULT
ENDIF
RESTORE register from stack
DELETE parameters from stack
RETURN
:
:
Parameters or parameter
addresses
Parameters or parameter
addresses
Save area for registers
Temporary results
Save area for registers
Temporary results
Frame for
second call
Frame for
first call
FIGURE: Use of a stack to dynamically provide
storage during recursive call
Procedure

More Related Content

What's hot

L kernel-logging-apis-pdf
L kernel-logging-apis-pdfL kernel-logging-apis-pdf
L kernel-logging-apis-pdfSusant Sahani
 
Kojak Metrics Explained
Kojak Metrics ExplainedKojak Metrics Explained
Kojak Metrics ExplainedBart Wood
 
GEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions FrameworkGEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions FrameworkAlexey Smirnov
 
Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...
Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...
Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...Flink Forward
 
Useful Linux Commands
Useful Linux CommandsUseful Linux Commands
Useful Linux CommandsDeepak Modak
 
Instruction Combine in LLVM
Instruction Combine in LLVMInstruction Combine in LLVM
Instruction Combine in LLVMWang Hsiangkai
 
Provided MATLAB functions, convert the State Space Model into a classical con...
Provided MATLAB functions, convert the State Space Model into a classical con...Provided MATLAB functions, convert the State Space Model into a classical con...
Provided MATLAB functions, convert the State Space Model into a classical con...MIbrar4
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filtersAcácio Oliveira
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler designAnul Chaudhary
 
Raspberry pi Part 6
Raspberry pi Part 6Raspberry pi Part 6
Raspberry pi Part 6Techvilla
 
2. reverse primarydns using bind for ptr and cname record ipv4
2. reverse primarydns using bind for ptr and cname record ipv42. reverse primarydns using bind for ptr and cname record ipv4
2. reverse primarydns using bind for ptr and cname record ipv4Piyush Kumar
 
Chapter 2
Chapter 2Chapter 2
Chapter 2lopjuan
 

What's hot (19)

L kernel-logging-apis-pdf
L kernel-logging-apis-pdfL kernel-logging-apis-pdf
L kernel-logging-apis-pdf
 
Kojak Metrics Explained
Kojak Metrics ExplainedKojak Metrics Explained
Kojak Metrics Explained
 
Linux comands for Hadoop
Linux comands for HadoopLinux comands for Hadoop
Linux comands for Hadoop
 
Linux crontab
Linux crontabLinux crontab
Linux crontab
 
GEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions FrameworkGEM - GNU C Compiler Extensions Framework
GEM - GNU C Compiler Extensions Framework
 
Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...
Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...
Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...
 
GCC LTO
GCC LTOGCC LTO
GCC LTO
 
Raman
RamanRaman
Raman
 
Useful Linux Commands
Useful Linux CommandsUseful Linux Commands
Useful Linux Commands
 
Instruction Combine in LLVM
Instruction Combine in LLVMInstruction Combine in LLVM
Instruction Combine in LLVM
 
Provided MATLAB functions, convert the State Space Model into a classical con...
Provided MATLAB functions, convert the State Space Model into a classical con...Provided MATLAB functions, convert the State Space Model into a classical con...
Provided MATLAB functions, convert the State Space Model into a classical con...
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
RTX Kernal
RTX KernalRTX Kernal
RTX Kernal
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
 
Raspberry pi Part 6
Raspberry pi Part 6Raspberry pi Part 6
Raspberry pi Part 6
 
COMPILER DESIGN Run-Time Environments
COMPILER DESIGN Run-Time EnvironmentsCOMPILER DESIGN Run-Time Environments
COMPILER DESIGN Run-Time Environments
 
2. reverse primarydns using bind for ptr and cname record ipv4
2. reverse primarydns using bind for ptr and cname record ipv42. reverse primarydns using bind for ptr and cname record ipv4
2. reverse primarydns using bind for ptr and cname record ipv4
 
Csd01
Csd01Csd01
Csd01
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 

Similar to Procedure

Chap6 procedures & macros
Chap6 procedures & macrosChap6 procedures & macros
Chap6 procedures & macrosHarshitParkar6677
 
Introduction to Assembly Language Programming
Introduction to Assembly Language ProgrammingIntroduction to Assembly Language Programming
Introduction to Assembly Language ProgrammingRahul P
 
Lec 04 intro assembly
Lec 04 intro assemblyLec 04 intro assembly
Lec 04 intro assemblyAbdul Khan
 
Assembly level language
Assembly level languageAssembly level language
Assembly level languagePDFSHARE
 
Virtualization summary b.docx
Virtualization summary b.docxVirtualization summary b.docx
Virtualization summary b.docxshruti533256
 
Dc 12 Chiueh
Dc 12 ChiuehDc 12 Chiueh
Dc 12 Chiuehwollard
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly LanguageAhmed M. Abed
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!manishamorya
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRavikumar Tiwari
 
1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdfSemsemSameer1
 
Chapter Seven(1)
Chapter Seven(1)Chapter Seven(1)
Chapter Seven(1)bolovv
 
Function & procedure
Function & procedureFunction & procedure
Function & procedureatishupadhyay
 
Examinable Question and answer system programming
Examinable Question and answer system programmingExaminable Question and answer system programming
Examinable Question and answer system programmingMakerere university
 

Similar to Procedure (20)

Chapter 5 notes new
Chapter 5 notes newChapter 5 notes new
Chapter 5 notes new
 
Chapter 6 notes
Chapter 6 notesChapter 6 notes
Chapter 6 notes
 
Chap6 procedures & macros
Chap6 procedures & macrosChap6 procedures & macros
Chap6 procedures & macros
 
Introduction to Assembly Language Programming
Introduction to Assembly Language ProgrammingIntroduction to Assembly Language Programming
Introduction to Assembly Language Programming
 
Lec 04 intro assembly
Lec 04 intro assemblyLec 04 intro assembly
Lec 04 intro assembly
 
Assembly level language
Assembly level languageAssembly level language
Assembly level language
 
Chapter 5 notes
Chapter 5 notesChapter 5 notes
Chapter 5 notes
 
Virtualization summary b.docx
Virtualization summary b.docxVirtualization summary b.docx
Virtualization summary b.docx
 
Alp 05
Alp 05Alp 05
Alp 05
 
Dc 12 Chiueh
Dc 12 ChiuehDc 12 Chiueh
Dc 12 Chiueh
 
Org-&-Arch-2.ppt
Org-&-Arch-2.pptOrg-&-Arch-2.ppt
Org-&-Arch-2.ppt
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly Language
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van Neumann
 
1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf1588147798Begining_ABUAD1.pdf
1588147798Begining_ABUAD1.pdf
 
Mp &mc programs
Mp &mc programsMp &mc programs
Mp &mc programs
 
Chapter Seven(1)
Chapter Seven(1)Chapter Seven(1)
Chapter Seven(1)
 
Data race
Data raceData race
Data race
 
Function & procedure
Function & procedureFunction & procedure
Function & procedure
 
Examinable Question and answer system programming
Examinable Question and answer system programmingExaminable Question and answer system programming
Examinable Question and answer system programming
 

More from lalithambiga kamaraj (20)

Firewall in Network Security
Firewall in Network SecurityFirewall in Network Security
Firewall in Network Security
 
Data Compression in Multimedia
Data Compression in MultimediaData Compression in Multimedia
Data Compression in Multimedia
 
Data CompressionMultimedia
Data CompressionMultimediaData CompressionMultimedia
Data CompressionMultimedia
 
Digital Audio in Multimedia
Digital Audio in MultimediaDigital Audio in Multimedia
Digital Audio in Multimedia
 
Network Security: Physical security
Network Security: Physical security Network Security: Physical security
Network Security: Physical security
 
Graphs in Data Structure
Graphs in Data StructureGraphs in Data Structure
Graphs in Data Structure
 
Package in Java
Package in JavaPackage in Java
Package in Java
 
Exception Handling in Java
Exception Handling in JavaException Handling in Java
Exception Handling in Java
 
Data structure
Data structureData structure
Data structure
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Estimating Software Maintenance Costs
Estimating Software Maintenance CostsEstimating Software Maintenance Costs
Estimating Software Maintenance Costs
 
Datamining
DataminingDatamining
Datamining
 
Digital Components
Digital ComponentsDigital Components
Digital Components
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Io management disk scheduling algorithm
Io management disk scheduling algorithmIo management disk scheduling algorithm
Io management disk scheduling algorithm
 
Recovery system
Recovery systemRecovery system
Recovery system
 
File management
File managementFile management
File management
 
Preprocessor
PreprocessorPreprocessor
Preprocessor
 
Inheritance
InheritanceInheritance
Inheritance
 

Recently uploaded

定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一ss ss
 
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...nagunakhan
 
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一ss ss
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一ga6c6bdl
 
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...Authentic No 1 Amil Baba In Pakistan
 
如何办理伦敦大学伯贝克学院毕业证(BBK毕业证) 成绩单留信学历认证原版一比一
如何办理伦敦大学伯贝克学院毕业证(BBK毕业证) 成绩单留信学历认证原版一比一如何办理伦敦大学伯贝克学院毕业证(BBK毕业证) 成绩单留信学历认证原版一比一
如何办理伦敦大学伯贝克学院毕业证(BBK毕业证) 成绩单留信学历认证原版一比一ga6c6bdl
 
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...Suhani Kapoor
 
Alambagh Call Girl 9548273370 , Call Girls Service Lucknow
Alambagh Call Girl 9548273370 , Call Girls Service LucknowAlambagh Call Girl 9548273370 , Call Girls Service Lucknow
Alambagh Call Girl 9548273370 , Call Girls Service Lucknowmakika9823
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程1k98h0e1
 
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》o8wvnojp
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gayasrsj9000
 
Russian Call Girls Kolkata Chhaya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls Kolkata Chhaya 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls Kolkata Chhaya 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls Kolkata Chhaya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up NumberCall Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up NumberMs Riya
 
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /WhatsappsBeautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsappssapnasaifi408
 

Recently uploaded (20)

CIVIL ENGINEERING
CIVIL ENGINEERINGCIVIL ENGINEERING
CIVIL ENGINEERING
 
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
定制(RHUL学位证)伦敦大学皇家霍洛威学院毕业证成绩单原版一比一
 
9953330565 Low Rate Call Girls In Jahangirpuri Delhi NCR
9953330565 Low Rate Call Girls In Jahangirpuri  Delhi NCR9953330565 Low Rate Call Girls In Jahangirpuri  Delhi NCR
9953330565 Low Rate Call Girls In Jahangirpuri Delhi NCR
 
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
 
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
 
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
 
如何办理伦敦大学伯贝克学院毕业证(BBK毕业证) 成绩单留信学历认证原版一比一
如何办理伦敦大学伯贝克学院毕业证(BBK毕业证) 成绩单留信学历认证原版一比一如何办理伦敦大学伯贝克学院毕业证(BBK毕业证) 成绩单留信学历认证原版一比一
如何办理伦敦大学伯贝克学院毕业证(BBK毕业证) 成绩单留信学历认证原版一比一
 
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Jejuri ( 7001035870 ) HI-Fi Pune Escorts Service
 
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
 
Alambagh Call Girl 9548273370 , Call Girls Service Lucknow
Alambagh Call Girl 9548273370 , Call Girls Service LucknowAlambagh Call Girl 9548273370 , Call Girls Service Lucknow
Alambagh Call Girl 9548273370 , Call Girls Service Lucknow
 
萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程萨斯喀彻温大学毕业证学位证成绩单-购买流程
萨斯喀彻温大学毕业证学位证成绩单-购买流程
 
Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565
 
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
 
Russian Call Girls Kolkata Chhaya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls Kolkata Chhaya 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls Kolkata Chhaya 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls Kolkata Chhaya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up NumberCall Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
Call Girls Delhi {Rs-10000 Laxmi Nagar] 9711199012 Whats Up Number
 
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /WhatsappsBeautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
 

Procedure

  • 2.  Introduction  Procedure Definitions  Procedure Declaration  Call and Return  Uses of procedure  Saving and Restoring Register  Procedure Communication  Recursive Procedure
  • 3.  The procedure is an important part of any computer system's architecture.  A procedure is a group of instructions that performs one task.  This saves memory space and makes it easier to develop software.  It is a reusable section of the software that is stored in memory once, but used as often as necessary.
  • 4.  Procedure is a set of code that can be branched and returned.  The branch to a procedure is referred to as the call and corresponding branch back is known as the return.  Procedure provides the primary means of breaking code in a program into modules.  The disadvantage is small amount of time to link to the procedure and return from it.
  • 5.  name - is the procedure name should be in the top and the bottom. It is used to check correct closing of procedures.  The RET instruction is used to return to the operating system and the same instruction is used to return from procedure.  PROC and ENDP are compiler directives. So, they are not assembled into any real machine code. The Compiler just remembers the address of procedure. name PROC ; The procedure code ; goes here RET name ENDP Syntax Example SEGX SEGMENT : SUBT PROC FAR : RET SUBT ENDP : CALL FAR PTR SUBT : SEGX ENDS
  • 6.  The CALL instruction links to the procedure and the RET instruction returns from the procedure.  The Stack stores the return address whenever a procedure is called during the execution of a programme.  The CALL instruction pushes the address of the instruction following it on the Stack.  The RET instruction removes an address from the Stack so the programme returns to the instruction following the CALL.
  • 8.  Both the calling program and procedure share the same set of register.  Save the registers when entering a procedure and to restore them before returning to the calling program. (DX) (DX) (CX) (CX) (BX) (BX) (AX) (AX) Return address Return address TOS TOS 0208 0200SP SP (a)After storing register (b)After restoring register
  • 9. SUBT PROC NEAR PUSH AX PUSH BX PUSH CX PUSH DX : : POP DX POP CX POP BX POP AX RET SUBT ENDP
  • 10.  The Procedure communication has two types. They are,  One it is always operate on the same set of data.  Another it is may process a different set of data each time.  If a procedure is of the former type and is in the same source module as the calling program.  Then the procedure can refer to the variable directly as indicated in the program
  • 11. DATA SEGMENT ARY DW 100 DUP(?) COUNT DW ? SUM DW ? DATA ENDS CODE SEGMENT : : CALL NEAR PTR PROADD : : PROADD PROC NEAR PUSH AX PUSH CX PUSH SI LEA SI,ARY MOV CX,COUNT XOR AX,AX NEXT: ADD AX,[SI] ADD SI,2 LOOP NEXT MOV SUM,AX POP SI POP CX POP AX PROADD ENDP : : CODE ENDS Example: Procedure that refer directly to the variables on which it operates
  • 12.  Recursive algorithm may be implemented by having procedure call by itself.  Each successive call does not destroy the parameters and results generated by the previous call and to make sure the procedure does not modify itself.  A trivial example of recursive procedure is one of the evaluating factorials. BEGIN FACT(N,RESULT) SAVE register on stack IF N=0 THEN RESULT 1 ELSE PUSH RESULT PUSH N-1 onto stack CALL FACT(N-1,RESULT) RESULT N*RESULT ENDIF RESTORE register from stack DELETE parameters from stack RETURN
  • 13. : : Parameters or parameter addresses Parameters or parameter addresses Save area for registers Temporary results Save area for registers Temporary results Frame for second call Frame for first call FIGURE: Use of a stack to dynamically provide storage during recursive call