Question about FASM and GCC
Posted: Sun Dec 24, 2006 8:04 pm
-- FASM 1.67, GCC 3.40(cross compile for x86_64 target)
Hi all, I'd try kernel code(C) to call ASM functions, ASM code simply written as:
and declare _test as "extern void _test();" in C, and then call it, but failed in linking stage:"undefined reference to `_test()'". I'd also try gas as ASM compiler to compile the following code and call it, but failed too:
Is there any solution? Thanks.[/code]
Hi all, I'd try kernel code(C) to call ASM functions, ASM code simply written as:
Code: Select all
format ELF64
public _test
section '.text' executable align 16
_test:
mov edi, 0xB8000
mov al, 'A'
mov ah, 13
mov [edi], ax
ret
Code: Select all
.file "irq.s"
.text
.align 2
.globl _test
.type _test, @function
_test:
ret