为什么在CALL的操作码获取中有6T状态而不是4? [英] Why are there 6T states in opcode fetch of CALL instead of 4?

查看:101
本文介绍了为什么在CALL的操作码获取中有6T状态而不是4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,为什么在8085微处理器中,在CALL指令的操作码提取中有6T状态,而在其他指令中有4T状态.我进行了很多搜索,但没有找到满意的答案.

My question is why are there 6T states in opcode fetch of the CALL instruction while there are 4 for other instructions in 8085 microprocessor. I have searched a lot but didn't find any satisfactory answer.

在这里: http://www.edaboard.com/thread201650.html 它表示它与在CALL情况下使用的双重寻址模式有关.但这并不能真正解释6T状态的原因.

Here: http://www.edaboard.com/thread201650.html it says that it has something to do with dual addressing modes being used in case of CALL. But doesn't really explain why 6T states.

有什么主意吗?

编辑

当我知道CALL需要18个T状态时,就出现了这个问题.

This question arose when I came to know that CALL takes 18 T-states.

根据我的计算,它应该是:4(用于获取操作码)+ 3 + 3(两次读取内存以读取子例程地址)+ 3 + 3(两次在堆栈上写入内存)= 16

According to my calculations it should be: 4(for opcode fetch) + 3 + 3 (two memory reads to read the subroutine address) + 3 + 3 (for two memory writes on the stack) = 16

因此,在互联网上搜索时,我知道在CALL的情况下,操作码提取部分采用6T状态而不是4T状态.

So, on searching the internet I got to know that the opcode fetch part in case of CALL takes 6T states instead of 4.

更新

现在,在阅读注释并重新思考之后,我知道PUSH通常将12个T状态用作指令.在CALL的情况下,我们可以忽略PUSH的操作码提取部分,因为没有显式的PUSH指令,所以现在我们有8(12-4).那么,我感觉是因为堆栈指针的减少了吗?因为即使在推入时它也应该是6(3 + 3用于内存写入),但是这里是8(4 + 4).

Now after reading the comments and rethinking, I got to know that PUSH takes 12 T-states normally as an instruction. We can ignore the opcode fetch part for PUSH in case of CALL as there is no explicit PUSH instruction, so now we have 8 (12 - 4). So, I feel is it because of the decrement of stack pointer? Because even in push it should have been 6 (3 + 3 for memory writes), but here it's 8 (4 + 4).

推荐答案

6(操作码提取)+ 3 + 3(两次读取内存以读取子例程地址)+ 3 + 3(两次在堆栈上写入内存)= 18

6(opcode fetch) + 3 + 3 (two memory reads to read the subroutine address) + 3 + 3 (two memory writes on the stack) = 18

所以我相信让您感到困惑的是操作码获取的6个T状态,而不是通常情况下的4个T状态.与其他任何指令获取一样,使用4个T状态来获取操作码. 2个T状态用于处理堆栈指针(SP).因为在堆栈的顶部没有存储任何内容.遇到调用时,程序计数器的当前内容(写入调用的行的地址)被压入堆栈.执行完成后,必须将堆栈的内容放回原处.因此,该调用需要比其他指令提取的另外两个状态.

So i believe what confuses you is the 6 T states for opcode fetch rather than 4 T states as in usual case.4 T states are used to fetch the opcode as in any other instruction fetch. 2 T states are used to deal with the Stack Pointer (SP). Because on top of the stack nothing is stored.When a call is encountered the current contents of the program counter ( the address of the line in which the call is written) is pushed to the stack. On completion of execution the contents of stack must be put back. Thus the call requires two additional states than the other instruction fetches.

这篇关于为什么在CALL的操作码获取中有6T状态而不是4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆