'libio' and 'libini': function 'get_color' not spoil register 'ecx'

game 'Nu_pogodi': revised

git-svn-id: svn://kolibrios.org@1573 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA
2010-08-20 10:31:17 +00:00
parent 7ea3c78d40
commit be3cceaea6
4 changed files with 113 additions and 59 deletions

View File

@@ -81,12 +81,14 @@ proc libini._.get_char _f ;/////////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push ecx
mov ecx, [_f]
dec [ecx + IniFile.cnt]
jns @f
stdcall libini._.preload_block, [_f]
dec [ecx + IniFile.cnt]
@@: lodsb
pop ecx
ret
endp
@@ -99,6 +101,7 @@ proc libini._.skip_nonblanks _f ;///////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push ecx
mov ecx, [_f]
@@: stdcall libini._.get_char, [_f]
cmp al, 32
@@ -114,6 +117,7 @@ proc libini._.skip_nonblanks _f ;///////////////////////////////////////////////
stdcall libini._.skip_line, [_f]
jmp @b
@@: stdcall libini._.unget_char, [_f]
pop ecx
ret
endp
@@ -126,6 +130,7 @@ proc libini._.skip_spaces _f ;//////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push ecx
mov ecx, [_f]
@@: stdcall libini._.get_char, [_f]
cmp al, 32
@@ -133,6 +138,7 @@ proc libini._.skip_spaces _f ;//////////////////////////////////////////////////
cmp al, 9
je @b
@@: stdcall libini._.unget_char, [_f]
pop ecx
ret
endp
@@ -145,6 +151,7 @@ proc libini._.skip_line _f ;////////////////////////////////////////////////////
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push ecx
mov ecx, [_f]
@@: stdcall libini._.get_char, [_f]
or al, al
@@ -154,6 +161,7 @@ proc libini._.skip_line _f ;////////////////////////////////////////////////////
cmp al, 10
jne @b
@@: stdcall libini._.unget_char, [_f]
pop ecx
ret
endp
@@ -425,7 +433,7 @@ proc libini._.find_section _f, _sec_name ;//////////////////////////////////////
;< eax = -1 (fail) / 0 (ok) ;;
;< [_f.pos] = new cursor position (right after ']' char if eax = 0, at the end of file otherwise) ;;
;;================================================================================================;;
push ebx edi
push ebx ecx edi
mov ecx, [_f]
invoke file.seek, [ecx + IniFile.fh], 0, SEEK_SET
@@ -461,12 +469,12 @@ proc libini._.find_section _f, _sec_name ;//////////////////////////////////////
@@:
cmp byte[edi], 0
jne .next_section
pop edi ebx
pop edi ecx ebx
xor eax, eax
ret
.exit_error:
pop edi ebx
pop edi ecx ebx
or eax, -1
ret
endp