Skip to content

Instantly share code, notes, and snippets.

@Cyang39
Last active March 2, 2018 21:45
Show Gist options
  • Select an option

  • Save Cyang39/bb5c35477d7300e1712b7d54d9d280d9 to your computer and use it in GitHub Desktop.

Select an option

Save Cyang39/bb5c35477d7300e1712b7d54d9d280d9 to your computer and use it in GitHub Desktop.

Revisions

  1. HuQinyang revised this gist Mar 2, 2018. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions statdata.s
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,9 @@
    # 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
  2. Hu,Qinyang revised this gist Mar 2, 2018. No changes.
  3. Hu,Qinyang created this gist Mar 2, 2018.
    17 changes: 17 additions & 0 deletions statdata.s
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    .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