Skip to content

dot_product.asm with different number of values #82

@sevilla-larry

Description

@sevilla-larry

Existing issues

  • I have searched the existing issues.

Affected document

https://github.com/0xAX/asm/blob/master/float/dot_product.asm, https://github.com/0xAX/asm/blob/master/content/asm_6.md

Issue description

Hi @0xAX,

nasm -g -f elf64 -o dot_product.o dot_product.asm
ld -dynamic-linker /lib64/ld-linux-x86-64.so.2 -lc dot_product.o -o dot_product.exe

./dot_product.exe
Input the first vector: 2.5 3.17
Input the second vector: 4.22 100.1
Dot product = 327.867000
[as expected]

[note: tried 2 values and 3 values]
./dot_product.exe
Input the first vector: 1.1 2.2
Input the second vector: 3.3 4.4 5.5
Dot product = 13.310000
[should be Error: ...]

[note: tried 2 values and blank]
./dot_product.exe
Input the first vector: 1.1 1.1
Input the second vector:
Error: the number of values in vectors should be the same
[as expected]

[note: tried 3 values and 2 values]
./dot_product.exe
Input the first vector: 1.1 2.2 3.3
Input the second vector: 4.4 5.5
Dot product = 16.940000
[should be Error: ...]

[note: tried both blanks]
./dot_product.exe
Input the first vector:
Input the second vector:
Error: the number of values in vectors should be the same
[not sure of this]

[note: tried 2 values and 1 value]
./dot_product.exe
Input the first vector: 1.1 2.2
Input the second vector: 3.3
Error: the number of values in vectors should be the same
[as expected]

[note: tried 1 value and 2 values]
./dot_product.exe
Input the first vector: 1.1
Input the second vector: 2.2 3.3
Error: the number of values in vectors should be the same
[as expected]

Attachments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions