2D 平面上の 2 点 (A と B) 間の距離を計算するアセンブリ YASM コードを作成しようとしています。
これは、コードを作成するために使用しているコマンドです。
yasm -f elf64 -g dwarf2 -l distance.lst distance.asm
distance.asm:2: エラー: 行頭にラベルまたは命令が必要です distance.asm:4: エラー: 行頭にラベルまたは命令が必要です
私はアセンブリが初めてで、エラーを修正する方法を理解できません:
segment .data
Ax dq 0 ; x coordinate of A
Ay dq 0 ; y coordinate of A
Bx dq 1 ; x coordinate of B
By dq 1 ; y coordinate of B
segment .text
global _start
_start:
mov rax, [Ax] ; Writing values
mov rbx, [Ay] ; of A and B
mov rcx, [Bx] ; coordinates to
mov rdx, [By] ; registers
sub rax, rcx ; Length of the first cathetus
sub rbx, rdx ; Length of the second cathetus
imul rax, rbx ; Suqare of distanse between A and B
私の質問は、上記のエラーが表示されるのはなぜですか? (stackoverflow で同様の質問を読みましたが、コードの何が問題なのかまだわかりませんでした)