I want to write a simple program that takes two integer numbers, divides them, converts the result into string and prints it to a screen.
Here's the part of code I got. It converts floating point number to an integer portion. There's an error there somewhere. It causes the floating point exception. Here I've tried to explain myself what actually happens within my program
_getTempIntegerPortion:
mov r8, temp
mov rcx, 10
xor rdx, rdx
; Input - rax as integer, r8 as pointer to temp, rcx is 10
_assignTempIntegerPortion:
div rcx
cmp rax, 0
mov rax, rdx
add rdx, 48
mov [r8], dl
inc r8
jne _assignTempIntegerPortion
ret