• 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
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...