Relative Content

Tag Archive for assemblyx86-64

Working with big integers in assembly x86-64

Starting to learn assembly x86-64 and I’m writing a program that get an array of integers and does some calculations on it, the purpose isn’t relevant to the question, but the calculations include multiplications and divisions, the size and sign of the integers are not known, and the program should handle any case.
I Wonder what is the correct way to do it, should I extend the integers to the x64 size registers or should I work the EDX::EAX extenstions?

Why doesn’t my code sort numbers greater than 128?

_start: mov rdx, len ; Store the number of elements in rdx (len – 1) dec rdx ; Subtract 1 to get the index of the last element mov rsi, 0 ; Store the starting index (0) in rsi lea rdi, [array] ; Load the address of the array into rdi call mergesort ; Call […]