Ejemplo n.º 1
0
        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}");
            }
        }
Ejemplo n.º 2
0
 private void DereferenceFromRegister(GenericToDref2Action action, Register source)
 {
     action(Ptr, source, StructOffset, OffsetMul, Offset, Ptr == Register64.RSP || Ptr == Register64.RBP ? Segment.SS : Segment.DS);
 }