Page 1 of 1

Question about asm code...

Posted: Sun Jul 31, 2011 3:07 pm
by VeryVeryWell
Hi guys.
I have that code in asm:

Code: Select all

Procedure.s H(String$)
  Global Hash.s
  Hash = MD5Fingerprint(@String$, Len(String$))
  !mov esi,[v_Hash]
  !xor ecx,ecx
  !next:
    !mov ax,word[esi+ecx]
    !cmp ah,0x39
    !jbe n2
    !sub ah,0x57
    !jmp n3
  !n2:
    !sub ah,0x30
  !n3:
    !cmp al,0x39
    !jbe n4
  !sub al,0x57
    !jmp n5
  !n4:
    !sub al,0x30
  !n5:
    !sal al,4
    !add al,ah
    !mov edi,ecx
    !sar edi,1
    !mov byte[edi+esi],al
    !inc ecx
    !inc ecx
    !cmp ecx,32
    !jnz next
    !mov byte[esi+edi+1],0
  ProcedureReturn Hash
EndProcedure
Will it work in other OS?

Re: Question about asm code...

Posted: Sun Jul 31, 2011 4:12 pm
by wilbert
It works on OS X x86. It won't work on OS X PPC
I haven't tested it on Linux but I see no reason why it wouldn't work on Linux.

Re: Question about asm code...

Posted: Sun Jul 31, 2011 4:32 pm
by VeryVeryWell
wilbert wrote:It works on OS X x86. It won't work on OS X PPC
I haven't tested it on Linux but I see no reason why it wouldn't work on Linux.
Thank you :)