Adding 64 bit numbers using 32 bit arithmetic

前端 未结 6 882
渐次进展
渐次进展 2020-12-05 06:02

How do we add two 64 bit numbers using 32 bit arithmetic??

6条回答
  •  眼角桃花
    2020-12-05 06:27

    Add the least significant bytes first, keep the carry. Add the most significant bytes considering the carry from LSBs:

    ; x86 assembly, Intel syntax
    ; adds ecx:ebx to edx:eax
    add eax, ebx
    adc edx, ecx
    

提交回复
热议问题