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

What are the variations in a fast adder, a. Design a fast adder. What are t...

a. Design a fast adder. What are the variations in a fast adder? b. Define how the virtual address is changed into real address in a paged virtual memory system. Give an example

Shared memory model, In the shared-memory programming model, tasks share a ...

In the shared-memory programming model, tasks share a common address space, which they read and write asynchronously. Several mechanisms such as locks / semaphores may be used to c

Priority array, The runqueue is the list of runnable processes on a given p...

The runqueue is the list of runnable processes on a given processor. There is only one runqueue per processor. Each runqueue contains two priority arrays: Active and Expired. Each

The average height or weight, A script kept information on potential subjec...

A script kept information on potential subjects for an experiment in a vector of structures known as "subjects".  The following show an example of what the contents may be: >> subj

Pci bus transactions - computer architecture, PCI bus transactions: PC...

PCI bus transactions: PCI bus traffic is prepared of a series of PCI bus transactions. Each transaction is build up of an address phase that is followed by 1 or more data phas

Explain dead code elimination, Explain briefly Dead code Elimination of the...

Explain briefly Dead code Elimination of the commonly used code optimization techniques Dead code Elimination: Code which is unreachable or which does not influence the pr

Choosing a micro-controller, There are many different forms of micro-contro...

There are many different forms of micro-controller and a manufacturer, selecting the proper micro-controller for your application is one of the critical decisions which controls th

What is digital versatile disk, Digital versatile disk (DVD) This is an...

Digital versatile disk (DVD) This is an optical system for storing data. It's similar to CD though typically can hold 4.7 Gbyte of data compared to only 700 MB of data on a CD.

State the advantages of bespoke software, State the advantages of Bespoke ...

State the advantages of Bespoke Software -  specifically designed for application and hence more efficient and will only contain the features wanted; as it will be devoid of

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