1

System Software クラスのプロジェクトがあり、ソース行をラベル、オペコード、オペランド 1、オペランド 2 の 4 つのコンポーネントに分解し、n、i、x、および e ビット設定を識別するサブルーチンを作成する必要があります。nixbpe ビットを見つけようとして問題が発生しています。よろしくお願いします。

以下にいくつかの例を示します。 ソース行の次の 4 つの例のコンポーネントとビットは次のとおりです。

  1. 例 +LDA STUFF,X .MAIN

    ラベル: "EXAMPLE" オペコード: "LDA" オペランド 1: "STUFF" オペランド 2: "X"

    nixbpe: 111??1

  2. RSUB NO OP

    ラベル: "" オペコード: "RSUB" オペランド 1: "NO" オペランド 2: "OP"

    nixbpe: 110??0

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

    ラベル: "CMT" op コード: "BYTE" オペランド 1: "C'RESERVED BLOCK'" オペランド 2: "XYZ"第2オペランド>

    nixbpe: 101??0

  4. RMO A,X

    ラベル: "" オペコード: "RMO" オペランド 1: "A" オペランド 2: "X"

    nixbpe: 11l??0

「?」とマークされた nixbpe ビット 呼び出しプログラムから受け取ったままになります。op コードの接頭辞によって e-bit が決まります。operand1 の接頭辞によって n ビットと i ビットが決まります。operand2 の最初の文字が x ビットを決定します。b ビットと p ビットは別の場所に設定されます。このルーチンではセマンティック チェックは想定されていません (したがって、特に、上記の RSUB ステートメントの解釈はどちらも OK です)。コンポーネントのデフォルト値は空の文字列です。「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 に答える