# An example push instruction
.section .data
values:
.int 22, 33, 55, 66, 77, 88
.section .text
.globl main
main:
nop
xor %eax, %eax
push values # 把内存位值中包含的数据值存放到堆栈中
push $values # 把标签引用的内存地址存放到堆栈中
mov $1, %eax
int $0x80
# an example of using the PUSH and POP instructions
.section .data
data:
.int 125
.section .text
.globl main
main:
nop
movl $24420, %ecx
movw $350, %bx
movb $100, %eax
pushl %ecx
pushw %bx
pushl %eax
pushl data
pushl $data
popl %eax
popl %eax
popl %eax
popw %ax
popl %eax
movl $0, %ebx
movl $1, %ax
int $0x80
# gdb 看内存或寄存器变化