Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The answer was not to use brk, in solutions there are only malloc and calloc implementations as well as in mine own. No one's solution uses bkr. And i dont know should it be issue or not?
This comment is hidden because it contains spoiler information about the solution
; <-- [qword RAX] parts_sums([qword RDI] len, ro [qword RSI] ls, qword RDX n) -->
No if im now trying to save pointer that came in the beginning from RDIand at the end of my code restore this pointer in rdi then it works and can see
len
in[rdi]
but there is another problem now.For first case the answer is
[ 20, 20, 19, 16, 10, 0 ]
and i have exactly this array inrax
but if im justret
it im gettingTest Crashed Caught unexpected signal: 6
6 here is len or[rdi]
.And the MOST important is that if before
ret
if i do
sub rax, 8
it doesnt error but returns[ 0, 20, 20, 19, 16, 10 ]
that is definetly not the right answerand if im in opposite do
add rax, 8
then it returns[ 20, 19, 16, 10, 0, 0 ]
that is also dont error but not the right answer.I just CANT return the right answer because of the error. Also I have function to print nums from registers(does not affect them) and if i print [rax] it prints the right 20 and not anything else.
How to sane len in NASM?
Im having an error in NASM while saving len in
[rdi]
.In C there is
*len = <some number>;
so in NASM its likemov [rdi], <some number>
.But if im moving any value to
[rdi]
im getting:Test Crashed Caught unexpected signal: <some number>
Thanks, worked
I dont get where array pointer in NASM.
; <-- RAX sumofmin(ro [qword [dword RDI]] nums, RSI rows, RDX cols) -->
So
[rdi]
should be first item in array?I even did some function to print values in STDERR and everything worked fine but for
[rdi]
.Code i did and even checked on my machine works and would here too i believe if i could get this array.
in C all random tests passed yet all basic tests wrong. Why there is strange numbers when (int)(*str_in) instead of normal (on my PC the same code works)
expected [ [ [ 76, 97, -5, 29, -48, 31, 80, 57, +0 ], [ 76, 97, -5, 29, -48, 31, 80, 57 ] ], 317 ]
to deeply equal [ [ [ 76, 97, -5, 29, -48, 31, 80, 57 ], [ 76, 97, -5, 29, -48, 31, 80, 57, +0 ] ], 317 ]
genious