SECTION .data ; data sectionmsg: db "Hello World",10 ; the string to print, 10=crlen: equ $-msg ; "$" means "here" ; len is a value, not an address SECTION .text ; code section global main ; make label available to linker main: ; standard gcc entry point push bx mov bx, 104h mov ax, 4F02h int 10h pop bx mov edx,len ; arg3, length of string to print mov ecx,msg ; arg2, pointer to string mov ebx,1 ; arg1, where to write, screen mov eax,4 ; write sysout command to int 80 hex int 0x80 ; interrupt 80 hex, call kernel mov ebx,0 ; exit code, 0=normal mov eax,1 ; exit command to kernel int 0x80 ; interrupt 80 hex, call kernel
The code source :
push bx mov bx, 104h mov ax, 4F02h int 10h pop bx
give me this error :
$ ./helloSegmentation fault (core dumped)
What is wrong ?
Under linux is not allow BIOS int .
I think is a true ... not sure .
What another solutions is ?
[Edited by - mythcat on September 1, 2010 9:27:52 AM]