Question about asm code...

Just starting out? Need help? Post your questions and find answers here.
VeryVeryWell
User
User
Posts: 35
Joined: Sat Jun 19, 2010 1:41 pm

Question about asm code...

Post 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?
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Question about asm code...

Post 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.
VeryVeryWell
User
User
Posts: 35
Joined: Sat Jun 19, 2010 1:41 pm

Re: Question about asm code...

Post 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 :)
Post Reply