News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

"main:" vs. "main proc" refering troubles

Started by MazeGen, January 10, 2006, 04:17:51 PM

Previous topic - Next topic

MazeGen

I'm just writing some *short* error messages regarding procedure labels and I'm in doubt how to refer to one specific definition of the procedure since I'm still not such good in english.

I refer to procedure defined using

main proc uses ebx ...

simply using the word "procedure". But how to refer to the procedure defined using just

main:

Should it be "plain procedure" or "anonymous procedure" or in any other words?
I also looked into masm guide, but it doesn't help me much...

Tedd

A procedure/function is a piece of code that does something, and then RETurns.
"proc" is a masm keyword for helping to make procedures - it makes the stack-frame and handles the parameter labels, and a few other checks.
main:
.
ret

..is a procedure.
And so is:
main proc
.
ret
main endp


In the source, the second example is usually easier to see/find.

For error messages/reports.. "main:" is a label, "main proc" is a procedure.
Would it be easier to use line numbers for the error reports? Of course, if the error is inside a procedure then you can also report that, but line numbers are more direct.
(An anonymous procedure would be a procedure with no name :wink A plain procedure would be one who does nothing interesting :lol)
No snowflake in an avalanche feels responsible.

MazeGen

Well, those errors are compile-time (I'm testing the procedure name itself) and I have to refer directly to the procedure definition.

Say there is procedure with a name "main". Then, I need to distinguish between procedure defined using "main:" and "main proc". (In my case, it can be detectable at compile time). I would refer to procedure defined using "main proc" as to "procedure", but how to refer to procedure defined using "main:"? I probably choose "procedure defined without proc directive", even though it is quite long...

MichaelW

To refer to the label main: depending on the context any of these would work for me:
main
"main"
main label
main label
main: label
main: label

eschew obfuscation

Tedd

"Unstructured procedure"?
or simply, "in main" -- which gives enough information without being so specific.
No snowflake in an avalanche feels responsible.

MazeGen

Thanks guys, I decided to use:

CALL MACRO op, flag, args:VARARG

           ...

           IF __pmacros_cm_adjust EQ __PMACROS_CM_ADJUST_INIT
             ErrorEcho <op procedure>, \
              <pmacros_cm macro has to be used before calling C or SYSCALL procedure>
             EXITM
           ENDIF

           ...

           IF __pmacros_cm_adjust EQ __PMACROS_CM_ADJUST_INIT
             ErrorEcho <op procedure>, \
              <pmacros_cm macro has to be used before calling procedure defined using op:>
             EXITM
           ENDIF


(op gets replaced by current argument value)

As for my suggestions or "unstructured" suggestion - since there is not such documented term, I decided not to invent any new term because it may cause confusion...

EDIT: Yes, I could use something like "in op procedure", but I want to be more general, i.e. what needs C or SYSCALL procedure generally and what needs "unstructured" procedure generally.