flat assembler
Message board for the users of flat assembler.
Index
> Main > new prerelease Goto page 1, 2 Next |
Author |
|
JohnFound 28 Oct 2003, 15:36
Why not to make this as new directive ("exists" for example) and keep old one's behaviour?
Regards. |
|||
28 Oct 2003, 15:36 |
|
Tomasz Grysztar 28 Oct 2003, 16:15
I try to keep the set of operators and directives as small as possible - so you won't have to keep track with the huge language reference as it happens with some overbloated compilers (and that's also why I prefer to implement many features with macros). The same problem was taken up in this thread - with having many non-standard and special operators and directives, sources might become quite unreadable to people not knowing the whole language reference in details, especially to people used to use some other assemblers.
This time I've chosen to change behavior of one operator, because I've realized the same tasks that could be done with the old one can be also (with only a little bit more effort) done with the new one, and the second variant allows much more. Of course, I don't like breaking the backward compatibility, that's why when I have to implement some new feature I usually spend much time on searching the implementation that will be most universal to minimize the chances that I'd have to change its bahaviour in the future - but this time I failed, I didn't realize that it was not best solution on time. That's why I've decided to change it now. |
|||
28 Oct 2003, 16:15 |
|
comrade 28 Oct 2003, 22:40
Cool! Nice to see FASM progress further... Maybe when you have spare time, dear Privalov, you might add DATE/TIME directives so for example aboutbox message string could include compilation date/time?
|
|||
28 Oct 2003, 22:40 |
|
Tomasz Grysztar 28 Oct 2003, 22:44
Would timestamp be enough (no need to modify the interface in order to get such feature, and BTW it would be useful also for some Win32 resources generation, as there are fields that theoretically should be filled with valid timestamp)?
And what name would be suitable for such value? Maybe %timestamp%? |
|||
28 Oct 2003, 22:44 |
|
comrade 29 Oct 2003, 00:22
I guess so, then you propose to extract day/month/year and hour/time/seconds with macro arithmetics?
|
|||
29 Oct 2003, 00:22 |
|
scientica 29 Oct 2003, 07:49
Privalov wrote: And what name would be suitable for such value? Maybe %timestamp%? IMO one of the follow would be better: timestamp __TIME __TIMESTAMP (the two last follows the high level pseudoMacros pattern (like __FILE, __LINE, etc), IMO one of the two last is preferable) _________________ ... 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 |
|||
29 Oct 2003, 07:49 |
|
tom tobias 29 Oct 2003, 11:05
Just my two cents, I prefer Privalov's notation to Scientica's, WHICH LOOKS TOO MUCH like C or C++. Going back to the old school of Nicholas Wirth, inventor of Pascal and Modula 2, I prefer avoidance of underscore character if at all possible. I believe that % symbol is much less ambiguous, and easier to recognize as a special character. I realize that two generations of programmers have become accustomed to the underscore prefix, but it ought not be employed in my opinion, for names of variables, operators, instructions, macros, or complex data types like structures, unions, etc. I understand that this view is contrary to the prevailing thinking, especially in USA, on the other hand, so is programming in Assembly! Regards, TomTobias nbri@mail.china.com |
|||
29 Oct 2003, 11:05 |
|
Tomasz Grysztar 29 Oct 2003, 11:44
Also %t might be an option (less checking for the parser and less writing for the programmer).
Another thing about which I'd like to hear your opinion: I'm planning to implement some way of specifying the section alignment for each section in ELF and MS COFF formats (classic COFF doesn't allow this, there all sections are aligned to 4 KB), and the only problem I have with it is what syntax should such option have. Would the simple: Code: section '.data' writeable 16 be enough to align section on 16 bytes boundary? What's your opinion? |
|||
29 Oct 2003, 11:44 |
|
tom tobias 29 Oct 2003, 16:47
First, I don't have the answer. Second, my opinion is based on ignorance, as I have never dealt with this question before. Third, I am willing to purchase the Intel C compiler for you, if that would assist in resolution of this issue. Intel has two C compilers, one for Windows (i.e. coff--common object file format), and one for Linux (elf--executable & linking format). Here's the reference to the Intel products which MIGHT address this questiion: http://www.intel.com/software/products/compilers/clin/pricelist.htm
searching the developer site at Intel redirects one to the corporate section, rather unsatisfying. Searching the PDF file on IA-32 architecture software developer's Manual http://www.intel.com/design/Pentium4/manuals/24547012.pdf yields no results on entering "application binary interface", i.e. Intel's term for the Microsoft COFF, and the Linux ELF. One consideration for adoption of any plan, is to realize that 64 bit architecture is upon us. Classically, compiler writers sought to SAVE MEMORY, this is also the case for example, in the famous Burrus Split Radix Fast Fourier Transform, which he developed IN PLACE, because memory was so precious in former times. I recommend to waste memory, forget about about both space and time, i.e. %t xxx or % xxx % is essentially the same, and FOCUS ON TWO aspects: (1) SIMPLICITY of design, (2) EASE of creation and maintenance, i.e. READABILITY. Memory is there for free. Assembly is already so fast there is no need to worry about saving time by concern about bus alignments to save clock cycles. Ensuring compatibility with IA-64 and SIMD extensions is ESSENTIAL. Let me know if you want me to purchase the Intel compiler for you, to see how they address the boundary question. Be my pleasure, if it would be useful to you. Regards, Tom Tobias, nbri@mail.china.com |
|||
29 Oct 2003, 16:47 |
|
GuyonAsm 29 Oct 2003, 17:24
Will the resources always have to be defined within the source or will there soon be a .res file implementation.
I ask this ,because I dont want to write MS COFF code just to do this. If not I'm going to end up writing a tool for the community that allows you to edit resources and then writes them to the end of the source in fasm syntax. _________________ I shall not evade what is predestined because every battle, is another lesson - GuyonAsm. A Believer of The System. |
|||
29 Oct 2003, 17:24 |
|
Tomasz Grysztar 29 Oct 2003, 17:24
tom tobias wrote: Memory is there for free. Assembly is already so fast there is no need to worry about saving time by concern about bus alignments to save clock cycles. No, at least not for me. I can't afford buying a new computer every year and I'm not alone with such problem. And I really like having something working smooth on my good old P60 (altough I have also a Duron 600 machine now). |
|||
29 Oct 2003, 17:24 |
|
tom tobias 29 Oct 2003, 18:29
[quote="Privalov
I can't afford buying a new computer every year and I'm not alone with such problem. [/quote] Send me an email. Regards, tom tobias: nbri@mail.china.com |
|||
29 Oct 2003, 18:29 |
|
eet_1024 30 Oct 2003, 02:29
What does ` (back tick) do?
Care should be taken with the definition of timestamp. I've written many parsers that act on strings that look like "%L" and "%S_Records" I think a nice feature to have would be \ within strings. A few I would like are: \\ \r \n \t \xHH \OOO |
|||
30 Oct 2003, 02:29 |
|
Kevin_Zheng 30 Oct 2003, 06:36
Hi,Privalov:
Please see the link: http://board.flatassembler.net/topic.php?t=256&start=30 In the 1.49.2 version, You have fixed the bug about WDM sys format. But in the 1.49.3 version, the bug is issue,too. Sorry, I have to fix the format.inc, and the driver runed OK: Code: mov dword [edx+14h],0E0h ; size of optional header mov dword [edx+16h],10B818Eh; flags and magic value mov dword [edx+38h],1000h ; section alignment mov dword [edx+3Ch],200h ; file alignment mov word [edx+40h],1 ; OS version mov eax,[image_base] mov dword [edx+34h],eax mov eax,[subsystem_version] mov [edx+48h],eax mov ax,[subsystem] mov [edx+5Ch],ax cmp ax,1 jne pe_alignment_ok mov eax,20h mov dword [edx+38h],eax mov dword [edx+3Ch],eax mov word [edx+5EH],2000H ;Kevin Zheng[101303]--WDM SYS Format pe_alignment_ok: Hi, Comrade and Bard: The wdm sys must be returned 0 from DriverEntry, except the driver found error. Thank you helpping. |
|||
30 Oct 2003, 06:36 |
|
BiDark 01 Nov 2003, 11:59
Privalov wrote:
Why not PE too?, 4k and 512 bytes. |
|||
01 Nov 2003, 11:59 |
|
JohnFound 01 Nov 2003, 14:56
eet_1024 wrote: What does ` (back tick) do? Very useful operator for some macroses. It converts name of the label to string. For example: Code: macro DispLabel lbl { display 'The label name is: ', `lbl, $0d, $0a } This macro will display the name of parameter. Look at StdCallEx in Fresh package for working example. Regards. |
|||
01 Nov 2003, 14:56 |
|
Tomasz Grysztar 03 Nov 2003, 19:43
Yes, I've removed that fix for WDM, because I've done it different way, but I forgot to include the newer fix in the 1.49.9.3
But now you have 1.49.9.4 with both this fix and the %t timestamp support. Only section alignment for object files and the "resource from" generator are left on my TODO list for 1.50. Attachment removed - new release available in some other place. Last edited by Tomasz Grysztar on 27 Nov 2003, 20:38; edited 1 time in total |
|||
03 Nov 2003, 19:43 |
|
Tomasz Grysztar 03 Nov 2003, 20:31
comrade wrote: I guess so, then you propose to extract day/month/year and hour/time/seconds with macro arithmetics? Yeah. Here's the quick and dirty example: Code: macro months [dayscount] { forward if DAY <= dayscount else DAY = DAY-dayscount MONTH = MONTH+1 forward end if } TIME = %T DAY = TIME/(24*3600) DAY = DAY - (DAY+365)/(3*365+366) YEAR = 1970+DAY/365 DAY = DAY mod 365 + 1 MONTH = 1 months 31,28,31,30,31,30,31,31,30,31,30,31 TIME = TIME mod (24*3600) HOUR = TIME/3600 MINUTE = (TIME mod 3600)/60 SECOND = (TIME mod 3600) mod 60 display <YEAR,10>,'-',<MONTH,10>,'-',<DAY,10>,13,10 display <HOUR,10>,':',<MINUTE,10>,':',<SECOND,10>,13,10 You need to use fasm 1.49.9.4+ and the display macro from here to compile it. (note that timestamp is UTC time) |
|||
03 Nov 2003, 20:31 |
|
comrade 03 Nov 2003, 20:57
Cool! Thanks!
|
|||
03 Nov 2003, 20:57 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.