flat assembler
Message board for the users of flat assembler.
Index
> IDE Development > New stdcall macroses for Fresh: |
Author |
|
decard 27 Sep 2003, 12:39
IMO fasm should have some directive that will display a name of specified identifier, it would make the whole thing simpler....
|
|||
27 Sep 2003, 12:39 |
|
JohnFound 27 Sep 2003, 13:10
decard wrote: IMO fasm should have some directive that will display a name of specified identifier, it would make the whole thing simpler.... The current solution in "endproc" directive is simply a workaround. AFAIK, it is not easy to make FASM to display label names. We must talk with Privalov for this. Regards. |
|||
27 Sep 2003, 13:10 |
|
scientica 27 Sep 2003, 13:51
I get an error ("invalid macro arguments", at enter) when compiling this:
Code: format PE console entry start include '%include%\win32ax.inc' include '%FreshRoot%\include\libs\StdcallEx.inc' include '%FreshRoot%\include\libs\strlib.inc' section '.code' code readable executable ;------------------------------------------------------------------------ proc GetHandles enter invoke GetModuleHandle,0 mov [hInstance],eax invoke GetStdHandle,STD_OUTPUT_HANDLE mov [hStdOut],eax invoke GetStdHandle,STD_INPUT_HANDLE mov [hStdIn],eax invoke GetStdHandle,STD_ERROR_HANDLE mov [hStdErr],eax return endproc 'GetHandles' ;------------------------------------------------------------------------ start: ;... _________________ ... 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 |
|||
27 Sep 2003, 13:51 |
|
JohnFound 27 Sep 2003, 14:05
Scientica:
It is because "win32ax.inc" includes old stdcall.inc and "enter" macro is double redefined - in result "enter" instruction in the macro is interpreted as old "enter" macro. Maybe we must rename "enter" macro to something different. I think "begin" will be good. (Yea, I am old Pascal programmer ) regards. |
|||
27 Sep 2003, 14:05 |
|
scientica 27 Sep 2003, 14:15
JohnFound wrote: Maybe we must rename "enter" macro to something different. I think "begin" will be good. (Yea, I am old Pascal programmer ) I've done some pascal too, long time ago thought. Anyway, begin, sounds like good start What about using end instead of endproc? And maybe procedure instead of proc? (perhaps a bit too much pascal inspiration, or? ) _________________ ... 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 |
|||
27 Sep 2003, 14:15 |
|
decard 27 Sep 2003, 14:15
IMHO it would be better to create alternative 'win32ax.inc' with stdcall.inc replaced with stdcallex.inc. I think having different names for the same purpouses (at least from user point of view) is a bad idea....
btw, I also started with pascal... |
|||
27 Sep 2003, 14:15 |
|
JohnFound 27 Sep 2003, 14:26
scientica wrote: What about using end instead of endproc? FASM uses "end" for some purposes. The same case as "enter" Quote: And maybe procedure instead of proc? (perhaps a bit too much pascal inspiration, or? ) Yea. I think "procedure" is too long for typing. I think the same for Pascal too. "proc" is shorter. Quote: IMHO it would be better to create alternative 'win32ax.inc' with stdcall.inc replaced with stdcallex.inc. I think having different names for the same purpouses (at least from user point of view) is a bad idea.... OK, in the next release of Fresh I will put one copy of Windows include files (at first Ascii only) as part of the Fresh package. If you are agree with new "stdcall.inc" I will convert whole project to use this approach. The next release "history.inc" file will be one meter longer. Regards. |
|||
27 Sep 2003, 14:26 |
|
decard 27 Sep 2003, 15:04
I have a little suggestion: why not to change 'endproc' to 'endp'? It will be shorter, and it will be similar to TASM proc syntax. When the problem with displaying symbol names will be solved, we will be able to use the following statement:
Code: proc myproc enter (some code) return endp |
|||
27 Sep 2003, 15:04 |
|
Joshua 28 Sep 2003, 09:46
this would be a simple solution, however the second line is not allowed.
Code:
strName fix str name str
str fix "
Personally i feel you should be able to equ everything. Even stuff like: Code:
temp1 fix "blah
temp2 fix temp1 blah"
|
|||
28 Sep 2003, 09:46 |
|
JohnFound 28 Sep 2003, 15:17
I am agree Jushua, but FASM doesn't allow assign via "fix" neither "equ" one only quote. We have to wait for Privalov IMHO.
regards. |
|||
28 Sep 2003, 15:17 |
|
pelaillo 29 Sep 2003, 16:13
Useful macros!
I vote for proc, begin and endp without labels (I'm too allergic to masm syntax) [edited] I agree with Joshua: one must be able to use equ as a text replacement |
|||
29 Sep 2003, 16:13 |
|
Betov 29 Sep 2003, 16:55
"EndP" seems to me an evident choice. This how i call it in RosAsm default HLL Macros.
But, what is that "Return" thingie about? Betov. |
|||
29 Sep 2003, 16:55 |
|
JohnFound 29 Sep 2003, 17:16
Betov wrote: But, what is that "Return" thingie about? Hi, Betov. It's "leave/ret nn" combination. |
|||
29 Sep 2003, 17:16 |
|
Betov 29 Sep 2003, 18:35
??? Then, what is the "EndP" about ???
Could you simply provide these macros expansions? (I mean, if i can do it all with one single "EndP" in RosAsm, you surely can do it also, in FASM/fresh parsing, as long as it is surely more easy with a Pre-Parser than with a User Macros Parser...). Betov. |
|||
29 Sep 2003, 18:35 |
|
JohnFound 29 Sep 2003, 19:50
Hi Betov.
So, look. In generaly I can make "endp" to make leave/return, but this is not useful in some situations. For example you may have severar exit points from procedure. In this case you may write: Code: proc SomeProc, arg1, arg2 begin ;some user code return ; some other user code return ; user code again return endp 'SomeProc' "return" simply exit procedure, "endp" finishes the procedure body at all. They are diferent things. If I embed leave/ret in "endp" macro, I must force the user to use only 1 exit point from procedure. Better check the code for details. Regards. |
|||
29 Sep 2003, 19:50 |
|
JohnFound 01 Oct 2003, 15:37
Well, after some discutions, the new "^" is fact. Privalov will include it in next official release of FASM. (Thank you Tomasz ) Therefore, we can turn to next generation of stdcall library, using this feature. For now you can use my implementation (even buggy ) to compile Fresh sources. Please download the version with new macroses from: http://board.win32asmcommunity.net/attachment.php?s=&postid=120143
and use this approach for future works. Maybe there are not the last versions of some files (I am sure about strlib.asm) but you can easy convert your work symply by deleting function name from "endp" macro. Read header of "stdcall.asm" for some instructions how to use macroses and how to find missing "endp" (this can be a hard problem.) Note: If you find that in the package is not last version, please, post it in the forum to let me include it in next release. Now I am working on visual library components. This will let users to create it's own visual components. Regards. |
|||
01 Oct 2003, 15:37 |
|
scientica 03 Oct 2003, 16:36
Important note: The strlib isn't updated in the package above, so you must change line 229 in strlib.asm from:
Code: stdcall StrPtr, [esp+4] to Code: stdcall StrPtr, [esp+8] or else StrLen (and all functions using it), probably will give an unexpected output. (Besides from that fresh compiles with any pain (only 8.7 secs waiting) ) _________________ ... 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 |
|||
03 Oct 2003, 16:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.