deepfuture@deepfuture-laptop:~/private/mytest$ gcc -o test12 test12.s
deepfuture@deepfuture-laptop:~/private/mytest$ ./test12
E
deepfuture@deepfuture-laptop:~/private/mytest$
.section .data myvalue: .byte 67,68,69,70,0 mygs: .asciz "%c\n" .section .text .globl main main: #基地址(偏移地址[必须为寄存器],数据元素变址,数据元素长度[必须为寄存器],) #基地址+偏移地址+数据元素变址*数据元素长度 movl $2,%ecx movl myvalue(,%ecx,1),%ebx #将myvalue的变址为2,长度为1的数据值移到ebx中 push %ebx push $mygs call printf push $0 call exit