Most assemblers can provide the programmer with a listing file, which shows the machine code for each instruction. The command line option for the as assembler to produce an assembly listing is -al. This causes the listing to be printed to standard output (your terminal window), so you probably want to redirect this output to a file. For example, the command:
as --gstabs -al -o assignment2.o assignment2.s > assignment2.lst
The first column is the line number. The next column is the address, relative to the beginning of this function. The third column, the 32-bit numbers, is the machine code. Be careful to remember that the machine code is shown in byte order not word order and that the ARM in the Raspberry Pi uses little endian memory storage.