kolibrios/programs/media/scrshoot/textwork.inc

41 lines
566 B
PHP
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

macro use_text_work
{
;edi - 㪠§ â¥«ì ­  áâபã, ®£à ­¨ç¥­­ãî ­ã«¥¬
;ç¨á«® ¢®§¢à é ¥âáï ¢ eax
zstr_to_int:
xor eax,eax
mov ecx,10
.next:
movsx ebx,byte [edi]
inc edi
test ebx,ebx
jz .end_str
cmp bl,'9'
jg .no_figure
cmp bl,'0'
jl .no_figure
sub ebx,'0'
mul ecx
add eax,ebx
.no_figure:
jmp .next
.end_str:
ret
;edi - 㪠§ â¥«ì ­  áâபã
;eax - ç¨á«®
;ebx - ª®«¨ç¥á¢® §­ ª®¢
int_to_str:
mov ecx,10
.next:
test ebx,ebx
jz .end
xor edx,edx
div ecx
add dl,'0'
dec ebx
mov [edi+ebx],dl
jmp .next
.end:
ret
}