Last active
March 2, 2018 21:45
-
-
Save Cyang39/bb5c35477d7300e1712b7d54d9d280d9 to your computer and use it in GitHub Desktop.
汇编语言里的静态数据
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# instruction name's sufiix mans data size | |
# q = 64-bits | |
# l = 32-bits | |
# w = 16-bits | |
# b = 8-bits | |
# row started with dot is a directive row | |
.data | |
x: .quad 0 | |
y: .word 0 | |
z: .double 123.125 | |
name: .string "blah blah\n" | |
.lcomm buf, 32 | |
.text | |
movq x, %rax | |
movw y, %bx | |
lea name, %rdi | |
movq $12, %rcx | |
movb %al, name(%rcx) | |
# as statdata.s -o statdata.o | |
# ld statdata.o | |
# readlf -s a.out | |
# readlf -S a.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment