The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Vineel Kumar Reddy Kovvuri on May 04, 2007, 01:02:59 PM

Title: problem using str$ macro
Post by: Vineel Kumar Reddy Kovvuri on May 04, 2007, 01:02:59 PM


I am new to assembly plz tell me the difference b/w the following two statements
and cause for the error

;assume eax has value 5
print str$(eax),"sdfasdfasdf"   ; working fine

print "sdfasdfasdf",str$(eax)   ;Not assembling, it is showing the following error


error A4910: cannot open file: C:\masm32\bin\ml.err
test.asm(17) : error A2008:  : ADDR
chr$(3): Macro Called From
  print(3): Macro Called From
   test.asm(17): Main Line Code
test.asm(17) : error A2006:  : ??001E
print(3): Macro Called From
  test.asm(17): Main Line Code
test.asm(17) : error A2114:  : 1
print(3): Macro Called From
  test.asm(17): Main Line Code


thanks in advance


Title: Re: problem using str$ macro
Post by: MichaelW on May 04, 2007, 03:58:14 PM
The first error indicates that ML.ERR is not in the same directory as ML.EXE. ML.ERR contains short descriptions of the errors, so for example instead of "error A2008:" you can get "error A2008: syntax error".

For the print macro there are limitations on the parameters that can be combined. To print a string in front of a number, you can use something like this:

print "sdfasdfasdf"
print str$(eax)

Title: Re: problem using str$ macro
Post by: askm on January 29, 2008, 01:38:18 AM
You have to...

make sure what is passed to it is what is expected.

You may have to...

use ADDR ...,
or use offset ...,
or get the idea.