Skip to content

Instantly share code, notes, and snippets.

@goatandsheep
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goatandsheep/11081785 to your computer and use it in GitHub Desktop.
Save goatandsheep/11081785 to your computer and use it in GitHub Desktop.
; Kemal Ahmed
; 2014-04-18
%include "asm_io.inc"
%define array[ebp+0x8]
%define size[ebp+0xC]
segment .data
segment .bss
segment .text
global fcn
fcn:
enter 0, 0
pusha
mov ecx, size
mov ebx, array
jz bass
dec ecx ; size-1
push ecx
push ebx
call fcn
add ebp, 8
;mov ebx, array
mov ebx, [ebx + 4*ecx]
add eax, ebx
jmp done
bass: xor eax, eax
done:
call print_int
popa
leave
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment