features.s
来自「*****汇编语言程序设计 源代码*****」· S 代码 · 共 59 行
S
59 行
# features.s - Determine MMX, SSE, SSE2, and SSE3 capabilities.section .datagotmmx: .asciz "Supports MMX"gotsse: .asciz "Supports SSE"gotsse2: .asciz "Supports SSE2"gotsse3: .asciz "Supports SSE3"output: .asciz "%s\n".section .bss .lcomm ecxdata, 4 .lcomm edxdata, 4.section .text.globl _start_start: nop movl $1, %eax cpuid movl %ecx, ecxdata movl %edx, edxdata test $0x00800000, %edx jz done pushl $gotmmx pushl $output call printf addl $8, %esp movl edxdata, %edx test $0x02000000, %edx jz done pushl $gotsse pushl $output call printf addl $8, %esp movl edxdata, %edx test $0x04000000, %edx jz done pushl $gotsse2 pushl $output call printf addl $8, %esp movl ecxdata, %ecx test $0x00000001, %ecx jz done pushl $gotsse3 pushl $output call printf addl $8, %espdone: pushl $0 call exit
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?