Hello ! I am facing an issue for the the test ‘test_negative_value_is_an_error’ for an assembly code x86_64
I have a label named .invalid which handles all invalid input :
'test_zero_is_an_error’ & ‘test_negative_value_is_an_error’
My code works for both and I am able to pass the ‘test_zero_is_an_error’ with -1, it does not work with ‘test_negative_value_is_an_error’ which send me this error log :
Expected -1 Was 389 I thought it was due to unsigned int or something but I have no clue how to fix it lol I want to kms
Here are my input verification in the beginning of my code :
test rdi, rdi
js .invalid
cmp rdi, 0
je .invalid
I’ve tried several implemantion for the .invalid label :
.invalid:
xor rax, rax
sub rax, 1
ret
.invalid
xor rax, rax
mov rax, -1
ret
Both implementation works for the ‘test_zero_is_an_error’ but not for ‘test_negative_value_is_an_error’
Can someone help me lol :33 ?