Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why is the x86 undefined instruction called ud2? Why 2?

The x86 undefined instruction ud2 is called such because it originated from the 0F FF sequence, which was found to reliably raise an invalid opcode exception when executed. Initially, there was no architecturally undefined instruction on x86, so those who wanted to force this exception looked for a byte sequence that would trigger it.

The 0F FF sequence was discovered to work, but it internally decoded as if it had two parameters, although these were not actually used since the exception was raised before any usage. Meanwhile, another sequence, 0F B9, also had the same properties. This led to two groups using separate sequences, 0F FF and 0F B9, for the same purpose.

Intel later created a dedicated instruction, ud2, to officially provide a reliable way to trigger an invalid opcode exception. The name ud2 came about because the 0F FF variant was retroactively named ud0, and the 0F B9 variant was named ud1, leaving ud2 as the recommended undefined opcode. The choice of ud2 instead of ud1 or ud0 was due to its simplicity as a two-byte instruction without parameters, avoiding issues with decoding and potential access violations if the instruction crossed into a not-present page.

Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Also reported by 1 other outlet

Read the original at devblogs.microsoft.com →

More in Tech

Power BI: Data Modelling, Relationships & Joins

1. Data Modelling in Power BI What is Data Modeling? Data Modeling is how you organize and connect your tables in Power BI so they work together properly.

  • Data Modelling organizes and connects tables in Power BI.
  • Avoids duplication and ensures efficient updates in the Kenya Crops csv file.
  • Relationships enable accurate calculations and reporting across tables.

Cognito With the Safety Off: MFA Disabled, Advanced Security Disabled

✓ Human-authored analysis; AI used for formatting and proofreading. A Cognito user pool is an identity perimeter. The pool authenticates customers, issues JWTs the application trusts, and brokers…

  • MFA and Advanced Security disabled by default in Cognito user pools
  • Attackers can easily gain access through credential stuffing and password spraying
  • Enforcing MFA crucial to prevent account takeover and protect user accounts

More from Sunday 13 September →