Assembly x64 Intro - View Assemble Variable by GDB




  extern printf

%define arg1 rdi
%define arg2 rsi
%define arg3 rdx
%define arg4 rcx
%define arg5 r8
%define arg6 r9
%define arg7 [rsp + push_num*8 + 8]
%define arg8 [rsp + push_num*8 + 16]
%define arg9 [rsp + push_num*8 + 24]
%define arg10 [rsp + push_num*8 + 32]
%define arg11 [rsp + push_num*8 + 40]
%define arg12 [rsp + push_num*8 + 48]

%define r0 rdi
%define r1 rsi
%define r2 rdx
%define r3 rcx
%define r4 r8
%define r5 r9
%define r6 r10
%define r7 rsp

%define r0d edi
%define r1d esi
%define r2d edx
%define r3d ecx
%define r4d r8d
%define r5d r9d
%define r6d r10d

%define r0w  di
%define r1w  si
%define r2w  dx
%define r3w  cx
%define r6w  r10w

%define r0b  dil
%define r1b  sil
%define r2b  dl
%define r3b  cl

%define  PUSHRFLAGS     pushfq
%define  POPRFLAGS      popfq
%define  retrq          rax
%define  retrd          eax

%macro SSE2_Copy8Times 2
    movd    %1, %2
    punpcklwd %1, %1
    pshufd  %1,     %1,     0
%endmacro

  section .data
align 16
a: dd 0x3f
align 16
fmt: db "The result is %lX", 10, 0
  section .bss
align 16
b: resq 2
  section .text
global main
main:
  push rbp
  mov r2d, [a]
  ; SSE2_Copy8Times xmm1, r2d
  movd xmm1, r2d
  punpcklwd xmm1, xmm1
  pshufd xmm1, xmm1, 0

  movdqa [b], xmm1
  movdqa xmm0, xmm1
  mov  rdi, fmt
  mov  rax, 1
  call printf
  pop rbp
  ret


如: 查看b

x/16ubx   &b

查看 register

info all-registers

查看单个寄存器

info register xmm0



你可能感兴趣的:(Assembly x64 Intro - View Assemble Variable by GDB)