Author Topic: Comments on Replacement for Iczelion's a2dw algorithm in the MASM32 library.  (Read 2561 times)

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
just noticed something about that code
if you call it with a pointer to a null string...
Code: [Select]
    mov edx, [esp+4]
    xor ecx, ecx
    movzx eax, BYTE PTR [edx]
    test eax, eax
    jz quit
;
;
  quit:
    lea eax, [ecx]
    ret 4
you probably meant to branch to the RET 4

my bad - it doesn't crash - just noticed it's an LEA   :P

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7541
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
 :P

> you probably meant to branch to the RET 4

No, as a matter of fact I really DID intend to use the LEA.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

dedndave

  • Member
  • *****
  • Posts: 8827
  • Still using Abacus 2.0
    • DednDave
not that it really matters, but eax is already 0
no need in optimizing the exception, though   :P