?? convert.asm
字號:
.386
.model flat,STDCALL
include win32.asi ; some 32-bit constants and structures
include win32.ase
.data
numbuf db 15 dup (0)
.code
public IntToString, StringToInt
IntToString PROC
push ebx
push ecx
push edx
lea edi,[numbuf]
push edi
or eax,eax
jns notneg
mov byte ptr [edi],'-'
inc edi
neg eax
notneg:
mov ebx,10
sub ecx,ecx
lp0:
inc ecx
sub edx,edx
div ebx
or dl,'0'
push edx
or eax,eax
jnz lp0
lp1:
pop eax
stosb
loop lp1
sub al,al
stosb
pop edi
pop edx
pop ecx
pop ebx
ret
IntToString ENDP
StringToInt PROC
push ebx
push edx
push esi
sub ebx,ebx
sub edx,edx
sub eax,eax
cmp byte ptr [edi],'-'
jnz sinotneg
inc edi
inc ebx
sinotneg:
cmp byte ptr [edi],'+'
jnz notplus
inc edi
notplus:
lodsb
or al,al
jz sid
sub al,'0'
imul edx,edx,10
sub al,'0'
add edx,eax
jmp notplus
sid:
mov eax,edx
pop esi
pop edx
pop ebx
ret
StringToInt ENDP
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -