flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > question on preproce.inc file, esp [memory_end]

Author
Thread Post new topic Reply to topic
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 04 Jul 2011, 08:13
Code:
preprocess_file:
;hlt
        push    [memory_end]
        push    esi               ;keeps file name
        mov     al,2              ;seek mode = from eof
        xor     edx,edx           ;seek offs = 0
        call    lseek
        push    eax               ;keeps file size
        xor     al,al             ;seek mode = from head
        xor     edx,edx           ;seek offs = 0
        call    lseek
        pop     ecx               ;restores file size
        mov     edx,[memory_end]  ;HERE IT STARTS...
        dec     edx               
        mov     byte [edx],1Ah    ;stores some marker at pointer
        sub     edx,ecx           ;...POINTER - FILE SIZE
        jc      out_of_memory     ;...WILL IT EVER CARRY
                                  ;...SHOULD IT BE (EDX-EDI-1)-ECX ? 
    
Post 04 Jul 2011, 08:13
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 04 Jul 2011, 08:16
;...SHOULD IT BE (EDX-EDI-1)-ECX ?
sorry, (EDX-EDI+1)-ECX ?
Post 04 Jul 2011, 08:16
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.