views:

33

answers:

0

I have a project for my System Software class, we have to produce a subroutine to decompose a line of source into 4 components: label, op code, operand1, and operand2, and identify the n,i,x and e bit settings. I'm having a problem trying to figure out the nixbpe bit. thank you in advance for your help

here are some examples: Components and bits for the following 4 examples of source lines are as follows:

  1. EXAMPLE +LDA STUFF,X .MAIN

    label: "EXAMPLE" op code: "LDA" operand 1: "STUFF" operand 2: "X"

    nixbpe: 111??1

  2. RSUB NO OP

    label: "" op code: "RSUB" operand 1: "NO" operand 2: "OP"

    nixbpe: 110??0

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

    label: "CMT" op code: "BYTE" operand 1: "C'RESERVED BLOCK'" operand 2: "XYZ" < Note: the x (index) bit in nixbpe is set whenever 'X' is the first character of the 2nd operand>

    nixbpe: 101??0

  4. RMO A,X

    label: "" op code: "RMO" operand 1: "A" operand 2: "X"

    nixbpe: 11l??0

nixbpe bits marked "?" remain as received from the calling program; the prefix for the op code determines the e-bit; the prefix for operand1 determines the n and i bits; the first character for operand2 determines the x bit. The b and p bits are set elsewhere. No semantic checking is expected in this routine (so in particular, both interpretations of the RSUB statement above are OK). Default values for components is the empty string. Default for the "ni??pe" bits is "00??00".