41 lines
566 B
PHP
41 lines
566 B
PHP
|
macro use_text_work
|
|||
|
{
|
|||
|
;edi - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>, <EFBFBD><EFBFBD>࠭<EFBFBD>祭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㫥<EFBFBD>
|
|||
|
;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 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 - 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD>
|
|||
|
;eax - <EFBFBD><EFBFBD>
|
|||
|
;ebx - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
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
|
|||
|
}
|