flat assembler
Message board for the users of flat assembler.
Index
> Programming Language Design > On my new assembler Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next |
Author |
|
idle 05 Sep 2016, 09:29
can that be applied to fasm?
|
|||
05 Sep 2016, 09:29 |
|
shoorick 05 Sep 2016, 10:13
thanks!
|
|||
05 Sep 2016, 10:13 |
|
Tomasz Grysztar 05 Sep 2016, 11:51
idle wrote: can that be applied to fasm? |
|||
05 Sep 2016, 11:51 |
|
randall 09 Sep 2016, 13:30
Tomasz, would it be a good idea to implement AMD GCN3 instruction set using fasmg? (http://gpuopen.com/compute-product/amd-gcn3-isa-architecture-manual/)
Thanks |
|||
09 Sep 2016, 13:30 |
|
Tomasz Grysztar 09 Sep 2016, 14:10
randall wrote: Tomasz, would it be a good idea to implement AMD GCN3 instruction set using fasmg? (http://gpuopen.com/compute-product/amd-gcn3-isa-architecture-manual/) |
|||
09 Sep 2016, 14:10 |
|
Tomasz Grysztar 11 Sep 2016, 21:21
The new release (0.98) comes with a change to LOCAL directive functionality. I concluded that the added feature of locality prediction has found no real use, while it noticeably impacts performance of the assembler. Therefore I decided to simplify the function of LOCAL and now it is more similar to its namesake from fasm 1 - the symbol becomes local only in the part of macro that comes after the LOCAL directive has been used.
|
|||
11 Sep 2016, 21:21 |
|
shoorick 12 Sep 2016, 08:05
how about something kinda eof - just stop far reading the file?
it may be used for "includeonce" implementation: Code: if defined mmm eof else restore mmm mmm = 1 end if -- it can be better of course |
|||
12 Sep 2016, 08:05 |
|
Tomasz Grysztar 12 Sep 2016, 09:17
shoorick wrote: how about something kinda eof - just stop far reading the file? Code: macro EOF? __FILE = __FILE__ macro ?! line& if __FILE__ <> __FILE purge ? end if end macro end macro However: shoorick wrote:
Code: if defined mmm macro execute eof end macro else macro execute end macro restore mmm mmm = 1 end if execute |
|||
12 Sep 2016, 09:17 |
|
shoorick 12 Sep 2016, 09:35
thanks, i'll try!
yes, i've been thinking about that missing of the "end if", as well as to use file name as the name of definition to not invent exclusive variable name for each file (to not mix/mess them), I just haven't figured out yet the better way to do that |
|||
12 Sep 2016, 09:35 |
|
revolution 12 Sep 2016, 10:03
For OSes with case insensitive filenames there may be a problem when matching by the text name only. And for all OSes that have paths specifiers that can be relative (i.e. "..") then getting to the same file via a different path can also cause a problem. Can the assembler be modified to check for the unique file ID?
IMO for modular assembly "includeonce" type functionality is very important. |
|||
12 Sep 2016, 10:03 |
|
Tomasz Grysztar 12 Sep 2016, 12:34
revolution wrote: For OSes with case insensitive filenames there may be a problem when matching by the text name only. And for all OSes that have paths specifiers that can be relative (i.e. "..") then getting to the same file via a different path can also cause a problem. Can the assembler be modified to check for the unique file ID? revolution wrote: IMO for modular assembly "includeonce" type functionality is very important. shoorick wrote: (...) as well as to use file name as the name of definition (...) Code: define files macro includeonce? path* local str,name,char,cmd virtual at 0 db path str: db 'symlink equ files.' repeat str load char : byte from %-1 if (char >= '0' & char <= '9') | (char >= 'a' & char <= 'z') | (char >= 'A' & char <= 'Z') | char >= 80h db char else db '@' db 80h + char end if end repeat db '?' ; for case-insensitive filesystems only (and it doesn't work for letters other than A-Z) load cmd : $ - str from str end virtual display cmd,13,10 ; just to see how macro works eval cmd if ~ defined symlink match variable, symlink restore variable variable = 1 end match include path end if end macro |
|||
12 Sep 2016, 12:34 |
|
idle 12 Sep 2016, 14:26
i suppose board.fasm.net & Board.Fasm.Net nonsense different?..
|
|||
12 Sep 2016, 14:26 |
|
shoorick 12 Sep 2016, 14:26
I think just filename without path could be enough for a while... just if I already have included "math.inc" to not include it again.
in future, when fasmg set of includes will be bloat more than windows psdk, maybe more fine method will be required, but not now yet. generally, if we spend time to invent name for the file, we can invent name for the trap label, or even name it similar, but we can later guess the better name for the file and get the name mismatch, or make it temporal copy with "_" and include both: one explicitly into the source and other implicitly via some other include, which already includes it (against it exactly includeonce exists but fails here), and even file ID will may not save against such situation, but trap label may... or not... many situations can appear, it's not possible to prevent all of them by assembler itself... |
|||
12 Sep 2016, 14:26 |
|
idle 12 Sep 2016, 14:30
shoorick, afaik, fasm(g) fetches full path/name of any file it processes
|
|||
12 Sep 2016, 14:30 |
|
shoorick 12 Sep 2016, 17:09
yes, I see. but anyway two full paths of the same file, if not resolved, also may differ:
Code: C:\spec\fasmg\fasmg.exe LL-2.asm LL-2.rks flat assembler g version 0.97.1471502275 C:\spec\winasm\..\lib85/spec.inc [25] Error: illegal instruction. ERRORLEVEL: 2 |
|||
12 Sep 2016, 17:09 |
|
bitRAKE 12 Sep 2016, 21:07
Given that the object file formats support multiple instruction sets. Doesn't it make more sense to have "format.inc" include the "x64.inc" et al. Actually, this might not be compatible with current FASM functionality? (Since one could use64 in a Win32 PE.)
|
|||
12 Sep 2016, 21:07 |
|
Tomasz Grysztar 13 Sep 2016, 09:01
bitRAKE wrote: Given that the object file formats support multiple instruction sets. Doesn't it make more sense to have "format.inc" include the "x64.inc" et al. Actually, this might not be compatible with current FASM functionality? (Since one could use64 in a Win32 PE.) On the other hand, "format.inc" is just a simple example that provides a bit of familiar syntax for fasm users, so I think it would not really hurt to follow your suggestion. For full customizability you'd be better off using the macro packages directly anyway, as demonstrated by some of my samples in other threads. |
|||
13 Sep 2016, 09:01 |
|
bitRAKE 14 Sep 2016, 21:11
I'm having trouble understanding the scoping of symbols. I'd like to encapsulate the naming as much as possible, doing something like:
Code: ; generate Import Address Tables (IAT) namespace PE irpv lib,Libraries namespace lib align 8 .IAT: ; Is the dot needed here? irpv fun,Functions fun dq RVA fun#_String end irpv end namespace rq 1 end irpv end namespace |
|||
14 Sep 2016, 21:11 |
|
Tomasz Grysztar 14 Sep 2016, 21:51
bitRAKE wrote:
bitRAKE wrote: I've reread the namespace stuff in the manual too many times. Going to step back from it for a bit. I'm definitely missing something. Note that "namespace" by itself does not create a namespace. It only switches the focus and temporarily (until the "end namespace") changes the namespace you are working in. The argument to "namespace" is an identifier of a symbol and it is interpreted just as if it was used in an expression, as long as such symbol exists. If there is no defined symbol with given identifier, the (undefined) symbol in current namespace is used - but I recommend to always use "namespace" with a defined symbol. Last edited by Tomasz Grysztar on 15 Sep 2016, 03:35; edited 1 time in total |
|||
14 Sep 2016, 21:51 |
|
Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.