# An example of using the TEST instruction
#
.section .data
output_cpuid:
.asciz "This processor supports the CPUID instruction.n"
output_nocpuid:
.asciz "This processor does not support the CPUID instruction.n"
.section .text
.globl main
main:
nop
pushfl # 把EFLAGS的值保存到堆栈顶部
popl %eax # 把EFLAGS值读取到EAX中
movl %eax, %edx
xor $0x00200000, %eax
push %eax
popfl # 把它存储在EFLAGS中
pushfl # 再次EFLAGS入堆栈
popl %eax
xor %edx, %eax
test $0x00200000, %eax
jnz cpuid
push $output_nocpuid
call printf
add $4, %esp
push $0
call exit
cpuid:
push $output_cpuid
call printf
add $4, %esp
push $0
call exit
最后
以上就是激动背包最近收集整理的关于Intel汇编-test指令的全部内容,更多相关Intel汇编-test指令内容请搜索靠谱客的其他文章。
发表评论 取消回复