Author Topic: inline asm  (Read 5370 times)


  • Guest
inline asm
« on: October 31, 2009, 07:35:51 pm »
Hello, I'm new in this forum. I'd like to ask you if I can write a messagebox in windows-c. Maybe something like this?

void writemessage(void)
  char msg[] = "Hello world!";
  char title[] = "from POASM";
  __asm {
    push   dword  0        // ok button
    push   dword  title
    push   dword  msg
    push   dword  0
    call   MessageBoxA
  exit (0);


Offline Vortex

  • Member
  • *
  • Posts: 536
Re: inline asm
« Reply #1 on: November 01, 2009, 12:28:12 pm »
Hi avcaballero,

Here is how it should go :

Code: [Select]
#include <windows.h>
#include <stdio.h>

char msg[] = "Hello world!";
char title[] = "from Pelles C";

void WriteMessage(void)

push 0
push OFFSET title
push OFFSET msg
push 0
call DWORD PTR MessageBox


int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
return 0;
Code it... That's all...


  • Guest
Re: inline asm
« Reply #2 on: November 07, 2009, 09:57:13 pm »
Hello. Thank you for your replay, it works fine. What I want now is to call a messagebox from c in an external PoASM module, adding it to the project.

Can I define in PoAsm the function MessageBox external?

POLINK: error: Unresolved external symbol '_MessageBox'.

Thank you


  • Guest
Re: inline asm
« Reply #3 on: April 01, 2015, 01:29:17 pm »
following message:
'polink fatal error(363): must be inside a section'.
This error is not listed in the Pelles C help file or in Goggle searches.
Please can anyone tell me the meaning of this error and what I need to do to resolve it?
Many thanks for your help.