# An example Listing system environment variables (查看环境变量)
.section .data
output:
.asciz "%s\n"
.section .text
.globl main
main:
movl %esp, %ebp
addl $12, %ebp
loop1:
cmpl $0, (%ebp)
je endit
push (%ebp)
push $output
call printf
addl $12, %esp
addl $4, %ebp
loop loop1
endit:
push $0
call exit
# gcc -g -o 05 05-environment.s
#
TERM=xterm
LESSOPEN=| /usr/bin/lesspipe %s
USER=wangzhijun
SHLVL=1
LC_TELEPHONE=zh_CN.UTF-8
LC_MEASUREMENT=zh_CN.UTF-8
XDG_SESSION_ID=11055
XDG_RUNTIME_DIR=/run/user/1015