; subs two long number
; rsi -- address of minuend (long number)
; rdi -- address of subtrahend (long number)
; rcx -- length of long numbers in qwords
; result:
; sub is written to rdi
sub_long_long:
push rdi
push rsi
push rcx
clc
.loop:
mov rax, [rsi]
lea rsi, [rsi + 8]
sbb rax, [rdi]
mov [rdi], rax
lea rdi, [rdi + 8]
dec rcx
jnz .loop
pop rcx
pop rsi
pop rdi
ret
现在,如果我将lea rsi, [rsi + 8]
更改为add rsi, 8
程序会给出错误的结果,例如:
10000000000000000000000000000000000000000000000000000000000000000000 1000000000000000000000000000 9999999999999999999999999999999999999999000000018446744073709551616
为什么会这样?