s5vi's Motorola p2k phone page
September 09, 2010, 12:02:06 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
Your Ad Here
News: 29000 member !!!
V-6.0.0 with CDMA support is available now.
To become VIP: you can do it via PayPal: http://www.el-co.hu/p2k05/paypal.html
 
   Home   Help Login Register  

Email me.
You can help me to work on P2kc.
I'm looking for a freelance work.
Upcoming V-5.0.0 can be branded with your company for a small fee. Please contact me.
Email me.
Your Ad Here
Pages: [1]   Go Down
  Print  
Author Topic: Using in-line assembly in C  (Read 8551 times)
0 Members and 1 Guest are viewing this topic.
s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 758



WWW Email
« on: November 10, 2006, 08:25:03 pm »

The core p2k functions is in p2kapi.asm and their constants and variables defined in p2kapi.inc

The method is just like this:

Code:
int myasmbeep();
int main( void )
{
freq=1000;
dur=1000;
myasmbeep();
}
int myasmbeep()
{
 __asm
  {
   push    freq
   push    dur
   call dword ptr [Beep]
  }
  // Return with result in EAX
}

The trick is to define variables in C,and use them in inline assembly
Parameter passing is standard C like via stack

Regards....
Code:
« Last Edit: November 14, 2006, 04:15:06 pm by s5vi » Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

s5vi webdesign: | www.inox-crom.hu | www.tancsicscipo.hu | www.el-co.hu | www.fulopkapu.hu | editdekor.atw.hu
Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!