News:

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

error A2148: invalid symbol type in expression : alloc

Started by Shooter, February 27, 2011, 04:14:40 PM

Previous topic - Next topic

Shooter

In my attempt to extract code from my primary .ASM and place it into it's own .ASM file (with "INCLUDE x.ASM" mentioned in the primary's .INC file), I'm having problems getting it to assemble. It assembled fine before I moved the code, but it was extremely messy and I wanted to try to clean it up, but scrolling up, then down, then up again, over and over, I decided to try it this way.

I've defined IPdwSize DD 0 in the .data section of the secondary .ASM file.

Something in this code is causing an error, particularly with EBX, but for the life of me, I can't figure it out...

(56) invoke GetIpAddrTable, ebx, ADDR IPdwSize, 0
(57)    .IF eax == ERROR_INSUFFICIENT_BUFFER
(58)        free ebx
(59)        mov ebx, alloc(IPdwSize)
(60)    .ENDIF
(61)    .IF ebx == 0
(62)        exit 1
(63)        jmp End_GetIPAddress
(64)    .ENDIF
.
.
.
(131)    free ebx


Quote
GetIPAddr.asm(58) : error A2008: syntax error : ebx
GetIPAddr.asm(62) : error A2008: syntax error : exit
GetIPAddr.asm(131) : error A2008: syntax error : ebx
GetIPAddr.asm(60) : error A2148: invalid symbol type in expression : alloc

Anyone got any ideas?

Thanks,
-Shooter

ref: RadASM / MASM32
Note: I did not include any files within the secondary .ASM file... should I have?
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

qWord

take care for the order of inclusion: macros.asm/masm32rt.inc should be included before any other includes.
FPU in a trice: SmplMath
It's that simple!

Shooter

Quote from: qWord on February 27, 2011, 04:59:49 PM
take care for the order of inclusion: macros.asm/masm32rt.inc should be included before any other includes.

In my primary .INC file, I've included my new .ASM file after all of the other INCLUDEs, but before the INCLUDELIB. Is this wrong? I got the impression that the order of INCLUDEs/LIBs doesn't matter on a multi-pass setup.
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.