首页 \ 问答 \ 间接寻址模式(Indirect Addressing Mode)

间接寻址模式(Indirect Addressing Mode)

我目前正在尝试解决我给出这些标准的问题:

我相信我的答案是正确的,但我很困惑,因为问题没有提到地址存储在地址10,所以间接寻址怎么可能发生呢?

问题 :给定以下寻址模式的相应操作数在哪里?

假设指令的地址字段包含小数10.对应的操作数在哪里给出以下寻址模式?

  1. 立即寻址:操作数-10
  2. 直接寻址:操作数 - 10 - >地址
  3. 间接寻址:10 - >地址 - >地址
  4. 注册寻址:
  5. 注册间接寻址:

有人可以帮帮我吗?

这是我正在使用的图表: 在此处输入图像描述

更新的地方:

  • 立即寻址:相应的操作数位于给定存储器的地址字段中。 在所有情况下,操作数只是给定内存位置的地址字段中的值。 因此,在这种情况下,操作数值将为10。

  • 直接寻址:在直接寻址中,地址字段包含操作数的地址。 因此,相应的操作数将是存储器地址10处的操作数所存储的任何操作数。

  • 间接寻址:在间接寻址中,存储器地址10的内容是操作数的地址。 因此,位置10的地址字段包含在其地址字段中保存操作数的位置的地址。

  • 寄存器寻址:在寄存器寻址中,存储器位置10的地址字段保持寄存器的地址而不是另一个存储器地址。 相应的操作数位于寄存器的内容中。

  • 寄存器间接寻址:寄存器间接寻址与寄存器寻址非常相似,因为存储器位置10也将地址保存到包含其操作数的位置; 区别在于地址可以是寄存器或存储器位置。


I am currently trying to solve a problem where I am given these criteria:

I believe that I have some of the answers correct but I am confused because the question mentions nothing about an address being stored at address 10 so how can indirect addressing even happen?

Question: Where is the corresponding operand given the following addressing modes?

Assume the address field of an instruction contains the decimal 10. Where is the corresponding operand given the following addressing modes?

  1. Immediate addressing: Operand- 10
  2. Direct addressing: Operand - 10 -> address
  3. Indirect addressing: 10 -> address -> address
  4. Register addressing:
  5. Register indirect addressing:

Can anybody help me out?

Here's the chart I'm using: enter image description here

Updated where's:

  • Immediate addressing: The corresponding operand is located in the address field of the given memory. In all cases the operand is simply the value in the address field of the given memory location. So in this case the operand value would be 10.

  • Direct addressing: In direct addressing the address field contains the address of the operand. Therefore the corresponding operand is going to be whatever is stored for an operand at memory address 10.

  • Indirect addressing: In indirect addressing the contents of memory address 10 are the address to the operand. Therefore the address field of location 10 contains the address to the location holding the operand in its address field.

  • Register addressing: In register addressing the address field of memory location 10 holds an address to a register instead of another memory address. The corresponding operand is found inside the contents of the register.

  • Register indirect addressing: Register indirect addressing is very similar to register addressing because memory location 10 also holds an address to a location containing its operand, however; the difference is that the address could be to a register or to a memory location.


原文:https://stackoverflow.com/questions/29958883
更新时间:2022-11-21 09:11

最满意答案

原则上,没有必要做这样的事情。 如果要关联两个连续的行,只需将分析调整为此事实(在读取第2行时执行第1行操作)。 示例代码:

using (System.IO.StreamReader sr = new System.IO.StreamReader("path"))
{
    string line = null;
    string prevLine = null;
    while ((line = sr.ReadLine()) != null)
    {
        if (prevLine != null)
        {
            //perform all the actions you wish with the previous line now
        }

        prevLine = line;
    }
}

这可能适用于处理所需的行数(前一行的集合而不仅仅是prevLine )。


In principle, there is no need to do such a thing. If you want to relate two consecutive lines, just adapt the analysis to this fact (perform the line 1 actions while reading line 2). Sample code:

using (System.IO.StreamReader sr = new System.IO.StreamReader("path"))
{
    string line = null;
    string prevLine = null;
    while ((line = sr.ReadLine()) != null)
    {
        if (prevLine != null)
        {
            //perform all the actions you wish with the previous line now
        }

        prevLine = line;
    }
}

This might be adapted to deal with as many lines as required (a collection of previous lines instead of just prevLine).

相关问答

更多
  • 无论是从自我分配(我认为包括构建一个新事物,如Link(item, *self) 意味着一个移动 ,这意味着在构建新Link的过程中,自我变得不可用,因为: “一个值被移动后,它不能再从源位置使用,并且不会在那里被销毁。” 正确的方式™可能是最好的记录stdlib在这个例子中做了什么。 这是一个双向链接列表,它是托管的,但它是可变的,我希望免费拷贝。 还有一些有用的容器类型 。 然而,我确实设法让你的数据结构的这个不变版本起作用。 trait Stack { fn push(self, ite ...
  • 在回答之前,请添加一些背景,解释这是什么头。 First of all what is HEAD? HEAD只是对当前分支的当前提交(最新)的引用。 在任何给定时间只能有一个HEAD 。 (不包括git worktree ) HEAD的内容存储在.git/HEAD ,它包含当前提交的40字节SHA-1。 detached HEAD 如果你不是最新的提交 - 这意味着HEAD指向历史上的一个先前的承诺,它被称为detached HEAD 。 在命令行上,它将看起来像这样SHA-1而不是分支名称,因为HEAD没 ...
  • 使用fgets(a,5,fp1)之后,文件指针是否向前移动了5个位置? 指针fp1不受fgets调用(或任何其他stdio I / O例程)的影响; 将更新fp1指向的FILE对象以反映新文件位置,但指针本身不会更改。 after using fgets(a,5,fp1) does the file pointer move 5 positions ahead ? The pointer fp1 is not affected by the fgets call (or any other stdio I/ ...
  • git checkout b9c157d由sha开始的提交,并以b9c157d - 您提到的提交。 git checkout b9c157d checks out the commit represented by the sha starting with b9c157d -- the commit you asked about.
  • 编辑:添加l == l[::-1]为is_palindrome5 ,这是非常快,到目前为止最可读和pythonic。 我可以检查回收的最快速度是这个单线程: def is_palindrome1(l): return l[:len(l) / 2] == l[(len(l)+1) / 2:][::-1] 在您的问题中对c ++函数的python转换检查非回文是最快的: def is_palindrome2(l): left = 0 right = len(l) - 1 ...
  • 我找到了解决方案。 我只是在后台调用finish() @Override public void onBackPressed(){ finish(); } 这解决了我的问题。 finish()调用包含片段的活动 I found the solution. I just called finish() on backpress @Override public void onBackPressed(){ finish(); } And this solved my issue. The ...
  • 原则上,没有必要做这样的事情。 如果要关联两个连续的行,只需将分析调整为此事实(在读取第2行时执行第1行操作)。 示例代码: using (System.IO.StreamReader sr = new System.IO.StreamReader("path")) { string line = null; string prevLine = null; while ((line = sr.ReadLine()) != null) { if (prevLin ...
  • 难道你不能摆脱stage.setChildIndex(this, 0)并添加这样的图像? var image = new Main(); stage.addChildAt(image, 0); Can't you just get rid of the stage.setChildIndex(this, 0) and add image like this? var image = new Main(); stage.addChildAt(image, 0);
  • 我很确定VB6提供了seek()函数来完成这项工作。 否则,如果文件相对较小,您可以将其全部读入内存并使用split()函数将其分隔为行。 然后可以随意访问这些。 显然,如果文件很大,这不是一个好主意。 FSO只允许您向前阅读。 I'm pretty sure VB6 provides a seek() function to do this. Otherwise, if the file is relatively small you could read it all into memory and u ...
  • 默认情况下,写入始终发生在文件的末尾。 调用file.readline()不会改变这种行为,尤其是因为readline()调用可以使用缓冲区来读取较大的块。 你可以通过显式使用file.seek()来覆盖一行的末尾; 你只是读了一行,你知道的长度,寻求这一点: x = file.readline() file.seek(len(x), 0) file.write(text) #write the text 请注意,您不能插入直线,也不能轻松更换直线。 文件是单个字节的流,而不是行,因此如果您以10个字符( ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)