小编And*_*rew的帖子

装配ADC(附带进位)

mov eax, ptr_to_num1 ; little endian
mov ebx, ptr_to_num2 ; little endian
xor ecx, ecx
xor edx, edx
clc
bytes_addition:
    mov dl, byte [eax+ecx] ; byte from shortest
    adc dl, byte [ebx+ecx]
    mov byte [eax+ecx], dl
    inc ecx
    cmp ecx, 4 ; counter, 
    jl bytes_addition
Run Code Online (Sandbox Code Playgroud)

考虑一下

EAX:4F2252FF(大端)

EBX:00DFFC00(大端)

这个添加的结果是错误的:50024fff(大端).它应该是50024eff.看起来进位标志受到影响,但为什么呢?

assembly adc

4
推荐指数
1
解决办法
644
查看次数

标签 统计

adc ×1

assembly ×1