public void DereferenceFromRegister( CodeGen codeGen, Register source, ILinkingInfo fixer, GenericBrotherAction brotherAction, GenericToDrefAction drefAction, GenericToDref2Action dref2Action, GenericToDref3Action dref3Action, GenericToDref4Action dref4Action ) { switch (Kind) { case ResultKind.Value: DereferenceFromRegister(brotherAction, source); return; case ResultKind.Pointer: DereferenceFromRegister(drefAction, source); return; case ResultKind.Pointer2: DereferenceFromRegister(dref2Action, source); return; case ResultKind.Pointer3: DereferenceFromRegister(dref3Action, source); return; case ResultKind.Offset: DereferenceFromRegister(codeGen, source, dref4Action, fixer); return; default: throw new NotImplementedException($"{nameof(ExpressionResult)}: {nameof(GenerateMoveTo)} has not implemented kind: {Kind}"); } }
private void DereferenceFromRegister(GenericToDrefAction action, Register source) { action(Ptr, source, Offset, Ptr == Register64.RSP || Ptr == Register64.RBP ? Segment.SS : Segment.DS); }