1 %line 1+1 sumofsquaresfrom1ton.asm 2 3 [section .data] 4 EXIT_SUCCESS equ 0 5 SYS_exit equ 60 6 00000000 14000000 n dd 20 7 00000004 0000000000000000 sum_of_squares dq 0 8 9 10 [section .text] 11 [global _start] 12 _start: 13 00000000 48C7C301000000 mov rbx, 1 14 00000007 8B0C25[00000000] mov ecx, dword [n] 15 SumLoop: 16 0000000E 4889D8 mov rax, rbx 17 00000011 48F7E0 mul rax 18 00000014 48010425[00000000] add qword[sum_of_squares], rax 19 0000001C 48FFC3 inc rbx 20 0000001F E2EB loop SumLoop 21 22 23 finish: 24 00000021 48C7C03C000000 mov rax, SYS_exit 25 00000028 48C7C700000000 mov rdi, EXIT_SUCCESS 26 0000002F 0F05 syscall 27 28