flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 07 Apr 2010, 07:11
Is there a reason why you can't simply put:
Code: mov edi,[fs:0] Code: mov edi,[fs:myValue-Seg1] ;... virtual at Seg1 myValue rd 1 end virtual |
|||
![]() |
|
l_inc 07 Apr 2010, 12:59
revolution
Actually I don't really need this. For me it's only a question of possibility to do it in fasm (I know, it doesn't support inline macros). But I know people, who would appreciate such feature. So the reason, why it would be useful, is that one may need to access really many times some memory locations from different segments with completely different bases. And it can be very annoying to write mov edi,[fs:myValue-Seg1] or even to calculate an offset by self every time one needs to access myValue. At least since it's a work of compiler to calculate offsets. |
|||
![]() |
|
revolution 07 Apr 2010, 13:52
This goes hand-in-hand with the segment paradigm. Segments are an ugly abomination, and this gets reflected into any assembly code that has to deal with segments.
Maybe: Code: struc Stuff { .var1 dd ? .var2 dd ? } ;... virtual at 0 Stuff.fs Stuff end virtual virtual at Seg1 Stuff.Seg1 Stuff end virtual ;... mov edi,[fs:Stuff.fs.var1] mov edi,[Stuff.seg1.var1] ![]() |
|||
![]() |
|
l_inc 07 Apr 2010, 15:16
revolution
Quote: Looks even worse It really does... This is too much for absolutely no benefit. Assume you have a big code piece, which contains many instructions accessing some different data through fs, for example. The point is to allow to load fs with a selector of another descriptor with different base, so that every memory access in this piece of code gets the same location (linear address), without making any changes in the code itself. This should be achieved by means of a single preliminary call to a macro like defBase fs,newBase. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.