Rev 919 | Rev 1001 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 919 | Rev 988 | ||
---|---|---|---|
Line 571... | Line 571... | ||
571 | cmp edi, [_buffer] |
571 | cmp edi, [_buffer] |
572 | jae @b |
572 | jae @b |
573 | @@: pop eax edi |
573 | @@: pop eax edi |
574 | ret |
574 | ret |
575 | endp>>>>>>>>>>>>>>>>>>> |
575 | endp |
- | 576 | ||
- | 577 | ;;================================================================================================;; |
|
- | 578 | proc libini._.str_to_int ;////////////////////////////////////////////////////////////////////////;; |
|
- | 579 | ;;------------------------------------------------------------------------------------------------;; |
|
- | 580 | ;? --- TBD --- ;; |
|
- | 581 | ;;------------------------------------------------------------------------------------------------;; |
|
- | 582 | ;> esi = string buffer address ;; |
|
- | 583 | ;;------------------------------------------------------------------------------------------------;; |
|
- | 584 | ;< eax = binary number representation (no overflow checks made) ;; |
|
- | 585 | ;;================================================================================================;; |
|
- | 586 | push edx |
|
- | 587 | ||
- | 588 | xor eax, eax |
|
- | 589 | xor edx, edx |
|
- | 590 | ||
- | 591 | @@: lodsb |
|
- | 592 | cmp al, '0' |
|
- | 593 | jb @f |
|
- | 594 | cmp al, '9' |
|
- | 595 | ja @f |
|
- | 596 | add eax, -'0' |
|
- | 597 | imul edx, 10 |
|
- | 598 | add edx, eax |
|
- | 599 | jmp @b |
|
- | 600 | ||
- | 601 | @@: dec esi |
|
- | 602 | mov eax, edx |
|
- | 603 | pop edx |
|
- | 604 | ret |
|
- | 605 | endp |
|
- | 606 | ||
- | 607 | ;;================================================================================================;; |
|
- | 608 | proc libini._.int_to_str ;////////////////////////////////////////////////////////////////////////;; |
|
- | 609 | ;;------------------------------------------------------------------------------------------------;; |
|
- | 610 | ;? --- TBD --- ;; |
|
- | 611 | ;;------------------------------------------------------------------------------------------------;; |
|
- | 612 | ;> eax = number to convert ;; |
|
- | 613 | ;> ecx = base ;; |
|
- | 614 | ;> edi = string buffer address ;; |
|
- | 615 | ;;------------------------------------------------------------------------------------------------;; |
|
- | 616 | ;< --- TBD --- ;; |
|
- | 617 | ;;================================================================================================;; |
|
- | 618 | push ecx edx |
|
- | 619 | ||
- | 620 | or eax, eax |
|
- | 621 | jns @f |
|
- | 622 | mov byte[edi], '-' |
|
- | 623 | inc edi |
|
- | 624 | @@: call .recurse |
|
- | 625 | pop edx ecx |
|
- | 626 | ret |
|
- | 627 | ||
- | 628 | .recurse: |
|
- | 629 | cmp eax,ecx |
|
- | 630 | jb @f |
|
- | 631 | xor edx,edx |
|
- | 632 | div ecx |
|
- | 633 | push edx |
|
- | 634 | call .recurse |
|
- | 635 | pop eax |
|
- | 636 | @@: cmp al,10 |
|
- | 637 | sbb al,0x69 |
|
- | 638 | das |
|
- | 639 | stosb |
|
- | 640 | retn |
|
- | 641 | endp>>>>>>>>>>>>>>>>>>>>> |