状态位 | 描述 |
0 | 非法操作异常标志 |
1 | 非格式化操作异常标志 |
2 | 除数为0异常标志 |
3 | 溢出异常标志 |
4 | 下溢异常标志 |
5 | 精度异常标志 |
6 | 堆栈错误 |
7 | 错误汇总状态 |
8 | 条件代码位0(C0) |
9 | 条件代码位1(C1) |
10 | 条件代码位2(C2) |
11-13 | 堆栈顶部指针 |
14 | 条件代码位3(C3) |
15 | FPU繁忙标志 |
.section .bss
.lcomm status, 2
.section .text
.global _start
_start:
nop
fstsw %ax
fstsw status
movl $1, %eax
movl $0, %ebx
int $0x80
(gdb) x/x &status
0x804908c <status>: 0x00000000
(gdb) print/x $eax
$1 = 0x0
控制位 | 描述 |
0 | 非法操作异常掩码 |
1 | 非格式化操作数异常掩码 |
2 | 除数位零异常掩码 |
3 | 溢出异常掩码 |
4 | 下溢异常掩码 |
5 | 精度异常掩码 |
6-7 | 保留 |
8-9 | 精度控制 |
10-11 | 舍入控制 |
12 | 无穷大控制 |
13-15 | 保留 |
.section .data
newvalue:
.byte 0x7f, 0x00
.section .text
.lcomm control, 2
.section .text
.global _start
_start:
nop
fstcw control
fldcw newvalue
fstcw control
movl $1, %eax
movl $0, %ebx
int $0x80
12 fstcw control
Current language: auto
The current source language is "auto; currently asm".
(gdb) n
13 fldcw newvalue
(gdb) x/x &control
0x804909c <control>: 0x0000037f
(gdb) n
14 fstcw control
(gdb) n
16 movl $1, %eax
(gdb) x/x &control
0x804909c <control>: 0x0000007f
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |