| | |
Passing Variables
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2009
Posts: 4
Reputation:
Solved Threads: 0
Hi. I am a little new to mixing C and ASM and I was wondering how one could pass a value from one asm function to another ASM function that then pushes the same value to a C function.
What I have is this:
01. ASM 01 loads ASM 2 into memory, pushes dword value into EAX, and then calls the ASM 2 function.
02. ASM 02 function sets up the stack and then calls the C function.
So, how do I pass this value from ASM to ASM to C? I hope this makes sense.
What I have is this:
01. ASM 01 loads ASM 2 into memory, pushes dword value into EAX, and then calls the ASM 2 function.
02. ASM 02 function sets up the stack and then calls the C function.
So, how do I pass this value from ASM to ASM to C? I hope this makes sense.
•
•
Join Date: Jan 2009
Posts: 4
Reputation:
Solved Threads: 0
I think the EAX register is getting overwritten in ASM 02. When I push the value onto the stack and call ASM 02, as soon as ASM 02 gets control I pop the EAX register and mov it to EBP which I then push on the stack and call the C program. The value I get is two small as it is supposed to be the linear frame buffer address and it appears to be the &end of my entire program as ASM 02 and C program are linked, but ASM 01 is not.
![]() |
Similar Threads
- Problem passing variables to thread (Perl)
- another question about securing and passing variables (PHP)
- Passing variables to a different server (PHP)
- function passing variables (C)
- passing variables threw query (MySQL)
- Passing Variables/Parameters - By Ref/Value? (Computer Science)
- Passing variables into form fields (PHP)
Other Threads in the Assembly Forum
- Previous Thread: Porting assembly code in to Mobile based application
- Next Thread: Getting input without newline
| Thread Tools | Search this Thread |
Tag cloud for Assembly






