flat assembler
Message board for the users of flat assembler.

Index > Main > work with ini files on i386

Author
Thread Post new topic Reply to topic
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 05 May 2011, 07:06
Post 05 May 2011, 07:06
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 07 May 2011, 06:29
not included to the links over:
russian texts corrupted though, i'm sorry Sad
Code:
include once 'pos.inc'
include once 'get_line.inc'
include once 'virtual_trim.inc'




;enu: list sections
;     proc  - user procedure, called every time a section found
;             - [esp-04] = line.Y pointer
;               [esp-08] = line.y pointer = ]
;               [esp-12] = line.x pointer = [
;               [esp-16] = line.X pointer
;             - al  = ]
;             - ebx = 0
;             - inc ecx
;               not ecx
;               the two instructions above = line.Y - line.y
;             - edx = lsrc  RESTORE ON EXIT
;             - edi = src   RESTORE ON EXIT
;             - esi = line.y
;             - ebp not used in this proc = headache but not for you...
;             - flags.df = 1
;             - execute clc on exit to continue, stc - to stop the loop
;     break - byte-sized line break(see crlf2ah file)
;     src   - text
;     lsrc  - text size
;rus: ?@>;8AB0BL A5:F88
;     proc  - 2K7K205B?AO A :064>9 A5:F859
;             - [esp-04] = C:070B5;L =0 line.Y
;               [esp-08] = C:070B5;L =0 line.y = ]
;               [esp-12] = C:070B5;L =0 line.x = [
;               [esp-16] = C:070B5;L =0 line.X
;             - al  = ]
;             - ebx = 0
;             - inc ecx
;               not ecx
;               425 8=AB@> 2KH5 = line.Y - line.y
;             - edx = lsrc  !!""
;             - edi = src   !!""
;             - esi = line.y
;             - ebp =58A?>;L7C5< = <>6=> ?> ?@56=5<C >1@0I0BLAO : 7028A8<K< ?5@5<5==K<
;             - flags.df = 1
;             - 2K?>;=8 clc =0 2KE>45 4;O ?@>4>;65=8O, stc - >AB0=>20 F8:;0
;     break - 109B>2K9 >1@K2 ;8=89(A<. D09; crlf2ah)
;     src   - B5:AB
;     lsrc  - 53> @07<5@
include once 'intro.inc'
intro list_sections
        pusha
        pushf

        label   .proc  dword at esp+(10+2)*4
        label   .break dword at esp+(11+3)*4
        label   .src   dword at esp+12*4
        label   .lsrc  dword at esp+13*4

        label   .line.Y dword at esp-08
        label   .line.y dword at esp-12
        label   .line.x dword at esp-16
        label   .line.X dword at esp-20

        mov     edi,[.src]
        mov     edx,[.lsrc]
        sub     eax,eax
.work:  inc     eax
        sub     ebx,ebx          ;pos will search case-sensitive
        push    ebx              ;pos.stop
        push    eax              ;pos.start
        push    edx              ;pos.lhere
        push    edi              ;pos.here
        push    1                ;pos.lthis
        call    .push_pos.this
        db      '['              ;pos.this
  .push_pos.this:
        cld                      ;pos will search forward
        call    pos
        test    eax,eax
        jz      .ret             ;no (more) ]

        push    eax edx edi [.break]
        call    get_line         ;get line.X and line.Y

        or      ecx,-1
        lea     esi,[edi-1]
        add     esi,[esp]        ;line.X
        mov     [.line.X],esi
        call    lite_virtual_trim
        cmp     al,'['
        clc
        jne     .try_again
        dec     esi
        mov     [.line.x],esi

        or      ecx,-1
        lea     esi,[edi-1]
        add     esi,[esp+4]      ;line.Y
        mov     [.line.Y],esi
        std
        call    lite_virtual_trim
        cmp     al,']'
        clc
        jne     .try_again
        inc     esi
        mov     [.line.y],esi

        call    [.proc]
  .try_again:
        pop     eax eax
        jnc     .work

.ret:   popf
        popa
        ret     4*4              ;2011_05_06
end if
    
Post 07 May 2011, 06:29
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.