Unusual byte sequence for setting R8 - 128

In a piece of system code (in Delphi) I found this sequence ($ stands for "hex"):

    DB      $49,$C7,$C0,$80,$00,$00,$00  // MOV  R8, 128

      

Indeed, it sets from R8 to 128 in the debugger. But it won't:

    MOV     R8D,$80 // or $00000080

      

do the same thing? Is there something special about the previous byte sequence (speed, setting some flags, etc.) that would make the author of the code prefer it over R8D?


A bit more code upon request:

// RAX/XMM : 16BYTES VALUE. RDX: COUNT. RCX: DEST. ADDRESS. (16BTYES ALIGNED)
@@COPY128:
        DB    $49,$C7,$C0,$80,$00,$00,$00  // MOV  R8, 128
        CMP   RDX,R8
        JL    @@COPY64
        SUB   RDX,R8
        DB    $0F,$1F,$80,$00,$00,$00,$00 // NOP DWORD PTR [EAX + 00000000H] ; NOP(7)
@@COPY128LOOP:
        MOVDQA [RCX      ],XMM0
        MOVDQA [RCX + $10],XMM0
        MOVDQA [RCX + $20],XMM0
        MOVDQA [RCX + $30],XMM0
        MOVDQA [RCX + $40],XMM0
        MOVDQA [RCX + $50],XMM0
        MOVDQA [RCX + $60],XMM0
        MOVDQA [RCX + $70],XMM0
        ADD   RCX,R8
        SUB   RDX,R8
        JG    @@COPY128LOOP
        ADD   RDX,R8

@@COPY64:

      

This is part of a procedure called _FillChar

that fills a piece of memory in multiples of one byte (or char), more or less similar to memset()

in other languages.

+3
assembly x86-64


source to share


No one has answered this question yet

Check out similar questions:

6
x86 128-bit atoms
4
How is the sequence of bytes 0x40 0x55 interpreted by the x86-64 emulator?
3
Why is the next build sequence signaling SIGILL?
2
(VC ++) Execution check for uninitialized variables: how is testing done?
1
Error saving byte in register assembly x86-64
0
x86-64 Assembly relative to byte part
0
Error moving constant byte value in% ebx
0
Link to 128-bit values ​​at
0
Shift the sequence of bytes by N bits. assembly language
0
Memory Allocation and Addressing in an Assembly



All Articles
Loading...
X
Show
Funny
Dev
Pics