15 banner_str db `SPED - the stupidly pointless editor\n`, 0x00
16 readfile_str db `reading file %s\n`, 0x00
17 nofile_str db `no file provided\n`, 0x00
18 argcount_str db `there are %d args\n`, 0x00
19 wrongfile_str db `unable to open file, error code: %i\n`, 0x00
28 ; read command line args
33 ; display error msg if no file
40 mov ebx, DWORD [ebp+12]
56 ; reads file line by line
59 ; eax - pointer to mem
70 mov DWORD [ebp-FILE_HANDLE], 0x00
74 mov ebx, [ebp+_FILE_NAME]
78 mov [ebp-FILE_HANDLE], eax
80 ; check if file was open successfully
96 mov ebx, [ebp-FILE_HANDLE]
107 ; reads a line until newline character is reached
109 ; return: location to buffer
112 %define _FILE_HANDLE 8
119 ; read a single character
121 mov ebx, [ebp+_FILE_HANDLE]