Untitled
Posted on March 6, 2010, 9:32 pm UTC anonymously (6 months ago)Code (highlighted for ASM)
- atod:
- mov bp,sp
- mov bx,[bp+0x2]
- push bx
- call strlen
- add bx,ax
- ;xor di,di
- mov al,1
- xor cx,cx
- atod_f1:
- mov dl,[bx]
- cmp dl,'0'
- jl atod_exit
- cmp dl,'9'
- jg atod_exit
- push dx
- push ax
- sub dl,0x30
- mul dl
- add cx,ax
- pop ax
- mov dl,10
- mul dl
- pop dx
- dec bx
- cmp bx,[bp+0x2]
- jz atod_exit
- jmp atod_f1
- atod_exit:
- mov ax,cx
- ret 2