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 do you mean by analysis and design, Analysis: Basically, it is the...

Analysis: Basically, it is the process of determining what requirement to be done before how it should be done. In order to accomplish this, the developer shows the existing sy

Define modem, Define Modem. A modem changes digital signals into audio ...

Define Modem. A modem changes digital signals into audio tones to be transmitted over telephone lines and also changes audio tones from the lines in digitals signals for machin

State in brief about polymorphism, State in brief about Polymorphism C...

State in brief about Polymorphism Class hierarchy is the deciding feature in the case of more than one implementation of properties. An object oriented program to compute the

Convenience of environments -artificial intelligence , Convenience of Envir...

Convenience of Environments -artificial intelligence: In some cases, some aspects of an environment which should be taken into account in decisions about actions may be unavai

Eme, state function and path function

state function and path function

Applications of generic framework for electronic commerce, How are the appl...

How are the applications of generic framework for electronic commerce performed? To perform applications, this is essential to have Supporting Information and Organizational In

Discuss the advantages of electronics data exchange, Discuss the advantages...

Discuss the advantages of Electronics Data Exchange (EDI). Advantages of EDI: Electronics Data Exchange's saves needless re-capture of data. It leads to faster transfer of d

How many instructions in a computer, Q. How many instructions in a Computer...

Q. How many instructions in a Computer? A computer can have a vast number of instructions and addressing modes. Older computers with the growth of Integrated circuit technolog

Explain the general model for the translation process, Write down the gener...

Write down the general model for the translation process. For the translation process the general model can be represented as given here:

Show select tag and pull down lists, The next type of input is a Pull Down ...

The next type of input is a Pull Down List. With this type you have to employ in place of and it also has a closing tag. This control is used when we have a

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