Hi all RadASM users.

I am trying to design (on paper for now) a way to interact between dialog editor and code editor. The bad thing is that to use it you probably must use my programming style. Here is what I have so far:

1. Design the dialog
2. Dbl click on a control. This will create an asm module with the same file name as the dialog (MtDialog.dlg ---> MyDialog.asm)
3. All the ID's are copied to a .const section.
4. A MyDialogProc is created in a .code section (using a sniplet)?.
5. A WM_COMMAND section is created in the proc with the proper EN_xxx.

When you at a later time dbl click on the control RadASM loads the module with the caret on the line where '==IDC_MYBUTTON' is found.

Does this sound like a good idea? Any suggestions on how to improve?

KetilO
Posted on 2002-01-28 05:32:06 by KetilO
ahhh yes. at last ;)

I swore that when something came up like that in ASM, i would switch to it 100%

Then it could truly be a Rapid Application Development ;)

And how about putting MASM functions in a help file? it would be easier to find it. Well, i guess its up to hutch ;)

Damn, this gets me all excited
Posted on 2002-01-28 06:39:01 by Tsongkie[ii]
My only suggestion would be to use The Svins WM_CASE Macro for processing window message and use bitRAKES Jump Table MACRO for processing the WM_COMMAND ids.

; The Svins Message Processing MACRO

WM_CASE MACRO reg,msgs
irp msg,<msgs>
cmp reg,WM_&msg
je j&msg
endm
endm

; bitRAKEs Jump Table Helper MACRO
;
; This macro is executed in three forms:
; 1. JT <min>,<max>,<jump table name>,<default label>
; this method is used to branch by way of the jump table, and it must
; appear before method 3
; 2. JT <jump table name>,<index>
; this method is used to mark a node within a jump table, and should
; appear before method 3
; 3. JT <jump table name>,END
; this method builds the jump table in the CONST segment, and should
; appear after all node definitions (uses of method 2)

JT MACRO a:REQ,b:REQ,tName,tDef
LOCAL w,x,y,z
; test if first parameter is a constant number?
; or tName not blank?
IFNB <&tName>
; being able to use this method multiple times for the
; same jump table is a feature
lea edx,[eax-1-b]
IF a NE 0
sub eax,a
ENDIF
xor edx,eax
jns @F
jmp &tName[eax*4]
@@:
; initalize global jump table array parameters
tName&_Min EQU a
tName&_Max EQU b
IFDIF <&tDefault>,<>
tName&_Default EQU offset &tDef
ENDIF
ELSE ; add entry to jump table or build table
; test is not second parameter is <END>
IFDIFI <&b>,<END> ; set entry in jump table list
&a&b: ; these could be defined without the macro, too
ELSE ; build jump table and empty global label
CONST SEGMENT
&a: ; jump table label
y = a&_Min
WHILE y LE a&_Max
; test if @CatStr(a,%y) exists and not blank
x TEXTEQU @CatStr(a,%y)
IF OPATTR(x)
dd offset x
ELSE ; error if _Default blank or doesn't exist
;this doesn't work!?
;z TEXTEQU <a&_Default>
;% .ERRNDEF z <JT:Condition not defined in jump table: &x>
;w = OPATTR(a&_Default)
;% .ERRE OPATTR(a&_Default) <JT:Condition not defined in jump table: &x>
dd a&_Default
ENDIF
y = y + 1
ENDM
CONST ENDS
ENDIF
ENDIF
ENDM
Posted on 2002-01-28 07:29:18 by Eóin
Hi E?in

I will have to check this out. Can't say I immediatly understand what is going on in this macros.


KetilO
Posted on 2002-01-28 07:51:02 by KetilO
Hi KetilO,

Sounds Great !!

I'd like the program to insert the appropriate .data and EQU's and uMsg handling, etc into my code...OR...generate all this in a "work window" by itself, so I could copy/paste into the source where I wanted it to go. Having the ability to do either one or the other would suit me fine!!!

gscundiff
Posted on 2002-01-28 07:54:47 by gscundiff
Hi KetilO
i've go an suggestion.
The bad thing is that to use it you probably must use my programming style.

You could do something similar to that what U did in masm.ini:


;KeyWord,InsertBeforeActiveLine,InsertAfterActiveLine
;{I}=Copy indent from keyword line
;{C}=Cr
;{S}=Space
;{T}=Tab
;{$}=Copy Proc/Struct Name
;The macros are set up to assume AutoIndent on
1=.If,{T},{C}{C}{I}.EndIf
2=.Else,{T},{C}
3=.ElseIf,{T},
4=.While,{T},{C}{C}{I}.EndW
5=MACRO,{T},{C}{I}EndM
6=PROC,{T}{C}{I}{T},{C}{I}{T}Ret{C}{C}{I}{$} EndP
7=STRUCT,{T},{C}{I}{$} EndS

[code]
Code=$-,EndP,PROC
Const=$-,{C},EQU
Data=$-,{C},DB,DW,DD,DQ,DF,DT,BYTE,WORD,DWORD,QWORD
Macro=$-,EndM,MACRO
Struct=$-,EndS,STRUCT
[/code] this is my style of programing, i could configure RadASM to it easly.

and BTW.... that new idea of yours, sounds great to me:)
goodluck
Posted on 2002-01-28 08:33:45 by NEMO
Well, taking controle over your programming style is bad. Maybe it is possible to make it very flexible by combining the use of a ini section and a template. I'll see if I can come up with someting.

Thanks for the feedback.

KetilO
Posted on 2002-01-28 09:44:29 by KetilO
i've didint mean to make RadASM using my style, i've wanted to show that U made it flexible and u can do something similar with new feature

cya
Posted on 2002-01-28 11:53:10 by NEMO
Sounds like a great feature :alright:

Question though: what exactly does the "find declare" menu item in the right click menu do?
Posted on 2002-01-28 12:57:18 by Qweerdy
Hi Qweerdy

Oh my God. Don't you know. It is one of the really useful things in RadASM. :grin:

How to use:

invoke MyProc,par1,par2

1. Set caret on MyProc.
2. Press F2. This loads the module where MyProc is found.
3 Press Ctrl+F2 to return to where you pressed F2.

This also works for a label.

KetilO
Posted on 2002-01-28 13:12:11 by KetilO
you probably must use my programming style


forgive my stupidity, but could you explain this a bit more? I fail to see the picture there :)
Posted on 2002-01-28 13:21:11 by Hiroshimator
Hi Hiroshimator

Some use cmp & jmp, others use .if - .elseif. Some even use a switch case macro. When auto generating code it is difficult to let the user decide the style.

KetilO
Posted on 2002-01-28 15:39:17 by KetilO
KetilO, is there a way that this could be implemented as a plugin - to allow changes in the code for different styles? Templates are a good idea, too.
Posted on 2002-01-28 16:21:13 by bitRAKE
"]
ahhh yes. at last ;)

I swore that when something came up like that in ASM, i would switch to it 100%

Then it could truly be a Rapid Application Development ;)

And how about putting MASM functions in a help file? it would be easier to find it. Well, i guess its up to hutch ;)

Damn, this gets me all excited



This coming from a well known PASCAL enthusiast? ;)

Funny... hehe :).

Have a good one Tsongkie ;)

Torch
aka
MacDeath of CES
Posted on 2002-01-28 18:17:15 by Torch
Hi bitRAKE

It was not what I had in mind, but it is a really good idea. I guess I just need to define more pointers into existing RadASM code to avoid duplicates.

KetilO
Posted on 2002-01-28 20:37:13 by KetilO
Well, If I understood well what you want to do...

Remember that assembly programmers love to write their code "freely", without being guided by wizards & things like that.

As you said, the programmer would be forced to use your own programming style or at least a "predefined" programming style.
As you said, I assume that many assembly programmers don't code the same way... in example, some uses .IF, some switch/case macros, while some others uses the good ol' conditionnal jumps.

I think "RAD" in the true sense of the term is not something for assembly programmers... many of them code in asm to avoid bloated things they did experience in VB or Delphi, and to control by themselves "100 %" of their code.

I think a good IDE must assist the programmer by managing the annoying things... like project creation, search in help files, and optimize the "workspace" to code better and faster (I think you know better than me what I am talking about ;) ) and not interfere with his own programming.

Well, that is only my opinion... ;)
Posted on 2002-01-29 01:32:33 by JCP
Hi Readiosys

Well, it will only write code you have written a 100 times before, and it will help you so you dont have to remember all those ID's.

KetilO
Posted on 2002-01-29 03:19:11 by KetilO
Sure, coding wndprocs isn't funny at all... I think it is very handful too, but how will you manage each user preferences of coding them ?
Posted on 2002-01-29 03:23:13 by JCP
Hi Readiosys

I will make options and a template. Those who still prefer to write the WndProc can do so. It is not possible to satisfy all, but you will still have some use of the addin because it will export ID equ's and dbl click on a control will jump to the code where it's ID is found.

KetilO
Posted on 2002-01-29 03:43:03 by KetilO

Hi Qweerdy

Oh my God. Don't you know. It is one of the really useful things in RadASM.

How to use:

invoke MyProc,par1,par2

1. Set caret on MyProc.
2. Press F2. This loads the module where MyProc is found.
3 Press Ctrl+F2 to return to where you pressed F2.

This also works for a label.

KetilO



Lol... ok ok I'm being a bit stupid... but I was trying to use it on variables, so I guess that explains it a bit.
Strange that I can make use of this handy feature for variables only if I declare them like

szMyStr: db "This is a labelled variable",0

I always use the properties list to jump between procs ;)
Posted on 2002-01-29 07:56:31 by Qweerdy