sharing data block in c and assembly

Status
Not open for further replies.

ash

Full Member level 3
Joined
Dec 25, 2002
Messages
151
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Location
Europe
Activity points
1,051
Hi friends,
How can i share data in c and assembly in one program like this

//main.cpp
int main(){
short int x;
asm{
// there're asm codes
increment x
}
printf(%d,x)
return 0;
}

thanks in advance...
 

// the C code
void main()
{
int B , A ;
int examle( int* ); // function declaration
.
.
.
A = example ( & B); // addres of B to stack
.
.
.
}

-----------------------------------------------------------------------------

// the assembler code
.model small ; delare DOS memory model
public _example ; public procedure
example proc near ; example is a near procedure
; dont forget to save the BP in stack
.
.
.
_example endp
end
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…