我有一個遊戲源代碼,但是我無法將它組裝到nasm上,我無法理解問題在哪裏。如何在nasm上運行此彙編代碼?
這裏是生成文件:
# Makefile for the nibbles game.
all: nibbles_asm nibbles_asm_start
# Rule for compiling C source
.c.o:
gcc -Os -march=i686 -Wall -g -c $<
# Rule for compiling assembly source
.S.o:
as -gstabs $^ -o [email protected]
# ASM game
nibbles_asm: main.o nibbles.o helpers.o
gcc -lcurses $^ -o -V [email protected]
# ASM game
nibbles_asm_start: start.o nibbles.o helpers.o workaround.o
gcc -lcurses -lc -nostdlib $^ -o [email protected]
clean:
rm -f *~
rm -f *.o
rm -f nibbles nibbles_asm
,這裏是錯誤:
as -o nibbles.o nibbles.s
gcc -lcurses main.o nibbles.o helpers.o -o -V nibbles_asm
gcc: nibbles_asm: No such file or directory
make: *** [nibbles_asm] Error 1
似乎爲-gstabs $^-o $ @不建nibbles_asm文件! 我也在終端中輸入了自己的命令,但它給了我很多錯誤。我的朋友在他的電腦上運行這段代碼,所以代碼沒有任何問題。
迂迴的評論:你不能在nasm上運行程序集。你在CPU上運行它。你用nasm集合它__ – sehe
'-V'是什麼? –
沒有-V它有這個錯誤:main.o:在函數'main'中: /home/aida/Desktop/13/main.c:45:未定義引用'start_game',有人告訴我把它放在這裏修復這個 – matarsak