public void X86_64Psig_MixedIntsFloats()
        {
            var pser = Given_ProcedureSerializer();
            var ssig = new SerializedSignature
            {
                ReturnValue = new Argument_v1 {
                    Type = PrimitiveType_v1.Int32()
                },
                Arguments = new Argument_v1[]
                {
                    new Argument_v1 {
                        Type = PrimitiveType_v1.Int32(), Name = "a"
                    },
                    new Argument_v1 {
                        Type = PrimitiveType_v1.Real64(), Name = "b"
                    },
                    new Argument_v1 {
                        Type = PointerType_v1.Create(PrimitiveType_v1.Char8(), 8), Name = "c"
                    },
                    new Argument_v1 {
                        Type = PrimitiveType_v1.Real64(), Name = "d"
                    },
                    new Argument_v1 {
                        Type = PrimitiveType_v1.Real32(), Name = "e"
                    },
                }
            };

            var sig = pser.Deserialize(ssig, frame);

            Assert.AreEqual("rax", sig.ReturnValue.Storage.ToString());
            ExpectArgs(sig, "rcx", "xmm1", "r8", "xmm3", "Stack +0008");
        }
예제 #2
0
        private bool LoadParameter(SerializedSignature ssig, List <Argument_v1> args)
        {
            if (PeekAndDiscard(TokenType.NUMBER))
            {
                return(true);
            }
            Token tok = Peek();

            if (tok.Type != TokenType.ID)
            {
                return(false);
            }
            Get();
            SerializedType type = null;

            switch (tok.Value)
            {
            case "word":
            case "s_word":
                type = new PrimitiveType_v1(PrimitiveType.Word16.Domain, 2);
                break;

            case "long":
                type = new PrimitiveType_v1(PrimitiveType.Word32.Domain, 4);
                break;

            //$TODO: need SegmentedPointerType
            case "segptr":
            case "segstr":
                type = new PrimitiveType_v1(Domain.SegPointer, 4);
                break;

            case "ptr":
                type = new PrimitiveType_v1(Domain.Pointer, 4);
                break;

            case "str":
                type = PointerType_v1.Create(PrimitiveType_v1.Char8(), 4);
                break;

            case "wstr":
                type = PointerType_v1.Create(PrimitiveType_v1.WChar16(), 4);
                break;

            case "uint16":
                type = PrimitiveType_v1.UInt16();
                break;

            case "uint32":
                type = PrimitiveType_v1.UInt32();
                break;

            case "uint64":
                type = PrimitiveType_v1.UInt64();
                break;

            case "int16":
                type = PrimitiveType_v1.Int16();
                break;

            case "int32":
                type = PrimitiveType_v1.Int32();
                break;

            case "int64":
                type = PrimitiveType_v1.Int64();
                break;

            default: throw new Exception("Unknown: " + tok.Value);
            }
            args.Add(new Argument_v1 {
                Type = type
            });
            return(true);
        }
예제 #3
0
파일: TypeBuilder.cs 프로젝트: ghmole/reko
 private static SerializedType FarPtr(SerializedType type)
 {
     return(PointerType_v1.Create(type, 4));
 }