<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># sumofsquaresfrom1ton.asm

section .data
EXIT_SUCCESS equ 0
SYS_exit equ 60
n dd 20
sum_of_squares dq 0


section .text
global _start
_start:
   mov rbx, 1          ; i
   mov ecx, dword [n] 
SumLoop:
   mov rax, rbx        ; get i
   mul rax             ; i^2
   add qword[sum_of_squares], rax
   inc rbx
   loop SumLoop
   
   
finish:
   mov rax, SYS_exit
   mov rdi, EXIT_SUCCESS
   syscall


</pre></body></html>