Returns and procedures definitions in 8086, Computer Engineering

Assignment Help:

Q. Returns and Procedures definitions in 8086?

8086 microprocessor supports RET and CALL instructions for procedure call. CALL instruction not only branches to indicate address but also pushes return address onto the stack. Additionally it also initialized IP with address of the procedure. RET instructions basically pops the return address from stack. 8086 supports two types of procedure call. These are NEAR and FAR calls.

NEAR procedure call is also called as Intrasegment call as called procedure is in same segment from that call has been made. Hence only IP is stored as return address. IP can be stored on stack as:

912_Returns and Procedures definitions in 8086.png

Please note that the growth of stack is towards stack segment base. So stack becomes full on an offset 0000h. Also for push operation, we decrement SP by 2 as stack is a word stack (word size in 8086 = 16 bits) whereas memory is byte organised memory.

FAR procedure call which is also known as intersegment call is a call made to separate code segment. So the control will be transferred outside current segment. So both IP and CS need to be stored as return address. These values on stack after the calls looks as below:

597_Returns and Procedures definitions in 80861.png

When 8086 executes FAR call it first stores contents of code segment register followed by contents of IP on to the stack. A RET from NEAR procedure. Pops the 2 bytes in IP. RET from the FAR procedure pops 4 bytes from the stack.


Related Discussions:- Returns and procedures definitions in 8086

How to creating a key pair, How to Creating a Key Pair You can make a...

How to Creating a Key Pair You can make a key pair using the Strong Name tool (Sn.exe). Key pair files usually have an .snk extension. To create a key pair at the command

Shm, composition of two shm in right angles to each other to havingg time p...

composition of two shm in right angles to each other to havingg time period in the ratio 1:2

Write-allocate and no-write-allocate policy in a cache, (a) How does a da...

(a) How does a data cache take advantage of spatial locality? Give an suitable example. (b) What are the basic differences between a write-allocate and no-write-allocate po

Model a disaster recovery system for the cyber city, Question: (a) Stat...

Question: (a) State possible Large Scale System Applications different from those mentioned in (c) which may have a component running in the Cyber City. (b) According to you

Explain the term- intranet, Explain the term- Intranets Various compani...

Explain the term- Intranets Various companies use intranets as well as the internet. Simple definition is "An intranet is a computer network which is based on internet technolo

Explain the resources of an operating system, Explain the resources of da...

Explain the resources of data structure is used by an operating system to keep track of process information? Explain A process is a program in execution. An operating system

Explain neural networks, A neural network can be definite as a model of rea...

A neural network can be definite as a model of reasoning based on the human brain. The human brain incorporates nearly 10 billion neurons and 60 trillion connections, Synapses amon

Functions for various communication modes, Q. Functions for various communi...

Q. Functions for various communication modes? MPI offers both non-blocking and blocking send/transmitting and receive operations for all modes. Functions for various commun

Design odd-even transposition algorithm, Q. Design Odd-Even Transposition A...

Q. Design Odd-Even Transposition Algorithm? Algorithm: Odd-Even Transposition for I=1 to N     {            If (I%2 != 0) //i.e. Odd phase            {

How reassembling of ip fragments is advantageous, Reassembling of IP fragme...

Reassembling of IP fragments at the ultimate destination is advantageous. Give reasons. Needing the ultimate destination to reassemble the fragments has two major advantages. F

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd