pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pgubook-readers] Re: problem with maximum (Stefan Ciobaca)


From: Stefan Ciobaca
Subject: Re: [Pgubook-readers] Re: problem with maximum (Stefan Ciobaca)
Date: Tue, 25 Nov 2008 19:30:46 +0100

Hi!

> It's hard to tell without seeing how you coded the function that compare
> values inside "data_items".

Well, the problem is not in compare. It's even earlier. The program
just doesn't seem to be able to load the first element of data_items
into the eax register and then move it to ebx, but it works fine if it
loads it directly into ebx...


> But try out the following:
>
> data_items:
>
> .int 34,67,34,222,45,75,38,19,29,39,100,0
>
> .section .text
>
> .globl _start
>
> _start:
>
> mov $0, %edi
>
> /* Load the first byte */
>
> mov data_items(,%edi,4), %eax
>
> movl %eax, %ebx

At this point, my %ebx has the value 0...

At this point, I haven't tried to run a debugger yet on the resulting
code to see exactly where the problem is, but the code looks so simple
that... Well, I'll try to figure out how to debug.

Thanks,

Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]