-1

This is my first time using assembly on a Raspberry Pi. I don't have sudo access so I can't try running it that way. Anytime I try to do sudo it just throws an error.

When I try to run my program it returns this:

./test.s: line 1: .data: command not found    
./test.s line 2: .bealign: command not found    
./test.s line 3: x:: command not found

and so on for all the lines in the file. I have no idea how to fix this.

I'm running my program doing ./test.s ; echo $? I also tried doing it without the echo part and without the $? part and without the ./ part.

jww
  • 97,681
  • 90
  • 411
  • 885
  • 1
    `sudo` is never needed to test your assembly programs. Do not try to use it for that as it may cause mistakes in your programs to break the system. Your main problem is that you did not assembly your program before executing it. – fuz Sep 27 '19 at 19:15

1 Answers1

3

test.s is assembly source code, not bash shell.

Running it that way got your shell to try to source it or run bash test.s which can't possibly work. That tries to run each line of assembler source code as a shell command.

Instead run gcc test.s to assemble+link it into an executable. If that doesn't work you'll need to find yourself a tutorial or book to learn some basics.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847