Author Topic: How to use MASM32 include?  (Read 2134 times)

anta40

  • Member
  • ***
  • Posts: 293
How to use MASM32 include?
« on: February 16, 2016, 09:00:02 PM »
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

  • Member
  • *****
  • Posts: 7305
  • Assembler is fun ;-)
    • MasmBasic
Re: How to use MASM32 include?
« Reply #1 on: February 16, 2016, 09:36:47 PM »
Add \masm32\macros\macros.asm

anta40

  • Member
  • ***
  • Posts: 293
Re: How to use MASM32 include?
« Reply #2 on: February 17, 2016, 01:09:11 PM »
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

  • Member
  • ****
  • Posts: 519
  • <AMD>< 7-32>
Re: How to use MASM32 include?
« Reply #3 on: February 17, 2016, 02:21:43 PM »
I think str$ need msvcrt.inc and .lib.

jj2007

  • Member
  • *****
  • Posts: 7305
  • Assembler is fun ;-)
    • MasmBasic
Re: How to use MASM32 include?
« Reply #4 on: February 17, 2016, 02:47:19 PM »
I think str$ need msvcrt.inc and .lib.

Line 2215 in macros.asm

dedndave

  • Member
  • *****
  • Posts: 8724
  • Still using Abacus 2.0
    • DednDave
Re: How to use MASM32 include?
« Reply #5 on: February 17, 2016, 09:58:55 PM »
look at the file \masm32\include\masm32rt.inc

HSE

  • Member
  • ****
  • Posts: 519
  • <AMD>< 7-32>
Re: How to use MASM32 include?
« Reply #6 on: February 18, 2016, 02:24:24 AM »
Sorry, dwtoa is in masm32.inc, and it's already included in the project.

jj2007

  • Member
  • *****
  • Posts: 7305
  • Assembler is fun ;-)
    • MasmBasic
Re: How to use MASM32 include?
« Reply #7 on: February 18, 2016, 05:03:05 AM »
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.

Code: [Select]
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

  • Moderator
  • Member
  • *****
  • Posts: 234
    • Easy Code
Re: How to use MASM32 include?
« Reply #8 on: February 18, 2016, 07:46:36 AM »
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

  • Member
  • ***
  • Posts: 293
Re: How to use MASM32 include?
« Reply #9 on: February 18, 2016, 12:40:59 PM »
thanks rsala,
it works  :t