On 09-Feb-08, at 4:04 PM, erik quanstrom wrote:
actually, i think there's something else wrong:
for the equivalent c "pwrite(1, string, 7, 0)" i get this

I don't get FP for `8c -S hello.c' (which just calls pwrite as you describe). This is what I get:

TEXT    main+0(SB), 0, $32
MOVL    $.string<>+0(SB), CX
MOVL    $1, AX
MOVL    AX, (SP)
MOVL    CX, 4(SP)
MOVL    $7, AX
MOVL    AX, 8(SP)
MOVL    $-1, 12(SP)
MOVL    $-1, 16(SP)
CALL    ,pwrite+0(SB)
RET ,
DATA    .string<>+0(SB)/8, $"Hello\n\z\z"
GLOBL   .string<>+0(SB), $8
END ,

Replicating the exact program - with just three changes: moving the DATA/GLOBL statement to the top, changing main to _main and replacing CALL with MOVL $64, AX and INT $64 - still results in the suicide.

Puzzling.

--
Anant

Reply via email to