a little bit helping about asm

04/06/2020 08:40 XareL#1
Hi, I'm slowly learning the assembly and it was by trying it in my best practice.
In the code below,
i want to edx value divided by 2 and
I tried to subtract the number divided by pointer.



but didn't work cz crashed
Where am I making mistakes, is there anyone to give hints about it?
04/06/2020 14:36 Призрак урана#2
Use "cdq" command.

mov eax,edx // Move EDX into EAX
cdq
mov ecx,#2 // Move the divisor into ECX
div ecx // EAX should now be 6, if EDX was 12
sub [edi+00000140],eax