libini: get/set color values; bugfixes

git-svn-id: svn://kolibrios.org@988 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Mihail Semenyako (mike.dld)
2008-12-29 19:09:45 +00:00
parent 7e149d6d99
commit e1b2086036
2 changed files with 169 additions and 15 deletions

View File

@@ -573,3 +573,69 @@ proc libini._.low.read_value _f_addr, _buffer, _buf_len ;///////////////////////
@@: pop eax edi
ret
endp
;;================================================================================================;;
proc libini._.str_to_int ;////////////////////////////////////////////////////////////////////////;;
;;------------------------------------------------------------------------------------------------;;
;? --- TBD --- ;;
;;------------------------------------------------------------------------------------------------;;
;> esi = string buffer address ;;
;;------------------------------------------------------------------------------------------------;;
;< eax = binary number representation (no overflow checks made) ;;
;;================================================================================================;;
push edx
xor eax, eax
xor edx, edx
@@: lodsb
cmp al, '0'
jb @f
cmp al, '9'
ja @f
add eax, -'0'
imul edx, 10
add edx, eax
jmp @b
@@: dec esi
mov eax, edx
pop edx
ret
endp
;;================================================================================================;;
proc libini._.int_to_str ;////////////////////////////////////////////////////////////////////////;;
;;------------------------------------------------------------------------------------------------;;
;? --- TBD --- ;;
;;------------------------------------------------------------------------------------------------;;
;> eax = number to convert ;;
;> ecx = base ;;
;> edi = string buffer address ;;
;;------------------------------------------------------------------------------------------------;;
;< --- TBD --- ;;
;;================================================================================================;;
push ecx edx
or eax, eax
jns @f
mov byte[edi], '-'
inc edi
@@: call .recurse
pop edx ecx
ret
.recurse:
cmp eax,ecx
jb @f
xor edx,edx
div ecx
push edx
call .recurse
pop eax
@@: cmp al,10
sbb al,0x69
das
stosb
retn
endp