flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 02 Sep 2003, 16:22
For the first statement, you can write it this way:
Code: filename: times 100h db 0 but if you only want to reserve a space for filename, not necessarily filling it with zeros, it's better to do it simply: Code: filename rb 100h Answer for the later questions depends on what output format you are using. Because you are posting in the Windows forum, I'm assuming you mean the PE format (altough you'd be aswell using COFF format with some external linker), but in such case you are programming in flat mode, without segments, and modifying segment registers is not recommended at all (it can only crash your program). You can think of a FORMAT directive as a some kind of equivalent for MODEL directive, but it's a bit different. For Windows programs you always use "format PE", this is the flat model, and you have to define sections for data, code, etc. There are also macroinstructions that make it simpler, look at the HELLO example in the FASMW package - it uses the package of macroinstructions, which emulate such things as .CODE or .DATA for you. |
|||
![]() |
|
prana 02 Sep 2003, 18:33
Thanks Privalov!
And yes, my mistake ![]() mov ax, @data mov es, ax in DOS console. |
|||
![]() |
|
Tomasz Grysztar 02 Sep 2003, 18:42
That is, with MZ format?
|
|||
![]() |
|
prana 02 Sep 2003, 18:45
Yes.
|
|||
![]() |
|
Tomasz Grysztar 02 Sep 2003, 19:07
Use just a name of your data segment, look at MULTISEG example in the DOS distribution of fasm.
|
|||
![]() |
|
prana 03 Sep 2003, 04:59
Ok found it.
Thanks a lot! ![]() |
|||
![]() |
|
kaafe 15 Oct 2003, 23:34
then what about
filename DB 100 dup (?) |
|||
![]() |
|
Tomasz Grysztar 16 Oct 2003, 00:12
You can do:
Code: filename: times 100h db ? but the most simple (and recommended) variant was already posted above, it's: Code: filename rb 100h |
|||
![]() |
|
kaafe 17 Oct 2003, 01:59
how can be an instruction does both thing? Does
Code: filename rb 100h |
|||
![]() |
|
aaro 18 Oct 2003, 11:51
Globals are zeroed, locals can be anything
|
|||
![]() |
|
hitertan 26 Mar 2004, 09:03
ha ha!I have found answer a more time in this message borad!
_________________ i like assembly language and i study it in my pleasure time tanshunquan@hotmail.com |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.