The coprocessor features a total of 68 distinct instructions. When the assembler encounters a coprocessor instruction mnemonic, it translates it into an ESC (Escape) instruction in machine language. This ESC instruction serves as the opcode for the coprocessor, allowing it to execute specific operations. During execution, if the coprocessor needs to access memory, the CPU generates the appropriate memory address. The coprocessor communicates with the CPU via the data bus, transferring data as needed.
For example, the 80287 coprocessor uses I/O addresses from 00FAH to 00FFH for data exchange, while later models like the 80387 and Pentium series use I/O addresses ranging from 800000FAH to 800000FFH. These addresses enable efficient communication between the coprocessor and the main CPU.
There are three primary types of data transfer instructions in the coprocessor's instruction set: BCD transfer, floating-point transfer, and integer transfer instructions. These instructions facilitate data movement between the coprocessor and the main memory or CPU registers.
**First, BCD Transfer Instructions**
1. **FBLD**
Instruction format: FBLD MemBCD
Function: Loads a BCD (Binary-Coded Decimal) value from memory onto the coprocessor’s stack.
2. **FBSTP**
Instruction format: FBSTP MemBCD
Function: Stores the BCD value from the top of the coprocessor’s stack into memory and then pops the stack.
These instructions are essential for handling decimal arithmetic, often used in financial and scientific applications.
**Second, Floating-Point Transfer Instructions**
Floating-point instructions allow the coprocessor to handle real numbers efficiently. Common instructions include:
1. **FST**
Instruction format: FST MemFP
Function: Stores the value at the top of the stack (ST(0)) into a specified memory location without popping the stack.
2. **FSTP**
Instruction format: FSTP MemFP
Function: Stores the value at ST(0) into memory and then pops the stack.
3. **FXCH**
Instruction format: FXCH ST(n)
Function: Exchanges the value at ST(0) with the value at the specified register ST(n).
These instructions are crucial for high-precision calculations, especially in engineering and mathematical software.
**Third, Integer Transfer Instructions**
1. **FILD**
Instruction format: FILD MemInt
Function: Loads an integer value from memory into the coprocessor’s stack.
2. **FIST / FISTP**
Instruction format: FIST MemInt / FISTP MemInt
Function: Converts the value at ST(0) to an integer and stores it in memory. The difference is that FIST does not pop the stack, while FISTP does.
These instructions are useful when converting between integer and floating-point representations, ensuring compatibility between different data types during computation.
Waterproof Speaker,Full Range Loud Speaker,Entrance System Speaker,Waterproof Multimedia Speaker
Jiangsu Huawha Electronices Co.,Ltd , https://www.hnbuzzer.com