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 is divide overflow, What is divide overflow?  The division operati...

What is divide overflow?  The division operation might result in a quotient with an overflow. Overflow happens when the length of the registers is finite and will not hold a nu

How many and gates are required to realize Y = CD+EF+G, How many AND gates ...

How many AND gates are required to realize Y = CD+EF+G ? Ans. Y = CD + EF + G for realize this two AND gates are needed (for CD and EF).

Switch statement with the use of nested if-else statement, Compare the use ...

Compare the use of switch statement with the use of nested if-else statement. If-else statement:  When there are many conditional statements that may all evaluate to true, bu

What layers are covered under end to end layer connectivity, What layers ar...

What layers are covered under end to end layer connectivity? The layers 4 to 7 of ISO-OSI reference model communicate along with peer entities into the end systems. There is n

What are the limitations of a cyclotron, Q. What are the limitations of a c...

Q. What are the limitations of a cyclotron? Limitations (i) Maintaining a consistent magnetic field over a large area of the Dees is difficult. (ii) At high rapidity

What is virtual memory, What is virtual memory? Virtual memory is a met...

What is virtual memory? Virtual memory is a method used in some large computer systems that allow the user to construct program as by a large memory space were available, equal

2 way staircase switch-truth table logic equation & circuit, A staircase li...

A staircase light is controlled by two switches one at the top of the stairs and another at the bottom of stairs a. Make a truth table for this system. b. Write the lo

Determine 127.0.0.1 is which type of address, 127.0.0.1 is a? 127.0.0.1...

127.0.0.1 is a? 127.0.0.1 it is a loop-back address.

What is artificial intelligence recognition, There are two goals to AI; the...

There are two goals to AI; the major one is to produce an artificial system that is about as good as or good than a human being at dealing with the actual world. The second goal is

Describe about the database marketing application of olap, Database marketi...

Database marketing tool or application helps a user or marketing professional in determining the right tool or plan for his valuable add campaign. This tool haves data from all sou

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