format PE GUI 4.0
entry start
;invoke  SendMessage,[hwnd],FEM_SETTEXTCOLOR,textClr,backgroundClr
include 'C:\fasmw17316\include\win32a.inc'
include 'C:\fasmw17316\INCLUDE\MACRO\STRUCT.INC'
include 'C:\fasmw17316\include\MACRO\if.inc'

savingSound = 1
NotRedraw = 1



section '.code' code readable writeable executable
        include 'procs\loadfile.txt'
        include 'procs\scriptSlotsStruct.txt'
        include 'procs\mystrtod.txt'
        oout  dd 0,0,0,0,0,0
        nfile db 'hl\slots.txt',0
        stroka db '%1.4f',0
        tttest db '899440000,5,6i,3,7i',0
        linkrTab dd bufrObmenaProcs,nfile
        tabFun dd p0,p1,p2,p3,p4,p5
p5: mov eax,dword [esp+4]
                        ;Msg dword [eax+2*8]
                Msg dword [eax]

ret 4
rept 5 n:0 { p#n:       mov eax,dword [esp+4]
                        Msg dword [eax+#n*4] 
        ret 4
        }

start: mov esi, bufrObmenaProcs
mov ecx,(0x0000a907-(start-0x400000))+start
rept 0 {
        mov ebx,899440000.0
        movd xmm1,ebx
        cvtss2si eax,xmm1       ;eax=899440000 ok
        mov ebx,tttest
        mov esi,oout
        call mygetDigs    ;testing +
cvtss2si eax,[oout]
}
        opnFile nfile,s!c!Buffer
        mov dword [scriptInit.p@TabProcs],tabFun
        mov [scriptInit.linkerTab],linkrTab
        mov [scriptInit.linkerTab+4],bufrObmenaProcs
        lea ebp,[s!c!Buffer+edx]
        mov edx,s!c!Buffer
.1:     call scriptSlots        ;get slot0
        ;call scriptSlots        ;get slot1
        cmp edx,ebp
        jb  .1

rept 0 {  mov eax,1
          mov ebx,2
          call getSSlot
          ;mov ebx,[edx+8*2]
          Msg ebx

        mov eax,2
          mov ebx,0
          call getSSlot
          Msg ebx

          mov eax,0
          mov ebx,12
          call getSSlot
          Msg ebx

          mov eax,0
          mov ebx,14
          call getSSlot
          Msg ebx

          mov eax,0
          mov ebx,8
          call getSSlot
          
          push tttest
          call dword [tabFun+ecx*4] ;push for dll or c functions
}
rept 0 {
        puMsg edx
        mov eax,[eax+8*12]
        Msg eax
        }
        ;mov dword [scriptInit.p@TabProcs],tabFun
        ;mov [scriptInit.linkerTab],linkrTab
        call scriptInit
        call scriptPool

;call dword [scriptPool.poolsTab]
runPool 0
runPool 1,msgProca:-1 ;,msgProca:-1,msgProca:2,msgProca:3

        ;Msg  Buffer
        Msg .exittxt
    invoke  ExitProcess,0

.exittxt db 'Exit to windows',0,0,0
msgProca: Msg eax
        ret

section '.bss' readable writeable
        Script@Buffer   rd 400000
        bufrObmenaProcs rd 8000*4       ;last 3kb for debug txt info from procs

section '.idata' import data readable writeable

  library kernel32,'KERNEL32.DLL',\
          msvcrt,'msvcrt.dll',\
          Winmm, 'Winmm.dll',\
          comdlg,'COMDLG32.dll',\
          user32,'USER32.DLL'


  import msvcrt,swprintf,'swprintf',sprintf,'sprintf',strtod,'strtod'


  include 'c:\fasmAPI\kernel32.inc'
  include 'c:\fasmAPI\user32.inc'
  include 'c:\fasmAPI\gdi32.inc'