When I'm trying to compile a program which uses macro:
;--- Macro to automatically include modules
@USES MACRO Modules:VARARG
IRP Module,
include &Module
ENDM
ENDM
And in source:
.586
.MODEL FLAT, stdcall
option casemap:none
@USES Windows.Inc, CAD.Mac
I get Internal Assembler Error, what can it be? Help me please!!!I've got ml version 6.15.8803, the command line is:
ml /c /coff /nologo /I\Masm\Include\ AnyFile.asm >Errors.Lst
After compiler start the file Errors.lst has the following:
Assembling: AnyFile.asm
AnyFile.Asm(??) : fatal error A1016: Internal Assembler Error
Im not too familiar with the IRP macro command (Iterate and Repeat??), but as a suggestion i often use:
%echo &Module
to have it display what is being written...
Also, kinda a long shot here, but did you try just ONE include with your macro?, perhaps its not adding a carrage returning or something...
My 2 Cents..
NaN
I've never used IRP either, I always use FORC. However, these may be equivalent pre-defined macros. Anyway, I would write it as so:
WARNING: UNTESTED CODE FOLLOWS
@USES MACRO Modules:VARARG
LOCAL Module
FORC Module, <&Modules>
include Module
ENDM
ENDM
Question: Is the AT sign "@" a legal character? (I don't know offhand)Hmmm... It worked... I've reinstalled Masm + sp1 + sp2 and it worked... Thanx to everyone!
I've got some more macroses! For now I've made some for making threads in the way like they realised in Delphi. Windows macroses that can Handle events like in delphi. And they are VERY handy, too.In several days I want to translate them into english and find someone to test'em.
(for better result of the @Uses macro try to give ml the includes path, and in the include file make first line like includelib blah-blah.lib then you'll only need to say @Uses Windows.Inc, User32.inc. And that's all)
For future: can someone tell me, where can I find the error codes for the ml? Are they published?
About includelib. Everytime you start your program you write a code like this:
.586
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
Do you need to write this all the time? Maybe no? Try this:
call ml like this
ml /c /W2 /coff /nologo /I\masm32\include AnySource.Asm
From this time you can make simply
include windows.inc
include user32.inc
If you don't want to write it for libs call link with option
/LIBPATH:\masm32\lib\
From this time you can write only includelib user32.lib
Then, open user32.inc and add the first line like this:
---[ file user32.inc
includelib user32.lib
from now you can just write your code like this:
.586
.model flat,stdcall
option casemap:none
include windows.inc
include user32.inc
And that's all! From now you can use my @Uses macro and one more macro:
@Program MACRO
.586
.model flat, stdcall
option casemap:none
ENDM
From this time your proggy can look like this:
@Program
@Uses Windows.Inc, User32.Inc
WinMain Proc
WinMain Endp
End WinMain
Isn't it good?CHEMI$T,
I'm not sure what you mean by error codes for ml. Mine came with a file ml.err, which ml.exe uses to convert error numbers to human readable info.
As far as a single .asm file to contain all .incs, well, it works, but you're forcing masm to compile them even when they are not needed.
An obscure fact about compiling is about 75% plus of compile time is spent just routing thru windows.inc.
Ernie,
Try to make it fall with internal assembler error. It doesn't make any listing, it doesn't show any readable error (cause in its ml.err this error showed only like: Internal Assembler Error. You can find it there)
But it shows fatal error A1016. Those numbers I need
P.S. And more, I think that compile time doesn't mean anything. I only need my programs to be readable for me. I've several projects written in masm which are near 80-120 Kb of code.
And if I'll ever return to those projects I want to spend as little time looking thru listing as possible...
This message was edited by CHEMI$T, on 5/29/2001 8:23:17 PM