|
From: Erik W. <om...@cs...> - 2000-04-26 23:16:34
|
On Wed, 26 Apr 2000, James Bowman wrote:
Some issues:
> .text
> .align 4
> .globl __dv_decode_vlc
> .type __dv_decode_vlc,@function
> __dv_decode_vlc:
> pushl %ebx
>
> /* Args are at 20(%esp). */
> movl 8(%esp),%eax /* %eax is bits */
>
> movl %eax,%edx /* %edx is class */
> andl $0xfe00,%edx
> sarl $9,%edx
> movsbl dv_vlc_class_lookup5(%edx),%edx
I'm confused. What does this do?
>
> movl dv_vlc_index_mask(,%edx,4),%ebx
> movl dv_vlc_index_rshift(,%edx,4),%ecx
> andl %eax,%ebx
> sarl %cl,%ebx
>
> movl dv_vlc_lookups(,%edx,4),%edx
> movl (%edx,%ebx,4),%edx
This is where it segfaults right now. I can't seem to get gdb to tell me
what's in the register, though.
>
> /* Now %edx holds result, like this:
> bits 0-7 run
> bits 8-15 len
> bits 16-31 amp
> */
> /* code needs to do this with result:
> if ((amp > 0) &&
> if ((bits >> sign_rshift[result->len]) & 1)
> amp = -amp;
> }
> */
> /* if (amp < 0) %edx is 0, else 0xffff0000. */
> movl %edx,%ecx
> sarl $8,%ecx
> andl $0xff,%ecx
> movl sign_mask(,%ecx,4),%ecx
> andl %ecx,%eax
> negl %eax
> sarl $31,%eax
>
> movl %edx,%ebx
> sarl $31,%ebx
> xorl $0xffffffff,%ebx
> andl $0xffff0000,%ebx
>
> andl %ebx,%eax
>
> xorl %eax,%edx
> subl %eax,%edx
>
> movl 12(%esp),%eax
> movl %edx,(%eax)
>
> popl %ebx
> ret
Erik Walthinsen <om...@cs...> - Staff Programmer @ OGI
Quasar project - http://www.cse.ogi.edu/DISC/projects/quasar/
Video4Linux Two drivers and stuff - http://www.cse.ogi.edu/~omega/v4l2/
__
/ \ SEUL: Simple End-User Linux - http://www.seul.org/
| | M E G A Helping Linux become THE choice
_\ /_ for the home or office user
|