flat assembler
Message board for the users of flat assembler.
Index
> Main > flat assembler 1.71.00-01 Goto page Previous 1, 2, 3, 4 Next |
Author |
|
Tomasz Grysztar 21 Sep 2012, 13:00
l_inc wrote: You wrote, that the addressing spaces cannot be forward referenced. Not the labels. I uploaded another update of 1.71.00 packages (since it is still within the first 24 hours I do not make a new version yet) - the reported bugs are fixed, please try it. |
|||
21 Sep 2012, 13:00 |
|
l_inc 21 Sep 2012, 13:17
Tomasz Grysztar
Quote: Yes, I did not state that correctly even though I had labels in mind. Wouldn't this be a kind of forward referencing? I'm still not sure, I clearly understand all of the use cases, where this rule applies. Code: if used space display 'Space used',13,10 end if space:: db 'ABCD' load a byte from space:$$ P.S. Probably it would be more consistent to allow forward referencing of such labels, but not forward referencing of the data (as it's used to be). |
|||
21 Sep 2012, 13:17 |
|
Tomasz Grysztar 21 Sep 2012, 13:22
This will work, it is analogous to the case of re-defined numerical variable, which also cannot be forward referenced by itself, but you are free to check its "used" status anywhere:
Code: if used tester display 'Tester used',13,10 end if ; this would cause error: ; dd tester tester = 0 tester = 1 dd tester PS But "defined" has not yet been upgraded to work correctly with these new labels, please wait for another update. |
|||
21 Sep 2012, 13:22 |
|
l_inc 21 Sep 2012, 13:29
Tomasz Grysztar
Quote: But "defined" has not yet been upgraded to work correctly with these new labels, please wait for another update. As for me, it works as expected: Code: if defined space display 'space defined 1',13,10 end if space:: db 'ABCD' if defined space display 'space defined 2',13,10 end if displays "space defined 2" only. I don't see any point of making it display both strings, because in this case it would be impossible to detect whether such label is allowed to be used at current code location. P.S. Or again, you could allow the addressing space labels to be forward referenced, as I mentioned before, because their semantics is nearer to the normal labels than to the redefined numerical variables. |
|||
21 Sep 2012, 13:29 |
|
Tomasz Grysztar 21 Sep 2012, 15:44
Yes, it works as it should in this case.
l_inc wrote: P.S. Or again, you could allow the addressing space labels to be forward referenced, as I mentioned before, because their semantics is nearer to the normal labels than to the redefined numerical variables. |
|||
21 Sep 2012, 15:44 |
|
l_inc 21 Sep 2012, 16:03
Tomasz Grysztar
Quote: Yes, it works as it should in this case. OK. Then we do not expect any updates currently. Quote: The fact that they can only be forward-referenced comes from the internal gimmicks I assume, you mean "can not be forward-referenced". Quote: But it is not a big deal, IMHO. I currently do not see any practical necessity in such things (forward referencing an addressing space label to access the previously defined data): Code: db 'ABCD' virtual load a from space:data_end-1 display a,13,10 end virtual space:: data_end: This works for data_end, but not for space. I just thought, it was an intentional design decision rather than a required measure. |
|||
21 Sep 2012, 16:03 |
|
Tomasz Grysztar 21 Sep 2012, 16:07
l_inc wrote: I assume, you mean "can not be forward-referenced". l_inc wrote: I just thought, it was an intentional design decision rather than a required measure. |
|||
21 Sep 2012, 16:07 |
|
l_inc 21 Sep 2012, 16:21
Tomasz Grysztar
Quote: I would probably be able to find a way around it and implement this one special case (forward-referencing label that marks the same space as the current one) My previous example is directed to point out, that the case is a little wider. It does not contain forward referencing of data or an addressing space, but the forward referenced addressing space label does not belong to the current space. Quote: I think that the simple rule of no forward references makes things much more plain and simple, and we are not losing much. IMHO it's equally plain and simple from the user's point of view. But as I said, absolutely not a problem for me. |
|||
21 Sep 2012, 16:21 |
|
JohnFound 21 Sep 2012, 17:52
Bug report:
Code: virtual at 0 __address_space1:: db 1 end virtual __address_space2:: rb 1 store byte 1 at __address_space1:0 ;db 1 ; this fixes the binary. Generates huge file full with random data. Defining even one byte at the end fixes the problem. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
21 Sep 2012, 17:52 |
|
Tomasz Grysztar 21 Sep 2012, 18:16
Fixed.
|
|||
21 Sep 2012, 18:16 |
|
hopcode 21 Sep 2012, 19:23
the feature ?
space:address what the use? forward-referencing not yet generated code but loaded one byte at a time, this last time. is it something new ? yes. but it has 2 main reasons: -one, it is needed to forward-reference the matter in a later time -two, because forward-referencing itself is a trend now. ok. i wait, i count sheep... one two three nth, oops,oops jumping oops ... _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
21 Sep 2012, 19:23 |
|
JohnFound 21 Sep 2012, 20:08
hopcode, IMHO, you need to get some sleep.
|
|||
21 Sep 2012, 20:08 |
|
cod3b453 22 Sep 2012, 14:29
I think I hit one of the cases fixed above, but now seems to work very nicely!
Already managed to convert some basic macros into LUT-driven variants and crypto/hash functions should be a lot easier/possible now! (at least without the need to chop a few kB form the end of the file where the state was kept! ) Another interesting aspect to this is that the preprocessor can now create, reference and share dynamic structures in these virtual address spaces: Code: macro @make_a_thing id { virtual at 0 id#:: .stuff rd 1 end virtual } macro @use_a_thing id { local d store dword 'x' at id#:.stuff load d dword from id#:.stuff display d } @make_a_thing x @use_a_thing x @use_a_thing x |
|||
22 Sep 2012, 14:29 |
|
Tomasz Grysztar 22 Sep 2012, 15:00
cod3b453 wrote: Another interesting aspect to this is that the preprocessor can now create, reference and share dynamic structures in these virtual address spaces. |
|||
22 Sep 2012, 15:00 |
|
cod3b453 22 Sep 2012, 15:52
Hi Tomasz,
(Sorry, yes, assembly time ) I've just hit a bit of a problem in this sort of code: Code: my_label: jmp .next ; <- cannot find my_label.next ; from macro virtual at 0 try:: .that dd 0 .this dd 0 ; .next dd 0 ; <- would fail due to redefinition end virtual ;end macro .next: ; <- renamed to try.next dd .this ; previously non-existent |
|||
22 Sep 2012, 15:52 |
|
Tomasz Grysztar 22 Sep 2012, 15:59
These special labels follow all the same rules as regular ones, and so you deal with name conflicts in exactly the same way. If you replaced "try::" with a simple "try:" you would still have the same problem. And so the solution is exactly the same as in the standard case, use "..try" instead of "try".
|
|||
22 Sep 2012, 15:59 |
|
hopcode 22 Sep 2012, 18:15
ok. i accept it.
...but all the sheep jumped ? Tomasz Grysztar wrote: The preprocessor has no access to these features, because LOAD/STORE directive operate at assembly time. But yes, you can now create dynamic structures (buffers, tables, etc.) and use them freely... hopcode wrote: ...wouldnt it be simply better to consolidate/extend the load/store things even on not yet assembled code, instead of creating such note please that you could have it done even in other ways, for example using the space?address form or extending the same virtual directive in this way, accepting the ? on it: Code: virtual at ? ... end virtual if you called it virtual, it must be virtual, right ? now we need a regexp engine to work with all those ::: Cheers, _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
22 Sep 2012, 18:15 |
|
Tomasz Grysztar 22 Sep 2012, 18:27
hopcode, I really don't understand any of your posts here.
|
|||
22 Sep 2012, 18:27 |
|
hopcode 22 Sep 2012, 18:48
Tomasz Grysztar wrote: hopcode, I really don't understand any of your posts here. _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
22 Sep 2012, 18:48 |
|
Goto page Previous 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.