Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run this assembly code on nasm?

I have a game source code but I could not assemble it on nasm , I could not understand where is the problem .

here is the makefile :

# 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 $@



# ASM game
nibbles_asm: main.o nibbles.o helpers.o
    gcc -lcurses $^ -o -V $@

# ASM game
nibbles_asm_start: start.o nibbles.o helpers.o workaround.o
    gcc -lcurses -lc -nostdlib $^ -o $@

clean:
    rm -f *~
    rm -f *.o
    rm -f nibbles nibbles_asm

and here is the error :

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

it seems that as -gstabs $^ -o $@ do not build the nibbles_asm file ! I also typed the command by myself in terminal but it gave me alot of errors . my friend run this code on his computer , so the code does not have any problem .

like image 253
Aida E Avatar asked Feb 20 '26 13:02

Aida E


1 Answers

There is no dependency to get from nibbles.S to nibbles.o. Also, helpers.o and workaround.o don't have associated source file relations. Add those relationship and it should work.

like image 164
wallyk Avatar answered Feb 23 '26 07:02

wallyk