The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: paranoidx on June 20, 2006, 05:53:43 PM

Title: mdir example reducing
Post by: paranoidx on June 20, 2006, 05:53:43 PM
I was snooping around the examples in masm32 distro and notice \masm32\exampl03\dir can be reduced a little further:

Starting Line:73 replace with

   jmp nxt
  @@:
    invoke FindNextFile,hSearch,ADDR wfd
    cmp eax, 0
    je lpOut
  nxt:
    invoke StdOut,ADDR wfd.cFileName
      mov al, [wfd.cFileName]
      cmp al, "."
      je nxt1
    invoke StdOut,ADDR spc
    invoke wsprintf,ADDR sizeBuffer,ADDR fMtStrinG,wfd.nFileSizeLow
    invoke StdOut,ADDR sizeBuffer
    invoke StdOut,ADDR bytes
  nxt1:
    invoke StdOut,ADDR lf
    jmp @B

  lpOut:
    invoke FindClose,hSearch

  TheEnd:

    ret

Main endp
end start