I like to add a byte from a memory location to a 32bit register,
is this possible in x86 assembly?
add edx, byte [ebx]
causes error: mismatch in operand sizes
You need to make sure that the operands are of the same size.
This involves a problem with the sign though. If you are working with signed integers you should use movsx, or use movzx if you are working with unsigned integers.
movsx/movzx eax, byte ptr [ebx]
add edx, eax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With