flat assembler
Message board for the users of flat assembler.
Index
> Main > Data reservations in include files |
Author |
|
revolution 03 Feb 2019, 14:30
This is where header files can be handy. But they can be cumbersome to deal with sometimes.
Another pure fasm way is to use either 1) macros to define the defs and instantiate at the proper place, or 2) tagged virtual blocks. The macro way: Code: ;in fat32.inc macro define_fat32_data { length dd ? ;... } ;---------------- ;in main.asm include 'fat32.inc' ;... org 0x5000 define_fat32_data Code: ;in main.asm virtual at data_definitions data_defs:: end virtual ;... include 'fat32.inc' ;... org 0x5000 data_definitions: virtual data_defs sizeof.data_defs = $ - $$ end virtual repeat sizeof.data_defs load char byte from data_defs:data_definitions + (% - 1) db char end repeat ;-------------------- ;in fat32.inc virtual data_defs length rd 1 ;... etc end virtual ;and you can add more later virtual data_defs sectors rd 1 ;... etc end virtual |
|||
03 Feb 2019, 14:30 |
|
bitRAKE 03 Feb 2019, 14:39
Nothing is idiotic here. Your learning experience far less so.
One of the beautiful things about using asm is that the variables are just memory addresses - if they aren't initialized then using a VIRTUAL block would suffice. If you want to define data in a non-linear manner - to be pieced together later - then the most general way is https://board.flatassembler.net/topic.php?p=207326#207326 . I do recommend switching to FASMG. FYI: the board has a OS development section: https://board.flatassembler.net/forum.php?f=11 _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
03 Feb 2019, 14:39 |
|
scippie 03 Feb 2019, 15:09
revolution wrote: This is where header files can be handy. But they can be cumbersome to deal with sometimes. Thanks man! One of these will certainly be fine for me. bitRAKE wrote: Nothing is idiotic here. Your learning experience far less so. Thanks... I am used to another forum where I would probably get shouted at with my post... bitRAKE wrote: FYI: the board has a OS development section. Ooh... I have been a member for a while here, but never saw it. See you there! |
|||
03 Feb 2019, 15:09 |
|
scippie 03 Feb 2019, 15:28
bitRAKE wrote: I do recommend switching to FASMG. I never heard of it before (I have been away a long time it seems) and I just looked it up, but I don't really see how it would be better for me. Why would it be better? |
|||
03 Feb 2019, 15:28 |
|
sts-q 03 Feb 2019, 16:08
Raise hand everybody with the same question: me!
fasmg is reported to be slower? Is there a **switching-to-fasmg-thread** somewhere in this forum? |
|||
03 Feb 2019, 16:08 |
|
revolution 03 Feb 2019, 16:28
fasmg is of interest if you want to make your own assembler by using the macro language it has.
If you don't really want to make your own assembler then it might not be of interest to you. fasmg, by its nature, will be slower than the native fasm. That may impact you for larger sources. For small sources you might not notice. fasmg has a completely different macro syntax, so if you have existing code written for fasm then you need to rewrite all of those; macro, struct, irp, match, etc. fasmg is more flexible if you need to customise anything. Whereas fasm needs you to rewrite the source code and reassemble it to make any custom changes. So there is no single answer for everyone. Your needs might be served best by either fasm or fasmg depending upon your goals. |
|||
03 Feb 2019, 16:28 |
|
Tomasz Grysztar 03 Feb 2019, 16:30
sts-q wrote: Is there a **switching-to-fasmg-thread** somewhere in this forum? For now, you can read my original post comparing languages of fasmg and fasm, but keep in mind that it was several years ago. Since then things like a macro package providing partial compatibility with fasm 1 (especially for Windows programming) have been developed. Oh, and there is also a thread that serves as a central information hub concerning fasmg. |
|||
03 Feb 2019, 16:30 |
|
scippie 03 Feb 2019, 17:25
Thanks for the info everyone!
I will be here more often. Great community here. And at some point, I will probably understand whether fasmg is better for me and at that point, I won't mind rewriting a bunch of code |
|||
03 Feb 2019, 17:25 |
|
revolution 03 Feb 2019, 18:11
bitRAKE wrote: One of the beautiful things about using asm is that the variables are just memory addresses - if they aren't initialized then using a VIRTUAL block would suffice. |
|||
03 Feb 2019, 18:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.