Mips で "Hello World" (インターネットで見つかった例から) を表示して、それがどのように機能するかを確認しようとしていますが、エラーが発生します。最初に次のエラーが発生しました:"spim: (パーサー) ラベルは、 2 回目はファイル C:Program Files (x86) main の 6 行目: # Execution starts at label "main" " ^ 修正するために、再初期化してリロードしました。次に、Qtspim を実行すると、次のエラーが表示されます。 $a0 に出力されます
誰かが最初と2番目のエラーの原因を説明できますか? オンラインで見つけたコードをテストして、課題を試す前に Qtspim がどのように機能するかを理解しようとしています。Windows 08 で Notepad++ を使用しています。ご協力をお願いします。以下はコードです。
# Program: Hello, World!
.data # data declaration section; specifies values to be stored
# in memory and labels whereby the values are accessed
Greeting: .asciiz "\nHello, World!\n"
.text # Start of code section
main: # Execution begins at label "main"
li $v0, 4 # system call code for printing string = 4
la $a0, Greetings # load address of string to be printed into $a0
syscall # call operating system to perform operation;
# $v0 specifies the system function called;
# syscall takes $v0 (and opt arguments)
#This illustrates the basic structure of an assembly language program.