We used to say, "the more you learn, the more you forget. the more you forget, the less you know. why bother?" Or something like that. Actually, I forget what it was we used to say. It was a long time ago... but still proves the point...
Back to our clay tablet: On a 64-bit system, there is a possibility that the 32-bit C library is not installed. That's a game-ender. The solution is something like "aptget install gcc multilibs" or some such. Due to a poor choice of Linux distro (I think), I never had amy luck with that. I repeatedly wound up with a MS EULA, of all things. I said, "yeah yeah I agree" but still no go. It was my daughter's old machine, and shortly died entirely. I have a 64-bit machine, I just need to shovel off a space to put it. I am in no hurry!
However, the error message suggests a different problem. gcc, or ld, should never see the .asm file at all. First, assemble it with Nasm to an .o file, and then pass the .o file to gcc.
nasm -f elf32 assign3_part2.asm
gcc -m32 assign3_part2.o -o assign3_part2
Let us hope you have better luck with that.
Now... or whenever... you do need a commented-out line:
; told ya it was a good idea to do this...
; nasm -f elf32 assign3_part2.asm
; gcc -m32 assign3_part2.o -o assign3_part2
; ./assign3_part2 one two three
bits 32
global main
extern printf
extern exit
section .data
;test_str db 'Hello World!', 10, 0
; you don't use it yet, but you probably will want
; Nasm accepts C "escape sequences" if we
; use "back quotes"
format db `%s\n\0`
; or
; format db "%s", 10, 0
section .text
main:
push ebp ; save caller's frame pointer
; you do need this
; it is part of the normal "prolog"
mov ebp, esp ; set up frame pointer
push ebx
push esi
push edi
; code
mov ebx, [ebp + 12]
mov esi, [ebx]
push esi
; now of course you want:
call printf
pop eax ; or whatever
pop edi
pop esi
;pop edx same typo I made - I thought I fixed it
pop ebx
mov esp, ebp ; clean up stack frame
pop ebp
ret
; if you stop here, you should see the program name
In the part I've snipped, the idea was to push rhe parameter before calling "exit".
See if that gets you any closer...
Best,
Frank
Edit: tested, and works so far... on my 32-bit system