Hi Frank.
First, thanks for the reply.
I'm still pulling my hair out, however. I have tried your syntax. The problem seems to be traceable to the declaration of charbuf as a local variable. If charbuf is declared outside the text of this subroutine and located in the [section .bss], the version I sent you is assembled fine (it has a different problem). If charbuf is declared as a local variable, however, the code does not assemble and I get the message you saw.
This brings me to a maybe more fundamental point about local variables. As you can see, I made charbuf in the code I sent a local dword. Suppose, however, I wanted to declare charbuf as a buffer of N bytes (as I would and could in a C subroutine, i. e. char charbuf[80] ; ).
How do I do this in NASM subroutine? In reading the NASM manual, I can't find anything on this subject. All i can think of is to do some sort of malloc call and grab some heap. But, you don't have to do that in C and I can'[t see why it should be required in a NASM subroutine. I must be missing something.....
Now, back to the failure of this subroutine. Let's forget about the local charbuf version. If I put charbuf in the .bss section, the code assembles. BUT, the call to _gets isn't executed...the program just blows right by the call and terminates normally. So, I can't figure why the _gets instruction is ignored, even though the push charbuf instruction works fine.
I take your point about not using _gets. I understand the buffer bit. I was just using _gets as a convenient and fast way to try to learn how to write a subroutine using the macro approach. If I were doing this "for real" I would go with _fgets or ReadFile.
Final comment: I actually don't understand your code on the push dword [charbuf]. My understanding is that _fgets is looking for a buffer POINTER to be pushed, not the contents. That is why I coded it as push charbuf.
I apologize for consuming so much of your time on this whole business. You have been very patient. Thanks for that.
Mark Allyn