format PE GUI 4.0
entry Start
 include 'c:\fasmw17316\include\Win32a.inc'
 include 'fasmAPI\if.inc'
 include 'macro\macro.txt'
 include 'macro\madmat32.txt'
section '.code' code readable writeable executable
                noskob db 0
                tx0 db 'dGeomSetPosition (&box)',0
                txt db 'dGeomSetPosition (&box,p[0],p[1],p[2],&dat,&dat2)',0
macro FindAnySymbol t { local .1,.2,.3
      mov edx,t
      mov al,[edx]
      sub al,48
      cmp al,0
      jbe  .3
.3:
      }
macro Ifznk znk,mm,rr=edx { local .1
      cmp byte [rr],znk
      jnz .1
      mm
.1:
      }
macro formatP lb { mov word [ecx],'  '
                add ecx,2
                inc edx
                jmp lb
      }
Start:  CopyDoZnaka txt,outTxt,'('                ;chFrom(edx),chTo(ecx),chZnk. EDX stop na Znk
        cmp byte [edx],'('
        jnz .1
        mov word [ecx],', '
        add ecx,2
        inc edx
.1:     mov byte [noskob],0
        CopyDoZnaka edx,ecx,',',')',';','[' ,'&'
        test al,al
        jz  .ll
        ;Ifznk ',',formatP .1
        Ifznk '&',<mov byte [noskob],1>
        cmp byte [noskob],1
        jz  .rr
        cmp byte [edx],'['
        jz  .rr
        mov byte [ecx],'['
        inc ecx
.rr:
        CopyDoZnaka edx,ecx,',',')',13
        cmp byte [noskob],1
        jz  .2
        cmp byte [ecx-1],']'
        jz  .2
        mov byte [ecx],']'
        inc ecx
.2:
        Ifznk 13,<jz .ll>
        Ifznk ')',<jz .ll>
        Ifznk ',',formatP .1
        inc edx
        jmp .1

.ll:
        ;Msg RichTxt+2000 ;'ParseC2Fasm'
        mov word [ecx],0x3e20
        mov word [ecx+2],0x0a0d
        mov dword [ecx+4],0
        add ecx,4
        Msg     outTxt
        invoke  ExitProcess,0

SECTION '.idata' IMPORT DATA READABLE WRITEABLE

     library  kernel32, 'KERNEL32.DLL',\
              user32,   'USER32.DLL',\
              winmm,    'WINMM.DLL',\
              msvcrt,   'MSVCRT.DLL'

 include 'fasmAPI\kernel32.inc'
 include 'fasmAPI\user32.inc'
 include 'fasmAPI\winmm.inc'
 include 'fasmAPI\msvcrt.inc'

section '.bss' readable writeable
        outTxt  rb      5000000