Maybe its a newbie question, but i dont know how to interface .asm files with MS Visual C++, i have been using the inline asm keyword "__asm". But sometimes i see when im debuggin that when there is a function call it loads the simbols in a .asm file.
Maybe there is a tutorial, maybe its a little explaind in MSDN, but i dont know where to start.

Thanks
Posted on 2004-02-26 09:06:06 by Ateneo

Maybe its a newbie question, but i dont know how to interface .asm files with MS Visual C++, i have been using the inline asm keyword "__asm". But sometimes i see when im debuggin that when there is a function call it loads the simbols in a .asm file.
Maybe there is a tutorial, maybe its a little explaind in MSDN, but i dont know where to start.

Thanks


You can write static and dynamic libraries in both languages and link them.

For example:

unload PROC
;code here
;please
ret
unload ENDP

ml /c /Cp /coff unload.asm
lib unload.obj

That should create unload.lib


extern "C" void __stdcall unload();
void main()
{
unload();
}

cl -c call_unload.cpp
link call_unload.cpp unload.lib

I hope it works.


:alright: :alright:
Posted on 2004-02-26 09:40:05 by Eternal Idol Birmingham

Maybe its a newbie question, but i dont know how to interface .asm files with MS Visual C++, i have been using the inline asm keyword "__asm". But sometimes i see when im debuggin that when there is a function call it loads the simbols in a .asm file.
Maybe there is a tutorial, maybe its a little explaind in MSDN, but i dont know where to start.

Thanks



Maestro no habia leido el 'Location' aguante Argentina, preguntame en castellano por privado si queres, saludos, Mariano.
:alright:
Posted on 2004-02-26 09:51:28 by Eternal Idol Birmingham
This has been asked a whole lot of times on this board, so the search function should most definitely come up with something. Or the FAQ section... I only found a sample of linking a C proc with an ASM app there, though.
Posted on 2004-02-26 10:04:22 by f0dder

This has been asked a whole lot of times on this board, so the search function should most definitely come up with something. Or the FAQ section... I only found a sample of linking a C proc with an ASM app there, though.


I told him the opposite way :grin: :cool:
:alright:
Posted on 2004-02-26 10:10:04 by Eternal Idol Birmingham
Asi que fanatico de Black S...

yo me traduje en espa?ol entero el disco en donde mencionas esa canci?n

las letras est?n impresionantes, l?stima perdi el archivo de word :(

Saludos
Posted on 2004-02-26 22:09:42 by Ateneo

Asi que fanatico de Black S...

yo me traduje en espa?ol entero el disco en donde mencionas esa canci?n

las letras est?n impresionantes, l?stima perdi el archivo de word :(

Saludos


Totalmente, Computer God y Time Machine estan en Dehumanizer, tremendo disco de estudio con Ronnie James Dio. El otro tema que tengo en la firma (The Sign of the Southern Cross) tambien es con Dio, en el disco Mob Rules.
Me encantan las letras de Sabbath, escuchaste Heaven and Hell o Headless Cross? Tremendos.

Por cierto, pudiste hacer algo con lo que te di? Cualquier cosa mandame un privado y te explico mejor (EN CASTELLANO) je.
:alright:

Saludos,
Mariano.
Posted on 2004-02-27 02:29:37 by Eternal Idol Birmingham
Ateneo,

Its not difficult to do. Write an assembler module in MASM built with the /coff switch. Write a prototype in C/C++ using the EXTERN C syntax for the particular C compiler and make sure you specify the calling convention. MASM handles STDCALL and C fine.

Easiest way is to make a library out of the asm module so you can just include it along with any others.
Posted on 2004-02-27 05:10:12 by hutch--
Thanks hutch--
Posted on 2004-02-27 11:26:14 by Ateneo
Te adjunto un archivo con un directorio zippeado que trae:

asm_called.asm : codigo fuente en ensamblador de una funcion (SayLong) que muestra un numero en un MessageBox

asm_called.obj : el codigo ensamblado de asm_called.asm

asm_called.lib : la libreria estatica creada apartir de asm_called.obj que tiene la funcion SayLong dentro

calling_asm.cpp : codigo fuente en C con el prototipo de la funcion SayLong y un main muy simple que la llama con el parametro 50

calling_asm.obj : el codigo compilado de calling_asm.cpp

calling_asm.exe : un programita misero que muestra el numero 50

makeasm.bat : un makefile para crear los 3 primeros archivos

makecpp.bat : un makefile para crear los 3 ultimos archivos
Posted on 2004-02-27 11:49:55 by Eternal Idol Birmingham