I am using Windows XP, and Newest Qt Creator with QtSDK and the built-in gcc compiler.
The question is, how to use full assembly in a C++ Qt Project. I know how to use inline assembly, but I don't know how to do non-inline(written in a separate .asm file) full assembly, in a Qt C++ project.
Is this possible with a Qt C++ project, and if so, how?
EDIT:
*pro file
TEMPLATE = app
CONFIG += console
CONFIG -= qt
SOURCES += \
calc.S
calc.S
section .data
hello: db 'Hello world!', 10
helloLen: equ $-hello
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, hello
mov edx, helloLen
int 80h
proexit:
mov eax, 1
mov ebx, 0
int 80h
Compile errors
..\plain_cpp\calc.S: Assembler messages:
..\plain_cpp\calc.S:1: Error: no such instruction: `section .data'
..\plain_cpp\calc.S:2: Error: no such instruction: `db 72ello world!4410'
..\plain_cpp\calc.S:3: Error: no such instruction: `equ $-hello'
..\plain_cpp\calc.S:5: Error: no such instruction: `section .text'
..\plain_cpp\calc.S:6: Error: no such instruction: `global _start'
..\plain_cpp\calc.S:9: Error: too many memory references for `mov'
..\plain_cpp\calc.S:10: Error: too many memory references for `mov'
..\plain_cpp\calc.S:11: Error: too many memory references for `mov'
..\plain_cpp\calc.S:12: Error: too many memory references for `mov'
..\plain_cpp\calc.S:13: Error: junk `h' after expression
..\plain_cpp\calc.S:13: Error: suffix or operands invalid for `int'
..\plain_cpp\calc.S:16: Error: too many memory references for `mov'
..\plain_cpp\calc.S:17: Error: too many memory references for `mov'
..\plain_cpp\calc.S:18: Error: junk `h' after expression
..\plain_cpp\calc.S:18: Error: suffix or operands invalid for `int'
EDIT 2 - AT&T Style
PRO File
TEMPLATE = app
CONFIG += console
CONFIG -= qt
SOURCES += \
calc.S
calc.S
.data
hello:
.string "Hello World\n"
.globl main
main:
movl $4, %eax
movl $1, %ebx
movl $hello,%ecx
movl $12,%edx
int $0x80
ret
ERRORS
undefined reference to `WinMain@16'
collect2: ld returned 1 exit status