1

我的系统软件类有一个项目,我们必须生成一个子程序来将一行源代码分解为 4 个组件:标签、操作码、操作数 1 和操作数 2,并识别 n、i、x 和 e 位设置。我在试图找出 nixbpe 位时遇到问题。预先感谢您的帮助

以下是一些示例: 以下 4 个源代码行示例的组件和位如下:

  1. 示例 +LDA STUFF,X .MAIN

    标签:“示例”操作码:“LDA”操作数 1:“STUFF”操作数 2:“X”

    nixbpe: 111??1

  2. RSUB 无操作

    标签:“”操作码:“RSUB”操作数1:“NO”操作数2:“OP”

    nixbpe: 110??0

  3. CMT BYTE @C'保留块',XYZ 搁置

    标签:“CMT” 操作码:“BYTE” 操作数 1:“C'RESERVED BLOCK'” 操作数 2:“XYZ”第二个操作数>

    nixbpe: 101??0

  4. RMO A,X

    标签:“”操作码:“RMO”操作数1:“A”操作数2:“X”

    nixbpe: 11l??0

nixbpe 位标记为“?” 保持从调用程序接收到的状态;操作码的前缀决定了 e-bit;操作数 1 的前缀决定了 n 和 i 位;操作数 2 的第一个字符确定 x 位。b 和 p 位在别处设置。在这个例程中不需要进行语义检查(所以特别是,上面 RSUB 语句的两种解释都可以)。组件的默认值是空字符串。“ni??pe”位的默认值为“00??00”。

4

1 回答 1

1

***寻址标志位说明

Mode        n i x b p e
-------------------------------------
Direct      1 1 0 0 0 0   12 bit displacement is target address
            1 1 0 0 0 1   20 bit address is target address
            1 1 0 0 1 0   12 bit 2's complement displacement from PC (PC relative)
            1 1 0 1 0 0   12 bit base unsigned displacement forward from B (base displacement)
            1 1 1 0 0 0   index register X added to direct address to get target address
            1 1 1 0 0 1   index register X added to direct address to get target address
            1 1 1 0 1 0   index register X added to PC relative computation to get target address
            1 1 1 1 0 0   index register X added to base displacement computation to get target address
            0 0 0 - - -   simple SIC instruction, last 15 bits are the address
            0 0 1 - - -   index register X added to direct address to get target address
Indirect    1 0 0 0 0 0   Computed memory address contains the target address
            1 0 0 0 0 1   Computed memory address contains the target address
            1 0 0 0 1 0   Computed memory address contains the target address
            1 0 0 1 0 0   Computed memory address contains the target address
Immediate   0 1 0 0 0 0   Computed memory address is the operand (target address is the instruction)
            0 1 0 0 0 1   Computed memory address is the operand (target address is the instruction)
            0 1 0 0 1 0   Computed memory address is the operand (target address is the instruction)
            0 1 0 1 0 0   Computed memory address is the operand (target address is the instruction)***

有关详细信息,请参阅http://www.unf.edu/~cwinton/html/cop3601/supplements/sicsim.docL.html

于 2011-10-06T17:09:40.643 回答