Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

sharing data block in c and assembly

Status
Not open for further replies.

ash

Full Member level 3
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top