News:

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

Interesting tip to use MASM with Visual C++ 2008

Started by johnsa, May 27, 2008, 01:43:40 PM

Previous topic - Next topic

johnsa

Dunno if any of you have seen this book or site.. quite interesting.

http://www.kipirvine.com/asm/gettingStarted/index.htm

Subsequently I'm now using ML 9, LINK 9 with manifest files and it's working like a charm and running debug sessions from Visual Studio 2008.

Here is the build process to allow you to assemble link and use the VS2008 (or VC++2008 express) debugger.

set VS_HOME=C:\Program Files\Microsoft Visual Studio 9.0
set PLATFORMSDK=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
set PATH=%VS_HOME%\VC\bin;%VS_HOME%\Common7\IDE;%PLATFORMSDK%\bin;%PATH%

ml /c /Cp /Zi /coff testcore.asm
link /debug /subsystem:console /machine:ix86 /nologo /incremental testcore
devenv.exe testcore.exe /debugexe

azdps

You indicate you are using ML 9 and LINK 9. Are those masm 9 and link 9. Im only aware of masm 8 being available.

Can you provide a link to masm9 and link9 please.

GregL

azdps,

ml.exe 9.0 comes with Visual Studio 2008 Professional or higher.

Supposedly ml.exe 9.0 will be included in Visual C++ 2008 Express Edition SP1. The beta is available now. I can't say for sure if it is included as I haven't installed the beta. If you install it, please report back whether or not it's included.


azdps

Yes ml.exe 9 was included in sp1 and is placed in the bin folder along with link.exe. I was hoping to se some sort of statement completion for assembly language in vs2008. If someone gets it going let me know please.

GregL

azdps,

Thanks for verifying that.  :thumbu

QuoteI was hoping to see some sort of statement completion for assembly language in vs2008

You would have to write an add-in to get statement completion for MASM.





kromag


kromag

I did exactly as follows and have the minor issues outlined below:

1) .model  --- does not highlight

2) others do not highlight

3) How could I enable different colors for each code section or keyword?

----

If anyone could help me out I would enjoy that.

I am using Visual C++ Express 2009 edition I have Windows SDK and WDDK

I also am on a Vista x64 box AMD64 Phenom X4 Quad


---------
regards,
will

GregL

will,

1 & 2:  Add the keywords to the file usertype.dat that resides in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE.  If you don't have that file, create one, it's just a plain text file. Here's the contents of mine:

386
386P
486
486P
586
586P
686
686P
ADDR
ALIAS
ALIGN
AND
ASSUME
BREAK
BYTE
C
CARRY?
CODE
COMMENT
CONST
CONTINUE
DATA
DATA?
DUP
DWORD
ECHO
ELSE
ELSEIF
END
ENDIF
ENDM
ENDP
ENDS
ENDW
EQ
EQU
ERR
EVEN
EXITM
EXTERN
EXTERNDEF
FLAT
FOR
FORC
GE
GOTO
GT
GT
HIGH
HIGH32
HIGHWORD
IF
IFB
IFDEF
IFDIF
IFDIFI
IFE
IFIDN
IFIDNI
IFNB
IFNDEF
INCLUDE
INCLUDELIB
INVOKE
LABEL
LENGTH
LENGTHOF
LIST
LOCAL
LOW
LOW32
LOWWORD
LT
MACRO
MASK
MMX
MOD
MODEL
NE
NOLIST
NOT
OFFSET
OPPATTR
OPTION
OR
OVERFLOW?
PAGE
PARITY?
PROC
PROTO
PTR
PUBLIC
PURGE
QWORD
RADIX
REAL10
REAL4
REAL8
RECORD
REPEAT
SBYTE
SDWORD
SHL
SHORT
SHR
SIGN
SIZE
SIZEOF
STDCALL
STRUCT
SWORD
TEXTEQU
THIS
TITLE
TYPE
TYPEDEF
UNION
UNTIL
UNTILCXZ
USES
WHILE
WIDTH
WORD
XMM
XMMWORD
XOR
ZERO?


3:  I believe it would require writing a custom add-in.


kromag

Yes I had about the same thing and some highlight but not all such as but not limited too: .model
.model

will show now highlighting?

Any suggestions?

wantondamage

if your source code does not show you will need to add a reference to the registry for .asm file formats.

add this key to the registry and restart visual studio 2008  :P

cut below this text

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Languages\File Extensions\.asm]
@="{B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}"

to before here ! and paste into notepad and save as asm.reg and run it !

please make sure you have done what greg posted above ! adding the usertype.dat file with his additions i already had a file as i edit php files in visual studio

david