如何识别n,i,x和e位设置(SIC / XE)?

时间:2010-03-25 20:45:03

标签: assembly

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

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

  1. 示例+ LDA STUFF,X .MAIN

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

    nixbpe:111 ?? 1

  2. RSUB NO OP

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

    nixbpe:110 ?? 0

  3. CMT BYTE @ C'RESERVED BLOCK',XYZ SET ASIDE

    标签:“CMT” 操作码:“BYTE” 操作数1:“C'RESERVED BLOCK'” 操作数2:“XYZ”<注意:只要'X'是第二个操作数的第一个字符>就会设置nixbpe中的x(索引)位。

    nixbpe:101 ?? 0

  4. RMO A,X

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

    nixbpe:11l ?? 0

  5. nixbpe位标记为“?”保持从呼叫程序收到;操作码的前缀决定了e位; operand1的前缀确定n和i位; operand2的第一个字符确定x位。 b和p位在别处设置。在此例程中不需要进行语义检查(因此,特别是上面对RSUB语句的两种解释都可以)。组件的默认值是空字符串。 “ni ?? pe”位的默认值为“00 ?? 00”。

1 个答案:

答案 0 :(得分: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