• Rémy Oudompheng's avatar
    cmd/8l: fix misassembling of MOVB involving (AX)(BX*1) · 354a3a15
    Rémy Oudompheng authored
    The linker accepts MOVB involving non-byte-addressable
    registers, by generating XCHG instructions to AX or BX.
    It does not handle the case where nor AX nor BX are available.
    
    See also revision 1470920a2804.
    
    Assembling
        TEXT ·Truc(SB),7,$0
        MOVB BP, (BX)(AX*1)
        RET
    
    gives before:
       08048c60 <main.Truc>:
        8048c60:       87 dd         xchg   %ebx,%ebp
        8048c62:       88 1c 03      mov    %bl,(%ebx,%eax,1)
        8048c65:       87 dd         xchg   %ebx,%ebp
        8048c67:       c3            ret
    
    and after:
       08048c60 <main.Truc>:
        8048c60:       87 cd         xchg   %ecx,%ebp
        8048c62:       88 0c 03      mov    %cl,(%ebx,%eax,1)
        8048c65:       87 cd         xchg   %ecx,%ebp
        8048c67:       c3            ret
    
    R=golang-dev, rsc
    CC=golang-dev
    https://golang.org/cl/7226066
    354a3a15
Name
Last commit
Last update
..
8.out.h Loading commit data...
Makefile Loading commit data...
asm.c Loading commit data...
doc.go Loading commit data...
l.h Loading commit data...
list.c Loading commit data...
mkenam Loading commit data...
obj.c Loading commit data...
optab.c Loading commit data...
pass.c Loading commit data...
prof.c Loading commit data...
span.c Loading commit data...