I'm trying to write a subroutine that adds two large numbers in x86 assembly (MASM). The numbers are pointed at by the si and di registers, and the function should iterate from right to left, adding each data word and passing the carry, and saving the result in di. The number of data words to add is determined by a previous chunk of code.
...
mov cx, ( number of data words to add )
adding:
mov bx,cx ;copy the loop counter to bx
lea ax,[di+2*bx] ;move ax to the destination word
adc ax,[si+2*bx] ;add the source word into the destination word
loop adding ;main sub loop
...
Unfortunately, when I try to compile this code, I get error A2032: invalid use of register on both the lea and adc lines. What is wrong with the syntax that I'm using?