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

Define grammar of a language, Define Grammar of a language. A formal la...

Define Grammar of a language. A formal language grammar is a set of formation rules which describe that strings formed from the alphabet of a formal language are syntactically

Give example of real time processing, Give example of Real time (transactio...

Give example of Real time (transaction) processing Using this illustration of booking seats on a flight, below sequence of events would occur: -  Customer/travel agent conta

When web pages containing emails are sent out, When web pages containing em...

When web pages containing emails are sent out they are prefixed by MIME Header. Why? Primarily email consisted messages having simple text written into English and expressed in

Differentiate between compiler and interpreter, (i) Compiler and Interpret...

(i) Compiler and Interpreter: These are two types of language translators. A compiler changes the source program (user-written program) into an object code (machine language b

Differentiate between unit testing and integration testing, Unit testing an...

Unit testing and integration testing: Unit testing focuses on the least element of software design by the module. Unit test is conducted on every of the modules to uncover er

Characteristics of large register file, Characteristics of large-register-f...

Characteristics of large-register-file and cache organizations Large Register File Cache Hold local variables for almost all functio

Analysts in computer operations, Q. Analysts in Computer Operations? Co...

Q. Analysts in Computer Operations? Computer Operations: All of the shared computers comprising mainframes, minicomputers and other computers are put to operation and same is c

Determine bhca rating for processor and call completion rate, A call proces...

A call processor in an exchange requires 120 ms to service a complete call. What is the BHCA rating for the processor? If the exchange is capable of carrying 700 Erlangs of traffic

DBMS, what is dbms goal?

what is dbms goal?

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