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:
EXAMPLE +LDA STUFF,X .MAIN
label: "EXAMPLE" op code: "LDA" operand 1: "STUFF" operand 2: "X"
nixbpe: 111??1
RSUB NO OP
label: "" op code: "RSUB" operand 1: "NO" operand 2: "OP"
nixbpe: 110??0
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
RMO A,X
lab开发者_JS百科el: "" 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".
***Addressing Flag bits Description
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)***
refer to http://www.unf.edu/~cwinton/html/cop3601/supplements/sicsim.docL.html for more details
精彩评论