flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
DOS386 20 Aug 2011, 13:43
No need for a special segment, you can place your scratch area anywhere
(preferably to a place that "belongs" to you). There is no protection in real mode. So the options are: - Put some "db or "rb" at program end (bad "db" causes bloat) - Hog some memory from DOS - Reserve some memory as "heap" at program end (preferred). Don't specify "heap 0", instead for example "heap $0100" gives you 4 KiB. So in your only-one segment there will be your code, the heap/scratch area and stack ("stack $1000" gives 4 KiB). So the stack is in a separate segment by default. RTFM!!! (but not very verbose) FYI, I personally use format binary for my MZ and PE executables. You don't need segments at all (except your code is > 64 KiB). Look at the (not many) examples in MZ format. http://board.flatassembler.net/topic.php?t=6735 Last edited by DOS386 on 20 Aug 2011, 14:11; edited 2 times in total |
|||
![]() |
|
emc 20 Aug 2011, 14:07
Are you talking about the FASM manual or the MZ manual? (I don't seen any "serious" document about the MZ format on the Web, just the Wiki article)
Then declaring an uninitialized variable, I shall want get its pointer (to put into a register and increase or decrease it). Is it possible with the heap method? Does its pointer will be DS? Last edited by emc on 23 Aug 2011, 12:14; edited 1 time in total |
|||
![]() |
|
DOS386 20 Aug 2011, 14:22
> get its pointer (to put
There are no pointers in FASM ![]() Code: ... mov bx, blahvar ; Constant - fixed address - no PIC anymore ... mov ax, 0 mov [bx], ax ; Init ... inc word [bx] ... dec word [bx] ... ; rdrand eax ; Dangerous, commented out Only BX SI DI and BP are usable for memory operands. BP defaults to SS instead of DS !!! |
|||
![]() |
|
emc 20 Aug 2011, 18:13
Ok, I am understanding (but I have problems with ntdvm sometimes).
Another question: The following line Code: mov [bx], ax ; Init This line allows us to put 0 in blahvar ? |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.