News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

How to use MASM32 include?

Started by anta40, February 16, 2016, 09:00:02 PM

Previous topic - Next topic

anta40

This is a project, which doesn't build under EasyCode v2.00.0.0011

Quote
============== addr - Debug ==============

Assembling: addr
addr.asm(21) : error A2008:syntax error : str$

Of course I've added masm32.inc and masm32.lib into the project definition.
The zipped project is attached.


jj2007


anta40

OK, I've added \masm32\macros\macros.asm so it's enlisted in the include section at EasyCode.

Now I get more errors
Quote
============== addr - Debug ==============

Assembling: addr
ECMasm32.asm(437) : error A2008:syntax error : equ
return(1): Macro Called From
  ECMasm32.asm(437): Include File
ECMasm32.asm(437) : error A2034:must be in segment block
return(2): Macro Called From
  ECMasm32.asm(437): Include File
ECMasm32.asm(450) : error A2008:syntax error : equ
LOWORD(1): Macro Called From
  ECMasm32.asm(450): Include File
ECMasm32.asm(450) : error A2034:must be in segment block
LOWORD(2): Macro Called From
  ECMasm32.asm(450): Include File

Errors ocurred.

HSE

I think str$ need msvcrt.inc and .lib.
Equations in Assembly: SmplMath

jj2007


dedndave

look at the file \masm32\include\masm32rt.inc

HSE

Sorry, dwtoa is in masm32.inc, and it's already included in the project.
Equations in Assembly: SmplMath

jj2007

OK, for the record:
- no, it doesn't need the CRT
- yes, it does need macros.asm

If you don't believe me, go to line 55 in the attachment and comment out the macros.asm line.

include \masm32\include\masm32rtNoCRT.inc  ; ATTACHED

.Data
letters DB 'a', 'b', 'c', 'd', 'e', 'f', 13, 10

hInst HINSTANCE NULL


.Code

start:
Invoke GetModuleHandle, NULL
Mov hInst, Eax

Mov Esi, 10
Mov Ebx, Offset letters

@@:
print str$ ([Ebx]), 13, 10 ; error A2008: syntax error : str$
Add Ebx, 4
Sub Esi, 1
Jnz @B

Invoke ExitProcess, 0
End start

rsala

Hi anta40,

Attached is your project corrected and working fine.

The Easy Code macros option, in the Project Properties, has been removed to avoid conflicts with the MASM32 macros.
EC coder

anta40