linux-汇编-地址及取地址变量(6)

.section .data
   mynum:
   .int 8
   mygs:
   .asciz "%x----%x----%x\n"
.section .text
   .globl main
   main:
   	  leal mynum,%eax #将mynum地址复制到%eax  
   	  movl (%eax),%ebx#将%eax内地址所指内容复制到%ebx
   	  movl mynum,%ecx#将mynum内容复制到%ecx中
      
   	  push %ecx
   	  push %ebx
  	  push %eax
   	  push $mygs
   	  call printf
   	  
   	  push $0
   	  call exit
   	  
 deepfuture@deepfuture-laptop:~/private/mytest$ gcc -o test66 test66.s

deepfuture@deepfuture-laptop:~/private/mytest$ ./test66

804a018----8----8

deepfuture@deepfuture-laptop:~/private/mytest$ 


你可能感兴趣的:(linux,gcc)