Skip to content

Instantly share code, notes, and snippets.

View budijuara's full-sized avatar
💭
I may be slow to respond.

budijuara budijuara

💭
I may be slow to respond.
View GitHub Profile
@budijuara
budijuara / readavg-nasm.as
Created June 6, 2023 20:48
read array and calculate average in assembly (asm)
section .data
array db 10, 20, 30, 40, 50 ; Declare an array with 5 elements
len equ $-array ; Compute the length of the array
avg db 0 ; Declare a byte to store the average
section .text
global _start
_start:
mov ecx, len ; Set up loop counter with number of elements