As the assembler in kodeblok?
I inserted assembler, but no, but no compile end errors occurred.
How can the correct syntax, how to compile this example right?
Please show the code, the correct code is probably the best answer.
#include <stdio.h>
// definition of constant string
char format[] = "%s %s\n";
char hello[] = "Hello";
char world[] = "earth";
int main( void )
{
__asm // start ASM code here
{
mov eax, offset world // move the address of world to eax
push eax // Push the address of world to the stack
mov eax, offset hello // eax = &(hello[0])
push eax // push hello to the stack
mov eax, offset format // eax = format
push eax // push format to the stack
call printf // here is the problem printf is not define
// at the time of compilation.
// It will be define in run time.
//clean up the stack so that main can exit cleanly
//use the unused register ebx to do the cleanup
pop ebx
pop ebx
pop ebx
} // end of ASM code
}
||=== Build: Debug in Asmpr (compiler: GNU GCC Compiler) ===|
C:\ETS-22\main.cpp|13|ошибка: expected «(» before «{» token|
C:\ETS-22\main.cpp|14|ошибка: нет декларации «mov» в этой области видимости|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|