• Re: x64 address indexed by 32-bit address

    From Paul Edwards@mutazilah@nospicedham.gmail.com to comp.lang.asm.x86 on Tue Feb 13 14:17:18 2024
    From Newsgroup: comp.lang.asm.x86

    On 19/01/24 21:42, Paul Edwards wrote:

    LM1873:
    movl $4294967295, %eax
    addq -64(%rbp), %rax
    movsbl (%rax),%esi
    movl $LC445, %edi
    movb $0, %al
    call _printf

    This has now been resolved. I wasn't building my
    modified gcc 3.2.3 properly, so it thought that
    size_t was 32 bits instead of 64 and was making
    it unsigned.

    Now I am getting working code:

    D:\devel\gcc\gcc>type foo.s
    .file "foo.c"
    .text
    .p2align 2,,3
    .globl foo
    foo:
    .LFB1:
    movsbl -1(%rcx),%eax
    ret
    .LFE1:

    D:\devel\gcc\gcc>


    (rcx is because one of my modifications is to use
    Win64 function call convention)

    BFN. Paul.

    --- Synchronet 3.21d-Linux NewsLink 1.2