How to check if the result of a division is an integer and, depending on it, do the analog of if else construction in other languages? I've tried subtracting one int from another and checking if the result is lesser than the subtractor, but it looks very primitive to me.
EDIT: I'd be also grateful if somebody shows me how to set the element of the passed as the argument to an assembly function C array. For example:
mov dd [rdx], 0
where rdx is a pointer to an array, produces a segmentation fault when called from C.
EDIT 2: I'm adding the code snippet (the commented lines are causing an error):
format ELF64
section '.text' executable
public have_int_solns
have_int_solns:
;rdi
;rsi
;rdx
;ecx
dec ecx
l1:
mov eax, [rsi]
mov ebx, [rdi]
xor edx, edx
div ebx
cmp edx, 0
je Equal
; mov dword [rdx], 0
jmp Both
Equal:
; mov dword [rdx], 1
Both:
add edi, 4
add rsi, 4
add rdx, 4
loop l1
ret
section '.data' writable