我是靠谱客的博主 激动背包,这篇文章主要介绍Intel汇编-test指令,现在分享给大家,希望可以做个参考。

# 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指令内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(106)

评论列表共有 0 条评论

立即
投稿
返回
顶部