assembly programming

bridged with qdn.public.neutrino
Post Reply
Jitendra Sasmal

assembly programming

Post by Jitendra Sasmal » Wed Oct 08, 2003 11:14 am

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

Mario Charest

Re: assembly programming

Post by Mario Charest » Wed Oct 08, 2003 4:47 pm

"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

Alexander Krisak

Re: assembly programming

Post by Alexander Krisak » Wed Oct 08, 2003 5:25 pm

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

Jitendra Sasmal

Re: assembly programming

Post by Jitendra Sasmal » Thu Oct 09, 2003 4:54 am

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

Alexander Krisak

Re: assembly programming

Post by Alexander Krisak » Thu Oct 09, 2003 11:38 am

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

Bill Caroselli

Re: assembly programming

Post by Bill Caroselli » Thu Oct 09, 2003 2:58 pm

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.

Post Reply

Return to “qdn.public.neutrino”