I am wondering how exactly CDQ would work in C#. Anyone know a C# equivalent?
What does a processor instruction have to do with a high-level language like C#?
Why is my data not saved to my database? | MSDN Data Walkthroughs VBForums Database Development FAQ My CodeBank Submissions: VB | C# My Blog: Data Among Multiple Forms (3 parts) Beginner Tutorials: VB | C# | SQL
Something like this... Code: ulong CDQ(uint d) { if((d & 0x80000000) != 0) return 0xffffffff00000000 | (ulong)d; //sign extend 1 else return (ulong)d; //sign extend 0 (this is implicit) } In fact since C# is so much higher-level than ASM, the above would be virtually identical to the implementation of the MOVSE (move with sign extend) opcode.
ulong CDQ(uint d) { if((d & 0x80000000) != 0) return 0xffffffff00000000 | (ulong)d; //sign extend 1 else return (ulong)d; //sign extend 0 (this is implicit) }
I don't live here any more.
Forum Rules