Hi!

I have just started to read the book but I have a problem with the first
real program in the book (that computes the maximum value from an
array) -- it always outputs 0.

In fact, I have isolated the problem to a couple of instructions. Here is
my code

.section .data

data_items:
        .long 34,67,34,222,45,75,38,19,29,39,100,0

.section .text

.globl _start
_start:
        movl data_items, %eax
        movl %eax, %ebx
        movl $1, %eax
        int $0x80

This code exits with error code 0.

However, if instead of
        movl data_items, %eax
        movl %eax, %ebx
I do
        movl data_items, %ebx

it exits with the expected error code 34.

Does anyone have any idea what's wrong?

Stefan Ciobaca


_______________________________________________
Pgubook-readers mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/pgubook-readers

Reply via email to