Advertisement
Guest User

Untitled

a guest
Mar 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         segment .data
  2. a       dq      151
  3. b       dq      310
  4. sum     dq      0
  5.         segment .text
  6.         global  main
  7. main:
  8.         push    rbp         ; establish a stack frame
  9.         mov     rbp, rsp
  10.         sub     rsp, 16
  11.         mov     rax, 9      ; set rax to 9
  12.         add     [a], rax    ; add rax to a
  13.         mov     rax, [b]    ; get b into rax
  14.         add     rax, 10     ; add 10 to rax
  15.         add     rax, [a]    ; add the contents of a
  16.         mov     [sum], rax  ; save the sum in sum
  17.         mov     rax, 0      ; would be better as "xor eax, eax"
  18.         leave               ; restore the previous stack frame
  19.         ret                 ; return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement