- push ebp
- mov ebp, esp
-
- ; allocate vars
- sub esp, 4
- mov DWORD [ebp-FILE_HANDLE], 0x00
-
- ; open existing file
- mov eax, 5
- mov ebx, [ebp+_FILE_NAME]
- mov ecx, 0
- mov edx, 0700
- int 0x80
- mov [ebp-FILE_HANDLE], eax
-
- ; check if file was open successfully
- cmp eax, 0
- jge .readFile_noerror
- push eax
- push wrongfile_str