asm code:Win95->Ok but crashes on Linux 
Author Message
 asm code:Win95->Ok but crashes on Linux

Amit Narayanan schrieb:

Quote:

> Hi,

>  I've developed a relatively short assembly language module as a
> function callable from C to drive the C program a lot faster.  While the
> code works perfectly on Windows95 it crashes with a Segmentation Fault
> on Linux (its the same machine which is dual bootable into Win95 or
> Linux)

Have you tried o put the whole code in a pushad ... popad? If it works
then, then you have forgotten to save some registers.

You use

Quote:
>  mov eax, [ebp+8] ;load all function parameters
>  movq mm0, [eax]  ;
>  mov ebx, [ebp+9] ;
>  movq mm1, [ebx]  ;
>  mov ebx, [ebp+11] ;
>  movq mm3, [ebx]  ;
>  mov ebx, [ebp+12] ;

so your pointers seem to be 8 bits large, instead of 32 bits? I'am
astonished at the fact that Windows 95 executes this code without any
problem...the upper 3 bytes of eax are identical to the lower 3 bytes of
ebx. I can't imagine that this is correct, and if it is correct, then
you're really brave...

MfG Alexander



Thu, 08 Aug 2002 03:00:00 GMT  
 asm code:Win95->Ok but crashes on Linux


Quote:

>          mov eax, [ebp+8] ;load all function parameters
>          movq mm0, [eax]  ;
>          mov ebx, [ebp+9] ;
>          movq mm1, [ebx]  ;
>          mov ebx, [ebp+11] ;
>          movq mm3, [ebx]  ;
>          mov ebx, [ebp+12] ;
>          movq mm2, [ebx]  ;

Either you've got some super-trick freestyle stunt code here, or your
offsets are wrong... I'd be awesomely impressed if you where getting the
right numbers from the way you're loading your pointers from [ebp+8,9,10,11]
etc....
Can you post your C function defintion, as the parameters you're loading,
the offsets don't look right at all, bot for passing 32bit data anyway..

Regards
M00



Fri, 09 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. asm code: Win95->ok but crashes on Linux

2. Making std asm code into Turbo Asm code?

3. Convert DOS asm code to Linux

4. Linux asm coding *without* C?

5. basic -> asm code conversion

6. BCC->ASM->OBJ->EXE ??

7. Windows DLL with Tcl 8.0 OK, crashes with 8.3

8. Graphics>>Rectangle>>intersects: erroneous code

9. Win32 asm/Linux asm newsgroups?

10. Win32 asm/Linux asm newsgroups?

11. Win95 revC ok for clip52e?

12. Clip53 Blink OK Exospace No in Win95

 

 
Powered by phpBB® Forum Software