Pal/Environment.Dos.cs

(完整代码) 868B

using System.Runtime.CompilerServices;

namespace System
{
    static class Environment
    {
        public static unsafe long TickCount64
        {
            // Mark no inlining so that we get "volatile" semantics
            [MethodImpl(MethodImplOptions.NoInlining)]
            get
            {
                // Read BIOS data area - 1Ah interrupt counter.
                //
                // Yep, we're just dereferencing memory at some "arbitrary" offset.
                //
                // BIOS data area is a documented data structure laid out by the BIOS
                // when the computer resets. DOS apps are allowed to read it.
                //
                // Offset 0x46C keeps track of time in ~55 ms units.
                uint timerTicks = *(uint*)0x46C;
                return (long)timerTicks * 55;
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。