18 T-States in Call Instructions of the 8085 Microprocessor - Explained

Why are there 18 T-states in the call instructions of an 8085 microprocessor?

Understanding the intricacies of microprocessors and their timing can be a bit overwhelming, but let's break down the concept of why call instructions in the 8085 microprocessor take 18 T-states into smaller, more detailed steps:

Step 1: Fetching the call instruction (4 T-states)

When the microprocessor encounters a call instruction, it needs to fetch it from memory. This involves the following steps:

  • The microprocessor sends a request to the memory to retrieve the call instruction.
  • The memory responds by providing the instruction to the microprocessor.

This fetching process takes 4 T-states to complete.

Step 2: Storing the return address (3 T-states)

Before the microprocessor jumps to another part of the program, it needs to store the address of the instruction right after the call on the stack. Here's how it's done:

  • The microprocessor pushes the return address onto the stack, which is a designated area in the memory.

This operation of storing the return address consumes 3 T-states.

Step 3: Updating the stack pointer (1 T-state)

The stack pointer keeps track of the top of the stack, and after storing the return address, it needs to be adjusted. The following occurs:

  • The microprocessor updates the stack pointer to point to the new top of the stack, which reflects the stored return address.

This adjustment of the stack pointer takes 1 T-state to complete.

Step 4: Fetching the target address (3 T-states)

The call instruction contains the address where the microprocessor should jump to. Fetching the target address involves the following:

  • The microprocessor fetches the lower byte of the target address from memory.

Fetching the lower byte of the target address requires 3 T-states.

Step 5: Fetching the rest of the target address (3 T-states)

Since the target address might be too large to fit in just the lower byte, the microprocessor fetches the remaining part of the address from memory. This is done as follows:

  • The microprocessor fetches the higher byte of the target address from memory.

This additional fetch operation takes 3 T-states.

Step 6: Jumping to the target address (4 T-states)

Finally, the microprocessor is ready to jump to the target address and start executing the instructions there. Here's what happens:

  • The microprocessor sets the program counter (PC) to the target address, indicating the new location of the program to be executed.

This process of jumping to the target address requires 4 T-states.

When we add up the T-states from each step, we get a total of 18 T-states for call instructions in the 8085 microprocessor.

It's important to note that the number of T-states for each instruction can vary depending on the microprocessor architecture and design. The 18 T-states specifically apply to call instructions in the 8085 microprocessor.

I hope this detailed explanation helps!

Replies

  • Harshad Italiya
    Harshad Italiya
    If you know that how CALL instruction functions then its very simple to calculate T states

    Assume at Memory Location 2000H instruction CALL 3000H is written

    During a call instruction the uP pushes the current value of program counter(16 bit ie 2 byte | Here it is 2000H) to the stack and then copies the new value from the memory(specified in the instruction | Here 3000H)

    So now
    6 T state Opcode fetch

    + Memory write * 2 (PC pushed to stack) ( 3+3 )

    + Memory read * 2 (New value of PC fetched from memory) ( 3+3 )

    ie 6 + 3 + 3 + 3 + 3 = 18 T-states.
  • shruti palod
    shruti palod
    Re: thanks for the reply

    Hi
    thanks for the reply
    It increased my knowledge about
    call instructions.
  • Harshad Italiya
    Harshad Italiya
    Re: thanks for the reply

    shruti palod
    Hi
    thanks for the reply
    It increased my knowledge about
    call instructions.
    You are most welcome. Looking forward to see you active on crazyengineers.
  • Manan Thakar
    Manan Thakar
    Plz, ans me that ,Why fetching of call instruction requires 6 t-states?

You are reading an archived discussion.

Related Posts

We were given a very basic introduction to C programming. Today we were set a task in labs to use Microsoft Visual Studio 2008 and use C++. The question on...
Mumbai: The free access to automated teller machines (ATMs) of any bank will be closed from October 15 as the third-party ATM usage would carry a cap on the withdrawal...
Computer Science Key concepts (NEW) BIOS (bask input/output system) :-A collection of software codes built into a PC that handle some of the fundamental tasks of sending data from one...
The popularity of Gmail in India cannot be denied, but even we were a bit surprised by a new report that stated it has already gone past Yahoo! Mail as...
The free e-mail client from the makers of Firefox makes an excellent choice for homes and personal use. Here are few tips to make a pro at using it. Access...