assembly programming

Hi,
I am trying to run the following assembly program through ‘nasm’ utility:

;hello.s
section .data
msg db ‘hello,world’,0xa
len equ $-msg

section .text
global _start
_start:
mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int dword 0x80
mov eax,1
int dword 0x80

The following are the command lines that I am using-
nasm -f elf hello.s
ld -s -o hello hello.o
/hello
But it gives error “Memory fault(core dumped)”

Please tell me where am I wrong ?

Thanks

Jitendra

“Jitendra Sasmal” <sasmal_jk@rediffmail.com> wrote in message
news:bm0rj5$8tt$1@tiger.openqnx.com

Hi,
I am trying to run the following assembly program through ‘nasm’ utility:

;hello.s
section .data
msg db ‘hello,world’,0xa
len equ $-msg

section .text
global _start
_start:
mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int dword 0x80
mov eax,1
int dword 0x80

int ? you can’t call BIOS from QNX (which is what I’m assuming you are
trying to do?)


The following are the command lines that I am using-
nasm -f elf hello.s
ld -s -o hello hello.o
/hello
But it gives error “Memory fault(core dumped)”

Please tell me where am I wrong ?

Thanks

Jitendra

Hello, “Jitendra Sasmal”

I am trying to run the following assembly program through ‘nasm’ utility:

;hello.s
section .data
msg db ‘hello,world’,0xa
len equ $-msg

section .text
global _start
_start:
mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int dword 0x80
mov eax,1
int dword 0x80

The following are the command lines that I am using-
nasm -f elf hello.s
ld -s -o hello hello.o
/hello
But it gives error “Memory fault(core dumped)”

Please tell me where am I wrong ?
AFAIK you trying Linux assembly code, but QNX is a different OS,

and it have it’s own system calls, it’s doesn’t s support int 0x80 as system
call gate.

chris

Hi Chris,
Thank you very much !

Please tell me where can I get help for Assembly programming(intel x86) in
QNX 6.2.1.

With Regards
Jitendra
Alexander Krisak wrote:

Hello, “Jitendra Sasmal”
I am trying to run the following assembly program through ‘nasm’ utility:

;hello.s
section .data
msg db ‘hello,world’,0xa
len equ $-msg

section .text
global _start
_start:
mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int dword 0x80
mov eax,1
int dword 0x80

The following are the command lines that I am using-
nasm -f elf hello.s
ld -s -o hello hello.o
/hello
But it gives error “Memory fault(core dumped)”

Please tell me where am I wrong ?
AFAIK you trying Linux assembly code, but QNX is a different OS,
and it have it’s own system calls, it’s doesn’t s support int 0x80 as system
call gate.

chris

Hello, “Jitendra Sasmal”

Please tell me where can I get help for Assembly programming(intel x86) in
QNX 6.2.1.
AFAIK QNX6 not have such high level kernel API such Linux have.

QNX6 is message passing OS, so when you need to open file, you must send
special message to appropriate resource manager. Please read System
Architecture, it will give you brief difference between Linux and QNX6,

chris

Jitendra Sasmal <sasmal_jk@rediffmail.com> wrote:
JS > Hi Chris,
JS > Thank you very much !

JS > Please tell me where can I get help for Assembly programming(intel x86) in
JS > QNX 6.2.1.

JS > With Regards
JS > Jitendra
JS > Alexander Krisak wrote:

I have written some time critical routines in asm for Neutrino.

What I did was to write a similar C routine and disassemble it. Then
look at how it calls other things and do what it does.

My routines were strickly computer bound however. I did not need to
do any I/O in asm. I’m sure that it would be possible if 1) your main()
was in C and 2) you included enough of the C runtime library.