flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > sorry Tomasz, another one

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 11 Nov 2010, 18:30

with my previous post and the problem with "dot_struct", i understood,
but here ? ... is this normal Tomasz ?

(Thank you and sorry for my many questions)

Code:
jmp BB.g3.s   ;2 passes  2 bytes
              ;it does compile, no problem.
struct BB
g1 dd ?
 ;union
 g2 dd ?
 g3 dd ?
 ;ends
ends

.s :
    

but ,

Code:
jmp BB.g3.s   ; does not compile (undefined symbol BB.g3.s)

struct BB
g1 dd ?
 union
 g2 dd ?
 g3 dd ?
 ends
ends

.s :

    

This is not a problem to implement this feature in "wink" ...
just wondering if this is normal. (?)
thank you

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 11 Nov 2010, 18:30
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 11 Nov 2010, 19:03
As I already suggested in the other thread: please treat the globals context after the "struct" definition as undefined (I mean: unknown). This is something that may change from implementation to implementation and to rely on any specific behavior would not be a good idea.
Post 11 Nov 2010, 19:03
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 11 Nov 2010, 19:53

Thank you for the tip ...
but this reasoning is valid for a compiler, not for something which is "seen". Here, I highlight or I do not highlight the words ... Wink must behave faithful to the result of compilation! Wink can not highlight a word, and then have a failure compilation. So I must also manage this situation .... and adjust if needed later.
I must be faithful to the result of compilation, and for that, Wink must handle even the imperfections or uncertainties. (Even if this is the result of a absurd code .)

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 11 Nov 2010, 19:53
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 11 Nov 2010, 20:51
The only way to be sure what the assembler will see would be to expand the macros in real-time. If you don't do it, then you will always have some cases where labels ends up meaning something different than your highlighter thought. Then why do you insist on having this one case covered when inevitably you are going to have other similar problems with macros anyway?
Post 11 Nov 2010, 20:51
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 11 Nov 2010, 21:58
Quote:
to expand the macros in real-time.
it would indeed be a magic solution,
but in terms of computation time, it's almost impossible.
Quote:
Then why do you insist on having this one case covered when inevitably you are going to have other similar problems with macros anyway ?
because I'm mad! Razz

my English, my god! ... I try anyway ... Confused

I speak here only about the macro "struct" (for now). I will not be able to manage everything. For example, "struc" will be very difficult to manage, almost impossible. In this case, I turn off the engine and i leave only the highlighting of keywords. Why ? because the most importantly is to not give false information ... don't highlight a word is less serious than highlight a word that should not be (my english ... Confused ). In the case of the macro "struct", i think I can get a perfect result. The results are already very good. one thing at a time ...
local labels, global labels,anonymous labels, keywords, multiline comments,management of the back-slash, of long lines, proc/endp, "label x", "x dd ?", now ... struct/{struct/union}/ends, and after, label/labels/endl for proc macro ... one thing at a time, slowly ! Of course because of macro language it will be impossible to manage everything in real time, however it is possible to manage many things.


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 11 Nov 2010, 21:58
View user's profile Send private message Send e-mail Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji 11 Nov 2010, 22:25

just a few instructions,
The core of next Wink has nothing to do with Wink 6.57 !

Each task can modify the "task_bitmap" itself ... it's very powerful!
Code:
                ....
             push    edi ebp
             push    [task_bitmap] <-- -------  ; very powerfull

          mov     ebp,[task_bitmap]
           bts     ebp,31
  
.task_manager:      bsf     edi,ebp               ;<-- and back
              btr     ebp,edi
             jmp     [task_list + (edi*4)] ;--> go

.END_oEv:   pop     [task_bitmap]

           pop     ebp edi
             jmp     .ebp_Pos
               ....

task_list dd \
\
Full_Scan.engine_capture_BEFORE                         ,\ ;0  ;00
Full_Scan.engine_global_words_selector                   ,\ ;1  ;01
Full_Scan.engine_proc_and_label_name                     ,\ ;0  ;02
Full_Scan.engine_label_and_label_name                    ,\ ;0  ;03
\
Full_Scan.engine_start_struct_and_name                     ,\ ;0  ;04
Full_Scan.engine_data_label                              ,\ ;0  ;05
Full_Scan.engine_ends_struct                             ,\ ;0  ;06
Full_Scan.engine_endp_proc                               ,\ ;0  ;07
\
Full_Scan.engine_endl                                      ,\ ;0  ;08
Full_Scan.engine_locals                                  ,\ ;0  ;09
Full_Scan.engine_local                                   ,\ ;0  ;10
Full_Scan.engine_macro                                   ,\ ;0  ;11
\
Full_Scan.engine_struc                                     ,\ ;0  ;12
Full_Scan.engine_code_label                              ,\ ;0  ;13
Full_Scan.engine_union_inside_a_struct                   ,\ ;0  ;14
Full_Scan.engine_struct_inside_a_struct                  ,\ ;0  ;15
\
Full_Scan.engine_capture_AFTER                             ,\ ;1  ;16
Full_Scan.engine_1st_2nd_words                           ,\ ;0  ;17
...
Full_Scan.END_oEv                                 ,\     ;31
...

    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 11 Nov 2010, 22:25
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.