Intel汇编-ADC指令

# An example of using the ADC instruction.
#
# ADC 执行两个无符号或者带符号整数值的加法,并且把前一个ADD产生的进位标志的值包含在其中。
#

    .section .data
data1:
    .quad 7252051615
data2:
    .quad 5732348928
output:
    .asciz "The result is %qd\n"    # %qd 显示64位带符号整数值

    .section .text
    .globl main
main:
    movl data1, %ebx        # 使用变址寻址方式把64位值加载到EAX:EBX 和 ECX:EDX中。
    movl data1+4, %eax        # data1的低32加载到EBX中,高32位加载到EAX。
    movl data2, %edx        # data2的低32加载到EDX中,高32位加载到ECX。
    movl data2+4, %ecx
    addl %ebx, %edx
    adcl %eax, %ecx
    push %ecx
    push %edx
    push $output
    call printf
    addl $12, %esp
    push $0
    call exit

# gcc -g -o 04 04-adc.s -m32
#
# The result is 12984400543

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值