flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > resume_esp, Tomasz ?

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 20 Dec 2010, 23:03

"[resume_esp]" and "[resume_eip]" are only defined inside "CalculatorDialog".
... while these two variables can potentially be used out from any errors which use "error_with_source" or directly "assembler_error" (from ERRORS.INC)
what do you think about this Tomasz ?
Code:
error_with_source:
        cmp     [symbols_file],0
    je      assembler_error
...
assembler_error:
      cmp     [hthread],0
 je      error_outside_compiler
...
error_outside_compiler:
        mov     esp,[resume_esp]   ;only defined inside "CalculatorDialog"
        jmp     [resume_eip]       ;if the code comes from elsewhere,
                                   ;it's a crash.
    

thank you.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 20 Dec 2010, 23:03
View user's profile Send private message Send e-mail Reply with quote
MinhHung



Joined: 10 Sep 2010
Posts: 51
Location: Viet Nam
MinhHung 21 Dec 2010, 03:08
Have you see

'entry start' or 'format' in SOURCE\IDE\FASMW\FASM.inc

in SOURCE\IDE\FASMW\FASMW.ASM :
->include 'fasm.inc'
and it had defined

i think it like order include file: system.inc,errors.inc

sorry for my english
Post 21 Dec 2010, 03:08
View user's profile Send private message Yahoo Messenger Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 21 Dec 2010, 17:47

ok, understood.
Code:
A)
--
proc CompileDialog hwnd_dlg,msg,wparam,lparam
        ...
  invoke  CreateThread,NULL,10000h,flat_assembler,\
        [ei.pszpath],0,param_buffer
   mov     [hthread],eax ;<-----
   
;-----------------------------
B)
--
proc CalculatorDialog hwnd,msg,wparam,lparam
        ...
.calculate:
 mov     esi,string_buffer
   invoke  GetDlgItemText,[hwnd],ID_EXPRESSION,esi,400h
        lea     edi,[esi+eax]
       xor     eax,eax   ;<-----
        stosb
       mov     [hthread],eax ;<-----
    mov     [source_start],eax

;==============================
assembler_error:
   cmp     [hthread],0
 je      error_outside_compiler
        ...

    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 21 Dec 2010, 17:47
View user's profile Send private message Send e-mail 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.