cs205-lecture-examples

Example codes used during Harvard CS205 lectures
git clone https://git.0xfab.ch/cs205-lecture-examples.git
Log | Files | Refs | README | LICENSE

registers.s (349B)


      1 .text
      2 .intel_syntax noprefix
      3 .global _start
      4 _start:
      5     mov     rax, 0x1  # initialize rax with value 1
      6     mov     rbx, 0x2  # initialize rbx with value 2
      7     add     rax, rbx  # add them together and store result in rax
      8     # this exits the program without libc and only works on 64-bit Linux:
      9     mov     rax, 60
     10     xor     rdi, rdi
     11     syscall