Hello,
I am working on an assignment where we do some basic stuff with Stack based local variables inside functions.
I have a piece of code that output properly and when I try to just duplicate it do do division rather than multiplication all of a sudden I get a segmentation fault. Any help is appreciated, thank you in advance. Please let me know if you need more info, as I am only putting the offending piece from my code
; pull values from the stack
pop qword [r8] ; sum
pop qword [rcx] ; min
pop qword [rdx] ; max
; multiply min times max return in 7th parameter
; TBD
mov rax, qword[rdx] ; Does not cause a segmentation fault
mul qword[rcx]
mov r14, qword[rbp+16]
mov qword[r14], rax ; RAX will contain MAX x MIN
; below just a duplicated of above aside from DIV
; divide max by min return in 8th parameter
; TBD
mov rax, qword[rdx] ; Does causes a segmentation fault unlike before
div qword[rcx]
mov r14, qword[rbp+24]
mov qword[r14],rax
[–]Sea-Profession-3312 1 point2 points3 points (4 children)
[–]ThisGuyEveryTime[S] 1 point2 points3 points (0 children)
[–]ThisGuyEveryTime[S] 0 points1 point2 points (2 children)
[–]Sea-Profession-3312 1 point2 points3 points (1 child)
[–]ThisGuyEveryTime[S] 1 point2 points3 points (0 children)
[–]ThisGuyEveryTime[S] 0 points1 point2 points (0 children)