flat assembler
Message board for the users of flat assembler.

flat assembler > IDE Development > For the Fresh team: conference

Author
Thread Post new topic Reply to topic
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
Hi, all.

So, there is one fairly important thing, and I think we must make some conference about it, because it concerns the whole project.

The problem is synchronization between source code and visual created content. On one hand we must create at the end only source code which will be compiled to executable, on the other hand some parts of this code will be created with visual tools, like form editor or with image editor, or with some other visual methods. But I think that we must give the user access to the generated source code and if he edit manualy some things, the changes must reflect to the visual tools.
So, how to solve this problem? I have some very blurry ideas, about some "compiler", that will parse the whole source code and will create data structures for visual tools (For example TBaseWin structures for form editor). And reverse - some "decompiler" that will compile visual data to source code. Another approach is to abandon all binary data, for visual tools and to make everything only with source code (to extract parameters for visual tools in real time from the source).

If you don't understand something, please ask. My english is poor and the problem is bloor and complex, so I will be surprised if everyone understand my rough drafts. Smile

So, the conference is opened. Smile
regards.
Post 16 Sep 2003, 19:34
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 492
Location: Norway
Hi John,

I understand what you mean, and in my opinion, we should use the last method - to use source code only (not any other formats). Cool

G2G to bed and sleep now. School again tomorrow... So long!

Regard,
Tommy
Post 16 Sep 2003, 19:45
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 871
Location: Colombia
Hi JohnFound,
I am not "still" in the team, but I want to contribute to it soon. At the moment I am scrambling arround with fasm to assemble and run to/from memory (my goal is the source level debugger, I have tons of patience Smile )

Regarding the thread, IMHO the second alternative is better. Abandon all binary data. This is the hardest way but is the cleaner and I will appreciate it a lot (as a future happy user)

Best Regards,
pelaillo
Post 17 Sep 2003, 07:29
View user's profile Send private message Yahoo Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
Hi, pelaillo.

pelaillo wrote:
Hi JohnFound,
I am not "still" in the team, but I want to contribute to it soon. At the moment I am scrambling arround with fasm to assemble and run to/from memory (my goal is the source level debugger, I have tons of patience Smile )


Hey, I wonder, why you don't make this in the sources of Fresh? We need exactly this. And Fresh will have source level debugger at any price. Smile I made some work, but there is too many problems to solve, but the day is still 24 hours. Wink

pelaillo wrote:
Regarding the thread, IMHO the second alternative is better. Abandon all binary data. This is the hardest way but is the cleaner and I will appreciate it a lot (as a future happy user)


I tend to this too, it's cleaner solution, but harder, because of tons of string manipulations and parsing. But let wait for more opinions. Maybe someone will suggest some better idea.
Post 17 Sep 2003, 10:25
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3494
Location: Bulgaria
Well, I write some draft example, trying to realize how the files will look at the end and what kind of processing we must make. I merged several files in one to try to illustrate the problem more clearly. But don't forget that these are diferent files. There are comments, what part in what file resides. Please read it and post your notes.
Code:
;--------------------------------------------------------------------------------
; This is part of form.inc standard library.
;--------------------------------------------------------------------------------
MODAL_ID = $6000

MR_NONE         =       0
MR_CANCEL       =       1
MR_OK           =       2
MR_YES          =       3
MR_NO           =       4

struc CTRL flags, walign, class, text, style, styleEx, ID, left, top, width, height, userdata {
  .flags      db   flags    ;
  .Align      db   walign
  .ptrClass   dd   class    ; pointer to the classname.
  .ptrText    dd   text
  .style      dd   style
  .styleEx    dd   styleEx
  .ID         dw   ID
  .left       dw   left
  .top        dw   top
  .width      dw   width
  .height     dw   height
  .UserData   dd   userdata
}

virtual at 0
   CTRL CTRL ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
   sizeof.CTRL = $
end virtual

wtChild  = 0
wtParent = 1    ; The current window is the parent for next windows until the window with wtEnd flag.
wtEnd    = 2    ; The current window is the last child of the current parent window. The next
                ; window becomes child of the previous parent.

;-------------------------------
; This is in winalign.inc
;-------------------------------
waNone   = 0
waLeft   = 1
waRight  = 2
waTop    = 3
waBottom = 4
waClient = 5

;-------------------------------
; This is in User32.inc
;-------------------------------
WS_EX_DLGMODALFRAME    = 00001h
WS_EX_DRAGOBJECT       = 00002h
WS_EX_NOPARENTNOTIFY   = 00004h
WS_EX_TOPMOST          = 00008h
WS_EX_ACCEPTFILES      = 00010h
WS_EX_TRANSPARENT      = 00020h
WS_EX_MDICHILD         = 00040h
WS_EX_TOOLWINDOW       = 00080h
WS_EX_WINDOWEDGE       = 00100h
WS_EX_CLIENTEDGE       = 00200h
WS_EX_CONTEXTHELP      = 00400h
WS_EX_RIGHT            = 01000h
WS_EX_LEFT             = 00000h
WS_EX_RTLREADING       = 02000h
WS_EX_LTRREADING       = 00000h
WS_EX_LEFTSCROLLBAR    = 04000h
WS_EX_RIGHTSCROLLBAR   = 00000h
WS_EX_CONTROLPARENT    = 10000h
WS_EX_STATICEDGE       = 20000h
WS_EX_APPWINDOW        = 40000h
WS_EX_LAYERED          = 80000h
WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE or WS_EX_CLIENTEDGE
WS_EX_PALETTEWINDOW    = WS_EX_WINDOWEDGE or WS_EX_TOOLWINDOW or WS_EX_TOPMOST

WS_VISIBLE or WS_CHILD or WS_BORDER
WS_VISIBLE or WS_CHILD or SS_BITMAP or SS_CENTERIMAGE or WS_BORDER
WS_VISIBLE or WS_CHILD or SS_LEFT or WS_BORDER
010000000h
040000000h
000800000h
050800000h

WS_OVERLAPPED   = 000000000h
WS_ICONICPOPUP  = 0C0000000h
WS_POPUP        = 080000000h
WS_CHILD        = 040000000h
WS_MINIMIZE     = 020000000h
WS_VISIBLE      = 010000000h
WS_DISABLED     = 008000000h
WS_CLIPSIBLINGS = 004000000h
WS_CLIPCHILDREN = 002000000h
WS_MAXIMIZE     = 001000000h
WS_CAPTION      = 000C00000h
WS_BORDER       = 000800000h
WS_DLGFRAME     = 000400000h
WS_VSCROLL      = 000200000h
WS_HSCROLL      = 000100000h
WS_SYSMENU      = 000080000h
WS_THICKFRAME   = 000040000h
WS_HREDRAW      = 000020000h
WS_VREDRAW      = 000010000h
WS_GROUP        = 000020000h
WS_TABSTOP      = 000010000h
WS_MINIMIZEBOX  = 000020000h
WS_MAXIMIZEBOX  = 000010000h

SS_LEFT           = 0000h
SS_CENTER         = 0001h
SS_RIGHT          = 0002h
SS_ICON           = 0003h
SS_BLACKRECT      = 0004h
SS_GRAYRECT       = 0005h
SS_WHITERECT      = 0006h
SS_BLACKFRAME     = 0007h
SS_GRAYFRAME      = 0008h
SS_WHITEFRAME     = 0009h
SS_USERITEM       = 000Ah
SS_SIMPLE         = 000Bh
SS_LEFTNOWORDWRAP = 000Ch
SS_BITMAP         = 000Eh
SS_OWNERDRAW      = 000Dh
SS_ENHMETAFILE    = 000Fh
SS_ETCHEDHORZ     = 0010h
SS_ETCHEDVERT     = 0011h
SS_ETCHEDFRAME    = 0012h
SS_TYPEMASK       = 001Fh
SS_NOPREFIX       = 0080h
SS_NOTIFY         = 0100h
SS_CENTERIMAGE    = 0200h
SS_RIGHTJUST      = 0400h
SS_REALSIZEIMAGE  = 0800h
SS_SUNKEN         = 1000h


;----------------------------------------------
; This is defined in ??? (I don't know where
; and I don't care.)
;----------------------------------------------
NULL = 0


;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
; ABOVE SOURCE IS PART OF THE STANDARD LIBRARY FILES.
; THERE ARE ONLY DEFINITIONS, NOT CODE OR DATA.
;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
; BELOW SOURCE IS PART OF THE USER PROJECT.
;VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV


;----------------------------------------------
; The folowing part is in separate file with
; classnames used in the project.
; this will avoid doubling of the class names.
; Also, this data may be included in code
; section, because it is read only.
;----------------------------------------------
cFormClassName  db  'Form',0
cButtonClassName db 'Button',0
cStaticClassName db 'Static',0


;--------------------------------------------------
; This is part of project data section.
;--------------------------------------------------

cAboutCaption   db 'About Fresh...',0
cAboutClose     db 'Close',0
cAboutText      db 'This is some about box text, bla bla bla',0


;---------------------------------------------
; .FRM file is a file that contains the form
; creating data for every form.
; there is another file .ASM for every form,
; that will contain the message handler proce-
; dure for the form.
;
; The .FRM file contains following data.
;---------------------------------------------

frmAbout  CTRL  wtParent or wtEnd, waNone, cFormClassName, cAboutCaption,                                \
                WS_CAPTION or WS_CLIPCHILDREN or WS_SYSMENU or WS_DLGFRAME, 0,                           \
                NULL, 0, 0, 400, 300, NULL

  btnOK     CTRL  wtChild, waBottom, cButtonClassName, cAboutClose, WS_VISIBLE or WS_CHILD or WS_BORDER, 0, \
                  MODAL_ID + MR_OK, 10, 50, 64, 25, NULL

  imgTurtle CTRL  wtChild, waLeft, cStaticClassName, 0,                                             \
                  WS_VISIBLE or WS_CHILD or SS_BITMAP or SS_CENTERIMAGE or WS_BORDER, 0,            \
                  1, 0, 10, 165, 19, NULL

  txtAbout  CTRL  wtChild or wtEnd, waClient, cStaticClassName, cAboutText,                         \
                  WS_VISIBLE or WS_CHILD or SS_LEFT or WS_BORDER, WS_EX_CLIENTEDGE,                 \
                  2, 0, 10, 180, 19, NULL

;---------------------------------------------
; Here is the same .FRM file, but not using
; symbol constants.
;
; As you can see, the only symbol names are
; in files from the project, not in external
; library files. This format is more easy for
; parsing, but more hard for human reading,
; and if the programmer changes something,
; he must use only numbers not symbol names.
;---------------------------------------------
;frmAbout  CTRL  3, 0, cFormClassName, cAboutCaption, $002c80000, 0, 0, 0, 0, 400, 300, 0
;  btnOK     CTRL  0, 4, cButtonClassName, cAboutClose, $050800000, 0, $6002, 10, 50, 64, 25, NULL
;  imgTurtle CTRL  0, 1, cStaticClassName, 0, $05080020e, 0, 1, 0, 10, 165, 19, 0
;  txtAbout  CTRL  2, 5, cStaticClassName, cAboutText, $050800000, $00200, 2, 0, 10, 180, 19
    
Post 17 Sep 2003, 15:42
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
JohnFound wrote:
;---------------------------------------------
; Here is the same .FRM file, but not using
; symbol constants.
;
; As you can see, the only symbol names are
; in files from the project, not in external
; library files. This format is more easy for
; parsing, but more hard for human reading,
; and if the programmer changes something,
; he must use only numbers not symbol names.
;---------------------------------------------[/code]

Why not solve it like this, the developer can do it three ways.
1) Use the properties panel/dialog/window (setting flags, etc using it). Output is numeral
2) Do it all by hand (or'ing the flags in the head)
3) Use equates (..., EQUA|EGUB, ...) and "pre parse" the file using some external util (accessible via some menu like "Utils"->"Parse .frm" (which also could test the .frm file for it's correctness) ).

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 17 Sep 2003, 16:10
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 871
Location: Colombia
JohnFound wrote:
Hey, I wonder, why you don't make this in the sources of Fresh? We need exactly this.

Yes I am going to do this when I have something useful. At this moment I am studying object code formats and debuggers and breaking fasm apart to understand it well.
Post 18 Sep 2003, 08:03
View user's profile Send private message Yahoo Messenger Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7237
Location: Kraków, Poland
pelaillo: you might find the thread about the listing feature useful - the version of fasm's source that is posted there shows how you can get the source lines corresponding to offset in file (for debugging to will need also to convert file offsets into memory addresses). If you need any help with it, feel free to ask.
Post 18 Sep 2003, 10:57
View user's profile Send private message Visit poster's website 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-2019, Tomasz Grysztar.

Powered by rwasa.