public void Setup() { f = new Frame(PrimitiveType.Word16); argOff = f.EnsureStackArgument(4, PrimitiveType.Word16); argSeg = f.EnsureStackArgument(6, PrimitiveType.SegmentSelector); arg_alias = f.EnsureStackArgument(4, PrimitiveType.Pointer32); }
public void Setup() { arch = new IntelArchitecture(ProcessorMode.Real); f = new Frame(PrimitiveType.Word16); argOff = f.EnsureStackArgument(4, PrimitiveType.Word16); argSeg = f.EnsureStackArgument(6, PrimitiveType.SegmentSelector); arg_alias = f.EnsureStackArgument(4, PrimitiveType.Pointer32); }
public override FunctionType Deserialize(SerializedSignature ss, Frame frame) { int ncrn = 0; int nsaa = 0; // mem arg forb ret val var argser = new ArgumentDeserializer( this, Architecture, frame, Architecture.PointerType.Size, Architecture.WordWidth.Size); Identifier ret = null; if (ss.ReturnValue != null) { ret = argser.DeserializeReturnValue(ss.ReturnValue); } var args = new List<Identifier>(); if (ss.Arguments != null) { foreach (var sArg in ss.Arguments) { var dt = sArg.Type.Accept(TypeLoader); var sizeInWords = (dt.Size + 3) / 4; if (sizeInWords == 2 && (ncrn & 1) == 1) ++ncrn; Identifier arg; if (sizeInWords <= 4 - ncrn) { if (sizeInWords == 2) { arg = frame.EnsureSequence( Architecture.GetRegister(argRegs[ncrn]), Architecture.GetRegister(argRegs[ncrn + 1]), dt); ncrn += 2; } else { arg = frame.EnsureRegister( Architecture.GetRegister(argRegs[ncrn])); ncrn += 1; } } else { arg = frame.EnsureStackArgument(nsaa, dt); nsaa += AlignedStackArgumentSize(dt); } args.Add(arg); } } return new FunctionType(ret, args.ToArray()); }