News:

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

Pelle's Assembler

Started by GregL, December 23, 2005, 06:00:22 AM

Previous topic - Next topic

Vortex

Jimg,

My apologies, something what I don't understand is that why don't you try to code your own call or invoke macros declaring internally external functions? I posted some simple examples for you, just have a look at them. I believe you can do it. Macros are existing to extend the capabilities of an assembler.

Jimg

callx macro RoutineName:req
ifndef RoutineName
  RoutineName Proto
endif
call RoutineName
endm

Yes, this works, but seems pretty (insert own adjective here) to me.

Vortex

Hi Jimg,

Nice work. Keep going on, you will see that macros are doing the job :U

Ratch

Jimg,

     One nice thing about PROTO is that it catches an incorrect number of parameters submitted to a function/subroutine using INVOKE.  I often PUSH parameters and code other instructions before calling the function/subroutine, so INVOKE is useless to me for that method.  Therefore, I wrote a macro called INVOKIT, which does not count parameters, but still pushes them in a right to left sequence before calling the function/subroutine.  And because I am a PROCless programmer, I do not have to contend with that can of worms. I call it that because there is a lot of mass storage and bandwidth expended by discussions addressing problems caused by that directive.   Ratch

Jimg

Hi Ratch-

I swore I wasn't going to comment on this anymore, but a two pass assembler should be able figure out everything it needs from the proc statement without need for a proto.  And in your case, unless all your routines preceed the call, you can't call them in poasm unless you use a proc and a proto.

Ratch

Jimg,

Quote
And in your case, unless all your routines preceed the call, you can't call them in poasm unless you use a proc and a proto.

     Not a problem.  I inclose my subroutines in files that can be INCLUDE'd, so I can arrange them easily in any way I want.  Otherwise, the EXTERN directive can be used to notify a the calling statement that the address is located at a higher address or a library.  That has never failed me.  Ratch