Here is that point in assembler:
CPU Disasm
Address Hex dump Command Comments
k_ptr->jaarkosten[0]=rentevoet*k_ptr->bedrag+0.5;
0040102B |. 8B45 FC MOV EAX,DWORD PTR SS:[k_ptr]
0040102E |. D945 F8 FLD DWORD PTR SS:[rentevoet]
00401031 |. DA48 78 FIMUL DWORD PTR DS:[EAX+78]
00401034 |. DC05 00304000 FADD QWORD PTR DS:[403000] ; FLOAT 0.5000000000000000
0040103A |. E8 21060000 CALL 00401660
0040103F |. 89C2 MOV EDX,EAX
00401041 |. 8910 MOV DWORD PTR DS:[EAX],EDX <- here is that problem, same value in registers
This way it won't crash:
k_ptr->jaarkosten[0]=(int)rentevoet*k_ptr->bedrag+0.5;
CPU Disasm
Address Hex dump Command Comments
0040102B |. D945 F8 FLD DWORD PTR SS:[LOCAL.3]
0040102E |. E8 3D060000 CALL 00401670 ; [Regel.00401670
00401033 |. 89C0 MOV EAX,EAX
00401035 |. 8B55 FC MOV EDX,DWORD PTR SS:[LOCAL.2]
00401038 |. 0FAF42 78 IMUL EAX,DWORD PTR DS:[EDX+78]
0040103C |. 50 PUSH EAX
0040103D |. DB0424 FILD DWORD PTR SS:[ESP]
00401040 |. 58 POP EAX
00401041 |. DC05 00304000 FADD QWORD PTR DS:[403000] ; FLOAT 0.5000000000000000
00401047 |. E8 24060000 CALL 00401670 ; [Regel.00401670
0040104C |. 89C0 MOV EAX,EAX
0040104E |. 8902 MOV DWORD PTR DS:[EDX],EAX