当前位置: 首页>>代码示例>>Golang>>正文


Golang Operation.Word方法代码示例

本文整理汇总了Golang中app/simulator/processor/models/operation.Operation.Word方法的典型用法代码示例。如果您正苦于以下问题:Golang Operation.Word方法的具体用法?Golang Operation.Word怎么用?Golang Operation.Word使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app/simulator/processor/models/operation.Operation的用法示例。


在下文中一共展示了Operation.Word方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: decodeInstruction

func (this *Decoder) decodeInstruction(op *operation.Operation) (*instruction.Instruction, error) {
	startCycles := this.Processor().Cycles()

	// Do decode once a data instruction is received
	instruction, err := this.Processor().InstructionsSet().GetInstructionFromBytes(op.Word())
	if err != nil {
		return nil, errors.New(fmt.Sprintf("Failed decoding instruction %#04X. %s]", op.Word(), err.Error()))
	}
	logger.Collect(" => [DE%d][%03d]: %#04X = %s, %s", this.Index(), op.Id(), op.Word(), instruction.Info.ToString(), instruction.Data.ToString())

	// Wait cycles of a decode stage
	this.Processor().Wait(consts.DECODE_CYCLES)

	// Log event
	if this.IsActive() {
		this.Processor().LogEvent(consts.DECODE_EVENT, this.Index(), op.Id(), startCycles)
	}
	return instruction, nil
}
开发者ID:felipegs01,项目名称:processor_simulator,代码行数:19,代码来源:decoder.go


注:本文中的app/simulator/processor/models/operation.Operation.Word方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。