Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include "io.inc"
- extern printf, _malloc, _calloc, _free
- global func_drawArray
- section .data
- message db "Number=%d", 10, 0
- data_length dd 10000000
- ptr_data dd 0
- section .text
- global CMAIN
- CMAIN:
- mov ebp, esp
- ; Allocate space
- ;mov eax,
- push 4 ; 4 bytes
- push dword [data_length]
- call _calloc
- add esp, 4
- mov dword [ptr_data], eax ; put pointer in data
- ; input data in array
- mov esi, [ptr_data]
- mov dword [esi], 0x15
- mov dword [esi + 4], 0x24
- ; Draw Data
- mov eax, dword [esi]
- push eax
- call func_drawArray
- add esp, 4
- ; Destroy data
- push ptr_data
- call _free
- add esp, 4
- xor eax, eax
- ret
- func_drawArray:
- push ebp
- mov ebp, esp
- mov eax, [esp+8]
- push eax
- push message
- call printf
- add esp, 8
- leave ; mov esp, ebp
- ; pop ebp
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement