ArticleslgStudy

science

Alternate Instruction Set

Alternate Instruction Set is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Alternate Instruction Set rather than just read about it. In short: The Alternate Instruction Set (AIS) is a unique secondary instruction set architecture found in the VIA C3 series of x86-32 CPUs made by VIA Technologies. The hidden processor mode is accessed by executing the x86 instruction JMPAI (0F 3F).

Key takeaways

  • Alternate Instruction Set belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Alternate Instruction Set to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Alternate Instruction Set from memory before moving on to harder problems.

Reference excerpt

The Alternate Instruction Set (AIS) is a unique secondary instruction set architecture found in the VIA C3 series of x86-32 CPUs made by VIA Technologies. The hidden processor mode is accessed by executing the x86 instruction JMPAI (0F 3F). If AIS mode has been enabled, the processor will perform a JMP EAX and begin executing AIS instructions at the address of the EAX register. Using AIS allows native access to the Centaur Technology-designed RISC core inside the processor.

Instruction format

The manufacturer describes the Alternate Instruction Set as "an extended set of integer, MMX, floating-point, and 3DNow! instructions along with additional registers and some more powerful instruction forms". Every AIS instruction is prefixed with the 3-byte sequence 0x8D8400 followed by the 32-bit instruction; this prefix form for the AIS instructions makes them appear to be x86 Load Effective Address (LEA) instructions. In 2018 researcher Christopher Domas reported that the prefix 0x620405 (x86 BOUND) also worked. A proposal made in 2002 to add AIS support to the Netwide Assembler (NASM) was partially declined in 2005, on the basis that NASM was an x86 assembler, and AIS is a separate instruction set. An assembler is available from Domas's 2018 research. In 2007 a patent named some microcode instructions as load and store to/from main RAM, and loadPRAM and storePRAM to/from private-RAM inside the processor. The Centaur Technologies verification team, in a 2014 paper about the VIA Nano, included some short lists of micro-instructions including ADDIG, JLINK, JMP_ALL, MVIG, NLOOPE, STORE_PRAM, plus micro-operations XADD and XSUB. Micro-operations were shown to have a format that includes the fields opcode, exec unit, src width, src1, src2, dest width, dest, write flags? and end routine?. A 2002 programming reference for the Alternate Instruction set and an accompanying appnote were added to the Bitsavers archive in May 2021.

Availability From x86 mode, the availability of the Alternate Instruction Set can be detected by executing a CPUID with the EAX register set to 0xc0000001 and then examining the EDX register. If EDX bit 0 is set to 1, then AIS is supported. If EDX bit 1 is also set to 1, then AIS is enabled. If AIS is supported by the CPU, then its status can be checked and altered through the Model-specific registers, by checking and setting the Feature Control Register (FCR, register 0x1107). If bit 0 ("ALTINST") is set to 1, then AIS is enabled. The Microsoft Windows NT kernel KiGetFeatureBits() initialisation function proactively disables Alternate Instruction mode on boot up. If the x86 JMPAI jump instruction is executed when AIS mode is disabled, then the processor will generate an Invalid Instruction exception. Setting the AIS-enabled bit requires privileged access, and should be set using a read–modify–write sequence.

Privilege elevation In 2018 Christopher Domas discovered that some Samuel 2 processors came with the Alternate Instruction Set enabled by default and that by executing AIS instructions from user space, it was possible to gain privilege escalation from Ring 3 to Ring 0. Domas had partially reverse engineered the AIS instruction set using automated fuzzing against a cluster of seven thin clients. Domas used the terms "deeply embedded core" (DEC) plus "deeply embedded instruction set" (DEIS) for the RISC instruction set, "launch instruction" for JMPAI, "bridge instruction" for the x86 prefix wrapper, "global configuration register" for the Feature Control Register (FCR), and gave the exploit the physics inspired name "Rosenbridge".

See also NEC V20/V30, an x86-compatible CPU implementing a similar scheme to enter and exit into an alternate instruction set mode to support Intel 8080 instructions.

References

Further reading

Worked examples

Example 1 — a first encounter with Alternate Instruction Set

Start with the simplest possible case. Write down what Alternate Instruction Set claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Alternate Instruction Set before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Alternate Instruction Set ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Alternate Instruction Set

In research
Alternate Instruction Set appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Alternate Instruction Set in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Alternate Instruction Set is common in secondary-school and first-year university syllabi. It links to neighbouring topics Instruction set extensions, VIA Technologies x86 microprocessors, X86 instructions, so understanding it makes those chapters shorter.
In everyday life
Look for Alternate Instruction Set outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Alternate Instruction Set” →

How to study Alternate Instruction Set in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Alternate Instruction Set means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Alternate Instruction Set out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Alternate Instruction Set in simple terms?

The Alternate Instruction Set (AIS) is a unique secondary instruction set architecture found in the VIA C3 series of x86-32 CPUs made by VIA Technologies. The hidden processor mode is accessed by executing the x86 instruction JMPAI (0F 3F).

Why does Alternate Instruction Set matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Alternate Instruction Set?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Alternate Instruction Set.

Tags

  • Instruction set extensions
  • VIA Technologies x86 microprocessors
  • X86 instructions
  • X86 operating modes

Keep exploring