我有一个系统软件类的项目,我们必须生成一个子例程,将一行源代码分解为4个组件: label、op代码、operand1和operand2,并标识n、i、x和e位设置。我想弄清楚这点有点问题。预先感谢您的帮助
下面是一些示例:以下4个源行示例的组件和位如下:
标签:“示例”op代码:"LDA“操作数1:”填充“操作数2:"X"nixbpe: 111?1
标签:“op代码:"RSUB”操作数1:"“NO”操作数2:"OP“
nixbpe: 110?0
标签:"CMT“op代码:”字节“操作数1:”C‘’RESERVED块‘“操作数2:"XYZ”<注意:只要'X’是第二个operand>的第一个字符,就会设置nixbpe中的x(索引)位。
nixbpe: 101?0
标签:“op代码:"RMO”操作数1:"A“操作数2:"X”
:11l??0
标记为"?“保持从调用程序接收的状态;op代码的前缀确定e位;operand1的前缀确定n位和i位;operand2的第一个字符决定x位。B位和p位在其他地方设置。在这个例程中不需要进行语义检查(特别是,上面对RSUB语句的两种解释都是可以的)。组件的默认值是空字符串。默认的"ni??pe“位是"00??00”。
发布于 2011-10-06 17:09:40
*寻址标志位描述
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
https://stackoverflow.com/questions/2519230
复制相似问题